Skip to content

Commit c394b87

Browse files
Issue 52828: Warning about ignored fields for data classes is not quite right (#1786)
1 parent c7e4eea commit c394b87

10 files changed

Lines changed: 50 additions & 39 deletions

File tree

packages/components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@labkey/components",
3-
"version": "6.38.2",
3+
"version": "6.39.0",
44
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
55
"sideEffects": false,
66
"files": [

packages/components/releaseNotes/components.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# @labkey/components
22
Components, models, actions, and utility functions for LabKey applications and pages
33

4+
### version 6.39.0
5+
*Released*: 2 May 2025
6+
- Export `getSourceDomainDefaultSystemFields`
7+
48
### version 6.38.2
59
*Released*: 30 April 2025
610
- Remove remnants of Edit with Grid from Bulk Edit modal

packages/components/src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ import {
140140
import { DisableableAnchor } from './internal/components/base/DisableableAnchor';
141141
import {
142142
DateFormatType,
143-
ISO_DATE_FORMAT_STRING,
144-
ISO_DATE_TIME_FORMAT_STRING,
145143
formatDate,
146144
formatDateTime,
147145
fromDate,
@@ -163,6 +161,8 @@ import {
163161
getTimeFormat,
164162
isDateBetween,
165163
isDateTimeInPast,
164+
ISO_DATE_FORMAT_STRING,
165+
ISO_DATE_TIME_FORMAT_STRING,
166166
isRelativeDateFilterValue,
167167
joinDateTimeFormat,
168168
parseDate,
@@ -394,9 +394,9 @@ import {
394394
import {
395395
deleteSampleSet,
396396
fetchSamples,
397-
getLookupRowIdsFromSelection,
398397
getGroupedSampleDisplayColumns,
399398
getGroupedSampleDomainFields,
399+
getLookupRowIdsFromSelection,
400400
getSampleSet,
401401
getSampleTypeDetails,
402402
getSelectedSampleIdsFromSelectionKey,
@@ -535,6 +535,7 @@ import {
535535
} from './internal/components/entities/constants';
536536
import { getModuleCustomLabels } from './internal/components/labels/actions';
537537
import {
538+
createEntityParentKey,
538539
getCellKeyColumnMap,
539540
getEntityDescription,
540541
getEntityNoun,
@@ -544,11 +545,10 @@ import {
544545
getUniqueIdColumnMetadata,
545546
isDataClassEntity,
546547
isSampleEntity,
548+
parseEntityParentKey,
547549
SAMPLE_ID_FIELD_KEY,
548550
sampleDeleteDependencyText,
549551
updateCellKeySampleIdMap,
550-
createEntityParentKey,
551-
parseEntityParentKey,
552552
} from './internal/components/entities/utils';
553553
import {
554554
ALIQUOT_CREATION,
@@ -562,8 +562,8 @@ import { DEFAULT_ALIQUOT_NAMING_PATTERN, SampleTypeModel } from './internal/comp
562562
import { EditableDetailPanel } from './public/QueryModel/EditableDetailPanel';
563563
import { Pagination } from './internal/components/pagination/Pagination';
564564
import {
565-
createSnapshotSelectionKey,
566565
createOrderedSnapshotSelectionKey,
566+
createSnapshotSelectionKey,
567567
getQueryModelExportParams,
568568
runDetailsColumnsForQueryModel,
569569
} from './public/QueryModel/utils';
@@ -596,7 +596,7 @@ import {
596596
saveDomain,
597597
setDomainFields,
598598
} from './internal/components/domainproperties/actions';
599-
import { createFormInputId } from './internal/components/domainproperties/utils';
599+
import { createFormInputId, getSourceDomainDefaultSystemFields } from './internal/components/domainproperties/utils';
600600
import {
601601
DomainDesign,
602602
DomainDetails,
@@ -1358,6 +1358,7 @@ export {
13581358
isAllSamplesSchema,
13591359
getFilterForSampleOperation,
13601360
getSampleDomainDefaultSystemFields,
1361+
getSourceDomainDefaultSystemFields,
13611362
getSampleStatusColor,
13621363
getSampleStatus,
13631364
getSampleStatusContainerFilter,

packages/components/src/internal/components/domainproperties/SystemFields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const SystemFields: FC<Props> = memo(({ fields, disabledSystemFields, onS
8787
<input
8888
className="grid-panel__row-checkbox"
8989
type="checkbox"
90-
disabled={!row.get('Disableble')}
90+
disabled={!row.get('Disableable')}
9191
checked={selected === true}
9292
onChange={onChange} // eslint-disable-line
9393
/>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const DESCRIPTION_FIELD = {
2-
Name: 'Description',
3-
Label: 'Description',
4-
DataType: 'Text',
5-
Required: false,
6-
Description: 'Contains a description for this data object',
7-
Disableble: true,
8-
};
2+
Name: 'Description',
3+
Label: 'Description',
4+
DataType: 'Text',
5+
Required: false,
6+
Description: 'Contains a description for this data object',
7+
Disableable: true,
8+
};
99

1010
export const DATACLASS_DOMAIN_SYSTEM_FIELDS = [
1111
{
@@ -14,7 +14,7 @@ export const DATACLASS_DOMAIN_SYSTEM_FIELDS = [
1414
DataType: 'Text',
1515
Required: true,
1616
Description: 'Contains a short name for this data object',
17-
Disableble: false,
17+
Disableable: false,
1818
},
1919
DESCRIPTION_FIELD,
2020
];
@@ -26,7 +26,7 @@ export const SOURCE_DOMAIN_SYSTEM_FIELDS = [
2626
DataType: 'Text',
2727
Required: true,
2828
Description: 'Contains a short name for this data object',
29-
Disableble: false,
29+
Disableable: false,
3030
},
3131
DESCRIPTION_FIELD,
3232
];

packages/components/src/internal/components/domainproperties/dataset/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ export const getDatasetSystemFields = (studyProperties: StudyProperties): System
5757
DataType: 'Text',
5858
Required: true,
5959
Description: 'Subject identifier',
60-
Disableble: false,
60+
Disableable: false,
6161
},
6262
{
6363
Name: 'SequenceNum',
6464
Label: 'Sequence Num',
6565
DataType: 'Decimal (floating point)',
6666
Required: isVisitBased,
6767
Description: '',
68-
Disableble: false,
68+
Disableable: false,
6969
},
7070
];
7171

@@ -76,15 +76,15 @@ export const getDatasetSystemFields = (studyProperties: StudyProperties): System
7676
DataType: 'DateTime',
7777
Required: true,
7878
Description: 'The day of the visit. Primarily used in date-based studies.',
79-
Disableble: false,
79+
Disableable: false,
8080
});
8181
systemFields.push({
8282
Name: 'Day',
8383
Label: 'Day',
8484
DataType: 'Integer',
8585
Required: false,
8686
Description: 'The day of the visit. Primarily used in date-based studies.',
87-
Disableble: false,
87+
Disableable: false,
8888
});
8989
}
9090

@@ -94,7 +94,7 @@ export const getDatasetSystemFields = (studyProperties: StudyProperties): System
9494
DataType: 'Integer',
9595
Required: true,
9696
Description: '',
97-
Disableble: false,
97+
Disableable: false,
9898
});
9999

100100
return systemFields;

packages/components/src/internal/components/domainproperties/models.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,9 +2221,9 @@ export interface NameExpressionsValidationResults {
22212221
export interface SystemField {
22222222
DataType: string;
22232223
Description: string;
2224-
Disableble: boolean;
2225-
Editable?: boolean;
2224+
Disableable: boolean;
22262225
Enabled?: boolean;
2226+
IsCalculated?: boolean;
22272227
Label: string;
22282228
Name: string;
22292229
Required: boolean;

packages/components/src/internal/components/domainproperties/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { OrderedMap, Set } from 'immutable';
33
import { IParentAlias } from '../entities/models';
44

55
import { DOMAIN_FIELD_PREFIX } from './constants';
6+
import { SystemField } from './models';
7+
import { SOURCE_DOMAIN_SYSTEM_FIELDS } from './dataclasses/constants';
68

79
export function createFormInputName(name: string): string {
810
return [DOMAIN_FIELD_PREFIX, name].join('-');
@@ -115,3 +117,7 @@ export function parentAliasInvalid(alias: Partial<IParentAlias>): boolean {
115117

116118
return !!(aliasValueInvalid || parentValueInvalid || alias.isDupe);
117119
}
120+
121+
export function getSourceDomainDefaultSystemFields(): SystemField[] {
122+
return SOURCE_DOMAIN_SYSTEM_FIELDS;
123+
}

packages/components/src/internal/components/samples/constants.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,56 +228,56 @@ export const SAMPLE_DOMAIN_DEFAULT_SYSTEM_FIELDS = [
228228
Required: true,
229229
// For user clarity, below text differs intentionally from schema browser
230230
Description: 'Unique ID generated from the Naming Pattern or Aliquot Naming Pattern',
231-
Disableble: false,
231+
Disableable: false,
232232
},
233233
{
234234
Name: 'SampleState',
235235
Label: 'Status',
236236
DataType: 'Integer',
237237
Required: false,
238238
Description: 'Represents the status of the sample',
239-
Disableble: false,
239+
Disableable: false,
240240
},
241241
{
242242
Name: 'Description',
243243
Label: 'Description',
244244
DataType: 'Text',
245245
Required: false,
246246
Description: 'Contains a Description for this sample',
247-
Disableble: true,
247+
Disableable: true,
248248
},
249249
{
250250
Name: 'MaterialExpDate',
251251
Label: 'Expiration Date',
252252
DataType: 'DateTime',
253253
Required: false,
254254
Description: 'The date that this sample expires on',
255-
Disableble: true,
255+
Disableable: true,
256256
},
257257
{
258258
Name: 'StoredAmount',
259259
Label: 'Amount',
260260
DataType: 'Decimal (floating point)',
261261
Required: false,
262262
Description: 'The amount of this sample',
263-
Disableble: true,
263+
Disableable: true,
264264
},
265265
{
266266
Name: 'Units',
267267
Label: 'Units',
268268
DataType: 'Text',
269269
Required: false,
270270
Description: 'The units associated with the Amount value for this sample',
271-
Disableble: true,
271+
Disableable: true,
272272
},
273273
{
274274
Name: 'AliquotCount',
275275
Label: 'Aliquots Created Count',
276276
DataType: 'Integer',
277277
Required: false,
278278
Description: '',
279-
Disableble: true,
280-
Editable: false,
279+
Disableable: true,
280+
IsCalculated: true,
281281
},
282282
];
283283

@@ -288,18 +288,18 @@ export const SAMPLE_DOMAIN_INVENTORY_SYSTEM_FIELDS = [
288288
DataType: 'Integer',
289289
Required: false,
290290
Description: '',
291-
Disableble: true,
291+
Disableable: true,
292292
},
293293
{
294294
Name: 'StorageLocation',
295295
Label: 'Storage Location',
296296
DataType: 'Text',
297297
Required: false,
298298
Description: '',
299-
Disableble: true,
299+
Disableable: true,
300300
},
301-
{ Name: 'StorageRow', Label: 'Storage Row', DataType: 'Text', Required: false, Description: '', Disableble: true },
302-
{ Name: 'StorageCol', Label: 'Storage Col', DataType: 'Text', Required: false, Description: '', Disableble: true },
301+
{ Name: 'StorageRow', Label: 'Storage Row', DataType: 'Text', Required: false, Description: '', Disableable: true },
302+
{ Name: 'StorageCol', Label: 'Storage Col', DataType: 'Text', Required: false, Description: '', Disableable: true },
303303
];
304304

305305
export const AMOUNT_PRECISION_ERROR_TEXT = 'Amount used is too precise for selected units.';

0 commit comments

Comments
 (0)