Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d0001bf
Move export config into `EntityDataType`
labkey-susanh Jun 30, 2026
e5545d1
Add `JobInputSources` query to workfow schema
labkey-susanh Jun 30, 2026
2fbee61
@labkey/components v7.45.3-jobSources.0
labkey-susanh Jun 30, 2026
91523c4
Relabel "Sample Workflow Events" as "Workflow Events"
labkey-susanh Jun 30, 2026
1bcb27c
@labkey/components v7.45.3-jobSources.1
labkey-susanh Jun 30, 2026
f07adac
Merge remote-tracking branch 'origin/develop' into fb_jobSources
cnathe Jul 8, 2026
1b9b1ff
7.45.6-jobSources.0
cnathe Jul 8, 2026
29e03ec
7.45.6-jobSources.1
cnathe Jul 8, 2026
571713d
jest test updates for sources changes
cnathe Jul 9, 2026
a0cd5eb
Merge remote-tracking branch 'origin/develop' into fb_jobSources
cnathe Jul 9, 2026
67deff2
7.46.1-jobSources.0
cnathe Jul 9, 2026
516da4f
7.46.1-jobSources.1
cnathe Jul 9, 2026
9a44025
Merge remote-tracking branch 'origin/develop' into fb_jobSources
cnathe Jul 12, 2026
17f6c6e
7.46.2-jobSources.0
cnathe Jul 12, 2026
0b82b87
Merge remote-tracking branch 'origin/develop' into fb_jobSources
labkey-susanh Jul 14, 2026
deb5e49
@labkey/components v7.46.3-jobSources.0
labkey-susanh Jul 14, 2026
2f5ff75
merge from develop
labkey-susanh Jul 15, 2026
5353db1
merge from develop and update to @labkey/components v7.46.4-jobSources.0
labkey-susanh Jul 15, 2026
7949338
remove components.md update
cnathe Jul 17, 2026
36f5eba
Add sourceDeleteDependencyText method
labkey-susanh Jul 20, 2026
ec6d440
Nouns and verbs
labkey-susanh Jul 20, 2026
2d9999f
@labkey/components v7.46.4-jobSources.2
labkey-susanh Jul 20, 2026
b2cb4e5
move use of `sourceDeleteDependencyText` function to `DataClassDataType`
labkey-susanh Jul 20, 2026
06a5c49
@labkey/components v7.46.4-jobSources.3
labkey-susanh Jul 20, 2026
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.46.3",
"version": "7.46.4-jobSources.3",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ import {
parseEntityParentKey,
SAMPLE_ID_FIELD_KEY,
sampleDeleteDependencyText,
sourceDeleteDependencyText,
updateCellKeySampleIdMap,
} from './internal/components/entities/utils';
import {
Expand Down Expand Up @@ -1708,6 +1709,7 @@ export {
showPremiumFeatures,
sleep,
SOURCE_AUDIT_QUERY,
sourceDeleteDependencyText,
SourceTypeImportAliasRenderer,
spliceURL,
SplitButton,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const ASSAY_RESULT_AUDIT_QUERY: AuditQuery = {
export const WORKFLOW_AUDIT_QUERY: AuditQuery = {
hasDetail: true,
hasTransactionId: true,
label: 'Sample Workflow Events',
label: 'Workflow Events',
value: 'SamplesWorkflowAuditEvent',
};
export const SOURCE_AUDIT_QUERY: AuditQuery = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('getAuditQueries', () => {
test('LKSM professional', () => {
const auditQueries = getAuditQueries(TEST_LKSM_PROFESSIONAL_MODULE_CONTEXT);
expect(auditQueries.length).toBe(18);
expect(auditQueries.findIndex(entry => entry === INVENTORY_AUDIT_QUERY)).toBe(16);
expect(auditQueries.findIndex(entry => entry === INVENTORY_AUDIT_QUERY)).toBe(15);
expect(auditQueries.findIndex(entry => entry === ASSAY_AUDIT_QUERY)).toBeGreaterThanOrEqual(0);
expect(auditQueries.findIndex(entry => entry === WORKFLOW_AUDIT_QUERY)).toBeGreaterThanOrEqual(0);
expect(auditQueries.findIndex(entry => entry === SOURCE_AUDIT_QUERY)).toBeGreaterThanOrEqual(0);
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('getAuditQueries', () => {
};
const auditQueries = getAuditQueries(moduleContext);
expect(auditQueries.length).toBe(19);
expect(auditQueries.findIndex(entry => entry === INVENTORY_AUDIT_QUERY)).toBe(17);
expect(auditQueries.findIndex(entry => entry === INVENTORY_AUDIT_QUERY)).toBe(16);
expect(auditQueries.findIndex(entry => entry === ASSAY_AUDIT_QUERY)).toBeGreaterThanOrEqual(0);
expect(auditQueries.findIndex(entry => entry === ASSAY_RESULT_AUDIT_QUERY)).toBeGreaterThanOrEqual(0);
expect(auditQueries.findIndex(entry => entry === WORKFLOW_AUDIT_QUERY)).toBeGreaterThanOrEqual(0);
Expand Down
15 changes: 11 additions & 4 deletions packages/components/src/internal/components/entities/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import { DELETE_ASSAY_RUNS_TOPIC, DELETE_SAMPLES_TOPIC } from '../../util/helpLi

import { SAMPLE_TYPE_KEY, SAMPLES_KEY } from '../../app/constants';

import { SAMPLE_STORAGE_COLUMNS_WITH_SUBSELECT_EXPR } from '../samples/constants';
import { SAMPLE_DATA_EXPORT_CONFIG, SAMPLE_STORAGE_COLUMNS_WITH_SUBSELECT_EXPR } from '../samples/constants';

import { SchemaQuery } from '../../../public/SchemaQuery';

import { SAMPLE_PROPERTY_ALL_SAMPLE_TYPE } from '../search/constants';

import { EntityDataType } from './models';
import { sampleDeleteDependencyText } from './utils';
import { sampleDeleteDependencyText, sourceDeleteDependencyText } from './utils';

const DATA_OPERATION_CONFIRMATION_ACTION = 'getDataOperationConfirmationData.api';
const SAMPLE_OPERATION_CONFIRMATION_ACTION = 'getMaterialOperationConfirmationData.api';
Expand Down Expand Up @@ -146,6 +146,7 @@ export const SampleTypeDataType: EntityDataType = {
folderConfigurableDataType: 'SampleType',
labelColorCol: 'labelcolor',
extraFinderFields: ['storagepositionnumber', 'storageterminallocation'],
exportConfig: SAMPLE_DATA_EXPORT_CONFIG,
};

export const SampleParentDataType = {
Expand All @@ -155,6 +156,11 @@ export const SampleParentDataType = {
containerFilter: Query.containerFilter.currentPlusProjectAndShared,
};

export const SOURCE_EXPORT_CONFIG = {
'exportAlias.name': 'SourceID',
'exportAlias.folder': 'Folder',
};

export const DataClassDataType: EntityDataType = {
typeListingSchemaQuery: SCHEMAS.EXP_TABLES.DATA_CLASSES,
listingSchemaQuery: SCHEMAS.EXP_TABLES.DATA,
Expand All @@ -171,7 +177,7 @@ export const DataClassDataType: EntityDataType = {
descriptionSingular: 'parent type',
descriptionPlural: 'parent types',
uniqueFieldKey: 'Name',
dependencyText: 'derived data or sample dependencies',
dependencyText: sourceDeleteDependencyText,
deleteHelpLinkTopic: 'dataClass#prevent',
inputColumnName: 'Inputs/Data/First',
ancestorColumnName: 'Ancestors/OtherData',
Expand All @@ -182,6 +188,7 @@ export const DataClassDataType: EntityDataType = {
typeIcon: 'source_type',
sampleFinderCardType: 'dataclassparent',
folderConfigurableDataType: 'DataClass',
exportConfig: SOURCE_EXPORT_CONFIG,
};

export const ParentEntityLineageColumns = List.of('Inputs/Materials/First', 'Inputs/Data/First');
Expand Down Expand Up @@ -210,5 +217,5 @@ export const DATA_CLASS_IMPORT_PREFIX = 'dataInputs/';

export enum JobOperation {
Delete,
Move
Move,
}
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ export interface EntityDataType {
descriptionSingular: string;
editTypeAppUrlPrefix?: string;
exprColumnsWithSubSelect?: string[];
exportConfig?: Record<string, string>;
extraFinderFields?: string[];
filterArray?: Filter.IFilter[];
filterCardHeaderClass?: string;
Expand Down
29 changes: 29 additions & 0 deletions packages/components/src/internal/components/entities/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
getSampleIdCellKey,
parseEntityParentKey,
sampleDeleteDependencyText,
sourceDeleteDependencyText,
updateCellKeySampleIdMap,
} from './utils';
import { DataClassDataType, SampleTypeDataType } from './constants';
Expand Down Expand Up @@ -275,6 +276,34 @@ describe('sampleDeleteDependencyText', () => {
});
});

describe('sourceDeleteDependencyText', () => {
let moduleContext;

// We need to store and reset the module context before and after these tests so we don't impact other tests in this
// file.
beforeEach(() => {
moduleContext = LABKEY.moduleContext;
});

afterEach(() => {
LABKEY.moduleContext = moduleContext;
});

test('cannot delete, professional', () => {
LABKEY.moduleContext = { ...TEST_LKSM_PROFESSIONAL_MODULE_CONTEXT };
expect(sourceDeleteDependencyText()).toBe(
'derived sample or source dependencies or references in one or more jobs or active notebooks'
);
});

test('cannot delete, no workflow', () => {
LABKEY.moduleContext = { ...TEST_LKS_STARTER_MODULE_CONTEXT };
expect(sourceDeleteDependencyText()).toBe(
'derived sample or source dependencies'
);
});
});

describe('getIdentifyingColumns', () => {
const columns = [
{ fieldKey: 'intCol', jsonType: 'int', name: 'intCol' },
Expand Down
10 changes: 10 additions & 0 deletions packages/components/src/internal/components/entities/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ import { EntityChoice, EntityDataType, IEntityTypeOption } from './models';

import { ParentIdData } from './actions';

export function sourceDeleteDependencyText(): string {
let deleteMsg = 'derived sample or source dependencies';
if (isELNEnabled()) {
deleteMsg += ' or references in one or more ' + (isWorkflowEnabled() ? 'jobs or' : '') + ' active notebooks';
} else if (isWorkflowEnabled()) {
deleteMsg += ' or references in one or more jobs';
}
return deleteMsg;
}

export function sampleDeleteDependencyText(): string {
let deleteMsg = '';
if (isWorkflowEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { getQueryModelExportParams } from '../../../public/QueryModel/utils';
import { SAMPLE_MANAGER_APP_PROPERTIES } from '../../app/constants';
import { EXPORT_TYPES } from '../../constants';
import { buildURL } from '../../url/AppURL';
import { SAMPLE_DATA_EXPORT_CONFIG } from '../samples/constants';

import { selectRows } from '../../query/selectRows';

Expand All @@ -19,6 +18,7 @@ import { handleRequestFailure } from '../../request';

import { LABEL_TEMPLATE_SQ } from './constants';
import { BarTenderConfiguration, BarTenderResponse, LabelTemplate } from './models';
import { SampleTypeDataType } from '../entities/constants';

function handleBarTenderConfigurationResponse(
resolve: (value: BarTenderConfiguration | PromiseLike<BarTenderConfiguration>) => void
Expand Down Expand Up @@ -147,7 +147,7 @@ export class LabelPrintingServerAPIWrapper implements LabelPrintingAPIWrapper {
Ajax.request({
url: buildURL(SAMPLE_MANAGER_APP_PROPERTIES.controllerName, 'printBarTenderLabels.api'),
params: getQueryModelExportParams(sampleModel, EXPORT_TYPES.LABEL, {
...SAMPLE_DATA_EXPORT_CONFIG,
...SampleTypeDataType.exportConfig,
labelFormat,
numCopies,
// We override the showRows value because of the strange default behavior for grid export that
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/internal/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const WORKFLOW = {
JOB_TEMPLATE: new SchemaQuery(WORKFLOW_SCHEMA, 'JobTemplate'),
JOB_PRIORITY: new SchemaQuery(WORKFLOW_SCHEMA, 'WorkflowJobPriority'),
JOB_INPUT_SAMPLES: new SchemaQuery(WORKFLOW_SCHEMA, 'JobInputSamples'),
JOB_INPUT_SOURCES: new SchemaQuery(WORKFLOW_SCHEMA, 'JobInputSources'),
};

// STUDY
Expand Down