@finos/legend-extension-dsl-data-space 10.0.3 → 10.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -1
  2. package/lib/components/DataSpaceDataAccess.js +11 -3
  3. package/lib/components/DataSpaceDataAccess.js.map +1 -1
  4. package/lib/components/DataSpaceDescription.d.ts +1 -1
  5. package/lib/components/DataSpaceDescription.d.ts.map +1 -1
  6. package/lib/components/DataSpaceDescription.js +8 -3
  7. package/lib/components/DataSpaceDescription.js.map +1 -1
  8. package/lib/components/DataSpaceDiagramViewer.d.ts +1 -1
  9. package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
  10. package/lib/components/DataSpaceDiagramViewer.js +22 -6
  11. package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
  12. package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
  13. package/lib/components/DataSpaceModelsDocumentation.js +11 -3
  14. package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
  15. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
  16. package/lib/components/DataSpaceQuickStart.js +75 -61
  17. package/lib/components/DataSpaceQuickStart.js.map +1 -1
  18. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  19. package/lib/components/DataSpaceViewer.js +36 -14
  20. package/lib/components/DataSpaceViewer.js.map +1 -1
  21. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
  22. package/lib/components/DataSpaceViewerActivityBar.js +6 -7
  23. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
  24. package/lib/components/DataSpaceWiki.d.ts.map +1 -1
  25. package/lib/components/DataSpaceWiki.js +11 -0
  26. package/lib/components/DataSpaceWiki.js.map +1 -1
  27. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts +3 -1
  28. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  29. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js +3 -0
  30. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  31. package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.d.ts +2 -2
  32. package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.d.ts.map +1 -1
  33. package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.js.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +7 -4
  36. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +4 -5
  38. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +64 -62
  40. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/package.json +1 -1
  44. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts +1 -0
  45. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  46. package/lib/stores/DataSpaceModelsDocumentationState.d.ts.map +1 -1
  47. package/lib/stores/DataSpaceModelsDocumentationState.js +1 -1
  48. package/lib/stores/DataSpaceModelsDocumentationState.js.map +1 -1
  49. package/lib/stores/DataSpaceViewerState.d.ts +38 -15
  50. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  51. package/lib/stores/DataSpaceViewerState.js +132 -62
  52. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  53. package/lib/stores/query/DataSpaceAdvancedSearchState.js +2 -2
  54. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  55. package/lib/stores/query/DataSpaceQueryBuilderState.js +2 -2
  56. package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -1
  57. package/package.json +13 -13
  58. package/src/components/DataSpaceDataAccess.tsx +27 -5
  59. package/src/components/DataSpaceDescription.tsx +22 -5
  60. package/src/components/DataSpaceDiagramViewer.tsx +49 -15
  61. package/src/components/DataSpaceModelsDocumentation.tsx +29 -5
  62. package/src/components/DataSpaceQuickStart.tsx +223 -211
  63. package/src/components/DataSpaceViewer.tsx +66 -12
  64. package/src/components/DataSpaceViewerActivityBar.tsx +6 -3
  65. package/src/components/DataSpaceWiki.tsx +14 -0
  66. package/src/graph-manager/action/analytics/DataSpaceAnalysis.ts +4 -0
  67. package/src/graph-manager/action/analytics/DataSpaceAnalysisHelper.ts +2 -2
  68. package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +15 -3
  69. package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +112 -89
  70. package/src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts +5 -0
  71. package/src/stores/DataSpaceModelsDocumentationState.ts +1 -1
  72. package/src/stores/DataSpaceViewerState.ts +193 -73
  73. package/src/stores/query/DataSpaceAdvancedSearchState.ts +3 -3
  74. package/src/stores/query/DataSpaceQueryBuilderState.ts +2 -2
