Skip to content

Commit 5011eb4

Browse files
authored
Issue 53449: resolve lineage items from container path (#1880)
1 parent cd450eb commit 5011eb4

6 files changed

Lines changed: 58 additions & 49 deletions

File tree

packages/components/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@labkey/components",
3-
"version": "6.67.1",
3+
"version": "6.67.2",
44
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
55
"sideEffects": false,
66
"files": [
@@ -50,7 +50,7 @@
5050
"homepage": "https://github.com/LabKey/labkey-ui-components#readme",
5151
"dependencies": {
5252
"@hello-pangea/dnd": "18.0.1",
53-
"@labkey/api": "1.43.0",
53+
"@labkey/api": "1.43.1",
5454
"@testing-library/dom": "~10.4.0",
5555
"@testing-library/jest-dom": "~6.6.3",
5656
"@testing-library/react": "~16.3.0",

packages/components/releaseNotes/components.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# @labkey/components
22
Components, models, actions, and utility functions for LabKey applications and pages
33

4+
### version 6.67.2
5+
*Released* 31 October 2025
6+
- Issue 53449: resolve lineage items from container path
7+
- Refer to `item.containerPath` instead of `item.container` in lineage details
8+
49
### version 6.67.1
510
*Released* 29 October 2025
611
- Issue 53563: Domain designer lookups don't show newly added entity types after initial load/view

packages/components/src/internal/components/lineage/models.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* any form or by any electronic or mechanical means without written permission from LabKey Corporation.
44
*/
55
import { immerable, produce } from 'immer';
6-
import { List, Map, Record as ImmutableRecord } from 'immutable';
6+
import { Record as ImmutableRecord, List, Map } from 'immutable';
77
import { DataSet } from 'vis-data';
88
import { Edge, IdType, Node } from 'vis-network';
99

@@ -159,9 +159,9 @@ export interface LineageIOWithMetadata extends LineageIOConfig {
159159
objectOutputs?: LineageItemWithMetadata[];
160160
}
161161

162-
export interface LineageItemWithIOMetadata extends LineageItemWithMetadata, LineageIOWithMetadata {}
162+
export interface LineageItemWithIOMetadata extends LineageIOWithMetadata, LineageItemWithMetadata {}
163163

164-
export interface LineageRunStepConfig extends Experiment.LineageRunStepBase, LineageItemWithIOMetadata {}
164+
export interface LineageRunStepConfig extends LineageItemWithIOMetadata, Experiment.LineageRunStepBase {}
165165

166166
export class LineageRunStep implements LineageRunStepConfig {
167167
[immerable] = true;
@@ -170,6 +170,7 @@ export class LineageRunStep implements LineageRunStepConfig {
170170
readonly activityDate: string;
171171
readonly activitySequence: number;
172172
readonly container: string;
173+
readonly containerPath: string;
173174
readonly created: string;
174175
readonly createdBy: string;
175176
readonly dataInputs: LineageIO[];
@@ -202,6 +203,7 @@ export class LineageIO implements LineageItemWithMetadata {
202203
[immerable] = true;
203204

204205
readonly container: string;
206+
readonly containerPath: string;
205207
readonly created: string;
206208
readonly createdBy: string;
207209
readonly expType: string;
@@ -246,15 +248,15 @@ export class LineageIO implements LineageItemWithMetadata {
246248
}
247249

248250
interface LineageNodeConfig
249-
extends Omit<Experiment.LineageNodeBase, 'children' | 'parents' | 'steps'>,
250-
LineageItemWithIOMetadata {
251-
children: List<LineageLink> | LineageLink[] | ILineageLink[];
251+
extends LineageItemWithIOMetadata,
252+
Omit<Experiment.LineageNodeBase, 'children' | 'parents' | 'steps'> {
253+
children: ILineageLink[] | LineageLink[] | List<LineageLink>;
252254
// computed properties
253255
distance: number;
254256
listURL: string;
255257

256258
meta: LineageNodeMetadata;
257-
parents: List<LineageLink> | LineageLink[] | ILineageLink[];
259+
parents: ILineageLink[] | LineageLink[] | List<LineageLink>;
258260
steps: List<LineageRunStep>;
259261
}
260262

@@ -394,11 +396,11 @@ export class LineageResult extends ImmutableRecord({
394396
});
395397
}
396398

397-
filterIn(field: string, value: undefined | string | string[]): LineageResult {
399+
filterIn(field: string, value: string | string[] | undefined): LineageResult {
398400
return LineageResult._filter(this, field, value, true);
399401
}
400402

401-
filterOut(field: string, value: undefined | string | string[]): LineageResult {
403+
filterOut(field: string, value: string | string[] | undefined): LineageResult {
402404
return LineageResult._filter(this, field, value, false);
403405
}
404406

@@ -412,7 +414,7 @@ export class LineageResult extends ImmutableRecord({
412414
private static _filter(
413415
result: LineageResult,
414416
field: string,
415-
value: undefined | string | string[],
417+
value: string | string[] | undefined,
416418
filterIn: boolean
417419
): LineageResult {
418420
if (field === undefined) throw new Error('field must not be undefined');
@@ -459,7 +461,7 @@ export class LineageResult extends ImmutableRecord({
459461
private static _matches(
460462
node: LineageNode,
461463
field: string,
462-
value: undefined | string | string[],
464+
value: string | string[] | undefined,
463465
filterIn: boolean
464466
): boolean {
465467
if (filterIn) {
@@ -510,7 +512,7 @@ export class LineageResult extends ImmutableRecord({
510512
value: any,
511513
filterIn: boolean,
512514
walked: Record<string, string>
513-
): Array<{ lsid: string; role: string }> {
515+
): { lsid: string; role: string }[] {
514516
let heritage = [];
515517
const lsid = edge.lsid;
516518
const toNode = nodes.get(lsid);
@@ -631,7 +633,7 @@ export class Lineage {
631633
export class LineageGridModel {
632634
[immerable] = true;
633635

634-
readonly columns: List<string | GridColumn> = LINEAGE_GRID_COLUMNS;
636+
readonly columns: List<GridColumn | string> = LINEAGE_GRID_COLUMNS;
635637
readonly data: List<LineageNode> = List();
636638
readonly distance: number = DEFAULT_LINEAGE_DISTANCE;
637639
readonly isError: boolean = false;
@@ -690,7 +692,7 @@ interface VisGraphClusterNode {
690692
nodesInCluster: VisGraphNodeType[];
691693
}
692694

693-
export type VisGraphNodeType = VisGraphNode | VisGraphCombinedNode | VisGraphClusterNode;
695+
export type VisGraphNodeType = VisGraphClusterNode | VisGraphCombinedNode | VisGraphNode;
694696

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

710712
readonly edges: DataSet<Edge>;
711713
readonly initialSelection: string[];
712-
readonly nodes: DataSet<VisGraphNode | VisGraphCombinedNode>;
714+
readonly nodes: DataSet<VisGraphCombinedNode | VisGraphNode>;
713715
readonly options: Record<string, any>;
714716

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

735737
/**
736738
* Create an edge between fromId -> toId when dir === Child.
@@ -986,7 +988,7 @@ export interface LineageNodeCollection {
986988
queryName: string;
987989
}
988990

989-
export function isAliquotNode(node: LineageNodeCollection | LineageNode): boolean {
991+
export function isAliquotNode(node: LineageNode | LineageNodeCollection): boolean {
990992
return node.materialLineageType === 'Aliquot';
991993
}
992994

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

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

14691471
return new VisGraphOptions({
1470-
nodes: new DataSet<VisGraphNode | VisGraphCombinedNode>(Object.values(nodes)),
1472+
nodes: new DataSet<VisGraphCombinedNode | VisGraphNode>(Object.values(nodes)),
14711473
edges: new DataSet<Edge>(Object.values(edges)),
14721474

14731475
// vis.js options described in detail here: https://visjs.github.io/vis-network/docs/network/

packages/components/src/internal/components/lineage/node/LineageDetail.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface LineageDetailProps {
1818
item: Experiment.LineageItemBase;
1919
}
2020

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

3434
return (
3535
<DetailPanel
36-
tableCls="detail-component--table__auto"
36+
detailRenderer={_resolveDetailRenderer}
3737
model={queryModels.model}
3838
queryColumns={detailColumns}
39-
detailRenderer={_resolveDetailRenderer}
39+
tableCls="detail-component--table__auto"
4040
/>
4141
);
4242
});
@@ -49,7 +49,7 @@ export const LineageDetail: FC<LineageDetailProps> = memo(({ item }) => {
4949
() => ({
5050
model: {
5151
baseFilters: item.pkFilters.map(pkFilter => Filter.create(pkFilter.fieldKey, pkFilter.value)),
52-
containerPath: item.container,
52+
containerPath: item.containerPath,
5353
// Issue 45028: Display details view columns in lineage
5454
schemaQuery: new SchemaQuery(item.schemaName, item.queryName, ViewInfo.DETAIL_NAME),
5555
// Must specify '*' columns be requested to resolve "properties" columns
@@ -60,7 +60,7 @@ export const LineageDetail: FC<LineageDetailProps> = memo(({ item }) => {
6060
);
6161

6262
// providing "key" to allow for reload on lsid change
63-
return <LineageDetailWithQueryModels key={item.lsid} autoLoad queryConfigs={queryConfigs} item={item} />;
63+
return <LineageDetailWithQueryModels autoLoad item={item} key={item.lsid} queryConfigs={queryConfigs} />;
6464
});
6565
LineageDetail.displayName = 'LineageDetail';
6666

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

80-
return (
81-
<tr key={fieldKey} className="lineage-detail-prop-row">
82-
<td className="lineage-detail-prop-cell">{name}</td>
83-
<td className="lineage-detail-prop-cell">{row.get('value')}</td>
84-
</tr>
85-
);
86-
}).toArray()}
81+
return (
82+
<tr className="lineage-detail-prop-row" key={fieldKey}>
83+
<td className="lineage-detail-prop-cell">{name}</td>
84+
<td className="lineage-detail-prop-cell">{row.get('value')}</td>
85+
</tr>
86+
);
87+
})
88+
.toArray()}
8789
</tbody>
8890
</table>
8991
);

packages/components/src/internal/components/lineage/node/LineageNodeDetail.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { LineageSummary } from '../LineageSummary';
1010
import {
1111
createLineageNodeCollections,
1212
isAliquotNode,
13-
LineageNodeCollectionByType,
1413
LineageIOWithMetadata,
1514
LineageNode,
15+
LineageNodeCollectionByType,
1616
} from '../models';
1717
import { LineageOptions } from '../types';
1818

@@ -75,7 +75,7 @@ export class LineageNodeDetail extends PureComponent<LineageNodeDetailProps, Lin
7575
<LineageDetail item={node} />
7676
<LineageSummary
7777
{...lineageOptions}
78-
containerPath={node.container}
78+
containerPath={node.containerPath}
7979
highlightNode={highlightNode}
8080
key={node.lsid}
8181
lsid={node.lsid}
@@ -148,10 +148,10 @@ export class ClusterNodeDetail extends PureComponent<ClusterNodeDetailProps> {
148148
);
149149
return (
150150
<DetailsListNodes
151+
highlightNode={highlightNode}
151152
key={groupName}
152-
title={groupDisplayName}
153153
nodes={nodesByType[groupName]}
154-
highlightNode={highlightNode}
154+
title={groupDisplayName}
155155
/>
156156
);
157157
})}
@@ -192,7 +192,7 @@ const RunStepNodeDetail: FC<RunStepNodeDetailProps> = memo(props => {
192192
<DetailsListLineageIO item={step} />
193193
</Tab>
194194
{hasProvenanceModule && (
195-
<Tab eventKey="provenanceMap" title="Provenance Map" className="lineage-run-step-provenance-map">
195+
<Tab className="lineage-run-step-provenance-map" eventKey="provenanceMap" title="Provenance Map">
196196
<RunStepProvenanceMap item={step} />
197197
</Tab>
198198
)}

0 commit comments

Comments
 (0)