Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/biobank/jsx/batchEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class BatchEditForm extends React.PureComponent {
(specimen.typeId !== current.typeId)) {
Swal.fire(
t('Oops!', {ns: 'biobank'}),
t('Specimens must be of the same Type and Center', {ns: 'biobank'}),
t('Specimens must be of the same Type and Site', {ns: 'biobank'}),
'warning'
);
return Promise.reject();
Expand Down
30 changes: 15 additions & 15 deletions modules/biobank/jsx/biobankIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class BiobankIndex extends Component {

float.map((field) => {
if (isNaN(parseInt(specimen[field])) || !isFinite(specimen[field])) {
errors[field] = t('This field must be a number. ', {ns: 'biobank'});
errors[field] = t('This field must be a number.', {ns: 'biobank'});
}
});

Expand Down Expand Up @@ -601,27 +601,27 @@ class BiobankIndex extends Component {
// validate required fields
required && required.map((field) => {
if (!process[field]) {
errors[field] = t('This field is required! ', {ns: 'biobank'});
errors[field] = t('This field is required.', {ns: 'biobank'});
}
});

// validate floats
number && number.map((field) => {
if (isNaN(parseInt(process[field])) || !isFinite(process[field])) {
errors[field] = t('This field must be a number! ', {ns: 'biobank'});
errors[field] = t('This field must be a number.', {ns: 'biobank'});
}
});

// validate date
regex = /^[12]\d{3}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$/;
if (regex.test(process.date === false)) {
errors.date = t('This field must be a valid date! ', {ns: 'biobank'});
errors.date = t('This field must be a valid date.', {ns: 'biobank'});
}

// validate time
regex = /^([01]\d|2[0-3]):([0-5]\d)$/;
if (regex.test(process.time === false)) {
errors.time = t('This field must be a valid time! ', {ns: 'biobank'});
errors.time = t('This field must be a valid time.', {ns: 'biobank'});
}

// validate custom attributes
Expand All @@ -641,7 +641,7 @@ class BiobankIndex extends Component {
if (attribute.required == 1
&& !process.data[attribute.id]) {
errors.data[attribute.id] = t(
'This field is required!',
'This field is required.',
{ns: 'biobank'}
);
}
Expand All @@ -652,7 +652,7 @@ class BiobankIndex extends Component {
if (isNaN(parseInt(process.data[attribute.id])) ||
!isFinite(process.data[attribute.id])) {
errors.data[attribute.id] = t(
'This field must be a number!',
'This field must be a number.',
{ns: 'biobank'}
);
}
Expand All @@ -663,7 +663,7 @@ class BiobankIndex extends Component {
regex = /^[12]\d{3}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$/;
if (regex.test(process.data[attribute.id] === false )) {
errors.data[attribute.id] = t(
'This field must be a valid date! ',
'This field must be a valid date.',
{ns: 'biobank'}
);
}
Expand All @@ -674,7 +674,7 @@ class BiobankIndex extends Component {
regex = /^([01]\d|2[0-3]):([0-5]\d)$/;
if (regex.test(process.data[attribute.id] === false)) {
errors.data[attribute.id] = t(
'This field must be a valid time! ',
'This field must be a valid time.',
{ns: 'biobank'}
);
}
Expand Down Expand Up @@ -716,13 +716,13 @@ class BiobankIndex extends Component {

required.map((field) => {
if (!container[field]) {
errors[field] = t('This field is required! ', {ns: 'biobank'});
errors[field] = t('This field is required.', {ns: 'biobank'});
}
});

float.map((field) => {
if (isNaN(parseInt(container[field])) || !isFinite(container[field])) {
errors[field] = t('This field must be a number! ', {ns: 'biobank'});
errors[field] = t('This field must be a number.', {ns: 'biobank'});
}
});

Expand Down Expand Up @@ -754,24 +754,24 @@ class BiobankIndex extends Component {

required.forEach((field) => {
if (!pool[field]) {
errors[field] = t('This field is required! ', {ns: 'biobank'});
errors[field] = t('This field is required.', {ns: 'biobank'});
}
});

if (isNaN(parseInt(pool.quantity)) || !isFinite(pool.quantity)) {
errors.quantity = t('This field must be a number! ', {ns: 'biobank'});
errors.quantity = t('This field must be a number.', {ns: 'biobank'});
}

// validate date
regex = /^[12]\d{3}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$/;
if (regex.test(pool.date === false )) {
errors.date = t('This field must be a valid date! ', {ns: 'biobank'});
errors.date = t('This field must be a valid date.', {ns: 'biobank'});
}

// validate time
regex = /^([01]\d|2[0-3]):([0-5]\d)$/;
if (regex.test(pool.time === false)) {
errors.time = t('This field must be a valid time! ', {ns: 'biobank'});
errors.time = t('This field must be a valid time.', {ns: 'biobank'});
}

if (pool.specimenIds == null || pool.specimenIds.length < 2) {
Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/jsx/poolSpecimenForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class PoolSpecimenForm extends React.Component {
{
title: this.props.t('Oops!', {ns: 'biobank'}),
text: this.props.t(`Specimens must be of the same PSCID,
Visit Label, Type and Center`),
Visit Label, Type and Site`),
type: 'warning',
}
);
Expand Down
48 changes: 26 additions & 22 deletions modules/biobank/locale/biobank.pot
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Default LORIS strings to be translated (English)
# Copyright (C) 2026
# This file is distributed under the same license as the LORIS package.
# Henri Rabalais <henri.j.rabalais@gmail.com>, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: LORIS 29\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-05 08:40-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Biobank"
Expand All @@ -31,7 +31,7 @@ msgstr ""
#: jsx/poolSpecimenForm.js:158
msgid ""
"Specimens must be of the same PSCID,\n"
"Visit Label, Type and Center"
"Visit Label, Type and Site"
msgstr ""

#: jsx/poolSpecimenForm.js:207
Expand Down Expand Up @@ -207,6 +207,10 @@ msgstr ""
msgid "Current Site"
msgstr ""

#: jsx/specimenTab.js:75 jsx/globals.js:234
msgid "Draw Site"
msgstr ""

#: jsx/container.js:54
msgid "Checkout Child Containers"
msgstr ""
Expand All @@ -228,7 +232,7 @@ msgid "This field is required."
msgstr ""

#: jsx/biobankIndex.js:512
msgid "This field must be a number. "
msgid "This field must be a number."
msgstr ""

#: jsx/biobankIndex.js:518
Expand All @@ -240,27 +244,21 @@ msgid "This field must be an integer."
msgstr ""

#: jsx/biobankIndex.js:597 jsx/biobankIndex.js:699 jsx/biobankIndex.js:736
msgid "This field is required! "
#: jsx/biobankIndex.js:636
msgid "This field is required."
msgstr ""

#: jsx/biobankIndex.js:604 jsx/biobankIndex.js:705 jsx/biobankIndex.js:741
msgid "This field must be a number! "
#: jsx/biobankIndex.js:644
msgid "This field must be a number."
msgstr ""

#: jsx/biobankIndex.js:611 jsx/biobankIndex.js:652 jsx/biobankIndex.js:747
msgid "This field must be a valid date! "
msgid "This field must be a valid date."
msgstr ""

#: jsx/biobankIndex.js:617 jsx/biobankIndex.js:660 jsx/biobankIndex.js:753
msgid "This field must be a valid time! "
msgstr ""

#: jsx/biobankIndex.js:636
msgid "This field is required!"
msgstr ""

#: jsx/biobankIndex.js:644
msgid "This field must be a number!"
msgid "This field must be a valid time."
msgstr ""

#: jsx/biobankIndex.js:711
Expand All @@ -271,6 +269,12 @@ msgstr ""
msgid "Pooling requires at least 2 specimens"
msgstr ""

#: jsx/filter.js:73
msgid "Container"
msgid_plural "Containers"
msgstr[0] ""
msgstr[1] ""

#: jsx/shipmentTab.js:69 jsx/shipmentTab.js:141
msgid "Origin Site"
msgstr ""
Expand All @@ -296,7 +300,7 @@ msgid "User"
msgstr ""

#: jsx/batchEditForm.js:214
msgid "Specimens must be of the same Type and Center"
msgid "Specimens must be of the same Type and Site"
msgstr ""

#: jsx/batchEditForm.js:274 jsx/globals.js:144
Expand Down Expand Up @@ -412,7 +416,7 @@ msgid ""
msgstr ""

#: jsx/specimenForm.js:219
msgid "Parent Specimen(s, {ns: 'biobank'})"
msgid "Parent Specimen(s)"
msgstr ""

#: jsx/specimenForm.js:255
Expand Down
Loading