@@ -14,9 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type {
18
- GenericLegendApplicationStore,
19
- NavigationZone,
17
+ import {
18
+ NAVIGATION_ZONE_SEPARATOR,
19
+ type GenericLegendApplicationStore,
20
+ type NavigationZone,
20
21
  } from '@finos/legend-application';
21
22
  import { type ClassView } from '@finos/legend-extension-dsl-diagram/graph';
22
23
  import {
@@ -29,13 +30,16 @@ import type {
29
30
  PackageableRuntime,
30
31
  } from '@finos/legend-graph';
31
32
  import {
32
- getNullableFirstElement,
33
+ getNullableEntry,
34
+ getNullableFirstEntry,
33
35
  guaranteeNonNullable,
36
+ isNonNullable,
34
37
  } from '@finos/legend-shared';
35
38
  import { action, computed, makeObservable, observable } from 'mobx';
36
39
  import type {
37
40
  DataSpaceAnalysisResult,
38
41
  DataSpaceDiagramAnalysisResult,
42
+ DataSpaceExecutableAnalysisResult,
39
43
  DataSpaceExecutionContextAnalysisResult,
40
44
  } from '../graph-manager/action/analytics/DataSpaceAnalysis.js';
41
45
  import {
@@ -47,38 +51,173 @@ import { DataSpaceViewerModelsDocumentationState } from './DataSpaceModelsDocume
47
51
 
48
52
  export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
49
53
  DESCRIPTION = 'description',
50
- DIAGRAM_VIEWER = 'diagram_viewer',
51
- MODELS_DOCUMENTATION = 'models_documentation',
52
- QUICK_START = 'quick_start',
53
- EXECUTION_CONTEXT = 'execution_context',
54
- DATA_ACCESS = 'data_access',
55
-
56
- DATA_STORES = 'data_stores', // TODO: with test-data, also let user call TDS query on top of these
57
- DATA_AVAILABILITY = 'data_availability',
58
- DATA_READINESS = 'data_readiness',
59
- DATA_COST = 'data_cost',
60
- DATA_GOVERNANCE = 'data_governance',
54
+ DIAGRAM_VIEWER = 'diagram-viewer',
55
+ MODELS_DOCUMENTATION = 'models-documentation',
56
+ QUICK_START = 'quick-start',
57
+ EXECUTION_CONTEXT = 'execution-context',
58
+ DATA_ACCESS = 'data-access',
59
+
60
+ DATA_STORES = 'data-stores', // TODO: with test-data, also let user call TDS query on top of these
61
+ DATA_AVAILABILITY = 'data-availability',
62
+ DATA_READINESS = 'data-readiness',
63
+ DATA_COST = 'data-cost',
64
+ DATA_GOVERNANCE = 'data-governance',
61
65
  INFO = 'info', // TODO: test coverage? (or maybe this should be done in elements/diagrams/data-quality section)
62
66
  SUPPORT = 'support',
63
67
  }
64
68
 
69
+ const generateAnchorChunk = (text: string): string =>
70
+ encodeURIComponent(
71
+ text
72
+ .trim()
73
+ .toLowerCase() // anchor is case-insensitive
74
+ .replace(/\s+/gu, '-'), // spaces will be replaced by hyphens
75
+ );
76
+ export const generateAnchorForActivity = (activity: string): string =>
77
+ generateAnchorChunk(activity);
78
+ export const generateAnchorForQuickStart = (
79
+ quickStart: DataSpaceExecutableAnalysisResult,
80
+ ): string =>
81
+ [
82
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START,
83
+ generateAnchorChunk(quickStart.title),
84
+ ].join(NAVIGATION_ZONE_SEPARATOR);
85
+ export const generateAnchorForDiagram = (
86
+ diagram: DataSpaceDiagramAnalysisResult,
87
+ ): string =>
88
+ [
89
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
90
+ generateAnchorChunk(diagram.title),
91
+ ].join(NAVIGATION_ZONE_SEPARATOR);
92
+
93
+ export const DATA_SPACE_WIKI_PAGE_SECTIONS = [
94
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION,
95
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
96
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_DOCUMENTATION,
97
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START,
98
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS,
99
+ ];
100
+
101
+ const DATA_SPACE_WIKI_PAGE_ANCHORS = DATA_SPACE_WIKI_PAGE_SECTIONS.map(
102
+ (activity) => generateAnchorForActivity(activity),
103
+ );
104
+
105
+ type DataSpacePageNavigationCommand = {
106
+ anchor: string;
107
+ useSmoothScroll?: boolean;
108
+ };
109
+
65
110
  class DataSpaceLayoutState {
66
111
  readonly dataSpaceViewerState: DataSpaceViewerState;
67
112
 
113
+ currentNavigationZone = '';
68
114
  isExpandedModeEnabled = false;
69
115
 
116
+ frame?: HTMLElement | undefined;
117
+ header?: HTMLElement | undefined;
118
+ isTopScrollerVisible = false;
119
+
120
+ wikiPageAnchorIndex = new Map<string, HTMLElement>();
121
+ wikiNavigationCommand?: DataSpacePageNavigationCommand | undefined;
122
+
70
123
  constructor(dataSpaceViewerState: DataSpaceViewerState) {
71
124
  makeObservable(this, {
125
+ currentNavigationZone: observable,
72
126
  isExpandedModeEnabled: observable,
127
+ isTopScrollerVisible: observable,
128
+ wikiPageAnchorIndex: observable,
129
+ frame: observable.ref,
130
+ wikiNavigationCommand: observable.ref,
131
+ isAllWikiPageFullyRendered: computed,
132
+ setCurrentNavigationZone: action,
73
133
  enableExpandedMode: action,
134
+ setFrame: action,
135
+ setTopScrollerVisible: action,
136
+ setWikiPageAnchor: action,
137
+ unsetWikiPageAnchor: action,
138
+ setWikiAnchorToNavigate: action,
74
139
  });
75
140
 
76
141
  this.dataSpaceViewerState = dataSpaceViewerState;
77
142
  }
78
143
 
144
+ setCurrentNavigationZone(val: string): void {
145
+ this.currentNavigationZone = val;
146
+ }
147
+
148
+ get isAllWikiPageFullyRendered(): boolean {
149
+ return (
150
+ DATA_SPACE_WIKI_PAGE_SECTIONS.includes(
151
+ this.dataSpaceViewerState.currentActivity,
152
+ ) &&
153
+ DATA_SPACE_WIKI_PAGE_ANCHORS.every((anchor) =>
154
+ this.wikiPageAnchorIndex.has(anchor),
155
+ ) &&
156
+ Array.from(this.wikiPageAnchorIndex.values()).every(isNonNullable)
157
+ );
158
+ }
159
+
79
160
  enableExpandedMode(val: boolean): void {
80
161
  this.isExpandedModeEnabled = val;
81
162
  }
163
+
164
+ setFrame(val: HTMLElement | undefined): void {
165
+ this.frame = val;
166
+ }
167
+
168
+ setTopScrollerVisible(val: boolean): void {
169
+ this.isTopScrollerVisible = val;
170
+ }
171
+
172
+ setWikiPageAnchor(anchorKey: string, element: HTMLElement): void {
173
+ // do not allow overriding existing anchor
174
+ if (!this.wikiPageAnchorIndex.has(anchorKey)) {
175
+ this.wikiPageAnchorIndex.set(anchorKey, element);
176
+ }
177
+ }
178
+
179
+ unsetWikiPageAnchor(anchorKey: string): void {
180
+ this.wikiPageAnchorIndex.delete(anchorKey);
181
+ }
182
+
183
+ setWikiAnchorToNavigate(
184
+ val: DataSpacePageNavigationCommand | undefined,
185
+ ): void {
186
+ this.wikiNavigationCommand = val;
187
+ }
188
+
189
+ navigateWikiAnchor(): void {
190
+ if (this.wikiNavigationCommand && this.isAllWikiPageFullyRendered) {
191
+ const anchor = this.wikiNavigationCommand.anchor;
192
+ const matchingWikiPageSection = this.wikiPageAnchorIndex.get(anchor);
193
+ const anchorChunks = anchor.split(NAVIGATION_ZONE_SEPARATOR);
194
+ if (matchingWikiPageSection) {
195
+ this.frame?.scrollTo({
196
+ top:
197
+ matchingWikiPageSection.offsetTop -
198
+ (this.header?.getBoundingClientRect().height ?? 0),
199
+ behavior: this.wikiNavigationCommand.useSmoothScroll
200
+ ? 'smooth'
201
+ : 'auto',
202
+ });
203
+ } else if (
204
+ getNullableFirstEntry(anchorChunks) ===
205
+ generateAnchorForActivity(
206
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
207
+ )
208
+ ) {
209
+ const matchingDiagram =
210
+ this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams.find(
211
+ (diagram) => generateAnchorForDiagram(diagram) === anchor,
212
+ );
213
+ if (matchingDiagram) {
214
+ this.dataSpaceViewerState.setCurrentDiagram(matchingDiagram);
215
+ }
216
+ }
217
+
218
+ this.setWikiAnchorToNavigate(undefined);
219
+ }
220
+ }
82
221
  }
83
222
 
84
223
  export class DataSpaceViewerState {
@@ -107,12 +246,15 @@ export class DataSpaceViewerState {
107
246
  | ((zone: NavigationZone | undefined) => void)
108
247
  | undefined;
109
248
 
110
- readonly dataAccessState: DataSpaceViewerDataAccessState;
111
249
  readonly modelsDocumentationState: DataSpaceViewerModelsDocumentationState;
112
250
 
251
+ // TODO: change this so it holds the data access state for each execution context
252
+ readonly dataAccessState: DataSpaceViewerDataAccessState;
253
+ // TODO: have a state similar to dataAccessState for each executables
254
+
113
255
  _renderer?: DiagramRenderer | undefined;
114
- currentDiagram?: DataSpaceDiagramAnalysisResult | undefined;
115
256
  currentActivity = DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION;
257
+ currentDiagram?: DataSpaceDiagramAnalysisResult | undefined;
116
258
  currentExecutionContext: DataSpaceExecutionContextAnalysisResult;
117
259
  currentRuntime: PackageableRuntime;
118
260
 
@@ -171,7 +313,7 @@ export class DataSpaceViewerState {
171
313
  this.currentExecutionContext =
172
314
  dataSpaceAnalysisResult.defaultExecutionContext;
173
315
  this.currentRuntime = this.currentExecutionContext.defaultRuntime;
174
- this.currentDiagram = getNullableFirstElement(
316
+ this.currentDiagram = getNullableFirstEntry(
175
317
  this.dataSpaceAnalysisResult.diagrams,
176
318
  );
177
319
  this.retriveGraphData = actions.retriveGraphData;
@@ -265,62 +407,40 @@ export class DataSpaceViewerState {
265
407
  ): void => this.onDiagramClassDoubleClick(classView);
266
408
  }
267
409
 
268
- changeZone(zone: NavigationZone): void {
269
- switch (zone) {
270
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION:
271
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER:
272
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_DOCUMENTATION:
273
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START: {
274
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION);
275
- break;
276
- }
277
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION_CONTEXT: {
278
- this.setCurrentActivity(
279
- DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION_CONTEXT,
280
- );
281
- break;
282
- }
283
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS: {
284
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_ACCESS);
285
- break;
286
- }
287
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_STORES: {
288
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_STORES);
289
- break;
290
- }
291
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_AVAILABILITY: {
292
- this.setCurrentActivity(
293
- DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_AVAILABILITY,
294
- );
295
- break;
296
- }
297
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_READINESS: {
298
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_READINESS);
299
- break;
300
- }
301
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_COST: {
302
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_COST);
303
- break;
304
- }
305
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_GOVERNANCE: {
306
- this.setCurrentActivity(
307
- DATA_SPACE_VIEWER_ACTIVITY_MODE.DATA_GOVERNANCE,
308
- );
309
- break;
310
- }
311
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO: {
312
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.INFO);
313
- break;
314
- }
315
- case DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT: {
316
- this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT);
317
- break;
318
- }
319
- default: {
320
- // unknown
410
+ syncZoneWithNavigation(zone: NavigationZone): void {
411
+ this.layoutState.setCurrentNavigationZone(zone);
412
+ this.onZoneChange?.(zone);
413
+ }
414
+
415
+ changeZone(zone: NavigationZone, force = false): void {
416
+ if (force) {
417
+ this.layoutState.setCurrentNavigationZone('');
418
+ }
419
+ if (zone !== this.layoutState.currentNavigationZone) {
420
+ const zoneChunks = zone.split(NAVIGATION_ZONE_SEPARATOR);
421
+ const activityChunk = getNullableEntry(zoneChunks, 0);
422
+ const matchingActivity = Object.values(
423
+ DATA_SPACE_VIEWER_ACTIVITY_MODE,
424
+ ).find(
425
+ (activity) => generateAnchorForActivity(activity) === activityChunk,
426
+ );
427
+ if (activityChunk && matchingActivity) {
428
+ if (DATA_SPACE_WIKI_PAGE_SECTIONS.includes(matchingActivity)) {
429
+ this.layoutState.setWikiAnchorToNavigate({
430
+ anchor: zone,
431
+ // NOTE: if we are already on the wiki page, use smooth scroll to suggest the scrollability of the page
432
+ // if we are navigating from a different section, go directly to the section within the page to avoid the wait
433
+ useSmoothScroll: DATA_SPACE_WIKI_PAGE_SECTIONS.includes(
434
+ this.currentActivity,
435
+ ),
436
+ });
437
+ }
438
+ this.setCurrentActivity(matchingActivity);
439
+ this.onZoneChange?.(zone);
440
+ this.layoutState.setCurrentNavigationZone(zone);
441
+ } else {
321
442
  this.setCurrentActivity(DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION);
322
- this.onZoneChange?.(undefined);
323
- break;
443
+ this.layoutState.setCurrentNavigationZone('');
324
444
  }
325
445
  }
326
446
  }
@@ -25,7 +25,7 @@ import {
25
25
  type StoredEntity,
26
26
  type DepotServerClient,
27
27
  DepotScope,
28
- ProjectData,
28
+ StoreProjectData,
29
29
  retrieveProjectEntitiesWithDependencies,
30
30
  } from '@finos/legend-server-depot';
31
31
  import {
@@ -161,13 +161,13 @@ export class DataSpaceAdvancedSearchState {
161
161
  try {
162
162
  // fetch project
163
163
  this.loadDataSpaceState.setMessage(`Fetching project...`);
164
- const project = ProjectData.serialization.fromJson(
164
+ const project = StoreProjectData.serialization.fromJson(
165
165
  (yield flowResult(
166
166
  this.depotServerClient.getProject(
167
167
  dataSpace.groupId,
168
168
  dataSpace.artifactId,
169
169
  ),
170
- )) as PlainObject<ProjectData>,
170
+ )) as PlainObject<StoreProjectData>,
171
171
  );
172
172
  // analyze data space
173
173
  const analysisResult = (yield DSL_DataSpace_getGraphManagerExtension(
@@ -37,7 +37,7 @@ import {
37
37
  type GeneratorFn,
38
38
  ActionState,
39
39
  assertErrorThrown,
40
- getNullableFirstElement,
40
+ getNullableFirstEntry,
41
41
  } from '@finos/legend-shared';
42
42
  import { action, flow, makeObservable, observable } from 'mobx';
43
43
  import { renderDataSpaceQueryBuilderSetupPanelContent } from '../../components/query/DataSpaceQueryBuilder.js';
@@ -228,7 +228,7 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
228
228
  // if there is no chosen class or the chosen one is not compatible
229
229
  // with the mapping then pick a compatible class if possible
230
230
  if (!this.class || !compatibleClasses.includes(this.class)) {
231
- const possibleNewClass = getNullableFirstElement(compatibleClasses);
231
+ const possibleNewClass = getNullableFirstEntry(compatibleClasses);
232
232
  if (possibleNewClass) {
233
233
  this.changeClass(possibleNewClass);
234
234
  }