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.6.0",
"version": "7.7.0",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down
8 changes: 8 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages

### version 7.7.0
*Released*: 29 December 2025
- Workflow Automation: Task action to filter samples for selected task
- Added `lockReadOnlyForDelete` prop for workflow filter components to prevent modification of read-only filters used for deletion.
- Introduced `EntityFieldFilter` type (renamed from `FieldFilter`) for improved clarity and consistency across workflow task filters.
- Added new filter action helper functions: `getActionValuesForFilterProps` and `removeFilterValueForFilterProps` to simplify reading and updating filter values.
- Added support for `supportAllValueInQuery` in entity data types so workflow filters can include an "All" option when querying entities.

### version 7.6.0
*Released*: 29 December 2025
- Copy folder access settings when copying freezers and assay designs
Expand Down
17 changes: 16 additions & 1 deletion packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ import {
FindDerivativesButton,
FindDerivativesMenuItem,
getSampleFinderLocalStorageKey,
getSearchFilterObj,
getSearchFilterObjs,
SAMPLE_FINDER_SESSION_PREFIX,
searchFiltersToJson,
Expand Down Expand Up @@ -624,6 +625,13 @@ import { GridPanel, GridPanelWithModel } from './public/QueryModel/GridPanel';
import { TabbedGridPanel } from './public/QueryModel/TabbedGridPanel';
import { DetailPanel, DetailPanelWithModel } from './public/QueryModel/DetailPanel';
import { makeTestActions, makeTestQueryModel } from './public/QueryModel/testUtils';
import { FilterStatus } from './public/QueryModel/FilterStatus';
import {
FilterAction,
getActionValuesForFilterProps,
removeFilterValueForFilterProps,
} from './public/QueryModel/grid/actions/Filter';

import {
BACKGROUND_IMPORT_MIN_FILE_SIZE,
BACKGROUND_IMPORT_MIN_ROW_SIZE,
Expand Down Expand Up @@ -1287,7 +1295,9 @@ export {
FileColumnRenderer,
FileInput,
FileTree,
FilterAction,
FilterCriteriaRenderer,
FilterStatus,
FIND_BY_IDS_QUERY_PARAM,
FindByIdsModal,
FindDerivativesButton,
Expand Down Expand Up @@ -1315,6 +1325,7 @@ export {
generateId,
generateNameWithTimestamp,
getActionErrorMessage,
getActionValuesForFilterProps,
getAltUnitKeys,
getAssayDefinitions,
getAuditQueries,
Expand Down Expand Up @@ -1393,6 +1404,7 @@ export {
getSampleTypeDetails,
getSampleTypesFromTransactionIds,
getSchemaQuery,
getSearchFilterObj,
getSearchFilterObjs,
getSearchScopeFromContainerFilter,
getSelected,
Expand Down Expand Up @@ -1597,6 +1609,7 @@ export {
removeColumn,
removeColumns,
RemoveEntityButton,
removeFilterValueForFilterProps,
removeParameters,
renderWithAppContext,
replaceParameters,
Expand Down Expand Up @@ -1865,7 +1878,7 @@ export type {
StorageActionStatusCounts,
} from './internal/components/samples/models';
export type { SearchHit, SearchOptions } from './internal/components/search/actions';
export type { FieldFilter } from './internal/components/search/models';
export type { EntityFieldFilter } from './internal/components/search/models';
export type { SecurityAPIWrapper } from './internal/components/security/APIWrapper';
export type { IDataViewInfo } from './internal/DataViewInfo';
export type { BSStyle } from './internal/dropdowns';
Expand Down Expand Up @@ -1897,9 +1910,11 @@ export type { QueryParams } from './internal/util/URL';
export type { FileSizeLimitProps } from './public/files/models';
export type { ImportTemplate } from './public/QueryInfo';
export type { EditableDetailPanelProps } from './public/QueryModel/EditableDetailPanel';
export type { Action, ActionValue } from './public/QueryModel/grid/actions/Action';
export type { QueryConfig } from './public/QueryModel/QueryModel';
export type { QueryModelLoader } from './public/QueryModel/QueryModelLoader';
export type { TabbedGridPanelProps } from './public/QueryModel/TabbedGridPanel';

// Due to babel-loader & typescript babel plugins we need to export/import types separately. The babel plugins require
// the typescript compiler option "isolatedModules", which do not export types from modules, so types must be exported
// separately.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SchemaQuery } from '../../../public/SchemaQuery';

import { TestTypeDataType, TestTypeDataTypeWithEntityFilter } from '../../../test/data/constants';

import { FieldFilter } from '../search/models';
import { EntityFieldFilter } from '../search/models';

import { SCHEMAS } from '../../schemas';

Expand Down Expand Up @@ -232,14 +232,14 @@ const anyValueFilter = {
fieldCaption: 'textField',
filter: Filter.create('textField', null, Filter.Types.HAS_ANY_VALUE),
jsonType: 'string',
} as FieldFilter;
} as EntityFieldFilter;

const stringBetweenFilter = {
fieldKey: 'strField',
fieldCaption: 'strField',
filter: Filter.create('strField', ['1', '5'], Filter.Types.BETWEEN),
jsonType: 'string',
} as FieldFilter;
} as EntityFieldFilter;

const card = {
entityDataType: TestTypeDataType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { QueryColumn } from '../../../public/QueryColumn';
import { QueryInfo } from '../../../public/QueryInfo';
import { isValidFilterField } from '../search/utils';
import { QueryModel } from '../../../public/QueryModel/QueryModel';
import { FieldFilter } from '../search/models';
import { EntityFieldFilter } from '../search/models';

import { useAppContext } from '../../AppContext';
import { ResponsiveMenuButton } from '../buttons/ResponsiveMenuButton';
Expand Down Expand Up @@ -44,7 +44,7 @@ export function isValidFilterFieldSampleFinder(
}

// exported for unit test coverage
export const getFieldFilter = (model: QueryModel, filter: Filter.IFilter): FieldFilter => {
export const getFieldFilter = (model: QueryModel, filter: Filter.IFilter): EntityFieldFilter => {
const colName = filter.getColumnName();
const column = model.getColumn(colName);

Expand All @@ -53,7 +53,7 @@ export const getFieldFilter = (model: QueryModel, filter: Filter.IFilter): Field
fieldCaption: column?.caption ?? colName,
filter,
jsonType: column?.isLookup() ? column.displayFieldJsonType : (column?.jsonType ?? 'string'),
} as FieldFilter;
} as EntityFieldFilter;
};

// exported for unit test coverage
Expand Down Expand Up @@ -126,16 +126,15 @@ function filterToJson(filter: Filter.IFilter): string {
return encodeURIComponent(filter.getURLParameterName()) + '=' + encodeURIComponent(filter.getURLParameterValue());
}

export function getSearchFilterObjs(filterProps: FilterProps[]): any[] {
const filterPropsObj = [];

filterProps.forEach(filterProp => {
const filterPropObj = { ...filterProp };
delete filterPropObj['entityDataType'];
// don't persist the entire entitydatatype
export function getSearchFilterObj(filterProp: FilterProps): any {
const filterPropObj = { ...filterProp };
delete filterPropObj['entityDataType'];
// don't persist the entire entitydatatype
if (filterProp.entityDataType)
filterPropObj['sampleFinderCardType'] = filterProp.entityDataType.sampleFinderCardType;

const filterArrayObjs = [];
const filterArrayObjs = [];
if (filterPropObj.filterArray) {
[...filterPropObj.filterArray].forEach(field => {
filterArrayObjs.push({
fieldKey: field.fieldKey,
Expand All @@ -145,8 +144,16 @@ export function getSearchFilterObjs(filterProps: FilterProps[]): any[] {
});
});
filterPropObj.filterArray = filterArrayObjs;
}

filterPropsObj.push(filterPropObj);
return filterPropObj;
}

export function getSearchFilterObjs(filterProps: FilterProps[]): any[] {
const filterPropsObj = [];

filterProps.forEach(filterProp => {
filterPropsObj.push(getSearchFilterObj(filterProp));
});

return filterPropsObj;
Expand Down
17 changes: 9 additions & 8 deletions packages/components/src/internal/components/entities/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { SCHEMAS } from '../../schemas';
import { EntityCreationType } from '../samples/models';
import { QueryInfo } from '../../../public/QueryInfo';
import { ViewInfo } from '../../ViewInfo';
import { FieldFilter } from '../search/models';
import { EntityFieldFilter } from '../search/models';

export interface EntityInputProps {
role: string;
Expand All @@ -41,7 +41,7 @@ export interface IDerivePayload {
materialDefault?: any;
materialInputs?: EntityInputProps[];
materialOutputCount?: number;
materialOutputs?: Array<{ [key: string]: any }>;
materialOutputs?: Record<string, any>[];
targetType: string;
}

Expand Down Expand Up @@ -434,14 +434,14 @@ export interface IEntityTypeDetails extends IEntityDetails {
importAliasValues?: string[];
}

export type SampleFinderCardType = 'sampleproperty' | 'sampleparent' | 'dataclassparent' | 'assaydata';
export type SampleFinderCardType = 'assaydata' | 'dataclassparent' | 'sampleparent' | 'sampleproperty';
export type FolderConfigurableDataType =
| 'SampleType'
| 'AssayDesign'
| 'Container'
| 'DashboardSampleType'
| 'DataClass'
| 'AssayDesign'
| 'StorageLocation'
| 'Container';
| 'SampleType'
| 'StorageLocation';

/**
* Avoid inline comment or above line comments for properties due to es-lint's limitation on moving comments:
Expand Down Expand Up @@ -507,6 +507,7 @@ export interface EntityDataType {
operationConfirmationActionName: string;
operationConfirmationControllerName: string;
sampleFinderCardType?: SampleFinderCardType;
supportAllValueInQuery?: boolean;
supportHasNoValueInQuery?: boolean;
supportsCrossTypeImport?: boolean;
typeIcon?: string;
Expand Down Expand Up @@ -649,7 +650,7 @@ export interface FilterProps {
disabled?: boolean;
entityDataType: EntityDataType;
// the filters to be used in conjunction with the schemaQuery
filterArray?: FieldFilter[];
filterArray?: EntityFieldFilter[];
index?: number;
schemaQuery?: SchemaQuery;
selectColumnFieldKey?: string;
Expand Down
Loading