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
12 changes: 6 additions & 6 deletions packages/components/package-lock.json

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

4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/components",
"version": "6.67.1",
"version": "6.67.2",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down Expand Up @@ -50,7 +50,7 @@
"homepage": "https://github.com/LabKey/labkey-ui-components#readme",
"dependencies": {
"@hello-pangea/dnd": "18.0.1",
"@labkey/api": "1.43.0",
"@labkey/api": "1.43.1",
"@testing-library/dom": "~10.4.0",
"@testing-library/jest-dom": "~6.6.3",
"@testing-library/react": "~16.3.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages

### version 6.67.2
*Released* 31 October 2025
- Issue 53449: resolve lineage items from container path
- Refer to `item.containerPath` instead of `item.container` in lineage details

### version 6.67.1
*Released* 29 October 2025
- Issue 53563: Domain designer lookups don't show newly added entity types after initial load/view
Expand Down
44 changes: 23 additions & 21 deletions packages/components/src/internal/components/lineage/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* any form or by any electronic or mechanical means without written permission from LabKey Corporation.
*/
import { immerable, produce } from 'immer';
import { List, Map, Record as ImmutableRecord } from 'immutable';
import { Record as ImmutableRecord, List, Map } from 'immutable';
import { DataSet } from 'vis-data';
import { Edge, IdType, Node } from 'vis-network';

Expand Down Expand Up @@ -159,9 +159,9 @@ export interface LineageIOWithMetadata extends LineageIOConfig {
objectOutputs?: LineageItemWithMetadata[];
}

export interface LineageItemWithIOMetadata extends LineageItemWithMetadata, LineageIOWithMetadata {}
export interface LineageItemWithIOMetadata extends LineageIOWithMetadata, LineageItemWithMetadata {}

export interface LineageRunStepConfig extends Experiment.LineageRunStepBase, LineageItemWithIOMetadata {}
export interface LineageRunStepConfig extends LineageItemWithIOMetadata, Experiment.LineageRunStepBase {}

export class LineageRunStep implements LineageRunStepConfig {
[immerable] = true;
Expand All @@ -170,6 +170,7 @@ export class LineageRunStep implements LineageRunStepConfig {
readonly activityDate: string;
readonly activitySequence: number;
readonly container: string;
readonly containerPath: string;
readonly created: string;
readonly createdBy: string;
readonly dataInputs: LineageIO[];
Expand Down Expand Up @@ -202,6 +203,7 @@ export class LineageIO implements LineageItemWithMetadata {
[immerable] = true;

readonly container: string;
readonly containerPath: string;
readonly created: string;
readonly createdBy: string;
readonly expType: string;
Expand Down Expand Up @@ -246,15 +248,15 @@ export class LineageIO implements LineageItemWithMetadata {
}

interface LineageNodeConfig
extends Omit<Experiment.LineageNodeBase, 'children' | 'parents' | 'steps'>,
LineageItemWithIOMetadata {
children: List<LineageLink> | LineageLink[] | ILineageLink[];
extends LineageItemWithIOMetadata,
Omit<Experiment.LineageNodeBase, 'children' | 'parents' | 'steps'> {
children: ILineageLink[] | LineageLink[] | List<LineageLink>;
// computed properties
distance: number;
listURL: string;

meta: LineageNodeMetadata;
parents: List<LineageLink> | LineageLink[] | ILineageLink[];
parents: ILineageLink[] | LineageLink[] | List<LineageLink>;
steps: List<LineageRunStep>;
}

Expand Down Expand Up @@ -394,11 +396,11 @@ export class LineageResult extends ImmutableRecord({
});
}

filterIn(field: string, value: undefined | string | string[]): LineageResult {
filterIn(field: string, value: string | string[] | undefined): LineageResult {
return LineageResult._filter(this, field, value, true);
}

filterOut(field: string, value: undefined | string | string[]): LineageResult {
filterOut(field: string, value: string | string[] | undefined): LineageResult {
return LineageResult._filter(this, field, value, false);
}

Expand All @@ -412,7 +414,7 @@ export class LineageResult extends ImmutableRecord({
private static _filter(
result: LineageResult,
field: string,
value: undefined | string | string[],
value: string | string[] | undefined,
filterIn: boolean
): LineageResult {
if (field === undefined) throw new Error('field must not be undefined');
Expand Down Expand Up @@ -459,7 +461,7 @@ export class LineageResult extends ImmutableRecord({
private static _matches(
node: LineageNode,
field: string,
value: undefined | string | string[],
value: string | string[] | undefined,
filterIn: boolean
): boolean {
if (filterIn) {
Expand Down Expand Up @@ -510,7 +512,7 @@ export class LineageResult extends ImmutableRecord({
value: any,
filterIn: boolean,
walked: Record<string, string>
): Array<{ lsid: string; role: string }> {
): { lsid: string; role: string }[] {
let heritage = [];
const lsid = edge.lsid;
const toNode = nodes.get(lsid);
Expand Down Expand Up @@ -631,7 +633,7 @@ export class Lineage {
export class LineageGridModel {
[immerable] = true;

readonly columns: List<string | GridColumn> = LINEAGE_GRID_COLUMNS;
readonly columns: List<GridColumn | string> = LINEAGE_GRID_COLUMNS;
readonly data: List<LineageNode> = List();
readonly distance: number = DEFAULT_LINEAGE_DISTANCE;
readonly isError: boolean = false;
Expand Down Expand Up @@ -690,7 +692,7 @@ interface VisGraphClusterNode {
nodesInCluster: VisGraphNodeType[];
}

export type VisGraphNodeType = VisGraphNode | VisGraphCombinedNode | VisGraphClusterNode;
export type VisGraphNodeType = VisGraphClusterNode | VisGraphCombinedNode | VisGraphNode;

export function isBasicNode(item: VisGraphNodeType): item is VisGraphNode {
return item && item.kind === 'node';
Expand All @@ -709,7 +711,7 @@ export class VisGraphOptions {

readonly edges: DataSet<Edge>;
readonly initialSelection: string[];
readonly nodes: DataSet<VisGraphNode | VisGraphCombinedNode>;
readonly nodes: DataSet<VisGraphCombinedNode | VisGraphNode>;
readonly options: Record<string, any>;

constructor(config?: Partial<VisGraphOptions>) {
Expand All @@ -730,7 +732,7 @@ function makeEdgeId(fromId: IdType, toId: IdType): string {
type EdgesRecord = Record<string, Edge>;
type LineageNodesRecord = Record<string, LineageNode>;
type NodesInCombinedNode = Record<string, string[]>;
type VisNodesRecord = Record<string, VisGraphNode | VisGraphCombinedNode>;
type VisNodesRecord = Record<string, VisGraphCombinedNode | VisGraphNode>;

/**
* Create an edge between fromId -> toId when dir === Child.
Expand Down Expand Up @@ -986,7 +988,7 @@ export interface LineageNodeCollection {
queryName: string;
}

export function isAliquotNode(node: LineageNodeCollection | LineageNode): boolean {
export function isAliquotNode(node: LineageNode | LineageNodeCollection): boolean {
return node.materialLineageType === 'Aliquot';
}

Expand Down Expand Up @@ -1149,7 +1151,7 @@ function groupingBoundary(
grouping: LineageGroupingOptions,
depth: number,
dir: LINEAGE_DIRECTIONS,
depthSets: Array<Record<string, string>>
depthSets: Record<string, string>[]
): boolean {
if (grouping) {
// Nearest only examines the first parent and child generations (depth = 1) from seed
Expand Down Expand Up @@ -1206,7 +1208,7 @@ function level(depth: number, dir: LINEAGE_DIRECTIONS, combined: boolean): numbe
* level, however, after further walking the graph it could be that this node needs to be moved to a different level
* given a parent/child at a higher/lower depth. See Issue 51425.
*/
function reprocessLevel(visNode: VisGraphNode | VisGraphCombinedNode, dir: LINEAGE_DIRECTIONS, depth: number): void {
function reprocessLevel(visNode: VisGraphCombinedNode | VisGraphNode, dir: LINEAGE_DIRECTIONS, depth: number): void {
if (!visNode) return;

const currentLevel = visNode.level;
Expand Down Expand Up @@ -1261,7 +1263,7 @@ function processNodes(
nodesInCombinedNode: NodesInCombinedNode,
depth = 0,
processed: Record<string, boolean> = {},
depthSets: Array<Record<string, string>> = []
depthSets: Record<string, string>[] = []
): void {
if (processed[lsid] === true) {
// We have already seen this node, however, this now might be at a greater depth so reprocess the level
Expand Down Expand Up @@ -1467,7 +1469,7 @@ export function generate(result: LineageResult, options?: LineageOptions): VisGr
const { edges, nodes } = generateNodesAndEdges(result, options);

return new VisGraphOptions({
nodes: new DataSet<VisGraphNode | VisGraphCombinedNode>(Object.values(nodes)),
nodes: new DataSet<VisGraphCombinedNode | VisGraphNode>(Object.values(nodes)),
edges: new DataSet<Edge>(Object.values(edges)),

// vis.js options described in detail here: https://visjs.github.io/vis-network/docs/network/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface LineageDetailProps {
item: Experiment.LineageItemBase;
}

const LineageDetailImpl: FC<LineageDetailProps & InjectedQueryModels> = memo(props => {
const LineageDetailImpl: FC<InjectedQueryModels & LineageDetailProps> = memo(props => {
const { queryModels } = props;
if (queryModels.model.isLoading) return <LoadingSpinner />;
if (queryModels.model.hasLoadErrors) return <Alert>{queryModels.model.loadErrors[0]}</Alert>;
Expand All @@ -33,10 +33,10 @@ const LineageDetailImpl: FC<LineageDetailProps & InjectedQueryModels> = memo(pro

return (
<DetailPanel
tableCls="detail-component--table__auto"
detailRenderer={_resolveDetailRenderer}
model={queryModels.model}
queryColumns={detailColumns}
detailRenderer={_resolveDetailRenderer}
tableCls="detail-component--table__auto"
/>
);
});
Expand All @@ -49,7 +49,7 @@ export const LineageDetail: FC<LineageDetailProps> = memo(({ item }) => {
() => ({
model: {
baseFilters: item.pkFilters.map(pkFilter => Filter.create(pkFilter.fieldKey, pkFilter.value)),
containerPath: item.container,
containerPath: item.containerPath,
// Issue 45028: Display details view columns in lineage
schemaQuery: new SchemaQuery(item.schemaName, item.queryName, ViewInfo.DETAIL_NAME),
// Must specify '*' columns be requested to resolve "properties" columns
Expand All @@ -60,7 +60,7 @@ export const LineageDetail: FC<LineageDetailProps> = memo(({ item }) => {
);

// providing "key" to allow for reload on lsid change
return <LineageDetailWithQueryModels key={item.lsid} autoLoad queryConfigs={queryConfigs} item={item} />;
return <LineageDetailWithQueryModels autoLoad item={item} key={item.lsid} queryConfigs={queryConfigs} />;
});
LineageDetail.displayName = 'LineageDetail';

Expand All @@ -73,17 +73,19 @@ export const CustomPropertiesRenderer: FC<RendererProps> = memo(({ data }) => {
return (
<table className="lineage-detail-prop-table" data-testid="custom-properties-table">
<tbody>
{data?.map(row => {
const fieldKey = row.get('fieldKey');
const name = fieldKey.substring(fieldKey.indexOf('#') + 1);
{data
?.map(row => {
const fieldKey = row.get('fieldKey');
const name = fieldKey.substring(fieldKey.indexOf('#') + 1);

return (
<tr key={fieldKey} className="lineage-detail-prop-row">
<td className="lineage-detail-prop-cell">{name}</td>
<td className="lineage-detail-prop-cell">{row.get('value')}</td>
</tr>
);
}).toArray()}
return (
<tr className="lineage-detail-prop-row" key={fieldKey}>
<td className="lineage-detail-prop-cell">{name}</td>
<td className="lineage-detail-prop-cell">{row.get('value')}</td>
</tr>
);
})
.toArray()}
</tbody>
</table>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { LineageSummary } from '../LineageSummary';
import {
createLineageNodeCollections,
isAliquotNode,
LineageNodeCollectionByType,
LineageIOWithMetadata,
LineageNode,
LineageNodeCollectionByType,
} from '../models';
import { LineageOptions } from '../types';

Expand Down Expand Up @@ -75,7 +75,7 @@ export class LineageNodeDetail extends PureComponent<LineageNodeDetailProps, Lin
<LineageDetail item={node} />
<LineageSummary
{...lineageOptions}
containerPath={node.container}
containerPath={node.containerPath}
highlightNode={highlightNode}
key={node.lsid}
lsid={node.lsid}
Expand Down Expand Up @@ -148,10 +148,10 @@ export class ClusterNodeDetail extends PureComponent<ClusterNodeDetailProps> {
);
return (
<DetailsListNodes
highlightNode={highlightNode}
key={groupName}
title={groupDisplayName}
nodes={nodesByType[groupName]}
highlightNode={highlightNode}
title={groupDisplayName}
/>
);
})}
Expand Down Expand Up @@ -192,7 +192,7 @@ const RunStepNodeDetail: FC<RunStepNodeDetailProps> = memo(props => {
<DetailsListLineageIO item={step} />
</Tab>
{hasProvenanceModule && (
<Tab eventKey="provenanceMap" title="Provenance Map" className="lineage-run-step-provenance-map">
<Tab className="lineage-run-step-provenance-map" eventKey="provenanceMap" title="Provenance Map">
<RunStepProvenanceMap item={step} />
</Tab>
)}
Expand Down