Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions packages/components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/components",
"version": "7.20.4",
"version": "7.20.5",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down
4 changes: 4 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages

### version 7.20.5
*Released*: 25 February 2026
- GitHub Issue #418: Remove flag field type & migrate to text

### version 7.20.4
*Released*: 25 February 2026
- GitHub Issue #734: App narrow screen display can cut off error message for field editor pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
DOMAIN_FIELD_TYPE,
DOUBLE_RANGE_URI,
FILELINK_RANGE_URI,
FLAG_CONCEPT_URI,
INT_RANGE_URI,
MULTILINE_RANGE_URI,
PARTICIPANTID_CONCEPT_URI,
Expand Down Expand Up @@ -190,37 +189,30 @@ describe('DomainForm', () => {
propertyId: 6,
propertyURI: 'test',
});
fields.push({
name: 'flag',
rangeURI: STRING_RANGE_URI,
conceptURI: FLAG_CONCEPT_URI,
propertyId: 7,
propertyURI: 'test',
});
fields.push({
name: 'file link',
rangeURI: FILELINK_RANGE_URI,
propertyId: 8,
propertyId: 7,
propertyURI: 'test',
});
fields.push({
name: 'participant id',
rangeURI: STRING_RANGE_URI,
conceptURI: PARTICIPANTID_CONCEPT_URI,
propertyId: 9,
propertyId: 8,
propertyURI: 'test',
});
fields.push({
name: 'attachment',
rangeURI: ATTACHMENT_RANGE_URI,
propertyId: 10,
propertyId: 9,
propertyURI: 'test',
});
fields.push({
name: 'sample',
rangeURI: STRING_RANGE_URI,
conceptURI: SAMPLE_TYPE_CONCEPT_URI,
propertyId: 11,
propertyId: 10,
propertyURI: 'test',
});

Expand All @@ -247,10 +239,10 @@ describe('DomainForm', () => {
expect(document.querySelectorAll('.domain-toolbar-delete-btn')).toHaveLength(1);
expect(document.querySelectorAll('.domain-search-input')).toHaveLength(1);
expect(document.querySelectorAll('.domain-toolbar-toggle-summary')).toHaveLength(1);
expect(document.querySelectorAll('.domain-field-row')).toHaveLength(12);
expect(document.querySelectorAll('.domain-field-delete-icon')).toHaveLength(11);
expect(document.querySelectorAll('.domain-field-row')).toHaveLength(11);
expect(document.querySelectorAll('.domain-field-delete-icon')).toHaveLength(10);

expect(document.querySelectorAll('.domain-field-details')).toHaveLength(11);
expect(document.querySelectorAll('.domain-field-details')).toHaveLength(10);
expect(document.querySelectorAll('.domain-field-details')[0].textContent).toContain('');
});

Expand All @@ -274,13 +266,6 @@ describe('DomainForm', () => {
propertyId: 2,
propertyURI: 'test',
});
fields.push({
name: 'flag changed to attachment',
rangeURI: STRING_RANGE_URI,
conceptURI: FLAG_CONCEPT_URI,
propertyId: 3,
propertyURI: 'test',
});

