@finos/legend-extension-dsl-data-space 10.1.93 → 10.1.95
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.
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +4 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +60 -0
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.js +3 -1
- package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.js +5 -1
- package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
- package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
- package/lib/components/DataSpaceQuickStart.js +5 -1
- package/lib/components/DataSpaceQuickStart.js.map +1 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.d.ts.map +1 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.js +2 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts +18 -0
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +1 -0
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js +94 -0
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -0
- package/lib/components/studio/DataSpacePreviewAction.d.ts.map +1 -1
- package/lib/components/studio/DataSpacePreviewAction.js +2 -1
- package/lib/components/studio/DataSpacePreviewAction.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts +2 -0
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.js +6 -0
- package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js +3 -3
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/package.json +12 -12
- package/src/__lib__/query/DSL_DataSpace_LegendQueryNavigation.ts +1 -1
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +89 -0
- package/src/components/DataSpaceDiagramViewer.tsx +5 -1
- package/src/components/DataSpaceModelsDocumentation.tsx +7 -1
- package/src/components/DataSpaceQuickStart.tsx +12 -1
- package/src/components/query/DataSpaceAdvancedSearchModal.tsx +7 -2
- package/src/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +224 -0
- package/src/components/studio/DataSpacePreviewAction.tsx +4 -1
- package/src/stores/query/DataSpaceQueryBuilderState.ts +7 -0
- package/src/stores/query/DataSpaceTemplateQueryCreatorStore.ts +3 -3
- package/tsconfig.json +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-extension-dsl-data-space",
|
3
|
-
"version": "10.1.
|
3
|
+
"version": "10.1.95",
|
4
4
|
"description": "Legend extension for Data Space DSL",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -44,17 +44,17 @@
|
|
44
44
|
"test:watch": "jest --watch"
|
45
45
|
},
|
46
46
|
"dependencies": {
|
47
|
-
"@finos/legend-application": "15.0.
|
48
|
-
"@finos/legend-application-query": "13.2.
|
49
|
-
"@finos/legend-application-studio": "28.16.
|
50
|
-
"@finos/legend-art": "7.1.
|
51
|
-
"@finos/legend-extension-dsl-diagram": "8.0.
|
52
|
-
"@finos/legend-graph": "31.9.
|
53
|
-
"@finos/legend-lego": "1.2.
|
54
|
-
"@finos/legend-query-builder": "4.14.
|
55
|
-
"@finos/legend-server-depot": "6.0.
|
56
|
-
"@finos/legend-shared": "10.0.
|
57
|
-
"@finos/legend-storage": "3.0.
|
47
|
+
"@finos/legend-application": "15.0.73",
|
48
|
+
"@finos/legend-application-query": "13.2.20",
|
49
|
+
"@finos/legend-application-studio": "28.16.7",
|
50
|
+
"@finos/legend-art": "7.1.25",
|
51
|
+
"@finos/legend-extension-dsl-diagram": "8.0.151",
|
52
|
+
"@finos/legend-graph": "31.9.6",
|
53
|
+
"@finos/legend-lego": "1.2.19",
|
54
|
+
"@finos/legend-query-builder": "4.14.20",
|
55
|
+
"@finos/legend-server-depot": "6.0.38",
|
56
|
+
"@finos/legend-shared": "10.0.34",
|
57
|
+
"@finos/legend-storage": "3.0.84",
|
58
58
|
"@types/react": "18.2.31",
|
59
59
|
"mobx": "6.10.2",
|
60
60
|
"mobx-react-lite": "4.0.5",
|
@@ -101,7 +101,7 @@ export const generateDataSpaceQueryCreatorRoute = (
|
|
101
101
|
}),
|
102
102
|
);
|
103
103
|
|
104
|
-
export const
|
104
|
+
export const generateDataSpaceTemplateQueryCreatorRoute = (
|
105
105
|
groupId: string,
|
106
106
|
artifactId: string,
|
107
107
|
versionId: string,
|
@@ -23,8 +23,12 @@ import {
|
|
23
23
|
} from '@finos/legend-application';
|
24
24
|
import packageJson from '../../package.json' assert { type: 'json' };
|
25
25
|
import type {
|
26
|
+
CuratedTemplateQuery,
|
27
|
+
CuratedTemplateQuerySpecification,
|
26
28
|
LoadQueryFilterOption,
|
29
|
+
QueryBuilderState,
|
27
30
|
QueryBuilder_LegendApplicationPlugin_Extension,
|
31
|
+
TemplateQueryPanelContentRenderer,
|
28
32
|
} from '@finos/legend-query-builder';
|
29
33
|
import { DataSpaceQueryBuilderState } from '../stores/query/DataSpaceQueryBuilderState.js';
|
30
34
|
import {
|
@@ -34,6 +38,9 @@ import {
|
|
34
38
|
import { DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_CONFIG } from '../__lib__/DSL_DataSpace_LegendApplicationCommand.js';
|
35
39
|
import type { QuerySearchSpecification } from '@finos/legend-graph';
|
36
40
|
import { configureDataGridComponent } from '@finos/legend-lego/data-grid';
|
41
|
+
import { renderDataSpaceQueryBuilderTemplateQueryPanelContent } from './query/DataSpaceQueryBuilderTemplateQueryPanelContent.js';
|
42
|
+
import { DataSpaceExecutableTemplate } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
43
|
+
import { filterByType } from '@finos/legend-shared';
|
37
44
|
|
38
45
|
export class DSL_DataSpace_LegendApplicationPlugin
|
39
46
|
extends LegendApplicationPlugin
|
@@ -114,4 +121,86 @@ export class DSL_DataSpace_LegendApplicationPlugin
|
|
114
121
|
},
|
115
122
|
];
|
116
123
|
}
|
124
|
+
|
125
|
+
getQueryFilterOptionsRelatedToTemplateQuery(): (
|
126
|
+
queryBuilderState: QueryBuilderState,
|
127
|
+
) => string[] {
|
128
|
+
return (queryBuilderState): string[] => {
|
129
|
+
if (queryBuilderState instanceof DataSpaceQueryBuilderState) {
|
130
|
+
return ['Current Data Space'];
|
131
|
+
}
|
132
|
+
return [];
|
133
|
+
};
|
134
|
+
}
|
135
|
+
|
136
|
+
getExtraTemplateQueryPanelContentRenderer(): TemplateQueryPanelContentRenderer[] {
|
137
|
+
return [
|
138
|
+
(queryBuilderState: QueryBuilderState): React.ReactNode => {
|
139
|
+
if (queryBuilderState instanceof DataSpaceQueryBuilderState) {
|
140
|
+
return renderDataSpaceQueryBuilderTemplateQueryPanelContent(
|
141
|
+
queryBuilderState,
|
142
|
+
);
|
143
|
+
}
|
144
|
+
return undefined;
|
145
|
+
},
|
146
|
+
];
|
147
|
+
}
|
148
|
+
|
149
|
+
getCuratedTemplateQuerySpecifications(): CuratedTemplateQuerySpecification[] {
|
150
|
+
return [
|
151
|
+
{
|
152
|
+
getCuratedTemplateQueries: (
|
153
|
+
queryBuilderState,
|
154
|
+
): CuratedTemplateQuery[] => {
|
155
|
+
if (queryBuilderState instanceof DataSpaceQueryBuilderState) {
|
156
|
+
const executableTemplates =
|
157
|
+
queryBuilderState.dataSpace.executables?.filter(
|
158
|
+
filterByType(DataSpaceExecutableTemplate),
|
159
|
+
);
|
160
|
+
return executableTemplates
|
161
|
+
? executableTemplates.map(
|
162
|
+
(e) =>
|
163
|
+
({
|
164
|
+
title: e.title,
|
165
|
+
description: e.description,
|
166
|
+
query: e.query,
|
167
|
+
executionContextKey:
|
168
|
+
e.executionContextKey ??
|
169
|
+
queryBuilderState.dataSpace.defaultExecutionContext
|
170
|
+
.name,
|
171
|
+
}) as CuratedTemplateQuery,
|
172
|
+
)
|
173
|
+
: [];
|
174
|
+
}
|
175
|
+
return [];
|
176
|
+
},
|
177
|
+
loadCuratedTemplateQuery: (
|
178
|
+
templateQuery: CuratedTemplateQuery,
|
179
|
+
queryBuilderState: QueryBuilderState,
|
180
|
+
): void => {
|
181
|
+
if (queryBuilderState instanceof DataSpaceQueryBuilderState) {
|
182
|
+
if (
|
183
|
+
queryBuilderState.executionContext.name !==
|
184
|
+
templateQuery.executionContextKey
|
185
|
+
) {
|
186
|
+
const executionContext =
|
187
|
+
queryBuilderState.dataSpace.executionContexts.find(
|
188
|
+
(c) => c.name === templateQuery.executionContextKey,
|
189
|
+
);
|
190
|
+
if (executionContext) {
|
191
|
+
queryBuilderState.setExecutionContext(executionContext);
|
192
|
+
queryBuilderState.propagateExecutionContextChange(
|
193
|
+
executionContext,
|
194
|
+
);
|
195
|
+
queryBuilderState.initializeWithQuery(templateQuery.query);
|
196
|
+
queryBuilderState.onExecutionContextChange?.(executionContext);
|
197
|
+
}
|
198
|
+
} else {
|
199
|
+
queryBuilderState.initializeWithQuery(templateQuery.query);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
},
|
203
|
+
},
|
204
|
+
];
|
205
|
+
}
|
117
206
|
}
|
@@ -235,6 +235,7 @@ const buildDiagramOption = (
|
|
235
235
|
const DataSpaceDiagramViewerHeader = observer(
|
236
236
|
(props: { dataSpaceViewerState: DataSpaceViewerState }) => {
|
237
237
|
const { dataSpaceViewerState } = props;
|
238
|
+
const applicationStore = dataSpaceViewerState.applicationStore;
|
238
239
|
const diagramViewerState = dataSpaceViewerState.diagramViewerState;
|
239
240
|
const diagramOptions =
|
240
241
|
dataSpaceViewerState.dataSpaceAnalysisResult.diagrams.map(
|
@@ -275,7 +276,10 @@ const DataSpaceDiagramViewerHeader = observer(
|
|
275
276
|
onChange={onDiagramOptionChange}
|
276
277
|
value={selectedDiagramOption}
|
277
278
|
placeholder="Search for a diagram"
|
278
|
-
darkMode={
|
279
|
+
darkMode={
|
280
|
+
!applicationStore.layoutService
|
281
|
+
.TEMPORARY__isLightColorThemeEnabled
|
282
|
+
}
|
279
283
|
/>
|
280
284
|
<div className="data-space__viewer__diagram-viewer__header__navigation__pager">
|
281
285
|
<input
|
@@ -543,14 +543,20 @@ const DataSpaceModelsDocumentationGridPanel = observer(
|
|
543
543
|
(props: { dataSpaceViewerState: DataSpaceViewerState }) => {
|
544
544
|
const { dataSpaceViewerState } = props;
|
545
545
|
const documentationState = dataSpaceViewerState.modelsDocumentationState;
|
546
|
+
const darkMode =
|
547
|
+
!dataSpaceViewerState.applicationStore.layoutService
|
548
|
+
.TEMPORARY__isLightColorThemeEnabled;
|
546
549
|
|
547
550
|
return (
|
548
551
|
<div
|
549
552
|
className={clsx(
|
550
|
-
'data-space__viewer__models-documentation__grid
|
553
|
+
'data-space__viewer__models-documentation__grid',
|
554
|
+
'data-space__viewer__grid',
|
551
555
|
{
|
552
556
|
'data-space__viewer__models-documentation__grid--shrink':
|
553
557
|
documentationState.showFilterPanel,
|
558
|
+
'ag-theme-balham': !darkMode,
|
559
|
+
'ag-theme-balham-dark': darkMode,
|
554
560
|
},
|
555
561
|
)}
|
556
562
|
>
|
@@ -149,6 +149,8 @@ const DataSpaceExecutableTDSResultView = observer(
|
|
149
149
|
extractTDSExecutableActionConfigurations.find(
|
150
150
|
(config) => config.key === selectedTab,
|
151
151
|
);
|
152
|
+
const darkMode =
|
153
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
152
154
|
|
153
155
|
return (
|
154
156
|
<div className="data-space__viewer__quickstart__item__content">
|
@@ -277,7 +279,16 @@ const DataSpaceExecutableTDSResultView = observer(
|
|
277
279
|
</div>
|
278
280
|
<div className="data-space__viewer__quickstart__item__content__tab__content">
|
279
281
|
{selectedTab === TDS_EXECUTABLE_ACTION_TAB.COLUMN_SPECS && (
|
280
|
-
<div
|
282
|
+
<div
|
283
|
+
className={clsx(
|
284
|
+
'data-space__viewer__quickstart__tds__column-specs',
|
285
|
+
'data-space__viewer__grid',
|
286
|
+
{
|
287
|
+
'ag-theme-balham': !darkMode,
|
288
|
+
'ag-theme-balham-dark': darkMode,
|
289
|
+
},
|
290
|
+
)}
|
291
|
+
>
|
281
292
|
<DataGrid
|
282
293
|
rowData={columnSpecifications}
|
283
294
|
gridOptions={{
|
@@ -153,7 +153,9 @@ export const DataSpaceAdvancedSearchModal = observer(
|
|
153
153
|
}}
|
154
154
|
>
|
155
155
|
<Modal
|
156
|
-
darkMode={
|
156
|
+
darkMode={
|
157
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
158
|
+
}
|
157
159
|
className="editor-modal data-space-advanced-search__dialog"
|
158
160
|
>
|
159
161
|
<ModalHeader className="data-space-advanced-search__dialog__header">
|
@@ -185,7 +187,10 @@ export const DataSpaceAdvancedSearchModal = observer(
|
|
185
187
|
placeholder="Search for data space by name..."
|
186
188
|
isClearable={true}
|
187
189
|
escapeClearsValue={true}
|
188
|
-
darkMode={
|
190
|
+
darkMode={
|
191
|
+
!applicationStore.layoutService
|
192
|
+
.TEMPORARY__isLightColorThemeEnabled
|
193
|
+
}
|
189
194
|
formatOptionLabel={formatDataSpaceOptionLabel}
|
190
195
|
/>
|
191
196
|
<button
|
@@ -0,0 +1,224 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import {
|
18
|
+
PanelHeader,
|
19
|
+
FilterIcon,
|
20
|
+
BasePopover,
|
21
|
+
ClickAwayListener,
|
22
|
+
ShareIcon,
|
23
|
+
TagIcon,
|
24
|
+
} from '@finos/legend-art';
|
25
|
+
import { observer } from 'mobx-react-lite';
|
26
|
+
import { useRef } from 'react';
|
27
|
+
import { DataSpaceExecutableTemplate } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
28
|
+
import type { DataSpaceQueryBuilderState } from '../../stores/query/DataSpaceQueryBuilderState.js';
|
29
|
+
import {
|
30
|
+
ActionAlertActionType,
|
31
|
+
ActionAlertType,
|
32
|
+
useApplicationStore,
|
33
|
+
} from '@finos/legend-application';
|
34
|
+
import { generateDataSpaceTemplateQueryCreatorRoute } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
35
|
+
|
36
|
+
const DataSpaceTemplateQueryDialog = observer(
|
37
|
+
(props: {
|
38
|
+
triggerElement: HTMLElement | null;
|
39
|
+
queryBuilderState: DataSpaceQueryBuilderState;
|
40
|
+
templateQueries: DataSpaceExecutableTemplate[];
|
41
|
+
}) => {
|
42
|
+
const { triggerElement, queryBuilderState, templateQueries } = props;
|
43
|
+
const applicationStore = useApplicationStore();
|
44
|
+
const handleClose = (): void => {
|
45
|
+
queryBuilderState.setTemplateQueryDialogOpen(false);
|
46
|
+
};
|
47
|
+
|
48
|
+
const loadTemplateQuery = (template: DataSpaceExecutableTemplate): void => {
|
49
|
+
const executionContext =
|
50
|
+
queryBuilderState.dataSpace.executionContexts.find(
|
51
|
+
(c) => c.name === template.executionContextKey,
|
52
|
+
);
|
53
|
+
if (
|
54
|
+
executionContext &&
|
55
|
+
executionContext.hashCode !==
|
56
|
+
queryBuilderState.executionContext.hashCode
|
57
|
+
) {
|
58
|
+
queryBuilderState.setExecutionContext(executionContext);
|
59
|
+
queryBuilderState.propagateExecutionContextChange(executionContext);
|
60
|
+
queryBuilderState.initializeWithQuery(template.query);
|
61
|
+
queryBuilderState.onExecutionContextChange?.(executionContext);
|
62
|
+
} else {
|
63
|
+
queryBuilderState.initializeWithQuery(template.query);
|
64
|
+
}
|
65
|
+
handleClose();
|
66
|
+
};
|
67
|
+
|
68
|
+
const loadQuery = (template: DataSpaceExecutableTemplate): void => {
|
69
|
+
if (queryBuilderState.changeDetectionState.hasChanged) {
|
70
|
+
applicationStore.alertService.setActionAlertInfo({
|
71
|
+
message:
|
72
|
+
'Unsaved changes will be lost if you continue. Do you still want to proceed?',
|
73
|
+
type: ActionAlertType.CAUTION,
|
74
|
+
actions: [
|
75
|
+
{
|
76
|
+
label: 'Proceed',
|
77
|
+
type: ActionAlertActionType.PROCEED_WITH_CAUTION,
|
78
|
+
handler: (): void => loadTemplateQuery(template),
|
79
|
+
},
|
80
|
+
{
|
81
|
+
label: 'Abort',
|
82
|
+
type: ActionAlertActionType.PROCEED,
|
83
|
+
default: true,
|
84
|
+
},
|
85
|
+
],
|
86
|
+
});
|
87
|
+
} else {
|
88
|
+
loadTemplateQuery(template);
|
89
|
+
}
|
90
|
+
};
|
91
|
+
|
92
|
+
const visitTemplateQuery = (
|
93
|
+
template: DataSpaceExecutableTemplate,
|
94
|
+
): void => {
|
95
|
+
if (queryBuilderState.projectInfo?.groupId) {
|
96
|
+
applicationStore.navigationService.navigator.visitAddress(
|
97
|
+
applicationStore.navigationService.navigator.generateAddress(
|
98
|
+
generateDataSpaceTemplateQueryCreatorRoute(
|
99
|
+
queryBuilderState.projectInfo.groupId,
|
100
|
+
queryBuilderState.projectInfo.artifactId,
|
101
|
+
queryBuilderState.projectInfo.versionId,
|
102
|
+
queryBuilderState.dataSpace.path,
|
103
|
+
template.title,
|
104
|
+
),
|
105
|
+
),
|
106
|
+
);
|
107
|
+
}
|
108
|
+
};
|
109
|
+
|
110
|
+
return (
|
111
|
+
<ClickAwayListener onClickAway={handleClose}>
|
112
|
+
<div>
|
113
|
+
<BasePopover
|
114
|
+
open={queryBuilderState.isTemplateQueryDialogOpen}
|
115
|
+
PaperProps={{
|
116
|
+
classes: {
|
117
|
+
root: '"query-builder__data-space__template-query-panel__container__root',
|
118
|
+
},
|
119
|
+
}}
|
120
|
+
className="query-builder__data-space__template-query-panel__container"
|
121
|
+
onClose={handleClose}
|
122
|
+
anchorEl={triggerElement}
|
123
|
+
anchorOrigin={{
|
124
|
+
vertical: 'bottom',
|
125
|
+
horizontal: 'left',
|
126
|
+
}}
|
127
|
+
transformOrigin={{
|
128
|
+
vertical: 'top',
|
129
|
+
horizontal: 'center',
|
130
|
+
}}
|
131
|
+
>
|
132
|
+
<div className="query-builder__data-space__template-query-panel">
|
133
|
+
<div className="query-builder__data-space__template-query-panel__header">
|
134
|
+
Curated Template Queries
|
135
|
+
</div>
|
136
|
+
{templateQueries.map((query) => (
|
137
|
+
<div
|
138
|
+
key={query.title}
|
139
|
+
className="query-builder__data-space__template-query-panel__query"
|
140
|
+
>
|
141
|
+
<TagIcon className="query-builder__data-space__template-query-panel__query__icon" />
|
142
|
+
<button
|
143
|
+
className="query-builder__data-space__template-query-panel__query__entry"
|
144
|
+
title="click to load template query"
|
145
|
+
onClick={() => loadQuery(query)}
|
146
|
+
>
|
147
|
+
<div className="query-builder__data-space__template-query-panel__query__entry__content">
|
148
|
+
<div className="query-builder__data-space__template-query-panel__query__entry__content__title">
|
149
|
+
{query.title}
|
150
|
+
</div>
|
151
|
+
{query.description && (
|
152
|
+
<div className="query-builder__data-space__template-query-panel__query__entry__content__description">
|
153
|
+
{query.description}
|
154
|
+
</div>
|
155
|
+
)}
|
156
|
+
</div>
|
157
|
+
</button>
|
158
|
+
<button
|
159
|
+
className="query-builder__data-space__template-query-panel__query__share"
|
160
|
+
title="Visit..."
|
161
|
+
onClick={() => visitTemplateQuery(query)}
|
162
|
+
>
|
163
|
+
<ShareIcon />
|
164
|
+
<div className="query-builder__data-space__template-query-panel__query__share__label">
|
165
|
+
Visit
|
166
|
+
</div>
|
167
|
+
</button>
|
168
|
+
</div>
|
169
|
+
))}
|
170
|
+
</div>
|
171
|
+
</BasePopover>
|
172
|
+
</div>
|
173
|
+
</ClickAwayListener>
|
174
|
+
);
|
175
|
+
},
|
176
|
+
);
|
177
|
+
|
178
|
+
const DataSpaceQueryBuilderTemplateQueryPanel = observer(
|
179
|
+
(props: { queryBuilderState: DataSpaceQueryBuilderState }) => {
|
180
|
+
const { queryBuilderState } = props;
|
181
|
+
const templateQueryButtonRef = useRef<HTMLButtonElement>(null);
|
182
|
+
const templateQueries = queryBuilderState.dataSpace.executables?.filter(
|
183
|
+
(e) => e instanceof DataSpaceExecutableTemplate,
|
184
|
+
) as DataSpaceExecutableTemplate[] | undefined;
|
185
|
+
|
186
|
+
const showTemplateQueries = (): void => {
|
187
|
+
queryBuilderState.setTemplateQueryDialogOpen(true);
|
188
|
+
};
|
189
|
+
|
190
|
+
return (
|
191
|
+
<>
|
192
|
+
{templateQueries && templateQueries.length > 0 && (
|
193
|
+
<PanelHeader className="query-builder__data-space__template-query">
|
194
|
+
<div className="query-builder__data-space__template-query__title">
|
195
|
+
<FilterIcon />
|
196
|
+
</div>
|
197
|
+
<button
|
198
|
+
className="query-builder__data-space__template-query__btn"
|
199
|
+
ref={templateQueryButtonRef}
|
200
|
+
onClick={showTemplateQueries}
|
201
|
+
>
|
202
|
+
Template ( {templateQueries.length} )
|
203
|
+
</button>
|
204
|
+
{queryBuilderState.isTemplateQueryDialogOpen && (
|
205
|
+
<DataSpaceTemplateQueryDialog
|
206
|
+
triggerElement={templateQueryButtonRef.current}
|
207
|
+
queryBuilderState={queryBuilderState}
|
208
|
+
templateQueries={templateQueries}
|
209
|
+
/>
|
210
|
+
)}
|
211
|
+
</PanelHeader>
|
212
|
+
)}
|
213
|
+
</>
|
214
|
+
);
|
215
|
+
},
|
216
|
+
);
|
217
|
+
|
218
|
+
export const renderDataSpaceQueryBuilderTemplateQueryPanelContent = (
|
219
|
+
queryBuilderState: DataSpaceQueryBuilderState,
|
220
|
+
): React.ReactNode => (
|
221
|
+
<DataSpaceQueryBuilderTemplateQueryPanel
|
222
|
+
queryBuilderState={queryBuilderState}
|
223
|
+
/>
|
224
|
+
);
|
@@ -59,6 +59,7 @@ export const DataSpacePreviewAction = observer(
|
|
59
59
|
|
60
60
|
export const DataSpacePreviewDialog = observer(() => {
|
61
61
|
const editorStore = useEditorStore();
|
62
|
+
const applicationStore = editorStore.applicationStore;
|
62
63
|
const dataSpacePreviewState =
|
63
64
|
DataSpacePreviewState.retrieveNullableState(editorStore);
|
64
65
|
if (!dataSpacePreviewState) {
|
@@ -81,7 +82,9 @@ export const DataSpacePreviewDialog = observer(() => {
|
|
81
82
|
}}
|
82
83
|
>
|
83
84
|
<Modal
|
84
|
-
darkMode={
|
85
|
+
darkMode={
|
86
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
87
|
+
}
|
85
88
|
className="editor-modal data-space-preview__dialog"
|
86
89
|
>
|
87
90
|
<ModalHeader className="data-space-preview__dialog__header">
|
@@ -146,6 +146,7 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
146
146
|
dataSpaces: DataSpaceInfo[] = [];
|
147
147
|
showRuntimeSelector = false;
|
148
148
|
advancedSearchState?: DataSpaceAdvancedSearchState | undefined;
|
149
|
+
isTemplateQueryDialogOpen = false;
|
149
150
|
|
150
151
|
constructor(
|
151
152
|
applicationStore: GenericLegendApplicationStore,
|
@@ -172,10 +173,12 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
172
173
|
executionContext: observable,
|
173
174
|
showRuntimeSelector: observable,
|
174
175
|
advancedSearchState: observable,
|
176
|
+
isTemplateQueryDialogOpen: observable,
|
175
177
|
showAdvancedSearchPanel: action,
|
176
178
|
hideAdvancedSearchPanel: action,
|
177
179
|
setExecutionContext: action,
|
178
180
|
setShowRuntimeSelector: action,
|
181
|
+
setTemplateQueryDialogOpen: action,
|
179
182
|
loadDataSpaces: flow,
|
180
183
|
});
|
181
184
|
|
@@ -197,6 +200,10 @@ export class DataSpaceQueryBuilderState extends QueryBuilderState {
|
|
197
200
|
: 'query-builder__setup__data-space';
|
198
201
|
}
|
199
202
|
|
203
|
+
setTemplateQueryDialogOpen(val: boolean): void {
|
204
|
+
this.isTemplateQueryDialogOpen = val;
|
205
|
+
}
|
206
|
+
|
200
207
|
showAdvancedSearchPanel(): void {
|
201
208
|
if (this.projectInfo && this.isAdvancedDataSpaceSearchEnabled) {
|
202
209
|
this.advancedSearchState = new DataSpaceAdvancedSearchState(
|
@@ -39,7 +39,7 @@ import {
|
|
39
39
|
DataSpaceProjectInfo,
|
40
40
|
} from './DataSpaceQueryBuilderState.js';
|
41
41
|
import type { DataSpaceInfo } from './DataSpaceInfo.js';
|
42
|
-
import {
|
42
|
+
import { generateDataSpaceTemplateQueryCreatorRoute } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
43
43
|
import {
|
44
44
|
DataSpaceExecutableTemplate,
|
45
45
|
type DataSpaceExecutionContext,
|
@@ -149,7 +149,7 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
149
149
|
(dataSpaceInfo: DataSpaceInfo) => {
|
150
150
|
if (dataSpaceInfo.defaultExecutionContext) {
|
151
151
|
this.applicationStore.navigationService.navigator.goToLocation(
|
152
|
-
|
152
|
+
generateDataSpaceTemplateQueryCreatorRoute(
|
153
153
|
guaranteeNonNullable(dataSpaceInfo.groupId),
|
154
154
|
guaranteeNonNullable(dataSpaceInfo.artifactId),
|
155
155
|
LATEST_VERSION_ALIAS, //always default to latest
|
@@ -167,7 +167,7 @@ export class DataSpaceTemplateQueryCreatorStore extends QueryEditorStore {
|
|
167
167
|
dataSpaceAnalysisResult,
|
168
168
|
(ec: DataSpaceExecutionContext) => {
|
169
169
|
this.applicationStore.navigationService.navigator.updateCurrentLocation(
|
170
|
-
|
170
|
+
generateDataSpaceTemplateQueryCreatorRoute(
|
171
171
|
this.groupId,
|
172
172
|
this.artifactId,
|
173
173
|
this.versionId,
|
package/tsconfig.json
CHANGED
@@ -93,6 +93,7 @@
|
|
93
93
|
"./src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx",
|
94
94
|
"./src/components/query/DataSpaceAdvancedSearchModal.tsx",
|
95
95
|
"./src/components/query/DataSpaceQueryBuilder.tsx",
|
96
|
+
"./src/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx",
|
96
97
|
"./src/components/query/DataSpaceQueryCreator.tsx",
|
97
98
|
"./src/components/query/DataSpaceQuerySetup.tsx",
|
98
99
|
"./src/components/query/DataSpaceTemplateQueryCreator.tsx",
|