@finos/legend-extension-dsl-data-space 10.1.96 → 10.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts +18 -6
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js +18 -6
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +1 -0
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts +4 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +55 -5
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.d.ts.map +1 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.js +5 -17
- package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilder.js +4 -16
- package/lib/components/query/DataSpaceQueryBuilder.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -1
- package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
- package/lib/components/query/DataSpaceQuerySetup.js +3 -16
- package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
- package/lib/components/query/DataSpaceTemplateQueryCreator.js +4 -4
- package/lib/components/query/DataSpaceTemplateQueryCreator.js.map +1 -1
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +2 -0
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +13 -0
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.d.ts +19 -0
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.d.ts.map +1 -0
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.js +79 -0
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.js.map +1 -0
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +1 -0
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +2 -0
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts +1 -0
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js +1 -0
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.d.ts +10 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +2 -0
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts +12 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +28 -3
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +1 -0
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.js +3 -6
- package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.js +3 -6
- package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js +3 -6
- package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts +3 -2
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js +9 -13
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.d.ts +61 -0
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.d.ts.map +1 -0
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js +407 -0
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js.map +1 -0
- package/package.json +11 -10
- package/src/__lib__/query/DSL_DataSpace_LegendQueryNavigation.ts +43 -9
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +1 -0
- package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +117 -3
- package/src/components/query/DataSpaceAdvancedSearchModal.tsx +4 -25
- package/src/components/query/DataSpaceQueryBuilder.tsx +3 -23
- package/src/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +1 -1
- package/src/components/query/DataSpaceQuerySetup.tsx +2 -24
- package/src/components/query/DataSpaceTemplateQueryCreator.tsx +6 -6
- package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +18 -1
- package/src/components/studio/DataSpaceTemplateQueryPromoteReview.tsx +285 -0
- package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +2 -0
- package/src/graph-manager/action/analytics/DataSpaceAnalysis.ts +1 -0
- package/src/graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.ts +15 -0
- package/src/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +2 -0
- package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +66 -2
- package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +2 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +2 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +1 -0
- package/src/stores/query/DataSpaceAdvancedSearchState.ts +3 -11
- package/src/stores/query/DataSpaceQueryBuilderState.ts +3 -11
- package/src/stores/query/DataSpaceQuerySetupStore.ts +3 -11
- package/src/stores/query/DataSpaceTemplateQueryCreatorStore.ts +12 -24
- package/src/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.ts +636 -0
- package/tsconfig.json +2 -0
@@ -16,15 +16,17 @@
|
|
16
16
|
|
17
17
|
import packageJson from '../../../package.json' assert { type: 'json' };
|
18
18
|
import {
|
19
|
-
type QuerySetupActionConfiguration,
|
20
19
|
type ExistingQueryEditorStateBuilder,
|
21
|
-
type
|
20
|
+
type QueryEditorStore,
|
21
|
+
type QuerySetupActionConfiguration,
|
22
|
+
ExistingQueryEditorStore,
|
22
23
|
LegendQueryApplicationPlugin,
|
23
24
|
LEGEND_QUERY_APP_EVENT,
|
24
25
|
createViewProjectHandler,
|
25
26
|
createViewSDLCProjectHandler,
|
27
|
+
type QueryEditorActionConfiguration,
|
26
28
|
} from '@finos/legend-application-query';
|
27
|
-
import { SquareIcon } from '@finos/legend-art';
|
29
|
+
import { ArrowCircleUpIcon, SquareIcon } from '@finos/legend-art';
|
28
30
|
import {
|
29
31
|
ActionAlertActionType,
|
30
32
|
ActionAlertType,
|
@@ -34,6 +36,7 @@ import {
|
|
34
36
|
DATA_SPACE_QUERY_ROUTE_PATTERN,
|
35
37
|
generateDataSpaceQueryCreatorRoute,
|
36
38
|
generateDataSpaceQuerySetupRoute,
|
39
|
+
generateDataSpaceTemplateQueryPromotionRoute,
|
37
40
|
} from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
38
41
|
import { DataSpaceQueryCreator } from './DataSpaceQueryCreator.js';
|
39
42
|
import {
|
@@ -54,6 +57,7 @@ import type { DataSpaceInfo } from '../../stores/query/DataSpaceInfo.js';
|
|
54
57
|
import { getOwnDataSpace } from '../../graph-manager/DSL_DataSpace_GraphManagerHelper.js';
|
55
58
|
import {
|
56
59
|
assertErrorThrown,
|
60
|
+
buildUrl,
|
57
61
|
guaranteeNonNullable,
|
58
62
|
LogEvent,
|
59
63
|
} from '@finos/legend-shared';
|
@@ -71,6 +75,8 @@ import type {
|
|
71
75
|
DataSpaceExecutionContext,
|
72
76
|
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
73
77
|
import { DataSpaceTemplateQueryCreator } from './DataSpaceTemplateQueryCreator.js';
|
78
|
+
import { DataSpaceTemplateQueryCreatorStore } from '../../stores/query/DataSpaceTemplateQueryCreatorStore.js';
|
79
|
+
import { parseProjectIdentifier } from '@finos/legend-storage';
|
74
80
|
|
75
81
|
const resolveExecutionContext = (
|
76
82
|
dataSpace: DataSpace,
|
@@ -305,4 +311,112 @@ export class DSL_DataSpace_LegendQueryApplicationPlugin extends LegendQueryAppli
|
|
305
311
|
},
|
306
312
|
];
|
307
313
|
}
|
314
|
+
|
315
|
+
override getExtraQueryHeaders(): ((
|
316
|
+
editorStore: QueryEditorStore,
|
317
|
+
) => React.ReactNode | undefined)[] {
|
318
|
+
return [
|
319
|
+
(editorStore: QueryEditorStore): React.ReactNode | undefined => {
|
320
|
+
if (editorStore instanceof DataSpaceTemplateQueryCreatorStore) {
|
321
|
+
return (
|
322
|
+
<div className="query-editor__dataspace__header">
|
323
|
+
<div className="query-editor__header__content__main query-editor__header__content__title__text query-editor__dataspace__header__title__text">
|
324
|
+
{editorStore.templateQueryTitle}
|
325
|
+
</div>
|
326
|
+
<div className="query-editor__dataspace__header__title__tag">
|
327
|
+
template
|
328
|
+
</div>
|
329
|
+
</div>
|
330
|
+
);
|
331
|
+
}
|
332
|
+
return undefined;
|
333
|
+
},
|
334
|
+
];
|
335
|
+
}
|
336
|
+
|
337
|
+
override getExtraQueryEditorActionConfigurations(): QueryEditorActionConfiguration[] {
|
338
|
+
return [
|
339
|
+
{
|
340
|
+
key: 'promote-as-curated-template-query',
|
341
|
+
renderer: (editorStore, queryBuilderState) => {
|
342
|
+
const proceedCuratedTemplateQueryPromotion =
|
343
|
+
async (): Promise<void> => {
|
344
|
+
if (
|
345
|
+
!(
|
346
|
+
editorStore instanceof ExistingQueryEditorStore &&
|
347
|
+
queryBuilderState instanceof DataSpaceQueryBuilderState
|
348
|
+
)
|
349
|
+
) {
|
350
|
+
return;
|
351
|
+
}
|
352
|
+
// fetch project data
|
353
|
+
const project = StoreProjectData.serialization.fromJson(
|
354
|
+
await editorStore.depotServerClient.getProject(
|
355
|
+
editorStore.lightQuery.groupId,
|
356
|
+
editorStore.lightQuery.artifactId,
|
357
|
+
),
|
358
|
+
);
|
359
|
+
|
360
|
+
// find the matching SDLC instance
|
361
|
+
const projectIDPrefix = parseProjectIdentifier(
|
362
|
+
project.projectId,
|
363
|
+
).prefix;
|
364
|
+
const matchingSDLCEntry =
|
365
|
+
editorStore.applicationStore.config.studioInstances.find(
|
366
|
+
(entry) => entry.sdlcProjectIDPrefix === projectIDPrefix,
|
367
|
+
);
|
368
|
+
if (matchingSDLCEntry) {
|
369
|
+
editorStore.applicationStore.navigationService.navigator.visitAddress(
|
370
|
+
buildUrl([
|
371
|
+
editorStore.applicationStore.config.studioApplicationUrl,
|
372
|
+
generateDataSpaceTemplateQueryPromotionRoute(
|
373
|
+
editorStore.lightQuery.groupId,
|
374
|
+
editorStore.lightQuery.artifactId,
|
375
|
+
editorStore.lightQuery.versionId,
|
376
|
+
queryBuilderState.dataSpace.path,
|
377
|
+
editorStore.lightQuery.id,
|
378
|
+
),
|
379
|
+
]),
|
380
|
+
);
|
381
|
+
} else {
|
382
|
+
editorStore.applicationStore.notificationService.notifyWarning(
|
383
|
+
`Can't find the corresponding SDLC instance to productionize the query`,
|
384
|
+
);
|
385
|
+
}
|
386
|
+
};
|
387
|
+
|
388
|
+
const proceed = (): void => {
|
389
|
+
queryBuilderState.changeDetectionState.alertUnsavedChanges(() => {
|
390
|
+
proceedCuratedTemplateQueryPromotion().catch(
|
391
|
+
editorStore.applicationStore.alertUnhandledError,
|
392
|
+
);
|
393
|
+
});
|
394
|
+
};
|
395
|
+
|
396
|
+
return (
|
397
|
+
<>
|
398
|
+
{editorStore instanceof ExistingQueryEditorStore &&
|
399
|
+
queryBuilderState instanceof DataSpaceQueryBuilderState && (
|
400
|
+
<button
|
401
|
+
className="query-editor__header__action btn--dark"
|
402
|
+
tabIndex={-1}
|
403
|
+
onClick={proceed}
|
404
|
+
title={
|
405
|
+
!(editorStore instanceof ExistingQueryEditorStore)
|
406
|
+
? 'Please save your query first before promoting'
|
407
|
+
: 'Promote Curated Template query...'
|
408
|
+
}
|
409
|
+
>
|
410
|
+
<ArrowCircleUpIcon className="query-editor__header__action__icon--productionize" />
|
411
|
+
<div className="query-editor__header__action__label">
|
412
|
+
Promote as Template Query
|
413
|
+
</div>
|
414
|
+
</button>
|
415
|
+
)}
|
416
|
+
</>
|
417
|
+
);
|
418
|
+
},
|
419
|
+
},
|
420
|
+
];
|
421
|
+
}
|
308
422
|
}
|
@@ -33,10 +33,10 @@ import {
|
|
33
33
|
ModalHeaderActions,
|
34
34
|
} from '@finos/legend-art';
|
35
35
|
import { generateGAVCoordinates } from '@finos/legend-storage';
|
36
|
-
import {
|
36
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
37
37
|
import { flowResult } from 'mobx';
|
38
38
|
import { observer } from 'mobx-react-lite';
|
39
|
-
import { useEffect,
|
39
|
+
import { useEffect, useRef } from 'react';
|
40
40
|
import { DataSpaceViewer } from '../DataSpaceViewer.js';
|
41
41
|
import type { DataSpaceInfo } from '../../stores/query/DataSpaceInfo.js';
|
42
42
|
import type { DataSpaceAdvancedSearchState } from '../../stores/query/DataSpaceAdvancedSearchState.js';
|
@@ -55,17 +55,15 @@ export const DataSpaceAdvancedSearchModal = observer(
|
|
55
55
|
const { searchState, onClose } = props;
|
56
56
|
const applicationStore = useApplicationStore();
|
57
57
|
const dataSpaceSearchRef = useRef<SelectComponent>(null);
|
58
|
-
const [searchText, setSearchText] = useState('');
|
59
58
|
const handleEnter = (): void => dataSpaceSearchRef.current?.focus();
|
60
59
|
const proceedToCreateQuery = (): void => {
|
61
60
|
flowResult(searchState.proceedToCreateQuery()).catch(
|
62
61
|
applicationStore.alertUnhandledError,
|
63
62
|
);
|
64
63
|
};
|
65
|
-
|
66
64
|
const toggleGetSnapshot = (): void => {
|
67
65
|
searchState.setToGetSnapShot(!searchState.toGetSnapShot);
|
68
|
-
flowResult(searchState.loadDataSpaces(
|
66
|
+
flowResult(searchState.loadDataSpaces()).catch(
|
69
67
|
applicationStore.alertUnhandledError,
|
70
68
|
);
|
71
69
|
};
|
@@ -106,26 +104,9 @@ export const DataSpaceAdvancedSearchModal = observer(
|
|
106
104
|
};
|
107
105
|
|
108
106
|
// search text
|
109
|
-
const debouncedLoadDataSpaces = useMemo(
|
110
|
-
() =>
|
111
|
-
debounce((input: string): void => {
|
112
|
-
flowResult(searchState.loadDataSpaces(input)).catch(
|
113
|
-
applicationStore.alertUnhandledError,
|
114
|
-
);
|
115
|
-
}, 500),
|
116
|
-
[applicationStore, searchState],
|
117
|
-
);
|
118
|
-
const onSearchTextChange = (value: string): void => {
|
119
|
-
if (value !== searchText) {
|
120
|
-
setSearchText(value);
|
121
|
-
debouncedLoadDataSpaces.cancel();
|
122
|
-
debouncedLoadDataSpaces(value);
|
123
|
-
}
|
124
|
-
};
|
125
107
|
|
126
108
|
useEffect(() => {
|
127
|
-
searchState.loadDataSpaces(
|
128
|
-
flowResult(searchState.loadDataSpaces('')).catch(
|
109
|
+
flowResult(searchState.loadDataSpaces()).catch(
|
129
110
|
applicationStore.alertUnhandledError,
|
130
111
|
);
|
131
112
|
}, [searchState, applicationStore]);
|
@@ -180,8 +161,6 @@ export const DataSpaceAdvancedSearchModal = observer(
|
|
180
161
|
className="data-space-advanced-search__dialog__input__selector"
|
181
162
|
options={dataSpaceOptions}
|
182
163
|
isLoading={searchState.loadDataSpacesState.isInProgress}
|
183
|
-
onInputChange={onSearchTextChange}
|
184
|
-
inputValue={searchText}
|
185
164
|
onChange={onDataSpaceOptionChange}
|
186
165
|
value={selectedDataSpaceOption}
|
187
166
|
placeholder="Search for data space by name..."
|
@@ -47,8 +47,8 @@ import {
|
|
47
47
|
} from '@finos/legend-graph';
|
48
48
|
import type { DataSpaceInfo } from '../../stores/query/DataSpaceInfo.js';
|
49
49
|
import { generateGAVCoordinates } from '@finos/legend-storage';
|
50
|
-
import { useEffect
|
51
|
-
import {
|
50
|
+
import { useEffect } from 'react';
|
51
|
+
import { guaranteeType } from '@finos/legend-shared';
|
52
52
|
import { flowResult } from 'mobx';
|
53
53
|
import {
|
54
54
|
DataSpace,
|
@@ -129,7 +129,6 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
|
|
129
129
|
(props: { queryBuilderState: DataSpaceQueryBuilderState }) => {
|
130
130
|
const { queryBuilderState } = props;
|
131
131
|
const applicationStore = useApplicationStore();
|
132
|
-
const [dataSpaceSearchText, setDataSpaceSearchText] = useState('');
|
133
132
|
|
134
133
|
// data space
|
135
134
|
const dataSpaceOptions =
|
@@ -152,23 +151,6 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
|
|
152
151
|
queryBuilderState.onDataSpaceChange(option.value);
|
153
152
|
};
|
154
153
|
|
155
|
-
// data space search text
|
156
|
-
const debouncedLoadDataSpaces = useMemo(
|
157
|
-
() =>
|
158
|
-
debounce((input: string): void => {
|
159
|
-
flowResult(queryBuilderState.loadDataSpaces(input)).catch(
|
160
|
-
applicationStore.alertUnhandledError,
|
161
|
-
);
|
162
|
-
}, 500),
|
163
|
-
[applicationStore, queryBuilderState],
|
164
|
-
);
|
165
|
-
const onDataSpaceSearchTextChange = (value: string): void => {
|
166
|
-
if (value !== dataSpaceSearchText) {
|
167
|
-
setDataSpaceSearchText(value);
|
168
|
-
debouncedLoadDataSpaces.cancel();
|
169
|
-
debouncedLoadDataSpaces(value);
|
170
|
-
}
|
171
|
-
};
|
172
154
|
const openDataSpaceAdvancedSearch = (): void =>
|
173
155
|
queryBuilderState.showAdvancedSearchPanel();
|
174
156
|
|
@@ -232,7 +214,7 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
|
|
232
214
|
);
|
233
215
|
|
234
216
|
useEffect(() => {
|
235
|
-
flowResult(queryBuilderState.loadDataSpaces(
|
217
|
+
flowResult(queryBuilderState.loadDataSpaces()).catch(
|
236
218
|
applicationStore.alertUnhandledError,
|
237
219
|
);
|
238
220
|
}, [queryBuilderState, applicationStore]);
|
@@ -287,8 +269,6 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
|
|
287
269
|
className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
|
288
270
|
options={dataSpaceOptions}
|
289
271
|
isLoading={queryBuilderState.loadDataSpacesState.isInProgress}
|
290
|
-
onInputChange={onDataSpaceSearchTextChange}
|
291
|
-
inputValue={dataSpaceSearchText}
|
292
272
|
onChange={onDataSpaceOptionChange}
|
293
273
|
value={selectedDataSpaceOption}
|
294
274
|
placeholder="Search for data space..."
|
@@ -15,7 +15,6 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
18
|
-
import { debounce } from '@finos/legend-shared';
|
19
18
|
import { useApplicationStore } from '@finos/legend-application';
|
20
19
|
import {
|
21
20
|
QueryEditor,
|
@@ -23,7 +22,7 @@ import {
|
|
23
22
|
useLegendQueryApplicationStore,
|
24
23
|
useLegendQueryBaseStore,
|
25
24
|
} from '@finos/legend-application-query';
|
26
|
-
import { useEffect,
|
25
|
+
import { useEffect, useRef } from 'react';
|
27
26
|
import { flowResult } from 'mobx';
|
28
27
|
import { QueryBuilderClassSelector } from '@finos/legend-query-builder';
|
29
28
|
import {
|
@@ -82,8 +81,6 @@ const DataSpaceQuerySetupSetupPanelContent = observer(
|
|
82
81
|
const { queryBuilderState } = props;
|
83
82
|
const applicationStore = useApplicationStore();
|
84
83
|
const dataSpaceSearchRef = useRef<SelectComponent>(null);
|
85
|
-
const [dataSpaceSearchText, setDataSpaceSearchText] = useState('');
|
86
|
-
|
87
84
|
// data space
|
88
85
|
const dataSpaceOptions =
|
89
86
|
queryBuilderState.dataSpaces.map(buildDataSpaceOption);
|
@@ -92,28 +89,11 @@ const DataSpaceQuerySetupSetupPanelContent = observer(
|
|
92
89
|
queryBuilderState.onDataSpaceChange(option.value);
|
93
90
|
};
|
94
91
|
|
95
|
-
// data space search text
|
96
|
-
const debouncedLoadDataSpaces = useMemo(
|
97
|
-
() =>
|
98
|
-
debounce((input: string): void => {
|
99
|
-
flowResult(queryBuilderState.loadDataSpaces(input)).catch(
|
100
|
-
applicationStore.alertUnhandledError,
|
101
|
-
);
|
102
|
-
}, 500),
|
103
|
-
[applicationStore, queryBuilderState],
|
104
|
-
);
|
105
|
-
const onDataSpaceSearchTextChange = (value: string): void => {
|
106
|
-
if (value !== dataSpaceSearchText) {
|
107
|
-
setDataSpaceSearchText(value);
|
108
|
-
debouncedLoadDataSpaces.cancel();
|
109
|
-
debouncedLoadDataSpaces(value);
|
110
|
-
}
|
111
|
-
};
|
112
92
|
const openDataSpaceAdvancedSearch = (): void =>
|
113
93
|
queryBuilderState.showAdvancedSearchPanel();
|
114
94
|
|
115
95
|
useEffect(() => {
|
116
|
-
flowResult(queryBuilderState.loadDataSpaces(
|
96
|
+
flowResult(queryBuilderState.loadDataSpaces()).catch(
|
117
97
|
applicationStore.alertUnhandledError,
|
118
98
|
);
|
119
99
|
}, [queryBuilderState, applicationStore]);
|
@@ -141,8 +121,6 @@ const DataSpaceQuerySetupSetupPanelContent = observer(
|
|
141
121
|
className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
|
142
122
|
options={dataSpaceOptions}
|
143
123
|
isLoading={queryBuilderState.loadDataSpacesState.isInProgress}
|
144
|
-
onInputChange={onDataSpaceSearchTextChange}
|
145
|
-
inputValue={dataSpaceSearchText}
|
146
124
|
onChange={onDataSpaceOptionChange}
|
147
125
|
value={selectedDataSpaceOption}
|
148
126
|
placeholder="Search for data space..."
|
@@ -33,8 +33,8 @@ const DataSpaceTemplateQueryCreatorStoreProvider: React.FC<{
|
|
33
33
|
children: React.ReactNode;
|
34
34
|
gav: string;
|
35
35
|
dataSpacePath: string;
|
36
|
-
|
37
|
-
}> = ({ children, gav, dataSpacePath,
|
36
|
+
templateQueryId: string;
|
37
|
+
}> = ({ children, gav, dataSpacePath, templateQueryId }) => {
|
38
38
|
const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
|
39
39
|
const applicationStore = useLegendQueryApplicationStore();
|
40
40
|
const baseStore = useLegendQueryBaseStore();
|
@@ -47,7 +47,7 @@ const DataSpaceTemplateQueryCreatorStoreProvider: React.FC<{
|
|
47
47
|
artifactId,
|
48
48
|
versionId,
|
49
49
|
dataSpacePath,
|
50
|
-
|
50
|
+
templateQueryId,
|
51
51
|
),
|
52
52
|
);
|
53
53
|
return (
|
@@ -65,16 +65,16 @@ export const DataSpaceTemplateQueryCreator = observer(() => {
|
|
65
65
|
parameters[
|
66
66
|
DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH
|
67
67
|
];
|
68
|
-
const
|
68
|
+
const templateQueryId =
|
69
69
|
parameters[
|
70
|
-
DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.
|
70
|
+
DATA_SPACE_TEMPLATE_QUERY_CREATOR_ROUTE_PATTERN_TOKEN.TEMPLATE_QUERY_ID
|
71
71
|
];
|
72
72
|
|
73
73
|
return (
|
74
74
|
<DataSpaceTemplateQueryCreatorStoreProvider
|
75
75
|
gav={gav}
|
76
76
|
dataSpacePath={dataSpacePath}
|
77
|
-
|
77
|
+
templateQueryId={templateQueryId}
|
78
78
|
>
|
79
79
|
<QueryEditor />
|
80
80
|
</DataSpaceTemplateQueryCreatorStoreProvider>
|
@@ -48,7 +48,10 @@ import {
|
|
48
48
|
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
49
49
|
import { DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.js';
|
50
50
|
import { SIMPLE_DATA_SPACE_SNIPPET } from '../../__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.js';
|
51
|
-
import type {
|
51
|
+
import type {
|
52
|
+
ApplicationPageEntry,
|
53
|
+
DocumentationEntry,
|
54
|
+
} from '@finos/legend-application';
|
52
55
|
import { DataSpaceIcon } from '../DSL_DataSpace_Icon.js';
|
53
56
|
import { DataSpacePreviewState } from '../../stores/studio/DataSpacePreviewState.js';
|
54
57
|
import {
|
@@ -57,6 +60,8 @@ import {
|
|
57
60
|
} from './DataSpacePreviewAction.js';
|
58
61
|
import type { PureGrammarTextSuggestion } from '@finos/legend-lego/code-editor';
|
59
62
|
import { DataSpaceQueryAction } from './DataSpaceQueryAction.js';
|
63
|
+
import { DataSpaceTemplateQueryPromotionReviewer } from './DataSpaceTemplateQueryPromoteReview.js';
|
64
|
+
import { DATA_SPACE_QUERY_ROUTE_PATTERN } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
60
65
|
|
61
66
|
const DATA_SPACE_ELEMENT_TYPE = 'DATA SPACE';
|
62
67
|
const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE =
|
@@ -80,6 +85,18 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin
|
|
80
85
|
];
|
81
86
|
}
|
82
87
|
|
88
|
+
override getExtraApplicationPageEntries(): ApplicationPageEntry[] {
|
89
|
+
return [
|
90
|
+
{
|
91
|
+
key: 'promote-as-curated-template-query-page',
|
92
|
+
addressPatterns: [
|
93
|
+
DATA_SPACE_QUERY_ROUTE_PATTERN.PROMOTE_TEMPLATE_QUERY,
|
94
|
+
],
|
95
|
+
renderer: DataSpaceTemplateQueryPromotionReviewer,
|
96
|
+
},
|
97
|
+
];
|
98
|
+
}
|
99
|
+
|
83
100
|
override getExtraExplorerContextMenuItemRendererConfigurations(): ExplorerContextMenuItemRendererConfiguration[] {
|
84
101
|
return [
|
85
102
|
{
|