let domain = DomainDesign.create({
name: 'update field types',
Expand All @@ -294,7 +279,6 @@ describe('DomainForm', () => {
domain = updateDomainField(domain, { id: createFormInputId(DOMAIN_FIELD_NAME, 0, 0), value: 'newfieldname' });
domain = updateDomainField(domain, { id: createFormInputId(DOMAIN_FIELD_TYPE, 0, 1), value: 'boolean' });
domain = updateDomainField(domain, { id: createFormInputId(DOMAIN_FIELD_TYPE, 0, 2), value: 'ParticipantId' });
domain = updateDomainField(domain, { id: createFormInputId(DOMAIN_FIELD_TYPE, 0, 3), value: 'attachment' });

await act(async () => {
renderWithAppContext(<DomainForm domain={domain} onChange={jest.fn()} />);
Expand All @@ -304,9 +288,9 @@ describe('DomainForm', () => {
expect(document.querySelectorAll('.domain-toolbar-delete-btn')).toHaveLength(1);
expect(document.querySelectorAll('.domain-search-input')).toHaveLength(1);
expect(document.querySelectorAll('.domain-toolbar-toggle-summary')).toHaveLength(1);
expect(document.querySelectorAll('.domain-field-row')).toHaveLength(5);
expect(document.querySelectorAll('.domain-field-delete-icon')).toHaveLength(4);
expect(document.querySelectorAll('.domain-field-details')).toHaveLength(4);
expect(document.querySelectorAll('.domain-field-row')).toHaveLength(4);
expect(document.querySelectorAll('.domain-field-delete-icon')).toHaveLength(3);
expect(document.querySelectorAll('.domain-field-details')).toHaveLength(3);
expect(document.querySelectorAll('.domain-field-details')[0].textContent).toContain('Updated');
});

Expand Down Expand Up @@ -362,7 +346,7 @@ describe('DomainForm', () => {
});

await act(async () => {
renderWithAppContext(<DomainForm domain={domain} collapsible={false} initCollapsed onChange={jest.fn()} />);
renderWithAppContext(<DomainForm collapsible={false} domain={domain} initCollapsed onChange={jest.fn()} />);
});

expect(document.getElementsByClassName('domain-panel-header-collapsed')).toHaveLength(1);
Expand Down Expand Up @@ -392,8 +376,8 @@ describe('DomainForm', () => {
await act(async () => {
renderWithAppContext(
<DomainForm
domain={domain}
collapsible={false}
domain={domain}
initCollapsed
onChange={jest.fn()}
panelStatus="COMPLETE"
Expand Down Expand Up @@ -496,7 +480,7 @@ describe('DomainForm', () => {
});

await act(async () => {
renderWithAppContext(<DomainForm domain={domain} onChange={jest.fn()} collapsible controlledCollapse />);
renderWithAppContext(<DomainForm collapsible controlledCollapse domain={domain} onChange={jest.fn()} />);
});

expect(document.getElementsByClassName('domain-panel-header-expanded')).toHaveLength(1);
Expand Down Expand Up @@ -574,10 +558,10 @@ describe('DomainForm', () => {
renderWithAppContext(
<DomainForm
domain={domain}
onChange={jest.fn()}
domainFormDisplayOptions={{
hideRequired: true,
}}
onChange={jest.fn()}
/>
);
});
Expand All @@ -593,11 +577,11 @@ describe('DomainForm', () => {
renderWithAppContext(
<DomainForm
domain={domain}
onChange={jest.fn()}
domainFormDisplayOptions={{
hideAddFieldsButton: true,
hideInferFromFile: true,
}}
onChange={jest.fn()}
/>
);
});
Expand Down Expand Up @@ -641,10 +625,10 @@ describe('DomainForm', () => {
renderWithAppContext(
<DomainForm
domain={domain}
onChange={jest.fn()}
domainFormDisplayOptions={{
hideRequired: true,
}}
onChange={jest.fn()}
/>
);
});
Expand Down Expand Up @@ -679,11 +663,11 @@ describe('DomainForm', () => {
renderWithAppContext(
<DomainForm
domain={domain}
onChange={jest.fn()}
domainFormDisplayOptions={{
hideRequired: true,
hideImportExport: true,
}}
onChange={jest.fn()}
/>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
CALCULATED_TYPE,
DATETIME_TYPE,
DOUBLE_TYPE,
FLAG_TYPE,
INTEGER_TYPE,
MULTI_CHOICE_TYPE,
MULTILINE_TYPE,
Expand Down Expand Up @@ -158,23 +157,6 @@ describe('DomainRowExpandedOptions', () => {
});
});

test('Flag data type', async () => {
const field = DomainField.create({
conceptURI: FLAG_TYPE.conceptURI,
rangeURI: FLAG_TYPE.rangeURI,
});

render(<DomainRowExpandedOptions {...DEFAULT_PROPS} field={field} />);

await waitFor(() => {
const headers = document.querySelectorAll('.domain-field-section-heading');
expect(headers.length).toBe(3);
expect(headers[0].textContent).toBe('Flag Options');
expect(headers[1].textContent).toBe('Name and Linking Options');
expect(headers[2].textContent).toBe('Conditional Formatting and Validation Options');
});
});

test('Multiline data type', async () => {
const field = DomainField.create({
rangeURI: MULTILINE_TYPE.rangeURI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
DECIMAL_RANGE_URI,
DOUBLE_RANGE_URI,
FILELINK_RANGE_URI,
FLAG_CONCEPT_URI,
FLOAT_RANGE_URI,
INT_RANGE_URI,
LONG_RANGE_URI,
Expand Down Expand Up @@ -285,12 +284,6 @@ export const DATETIME_TYPE = new PropDescType({
rangeURI: DATETIME_RANGE_URI,
alternateRangeURI: 'xsd:dateTime',
});
export const FLAG_TYPE = new PropDescType({
name: 'flag',
display: 'Flag',
rangeURI: STRING_RANGE_URI,
conceptURI: FLAG_CONCEPT_URI,
});
export const FILE_TYPE = new PropDescType({ name: 'fileLink', display: 'File', rangeURI: FILELINK_RANGE_URI });
export const ATTACHMENT_TYPE = new PropDescType({
name: 'attachment',
Expand Down Expand Up @@ -405,7 +398,6 @@ export const PROP_DESC_TYPES = List([
DATE_TYPE,
TIME_TYPE,
DATETIME_TYPE,
FLAG_TYPE,
FILE_TYPE,
ATTACHMENT_TYPE,
USERS_TYPE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
DATETIME_TYPE,
DOUBLE_TYPE,
FILE_TYPE,
FLAG_TYPE,
INTEGER_TYPE,
MULTI_CHOICE_TYPE,
ONTOLOGY_LOOKUP_TYPE,
Expand All @@ -79,7 +78,6 @@ import {
DOMAIN_FIELD_PREFIX,
FIELD_NAME_CHAR_WARNING_INFO,
FIELD_NAME_CHAR_WARNING_MSG,
FLAG_CONCEPT_URI,
INT_RANGE_URI,
MAX_TEXT_LENGTH,
SEVERITY_LEVEL_ERROR,
Expand Down Expand Up @@ -119,23 +117,14 @@ describe('domain properties actions', () => {
expect(field1.dataType.rangeURI).toBe(INT_RANGE_URI);

const field2 = DomainField.create({
name: 'field2name',
rangeURI: STRING_RANGE_URI,
conceptURI: FLAG_CONCEPT_URI,
propertyId: 0,
propertyURI: 'test',
});
expect(field2.dataType.name).toBe('flag');

const field3 = DomainField.create({
name: 'field3name',
rangeURI: INT_RANGE_URI,
lookupSchema: 'core',
lookupQuery: 'users',
propertyId: 0,
propertyURI: 'test',
});
expect(field3.dataType.name).toBe('users');
expect(field2.dataType.name).toBe('users');
});

test('server side error on the banner', () => {
Expand Down Expand Up @@ -365,7 +354,6 @@ describe('domain properties actions', () => {
__setController('project');
setModuleContext(TEST_LKS_STARTER_MODULE_CONTEXT);
const domain = DomainDesign.create({
allowFlagProperties: true,
allowFileLinkProperties: true,
allowAttachmentProperties: true,
allowTimepointProperties: true,
Expand All @@ -375,7 +363,6 @@ describe('domain properties actions', () => {
allowMultiChoiceProperties: true,
});
const available = getAvailableTypes(domain);
expect(available.contains(FLAG_TYPE)).toBeTruthy();
expect(available.contains(FILE_TYPE)).toBeTruthy();
expect(available.contains(ATTACHMENT_TYPE)).toBeTruthy();
expect(available.contains(ONTOLOGY_LOOKUP_TYPE)).toBeFalsy();
Expand All @@ -395,7 +382,6 @@ describe('domain properties actions', () => {
__setController('project');
setModuleContext(TEST_LKS_STARTER_MODULE_CONTEXT);
const domain = DomainDesign.create({
allowFlagProperties: false,
allowFileLinkProperties: false,
allowAttachmentProperties: false,
allowTimepointProperties: false,
Expand All @@ -405,7 +391,6 @@ describe('domain properties actions', () => {
allowMultiChoiceProperties: false,
});
const available = getAvailableTypes(domain);
expect(available.contains(FLAG_TYPE)).toBeFalsy();
expect(available.contains(FILE_TYPE)).toBeFalsy();
expect(available.contains(ATTACHMENT_TYPE)).toBeFalsy();
expect(available.contains(ONTOLOGY_LOOKUP_TYPE)).toBeFalsy();
Expand Down Expand Up @@ -456,7 +441,6 @@ describe('domain properties actions', () => {
});
const domain = DomainDesign.create({});
const types = await getAvailableTypesForOntology(api, domain);
expect(types.contains(FLAG_TYPE)).toBeTruthy();
expect(types.contains(FILE_TYPE)).toBeFalsy();
expect(types.contains(ATTACHMENT_TYPE)).toBeFalsy();
expect(types.contains(ONTOLOGY_LOOKUP_TYPE)).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ import {
ATTACHMENT_TYPE,
CALCULATED_TYPE,
FILE_TYPE,
FLAG_TYPE,
MULTI_CHOICE_TYPE,
ONTOLOGY_LOOKUP_TYPE,
PARTICIPANT_TYPE,
Expand Down Expand Up @@ -339,10 +338,6 @@ export async function getAvailableTypesForOntology(
}

function _isAvailablePropType(type: PropDescType, domain: DomainDesign, ontologies: OntologyModel[]): boolean {
if (type === FLAG_TYPE && !domain.allowFlagProperties) {
return false;
}

if (type === FILE_TYPE && !domain.allowFileLinkProperties) {
return false;
}
Expand Down
Loading