From ddacc295a84c5d28d95a86dad691917c6cf4f168 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 08:33:09 -0500 Subject: [PATCH 01/51] Sample listing grid updates to include ExpMaterialColor and use SAMPLE_COLOR_REQUIRED_COLUMNS in requiredColumns --- .../components/src/internal/components/samples/constants.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/components/src/internal/components/samples/constants.ts b/packages/components/src/internal/components/samples/constants.ts index 066f4eb859..e23dd06218 100644 --- a/packages/components/src/internal/components/samples/constants.ts +++ b/packages/components/src/internal/components/samples/constants.ts @@ -57,8 +57,6 @@ export const SAMPLE_STATUS_REQUIRED_COLUMNS = [ export const SAMPLE_COLOR_COLUMN_NAME = 'ExpMaterialColor'; export const SAMPLE_COLOR_COLOR_COLUMN_NAME = 'ExpMaterialColor/Color'; - -// TODO, color fields not wired up yet export const SAMPLE_COLOR_REQUIRED_COLUMNS = [SAMPLE_COLOR_COLUMN_NAME, SAMPLE_COLOR_COLOR_COLUMN_NAME]; export enum SampleOperation { From a3fe2ab4168ee24d4f6cc98324a2bb47d0ce32dd Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 08:41:53 -0500 Subject: [PATCH 02/51] update success message to use bold instead of quotes --- .../components/picklist/ChoosePicklistModal.test.tsx | 10 +++++----- .../components/picklist/ChoosePicklistModal.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/components/src/internal/components/picklist/ChoosePicklistModal.test.tsx b/packages/components/src/internal/components/picklist/ChoosePicklistModal.test.tsx index 573ec4b02c..090cad7a68 100644 --- a/packages/components/src/internal/components/picklist/ChoosePicklistModal.test.tsx +++ b/packages/components/src/internal/components/picklist/ChoosePicklistModal.test.tsx @@ -198,7 +198,7 @@ describe('ChoosePicklistModal', () => { test('no samples added', () => { render(); expect(document.body.textContent).toBe( - `No samples added to picklist "${PUBLIC_EDITOR_PICKLIST.name}". 4 samples were already in the list.` + `No samples added to picklist ${PUBLIC_EDITOR_PICKLIST.name}. 4 samples were already in the list.` ); expect(document.querySelector('a').textContent).toBe(PUBLIC_EDITOR_PICKLIST.name); }); @@ -206,28 +206,28 @@ describe('ChoosePicklistModal', () => { test('all samples added', () => { render(); expect(document.body.textContent).toBe( - `Successfully added 4 samples to picklist "${PUBLIC_EDITOR_PICKLIST.name}".` + `Successfully added 4 samples to picklist ${PUBLIC_EDITOR_PICKLIST.name}.` ); }); test('some samples added', () => { render(); expect(document.body.textContent).toBe( - `Successfully added 2 samples to picklist "${PUBLIC_EDITOR_PICKLIST.name}". 2 samples were already in the list.` + `Successfully added 2 samples to picklist ${PUBLIC_EDITOR_PICKLIST.name}. 2 samples were already in the list.` ); }); test('one sample added', () => { render(); expect(document.body.textContent).toBe( - `Successfully added 1 sample to picklist "${PUBLIC_EDITOR_PICKLIST.name}". 3 samples were already in the list.` + `Successfully added 1 sample to picklist ${PUBLIC_EDITOR_PICKLIST.name}. 3 samples were already in the list.` ); }); test('one sample not added', () => { render(); expect(document.body.textContent).toBe( - `Successfully added 3 samples to picklist "${PUBLIC_EDITOR_PICKLIST.name}". 1 sample was already in the list.` + `Successfully added 3 samples to picklist ${PUBLIC_EDITOR_PICKLIST.name}. 1 sample was already in the list.` ); }); }); diff --git a/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx b/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx index 121de577d9..8d85de9806 100644 --- a/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx +++ b/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx @@ -189,9 +189,11 @@ export const AddedToPicklistNotification: FC = return ( <> - {numAddedNotification} to picklist " - {picklist.name}". - {numNotAddedNotification} + {numAddedNotification} to picklist{' '} + + {picklist.name} + + .{numNotAddedNotification} ); }; From 38afba3e2e208fcaec70cc9797519ed1838ccd62 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 08:42:15 -0500 Subject: [PATCH 03/51] SampleColorRenderer minor styling update --- .../components/src/internal/renderers/SampleColorRenderer.tsx | 2 +- packages/components/src/theme/samples.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/components/src/internal/renderers/SampleColorRenderer.tsx b/packages/components/src/internal/renderers/SampleColorRenderer.tsx index b37460b51f..8997a33316 100644 --- a/packages/components/src/internal/renderers/SampleColorRenderer.tsx +++ b/packages/components/src/internal/renderers/SampleColorRenderer.tsx @@ -26,7 +26,7 @@ export const SampleColorRenderer: FC = memo(({ data, row }) => { caseInsensitive(rowJS, 'SampleID/' + SAMPLE_COLOR_COLOR_COLUMN_NAME)?.value; } - return ; + return ; }); SampleColorRenderer.displayName = 'SampleColorRenderer'; diff --git a/packages/components/src/theme/samples.scss b/packages/components/src/theme/samples.scss index 07f187bed7..2e08a2ce18 100644 --- a/packages/components/src/theme/samples.scss +++ b/packages/components/src/theme/samples.scss @@ -73,3 +73,7 @@ font-weight: normal; margin: 0; } + +.sample-color { + vertical-align: text-top; +} From c949765b4696452b16c33e91d591d8c66d527204 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 08:42:24 -0500 Subject: [PATCH 04/51] 7.50.1-fb-sampleColor2.0 --- packages/components/package-lock.json | 4 ++-- packages/components/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index e36eb02c45..af315cb775 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/components", - "version": "7.50.0", + "version": "7.50.1-fb-sampleColor2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/components", - "version": "7.50.0", + "version": "7.50.1-fb-sampleColor2.0", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", diff --git a/packages/components/package.json b/packages/components/package.json index d7cf803043..05aba3cdb7 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/components", - "version": "7.50.0", + "version": "7.50.1-fb-sampleColor2.0", "description": "Components, models, actions, and utility functions for LabKey applications and pages", "sideEffects": false, "files": [ From ea55487a965a7a32b4f0d0257e4655f71d15e251 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 10:35:02 -0500 Subject: [PATCH 05/51] QueryInfo.showSampleColorCol --- .../components/src/public/QueryInfo.test.ts | 40 +++++++++++++++++++ packages/components/src/public/QueryInfo.ts | 5 +++ 2 files changed, 45 insertions(+) diff --git a/packages/components/src/public/QueryInfo.test.ts b/packages/components/src/public/QueryInfo.test.ts index 7bbb350839..4b2dd90090 100644 --- a/packages/components/src/public/QueryInfo.test.ts +++ b/packages/components/src/public/QueryInfo.test.ts @@ -8,6 +8,8 @@ import sampleSetQueryInfo from '../test/data/sampleSet-getQueryDetails.json'; import { ViewInfo } from '../internal/ViewInfo'; +import { SAMPLE_COLOR_COLUMN_NAME } from '../internal/components/samples/constants'; + import { ExtendedMap } from './ExtendedMap'; import { QueryInfo } from './QueryInfo'; @@ -553,4 +555,42 @@ describe('QueryInfo', () => { expect(col.name).toBe('Name'); }); }); + + describe('showSampleColorCol', () => { + const makeQueryInfo = (sampleColorCol?: Record): QueryInfo => + QueryInfo.fromJsonForTests({ + columns: [{ fieldKey: 'name', name: 'name' }, ...(sampleColorCol ? [sampleColorCol] : [])], + name: 'query', + schemaName: 'schema', + }); + + test('without sample color column', () => { + expect(makeQueryInfo().showSampleColorCol()).toBe(false); + }); + + test('sample color column shown in details view', () => { + expect( + makeQueryInfo({ fieldKey: SAMPLE_COLOR_COLUMN_NAME, shownInDetailsView: true }).showSampleColorCol() + ).toBe(true); + }); + + test('sample color column not shown in details view', () => { + expect( + makeQueryInfo({ fieldKey: SAMPLE_COLOR_COLUMN_NAME, shownInDetailsView: false }).showSampleColorCol() + ).toBe(false); + }); + + test('sample color column without shownInDetailsView', () => { + expect(makeQueryInfo({ fieldKey: SAMPLE_COLOR_COLUMN_NAME }).showSampleColorCol()).toBe(false); + }); + + test('sample color column field key is case-insensitive', () => { + expect( + makeQueryInfo({ + fieldKey: SAMPLE_COLOR_COLUMN_NAME.toUpperCase(), + shownInDetailsView: true, + }).showSampleColorCol() + ).toBe(true); + }); + }); }); diff --git a/packages/components/src/public/QueryInfo.ts b/packages/components/src/public/QueryInfo.ts index a6b4a2ffd1..ee876054f7 100644 --- a/packages/components/src/public/QueryInfo.ts +++ b/packages/components/src/public/QueryInfo.ts @@ -14,6 +14,7 @@ import { insertColumnFilter, QueryColumn } from './QueryColumn'; import { SchemaQuery } from './SchemaQuery'; import { QuerySort } from './QuerySort'; import { naturalSortByProperty } from './sort'; +import { SAMPLE_COLOR_COLUMN_NAME } from '../internal/components/samples/constants'; export enum QueryInfoStatus { ok, @@ -516,4 +517,8 @@ export class QueryInfo { template => template.url.toLowerCase().indexOf('exportexceltemplate') === -1 ); } + + showSampleColorCol(): boolean { + return this.getColumn(SAMPLE_COLOR_COLUMN_NAME)?.shownInDetailsView === true; + } } From e113739cc012c2ee9aeffb60625f89020a2b3296 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 10:35:16 -0500 Subject: [PATCH 06/51] 7.50.1-fb-sampleColor2.1 --- packages/components/package-lock.json | 4 ++-- packages/components/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index af315cb775..3be8f0c916 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.0", + "version": "7.50.1-fb-sampleColor2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.0", + "version": "7.50.1-fb-sampleColor2.1", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", diff --git a/packages/components/package.json b/packages/components/package.json index 05aba3cdb7..8412449b33 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.0", + "version": "7.50.1-fb-sampleColor2.1", "description": "Components, models, actions, and utility functions for LabKey applications and pages", "sideEffects": false, "files": [ From 6eb84ee675aefefc3afcdc2e442ee39c1c78ca00 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 13:32:54 -0500 Subject: [PATCH 07/51] Include ExpMaterialColor for aliquot editable field --- .../internal/components/picklist/ChoosePicklistModal.tsx | 6 ++---- .../components/src/internal/components/samples/actions.ts | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx b/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx index 8d85de9806..4630e75554 100644 --- a/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx +++ b/packages/components/src/internal/components/picklist/ChoosePicklistModal.tsx @@ -190,10 +190,8 @@ export const AddedToPicklistNotification: FC = return ( <> {numAddedNotification} to picklist{' '} - - {picklist.name} - - .{numNotAddedNotification} + {picklist.name}. + {numNotAddedNotification} ); }; diff --git a/packages/components/src/internal/components/samples/actions.ts b/packages/components/src/internal/components/samples/actions.ts index e0fbfaafcf..1cf9bdd441 100644 --- a/packages/components/src/internal/components/samples/actions.ts +++ b/packages/components/src/internal/components/samples/actions.ts @@ -376,6 +376,7 @@ function isAliquotEditableField(colName: string): boolean { colName === 'name' || colName === 'description' || colName === 'materialexpdate' || + colName === 'expmaterialcolor' || (isSampleStatusEnabled() && colName === 'samplestate') ); } From 49823a570c91278ad58d040a08d35913087ad600 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 14:41:39 -0500 Subject: [PATCH 08/51] App helpers for getting hasActiveProjectColors from moduleContext --- packages/components/src/index.ts | 2 ++ .../components/src/internal/app/constants.ts | 1 + .../components/src/internal/app/utils.test.ts | 13 ++++++++++++ packages/components/src/internal/app/utils.ts | 17 +++++++++++++++ .../samples/ManageSampleColorsPanel.tsx | 10 ++++++++- .../internal/components/samples/utils.test.ts | 21 +++++++++++++------ 6 files changed, 57 insertions(+), 7 deletions(-) diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 0dd92ffa59..33e0af429d 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -712,6 +712,7 @@ import { getFolderSampleTypeExclusion, getPrimaryAppProperties, getProjectPath, + hasActiveProjectColors, hasModule, hasPremiumModule, hasProductFolders, @@ -974,6 +975,7 @@ const App = { getLabelsTestAPIWrapper, getSecurityTestAPIWrapper, getQueryTestAPIWrapper, + hasActiveProjectColors, hasPremiumModule, hasProductFolders, hasModule, diff --git a/packages/components/src/internal/app/constants.ts b/packages/components/src/internal/app/constants.ts index 2ac3de755e..6994e15ab4 100644 --- a/packages/components/src/internal/app/constants.ts +++ b/packages/components/src/internal/app/constants.ts @@ -114,6 +114,7 @@ export const EXPERIMENTAL_REQUESTS_MENU = 'experimental-biologics-requests-menu' export const FOLDER_DATA_TYPE_EXCLUSIONS = 'dataTypeExclusions'; export const ARCHIVED_FOLDERS = 'archivedContainers'; +export const HAS_ACTIVE_PROJECT_COLORS = 'hasActiveProjectColors'; export const BASE_APP_HELP_LINK = 'https://www.labkey.org/SampleManagerHelp/wiki-page.view?name='; diff --git a/packages/components/src/internal/app/utils.test.ts b/packages/components/src/internal/app/utils.test.ts index 7869731379..6095f5baa7 100644 --- a/packages/components/src/internal/app/utils.test.ts +++ b/packages/components/src/internal/app/utils.test.ts @@ -47,6 +47,7 @@ import { getProjectPath, getSamplesSectionConfig, getStorageSectionConfig, + hasActiveProjectColors, hasPremiumModule, isAppHomeFolder, isAssayEnabled, @@ -812,6 +813,18 @@ describe('utils', () => { expect(LABKEY.moduleContext.query).toEqual({ hasProductFolders: false, ken: 'griffey' }); }); + test('hasActiveProjectColors', () => { + expect(hasActiveProjectColors({})).toBe(false); + expect(hasActiveProjectColors({ samplemanagement: {} })).toBe(false); + expect(hasActiveProjectColors({ samplemanagement: { hasActiveProjectColors: false } })).toBe(false); + expect(hasActiveProjectColors({ samplemanagement: { hasActiveProjectColors: true } })).toBe(true); + + const moduleContext = LABKEY.moduleContext; + LABKEY.moduleContext = { samplemanagement: { hasActiveProjectColors: true } }; + expect(hasActiveProjectColors()).toBe(true); // falls back to the global moduleContext + LABKEY.moduleContext = moduleContext; + }); + test('hasPremiumModule', () => { expect(hasPremiumModule({})).toBeFalsy(); expect(hasPremiumModule({ api: { moduleNames: ['samplemanagement'] } })).toBeFalsy(); diff --git a/packages/components/src/internal/app/utils.ts b/packages/components/src/internal/app/utils.ts index 716e2ed344..0373ba824d 100644 --- a/packages/components/src/internal/app/utils.ts +++ b/packages/components/src/internal/app/utils.ts @@ -30,6 +30,7 @@ import { FOLDER_DATA_TYPE_EXCLUSIONS, FREEZER_MANAGER_APP_PROPERTIES, FREEZERS_KEY, + HAS_ACTIVE_PROJECT_COLORS, HOME_KEY, LABKEY_SERVER_PRODUCT_NAME, LIMS_APP_PROPERTIES, @@ -208,6 +209,22 @@ export function isSampleColorsEnabled(moduleContext?: ModuleContext): boolean { return resolveModuleContext(moduleContext)?.experiment?.SampleColors === true; } +/** True if the current container's project has at least one active (non-archived) sample color. */ +export function hasActiveProjectColors(moduleContext?: ModuleContext): boolean { + return resolveModuleContext(moduleContext)?.samplemanagement?.[HAS_ACTIVE_PROJECT_COLORS] === true; +} + +export function setActiveProjectColors(moduleContext: ModuleContext, hasActiveProjectColors: boolean): ModuleContext { + // side-effect set global moduleContext + if (LABKEY?.moduleContext?.samplemanagement) { + LABKEY.moduleContext.samplemanagement.hasActiveProjectColors = hasActiveProjectColors; + } + + return Object.assign(moduleContext ?? {}, { + samplemanagement: Object.assign(moduleContext?.samplemanagement ?? {}, { hasActiveProjectColors }), + }); +} + export function isQueryMetadataEditor(): boolean { const action = ActionURL.getAction()?.toLowerCase() || ''; return action === 'metadataquery' || action.startsWith('querymetadataeditor'); diff --git a/packages/components/src/internal/components/samples/ManageSampleColorsPanel.tsx b/packages/components/src/internal/components/samples/ManageSampleColorsPanel.tsx index 71fbfc92f9..c4441fab54 100644 --- a/packages/components/src/internal/components/samples/ManageSampleColorsPanel.tsx +++ b/packages/components/src/internal/components/samples/ManageSampleColorsPanel.tsx @@ -19,6 +19,8 @@ import { SCHEMAS } from '../../schemas'; import { resolveErrorMessage } from '../../util/messaging'; import { InjectedRouteLeaveProps } from '../../util/RouteLeave'; import { useAppContext } from '../../AppContext'; +import { useServerContext } from '../base/ServerContext'; +import { setActiveProjectColors } from '../../app/utils'; import { Container } from '../base/models/Container'; import { DataTypeSelector } from '../entities/DataTypeSelector'; @@ -374,6 +376,7 @@ export const ManageSampleColorsPanel: FC = memo(pr const [selectedRowId, setSelectedRowId] = useState(); const [dirty, setDirty] = useState(false); const { api } = useAppContext(); + const { moduleContext } = useServerContext(); const isNew = selectedRowId === NEW_COLOR_INDEX; const loadColors = useCallback( @@ -383,6 +386,11 @@ export const ManageSampleColorsPanel: FC = memo(pr .getSampleColors(true, true, homeContainer?.path) .then(loaded => { setColors(loaded); + // keep the moduleContext flag in sync so consumers don't have to reload the page after a save + setActiveProjectColors( + moduleContext, + loaded.some(c => !c.archived) + ); if (selectLabel) setSelectedRowId(loaded.find(c => c.label === selectLabel)?.rowId); }) .catch(() => { @@ -390,7 +398,7 @@ export const ManageSampleColorsPanel: FC = memo(pr setError('Error: Unable to load sample colors.'); }); }, - [api, homeContainer?.path] + [api, homeContainer?.path, moduleContext] ); useEffect(() => { diff --git a/packages/components/src/internal/components/samples/utils.test.ts b/packages/components/src/internal/components/samples/utils.test.ts index c74586d474..2ab4bed0e3 100644 --- a/packages/components/src/internal/components/samples/utils.test.ts +++ b/packages/components/src/internal/components/samples/utils.test.ts @@ -18,6 +18,7 @@ import { DEFAULT_AVAILABLE_STATUS_COLOR, DEFAULT_CONSUMED_STATUS_COLOR, DEFAULT_LOCKED_STATUS_COLOR, + SAMPLE_COLOR_REQUIRED_COLUMNS, SAMPLE_STATE_TYPE_COLUMN_NAME, SampleOperation, } from './constants'; @@ -47,15 +48,23 @@ const INVENTORY_COLS = SCHEMAS.INVENTORY.INVENTORY_COLS; test('getOmittedSampleTypeColumn', () => { let moduleContext = {}; expect(isFreezerManagementEnabled(moduleContext)).toBeFalsy(); - expect(getOmittedSampleTypeColumns(TEST_USER_READER, moduleContext)).toStrictEqual(INVENTORY_COLS); - expect(getOmittedSampleTypeColumns(TEST_USER_GUEST, moduleContext)).toStrictEqual( - [CHECKED_OUT_BY_FIELD].concat(INVENTORY_COLS) - ); + expect(getOmittedSampleTypeColumns(TEST_USER_READER, moduleContext)).toStrictEqual([ + ...INVENTORY_COLS, + ...SAMPLE_COLOR_REQUIRED_COLUMNS, + ]); + expect(getOmittedSampleTypeColumns(TEST_USER_GUEST, moduleContext)).toStrictEqual([ + CHECKED_OUT_BY_FIELD, + ...INVENTORY_COLS, + ...SAMPLE_COLOR_REQUIRED_COLUMNS, + ]); moduleContext = { inventory: {} }; expect(isFreezerManagementEnabled(moduleContext)).toBeTruthy(); - expect(getOmittedSampleTypeColumns(TEST_USER_READER, moduleContext)).toStrictEqual([]); - expect(getOmittedSampleTypeColumns(TEST_USER_GUEST, moduleContext)).toStrictEqual([CHECKED_OUT_BY_FIELD]); + expect(getOmittedSampleTypeColumns(TEST_USER_READER, moduleContext)).toStrictEqual(SAMPLE_COLOR_REQUIRED_COLUMNS); + expect(getOmittedSampleTypeColumns(TEST_USER_GUEST, moduleContext)).toStrictEqual([ + CHECKED_OUT_BY_FIELD, + ...SAMPLE_COLOR_REQUIRED_COLUMNS, + ]); }); describe('isSampleOperationPermitted', () => { From eade72e132a1957ec4d01f9e45965941ce660dc5 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 14:43:29 -0500 Subject: [PATCH 09/51] getOmittedSampleTypeColumns to include SAMPLE_COLOR_REQUIRED_COLUMNS when no colors defined in project --- .../src/internal/components/samples/utils.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/components/src/internal/components/samples/utils.tsx b/packages/components/src/internal/components/samples/utils.tsx index 504468f28d..8352035e68 100644 --- a/packages/components/src/internal/components/samples/utils.tsx +++ b/packages/components/src/internal/components/samples/utils.tsx @@ -7,7 +7,12 @@ import { Filter, Query, Utils } from '@labkey/api'; import { User } from '../base/models/User'; import { isFreezerManagementEnabled } from '../../app/products'; -import { isProductFoldersEnabled, isProjectContainer, isSampleStatusEnabled } from '../../app/utils'; +import { + hasActiveProjectColors, + isProductFoldersEnabled, + isProjectContainer, + isSampleStatusEnabled, +} from '../../app/utils'; import { OperationConfirmationData } from '../entities/models'; @@ -25,6 +30,7 @@ import { DEFAULT_LOCKED_STATUS_COLOR, operationRestrictionMessage, permittedOps, + SAMPLE_COLOR_REQUIRED_COLUMNS, SAMPLE_DOMAIN_DEFAULT_SYSTEM_FIELDS, SAMPLE_DOMAIN_INVENTORY_SYSTEM_FIELDS, SAMPLE_STATE_COLOR_COLUMN_NAME, @@ -46,6 +52,9 @@ export function getOmittedSampleTypeColumns(user: User, moduleContext?: ModuleCo if (!isFreezerManagementEnabled(moduleContext)) { cols = cols.concat(SCHEMAS.INVENTORY.INVENTORY_COLS); } + if (!hasActiveProjectColors(moduleContext)) { + cols = cols.concat(SAMPLE_COLOR_REQUIRED_COLUMNS); + } return cols; } From b4adfc28deba90111e8417ac3e263b586e5d39f2 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 14:43:51 -0500 Subject: [PATCH 10/51] 7.50.1-fb-sampleColor2.2 --- packages/components/package-lock.json | 4 ++-- packages/components/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 3be8f0c916..1af47aba47 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.1", + "version": "7.50.1-fb-sampleColor2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.1", + "version": "7.50.1-fb-sampleColor2.2", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", diff --git a/packages/components/package.json b/packages/components/package.json index 8412449b33..42352d2704 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.1", + "version": "7.50.1-fb-sampleColor2.2", "description": "Components, models, actions, and utility functions for LabKey applications and pages", "sideEffects": false, "files": [ From 129ef71059b30fb0e1346397754d66e267ea50d2 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 16:04:20 -0500 Subject: [PATCH 11/51] remove experimental feature flag --- packages/components/package-lock.json | 4 ++-- packages/components/package.json | 2 +- packages/components/src/index.ts | 2 -- packages/components/src/internal/app/utils.ts | 4 ---- .../domainproperties/samples/SampleTypePropertiesPanel.tsx | 6 ++---- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 1af47aba47..832a3322be 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.2", + "version": "7.50.1-fb-sampleColor2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.2", + "version": "7.50.1-fb-sampleColor2.3", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", diff --git a/packages/components/package.json b/packages/components/package.json index 42352d2704..f7cc3d67b8 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/components", - "version": "7.50.1-fb-sampleColor2.2", + "version": "7.50.1-fb-sampleColor2.3", "description": "Components, models, actions, and utility functions for LabKey applications and pages", "sideEffects": false, "files": [ diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 33e0af429d..32c9890a2a 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -740,7 +740,6 @@ import { isProjectContainer, isProtectedDataEnabled, isRegistryEnabled, - isSampleColorsEnabled, isSampleStatusEnabled, isSharedContainer, isSourceTypeEnabled, @@ -957,7 +956,6 @@ const App = { isSharedContainer, freezerManagerIsCurrentApp, isSampleManagerEnabled, - isSampleColorsEnabled, isSampleStatusEnabled, isProductFoldersEnabled, isAllProductFoldersFilteringEnabled, diff --git a/packages/components/src/internal/app/utils.ts b/packages/components/src/internal/app/utils.ts index 0373ba824d..b9df29c2ad 100644 --- a/packages/components/src/internal/app/utils.ts +++ b/packages/components/src/internal/app/utils.ts @@ -205,10 +205,6 @@ export function isSampleStatusEnabled(moduleContext?: ModuleContext): boolean { return hasSampleManagementModule(moduleContext); } -export function isSampleColorsEnabled(moduleContext?: ModuleContext): boolean { - return resolveModuleContext(moduleContext)?.experiment?.SampleColors === true; -} - /** True if the current container's project has at least one active (non-archived) sample color. */ export function hasActiveProjectColors(moduleContext?: ModuleContext): boolean { return resolveModuleContext(moduleContext)?.samplemanagement?.[HAS_ACTIVE_PROJECT_COLORS] === true; diff --git a/packages/components/src/internal/components/domainproperties/samples/SampleTypePropertiesPanel.tsx b/packages/components/src/internal/components/domainproperties/samples/SampleTypePropertiesPanel.tsx index e06920d390..b1b6249b59 100644 --- a/packages/components/src/internal/components/domainproperties/samples/SampleTypePropertiesPanel.tsx +++ b/packages/components/src/internal/components/domainproperties/samples/SampleTypePropertiesPanel.tsx @@ -32,7 +32,7 @@ import { ENTITY_FORM_IDS } from '../entities/constants'; import { AutoLinkToStudyDropdown } from '../AutoLinkToStudyDropdown'; import { isSampleManagerEnabled } from '../../../app/products'; -import { getCurrentProductName, isCommunityDistribution, isSampleColorsEnabled } from '../../../app/utils'; +import { getCurrentProductName, isCommunityDistribution } from '../../../app/utils'; import { PREFIX_SUBSTITUTION_EXPRESSION, PROPERTIES_PANEL_NAMING_PATTERN_WARNING_MSG } from '../constants'; @@ -618,9 +618,7 @@ class SampleTypePropertiesPanelImpl extends PureComponent - {isSampleColorsEnabled() && ( - - )} + {includeMetricUnitProperty && ( <>
From efe83085e13f36d510063b2b3f077548c3defe6f Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 31 Jul 2026 16:06:34 -0500 Subject: [PATCH 12/51] jset snapshot update --- .../SampleTypePropertiesPanel.test.tsx.snap | 91 ++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/packages/components/src/internal/components/domainproperties/samples/__snapshots__/SampleTypePropertiesPanel.test.tsx.snap b/packages/components/src/internal/components/domainproperties/samples/__snapshots__/SampleTypePropertiesPanel.test.tsx.snap index d577011f50..0d7e2c2cdb 100644 --- a/packages/components/src/internal/components/domainproperties/samples/__snapshots__/SampleTypePropertiesPanel.test.tsx.snap +++ b/packages/components/src/internal/components/domainproperties/samples/__snapshots__/SampleTypePropertiesPanel.test.tsx.snap @@ -260,6 +260,47 @@ exports[`SampleTypePropertiesPanel appPropertiesOnly 1`] = `
+
+
+ + Sample + + Colors +
+ + + +
+
+
+
+
+ +