@finos/legend-query-builder 3.2.0 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/lib/__lib__/QueryBuilderColorTheme.d.ts +23 -0
  2. package/lib/__lib__/QueryBuilderColorTheme.d.ts.map +1 -0
  3. package/lib/__lib__/QueryBuilderColorTheme.js +24 -0
  4. package/lib/__lib__/QueryBuilderColorTheme.js.map +1 -0
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +24 -34
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryBuilder_LegendApplicationPlugin.d.ts +0 -1
  9. package/lib/components/QueryBuilder_LegendApplicationPlugin.d.ts.map +1 -1
  10. package/lib/components/QueryBuilder_LegendApplicationPlugin.js +3 -4
  11. package/lib/components/QueryBuilder_LegendApplicationPlugin.js.map +1 -1
  12. package/lib/components/QueryLoader.d.ts.map +1 -1
  13. package/lib/components/QueryLoader.js +6 -2
  14. package/lib/components/QueryLoader.js.map +1 -1
  15. package/lib/components/data-access/DataAccessOverview.d.ts +23 -0
  16. package/lib/components/data-access/DataAccessOverview.d.ts.map +1 -0
  17. package/lib/components/data-access/DataAccessOverview.js +146 -0
  18. package/lib/components/data-access/DataAccessOverview.js.map +1 -0
  19. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
  20. package/lib/components/execution-plan/ExecutionPlanViewer.js +3 -3
  21. package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
  22. package/lib/components/execution-plan/SQLExecutionNodeViewer.js +1 -1
  23. package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
  24. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +1 -1
  25. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
  26. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  27. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +2 -2
  28. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -18
  30. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  31. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +34 -36
  32. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  33. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  34. package/lib/components/shared/LambdaEditor.js +7 -19
  35. package/lib/components/shared/LambdaEditor.js.map +1 -1
  36. package/lib/index.css +2 -2
  37. package/lib/index.css.map +1 -1
  38. package/lib/index.d.ts +2 -0
  39. package/lib/index.d.ts.map +1 -1
  40. package/lib/index.js +2 -0
  41. package/lib/index.js.map +1 -1
  42. package/lib/package.json +6 -4
  43. package/lib/stores/QueryBuilderState.d.ts +3 -3
  44. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  45. package/lib/stores/QueryBuilderState.js +34 -18
  46. package/lib/stores/QueryBuilderState.js.map +1 -1
  47. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +9 -0
  48. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  49. package/lib/stores/data-access/DataAccessState.d.ts +56 -0
  50. package/lib/stores/data-access/DataAccessState.d.ts.map +1 -0
  51. package/lib/stores/data-access/DataAccessState.js +212 -0
  52. package/lib/stores/data-access/DataAccessState.js.map +1 -0
  53. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.d.ts +4 -2
  54. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.d.ts.map +1 -1
  55. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.js +20 -6
  56. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.js.map +1 -1
  57. package/package.json +14 -12
  58. package/src/__lib__/QueryBuilderColorTheme.ts +23 -0
  59. package/src/components/QueryBuilder.tsx +85 -96
  60. package/src/components/QueryBuilder_LegendApplicationPlugin.ts +4 -5
  61. package/src/components/QueryLoader.tsx +4 -1
  62. package/src/components/data-access/DataAccessOverview.tsx +308 -0
  63. package/src/components/execution-plan/ExecutionPlanViewer.tsx +1 -3
  64. package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +1 -1
  65. package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +1 -1
  66. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +2 -3
  67. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +99 -102
  68. package/src/components/shared/LambdaEditor.tsx +4 -21
  69. package/src/index.ts +4 -0
  70. package/src/stores/QueryBuilderState.ts +65 -19
  71. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +10 -0
  72. package/src/stores/data-access/DataAccessState.ts +322 -0
  73. package/src/stores/entitlements/QueryBuilderCheckEntitlementsState.ts +53 -6
  74. package/tsconfig.json +3 -0
@@ -16,24 +16,38 @@
16
16
  import { hashArray } from '@finos/legend-shared';
17
17
  import { makeObservable, observable, action, computed } from 'mobx';
18
18
  import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../QueryBuilderStateHashUtils.js';
19
+ import { DataAccessState } from '../data-access/DataAccessState.js';
20
+ import { RuntimePointer, InMemoryGraphData, } from '@finos/legend-graph';
19
21
  export class QueryBuilderCheckEntitlementsState {
20
22
  queryBuilderState;
21
- isCheckingEntitlements = false;
23
+ dataAccessState;
24
+ showCheckEntitlementsViewer = false;
22
25
  constructor(queryBuilderState) {
23
26
  makeObservable(this, {
24
- isCheckingEntitlements: observable,
25
- setIsCheckingEntitlements: action,
27
+ showCheckEntitlementsViewer: observable,
28
+ dataAccessState: observable,
29
+ setShowCheckEntitlementsViewer: action,
26
30
  hashCode: computed,
27
31
  });
28
32
  this.queryBuilderState = queryBuilderState;
29
33
  }
30
- setIsCheckingEntitlements(val) {
31
- this.isCheckingEntitlements = val;
34
+ setShowCheckEntitlementsViewer(val) {
35
+ this.showCheckEntitlementsViewer = val;
36
+ this.dataAccessState = undefined;
37
+ if (this.queryBuilderState.mapping &&
38
+ this.queryBuilderState.runtimeValue instanceof RuntimePointer) {
39
+ const mappingPath = this.queryBuilderState.mapping.path;
40
+ const runtimePath = this.queryBuilderState.runtimeValue.packageableRuntime.value.path;
41
+ this.dataAccessState = new DataAccessState(this.queryBuilderState.applicationStore, this.queryBuilderState.graphManagerState, {
42
+ surveyDatasets: async () => this.queryBuilderState.graphManagerState.graphManager.surveyDatasets(mappingPath, runtimePath, this.queryBuilderState.buildQuery(), new InMemoryGraphData(this.queryBuilderState.graphManagerState.graph)),
43
+ checkDatasetEntitlements: async (datasets) => this.queryBuilderState.graphManagerState.graphManager.checkDatasetEntitlements(datasets, mappingPath, runtimePath, this.queryBuilderState.buildQuery(), new InMemoryGraphData(this.queryBuilderState.graphManagerState.graph)),
44
+ });
45
+ }
32
46
  }
33
47
  get hashCode() {
34
48
  return hashArray([
35
49
  QUERY_BUILDER_STATE_HASH_STRUCTURE.CHECK_ENTITLEMENTS_STATE,
36
- this.isCheckingEntitlements,
50
+ this.showCheckEntitlementsViewer,
37
51
  ]);
38
52
  }
39
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderCheckEntitlementsState.js","sourceRoot":"","sources":["../../../src/stores/entitlements/QueryBuilderCheckEntitlementsState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAGtF,MAAM,OAAO,kCAAkC;IACpC,iBAAiB,CAAoB;IAC9C,sBAAsB,GAAG,KAAK,CAAC;IAE/B,YAAY,iBAAoC;QAC9C,cAAc,CAAC,IAAI,EAAE;YACnB,sBAAsB,EAAE,UAAU;YAClC,yBAAyB,EAAE,MAAM;YACjC,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,yBAAyB,CAAC,GAAY;QACpC,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC;IACpC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,SAAS,CAAC;YACf,kCAAkC,CAAC,wBAAwB;YAC3D,IAAI,CAAC,sBAAsB;SAC5B,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"QueryBuilderCheckEntitlementsState.js","sourceRoot":"","sources":["../../../src/stores/entitlements/QueryBuilderCheckEntitlementsState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EACL,cAAc,EAGd,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,kCAAkC;IACpC,iBAAiB,CAAoB;IAE9C,eAAe,CAA+B;IAC9C,2BAA2B,GAAG,KAAK,CAAC;IAEpC,YAAY,iBAAoC;QAC9C,cAAc,CAAC,IAAI,EAAE;YACnB,2BAA2B,EAAE,UAAU;YACvC,eAAe,EAAE,UAAU;YAC3B,8BAA8B,EAAE,MAAM;YACtC,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,8BAA8B,CAAC,GAAY;QACzC,IAAI,CAAC,2BAA2B,GAAG,GAAG,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IACE,IAAI,CAAC,iBAAiB,CAAC,OAAO;YAC9B,IAAI,CAAC,iBAAiB,CAAC,YAAY,YAAY,cAAc,EAC7D;YACA,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC;YACxD,MAAM,WAAW,GACf,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC;YACpE,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CACxC,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EACvC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EACxC;gBACE,cAAc,EAAE,KAAK,IAAqC,EAAE,CAC1D,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,cAAc,CAClE,WAAW,EACX,WAAW,EACX,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,EACnC,IAAI,iBAAiB,CACnB,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAC/C,CACF;gBACH,wBAAwB,EAAE,KAAK,EAC7B,QAAgC,EACK,EAAE,CACvC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,wBAAwB,CAC5E,QAAQ,EACR,WAAW,EACX,WAAW,EACX,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,EACnC,IAAI,iBAAiB,CACnB,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAC/C,CACF;aACJ,CACF,CAAC;SACH;IACH,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,SAAS,CAAC;YACf,kCAAkC,CAAC,wBAAwB;YAC3D,IAAI,CAAC,2BAA2B;SACjC,CAAC,CAAC;IACL,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-query-builder",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Legend query builder core",
5
5
  "keywords": [
6
6
  "legend",
@@ -42,28 +42,30 @@
42
42
  "test:watch": "jest --watch"
43
43
  },
44
44
  "dependencies": {
45
- "@finos/legend-application": "15.0.7",
46
- "@finos/legend-art": "7.0.8",
47
- "@finos/legend-graph": "28.1.4",
48
- "@finos/legend-lego": "0.1.13",
49
- "@finos/legend-server-depot": "6.0.4",
50
- "@finos/legend-shared": "10.0.3",
51
- "@finos/legend-storage": "3.0.53",
45
+ "@finos/legend-application": "15.0.9",
46
+ "@finos/legend-art": "7.0.10",
47
+ "@finos/legend-graph": "28.1.5",
48
+ "@finos/legend-lego": "1.0.1",
49
+ "@finos/legend-server-depot": "6.0.5",
50
+ "@finos/legend-shared": "10.0.4",
51
+ "@finos/legend-storage": "3.0.54",
52
52
  "@testing-library/react": "14.0.0",
53
- "@types/react": "18.2.0",
54
- "@types/react-dom": "18.2.1",
53
+ "@types/react": "18.2.1",
54
+ "@types/react-dom": "18.2.2",
55
+ "chart.js": "4.3.0",
55
56
  "mathjs": "11.8.0",
56
57
  "mobx": "6.9.0",
57
58
  "mobx-react-lite": "3.4.3",
58
- "monaco-editor": "0.37.1",
59
+ "monaco-editor": "0.38.0",
59
60
  "react": "18.2.0",
61
+ "react-chartjs-2": "5.2.0",
60
62
  "react-dnd": "16.0.1",
61
63
  "react-dom": "18.2.0",
62
64
  "serializr": "3.0.2",
63
65
  "sql-formatter": "12.2.0"
64
66
  },
65
67
  "devDependencies": {
66
- "@finos/legend-dev-utils": "2.0.57",
68
+ "@finos/legend-dev-utils": "2.0.59",
67
69
  "@jest/globals": "29.5.0",
68
70
  "cross-env": "7.0.3",
69
71
  "eslint": "8.39.0",
@@ -0,0 +1,23 @@
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
+ export enum QUERY_BUILDER_COLOR_THEME_KEY {
18
+ DATA_ACCESS_OVERVIEW__CHART__ACCESS_GRANTED = 'data-access-overview.chart.access-granted',
19
+ DATA_ACCESS_OVERVIEW__CHART__ACCESS_APPROVED = 'data-access-overview.chart.access-approved',
20
+ DATA_ACCESS_OVERVIEW__CHART__ACCESS_REQUESTED = 'data-access-overview.chart.access-requested',
21
+ DATA_ACCESS_OVERVIEW__CHART__ACCESS_NOT_GRANTED = 'data-access-overview.chart.access-not-granted',
22
+ DATA_ACCESS_OVERVIEW__CHART__UNSUPPORTED_ACCESS = 'data-access-overview.chart.unsupported-access',
23
+ }
@@ -40,7 +40,7 @@ import {
40
40
  ModalHeader,
41
41
  BlankPanelContent,
42
42
  ModalFooterButton,
43
- CalendarIcon,
43
+ CalendarClockIcon,
44
44
  } from '@finos/legend-art';
45
45
  import { QueryBuilderFilterPanel } from './filter/QueryBuilderFilterPanel.js';
46
46
  import { QueryBuilderExplorerPanel } from './explorer/QueryBuilderExplorerPanel.js';
@@ -69,9 +69,9 @@ import { QueryBuilderGraphFetchTreeState } from '../stores/fetch-structure/graph
69
69
  import { QueryBuilderPostTDSPanel } from './fetch-structure/QueryBuilderPostTDSPanel.js';
70
70
  import { QueryBuilderWatermarkEditor } from './watermark/QueryBuilderWatermark.js';
71
71
  import { QueryBuilderConstantExpressionPanel } from './QueryBuilderConstantExpressionPanel.js';
72
- import { QueryBuilder_LegendApplicationPlugin } from './QueryBuilder_LegendApplicationPlugin.js';
73
72
  import { QUERY_BUILDER_SETTING_KEY } from '../__lib__/QueryBuilderSetting.js';
74
73
  import { QUERY_BUILDER_COMPONENT_ELEMENT_ID } from './QueryBuilderComponentElement.js';
74
+ import { DataAccessOverview } from './data-access/DataAccessOverview.js';
75
75
 
76
76
  const QueryBuilderStatusBar = observer(
77
77
  (props: { queryBuilderState: QueryBuilderState }) => {
@@ -199,49 +199,6 @@ const QueryBuilderPostGraphFetchPanel = observer(
199
199
  },
200
200
  );
201
201
 
202
- const renderCheckEntitlementsEditor = (
203
- queryBuilderState: QueryBuilderState,
204
- plugins: QueryBuilder_LegendApplicationPlugin[],
205
- ): React.ReactNode => {
206
- const checkEntitlementsEditorRenderers = plugins.flatMap(
207
- (plugin) => plugin.getCheckEntitlementsEditorRender() ?? [],
208
- );
209
- for (const editorRenderer of checkEntitlementsEditorRenderers) {
210
- const editor = editorRenderer(queryBuilderState);
211
- if (editor) {
212
- return editor;
213
- }
214
- }
215
-
216
- const handleClose = (): void => {
217
- queryBuilderState.checkEntitlementsState.setIsCheckingEntitlements(false);
218
- };
219
-
220
- return (
221
- <Dialog
222
- open={queryBuilderState.checkEntitlementsState.isCheckingEntitlements}
223
- onClose={handleClose}
224
- classes={{
225
- root: 'editor-modal__root-container',
226
- container: 'editor-modal__container',
227
- paper: 'editor-modal__content',
228
- }}
229
- >
230
- <Modal darkMode={true} className="editor-modal">
231
- <ModalHeader title="Query Entitlements" />
232
- <ModalBody>
233
- <BlankPanelContent>
234
- Check Entitlements is not supported yet
235
- </BlankPanelContent>
236
- </ModalBody>
237
- <ModalFooter>
238
- <ModalFooterButton text="Close" onClick={handleClose} />
239
- </ModalFooter>
240
- </Modal>
241
- </Dialog>
242
- );
243
- };
244
-
245
202
  export const QueryBuilder = observer(
246
203
  (props: { queryBuilderState: QueryBuilderState }) => {
247
204
  const { queryBuilderState } = props;
@@ -249,7 +206,6 @@ export const QueryBuilder = observer(
249
206
  const fetchStructureState = queryBuilderState.fetchStructureState;
250
207
  const isTDSState =
251
208
  fetchStructureState.implementation instanceof QueryBuilderTDSState;
252
- const applicationStore = queryBuilderState.applicationStore;
253
209
  const openLambdaEditor = (mode: QueryBuilderTextEditorMode): void =>
254
210
  queryBuilderState.textEditorState.openModal(mode);
255
211
  const toggleShowFunctionPanel = (): void => {
@@ -347,9 +303,15 @@ export const QueryBuilder = observer(
347
303
  };
348
304
 
349
305
  const openCheckEntitlmentsEditor = (): void => {
350
- queryBuilderState.checkEntitlementsState.setIsCheckingEntitlements(true);
306
+ queryBuilderState.checkEntitlementsState.setShowCheckEntitlementsViewer(
307
+ true,
308
+ );
309
+ };
310
+ const handleClose = (): void => {
311
+ queryBuilderState.checkEntitlementsState.setShowCheckEntitlementsViewer(
312
+ false,
313
+ );
351
314
  };
352
-
353
315
  useCommands(queryBuilderState);
354
316
  const toggleShowOLAPGroupByPanel = (): void => {
355
317
  if (isTDSState) {
@@ -392,26 +354,25 @@ export const QueryBuilder = observer(
392
354
  />
393
355
  <div className="query-builder__body">
394
356
  <div className="query-builder__content">
395
- <div className="query-builder__sub-header">
396
- <div className="query-builder__sub-header__content__icons">
357
+ <div className="query-builder__header">
358
+ <div className="query-builder__header__statuses">
397
359
  {queryBuilderState.watermarkState.value && (
398
- <>
399
- <button
400
- className="panel__header__action"
401
- onClick={openWatermark}
402
- tabIndex={-1}
403
- title="Show Watermark"
404
- >
405
- <WaterDropIcon />
406
- </button>
407
- </>
360
+ <button
361
+ className="query-builder__header__status query-builder__header__status--action"
362
+ onClick={openWatermark}
363
+ tabIndex={-1}
364
+ title="Used watermark"
365
+ >
366
+ <WaterDropIcon />
367
+ </button>
408
368
  )}
409
369
  {queryBuilderState.isCalendarEnabled && (
410
- <>
411
- <div className="query-builder__sub-header__content__icon">
412
- <CalendarIcon />
413
- </div>
414
- </>
370
+ <div
371
+ className="query-builder__header__status"
372
+ title="Used calendar aggregation"
373
+ >
374
+ <CalendarClockIcon className="query-builder__header__status__icon--calendar" />
375
+ </div>
415
376
  )}
416
377
  {queryBuilderState.watermarkState.isEditingWatermark && (
417
378
  <QueryBuilderWatermarkEditor
@@ -419,9 +380,9 @@ export const QueryBuilder = observer(
419
380
  />
420
381
  )}
421
382
  </div>
422
- <div className="query-builder__sub-header__content__actions">
383
+ <div className="query-builder__header__actions">
423
384
  <DropdownMenu
424
- className="query-builder__sub-header__custom-action"
385
+ className="query-builder__header__advanced-dropdown"
425
386
  title="Show Advanced Menu..."
426
387
  content={
427
388
  <MenuContent>
@@ -434,7 +395,7 @@ export const QueryBuilder = observer(
434
395
  <CheckIcon />
435
396
  ) : null}
436
397
  </MenuContentItemIcon>
437
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
398
+ <MenuContentItemLabel>
438
399
  Show Function(s)
439
400
  </MenuContentItemLabel>
440
401
  </MenuContentItem>
@@ -452,7 +413,7 @@ export const QueryBuilder = observer(
452
413
  <CheckIcon />
453
414
  ) : null}
454
415
  </MenuContentItemIcon>
455
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
416
+ <MenuContentItemLabel>
456
417
  Show Parameter(s)
457
418
  </MenuContentItemLabel>
458
419
  </MenuContentItem>
@@ -471,7 +432,7 @@ export const QueryBuilder = observer(
471
432
  <CheckIcon />
472
433
  ) : null}
473
434
  </MenuContentItemIcon>
474
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
435
+ <MenuContentItemLabel>
475
436
  Show Constant(s)
476
437
  </MenuContentItemLabel>
477
438
  </MenuContentItem>
@@ -490,10 +451,9 @@ export const QueryBuilder = observer(
490
451
  <CheckIcon />
491
452
  ) : null}
492
453
  </MenuContentItemIcon>
493
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
494
- Show Filter
495
- </MenuContentItemLabel>
454
+ <MenuContentItemLabel>Show Filter</MenuContentItemLabel>
496
455
  </MenuContentItem>
456
+ <MenuContentDivider />
497
457
  <MenuContentItem
498
458
  onClick={toggleShowOLAPGroupByPanel}
499
459
  disabled={
@@ -516,8 +476,8 @@ export const QueryBuilder = observer(
516
476
  <CheckIcon />
517
477
  ) : null}
518
478
  </MenuContentItemIcon>
519
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
520
- Show Window Func(s)
479
+ <MenuContentItemLabel>
480
+ Show Window Function(s)
521
481
  </MenuContentItemLabel>
522
482
  </MenuContentItem>
523
483
  <MenuContentItem
@@ -541,13 +501,13 @@ export const QueryBuilder = observer(
541
501
  <CheckIcon />
542
502
  ) : null}
543
503
  </MenuContentItemIcon>
544
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
504
+ <MenuContentItemLabel>
545
505
  Show Post-Filter
546
506
  </MenuContentItemLabel>
547
507
  </MenuContentItem>
548
508
  <MenuContentItem onClick={openWatermark}>
549
509
  <MenuContentItemIcon>{null}</MenuContentItemIcon>
550
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
510
+ <MenuContentItemLabel>
551
511
  Show Watermark
552
512
  </MenuContentItemLabel>
553
513
  </MenuContentItem>
@@ -566,7 +526,7 @@ export const QueryBuilder = observer(
566
526
  <CheckIcon />
567
527
  ) : null}
568
528
  </MenuContentItemIcon>
569
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
529
+ <MenuContentItemLabel>
570
530
  Enable Calendar
571
531
  </MenuContentItemLabel>
572
532
  </MenuContentItem>
@@ -581,20 +541,20 @@ export const QueryBuilder = observer(
581
541
  .projectionColumns.length === 0
582
542
  }
583
543
  >
584
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
585
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
544
+ <MenuContentItemIcon />
545
+ <MenuContentItemLabel>
586
546
  Check Entitlements
587
547
  </MenuContentItemLabel>
588
548
  </MenuContentItem>
589
549
  <MenuContentItem onClick={editQueryInPure}>
590
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
591
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
550
+ <MenuContentItemIcon />
551
+ <MenuContentItemLabel>
592
552
  Edit Query in Pure
593
553
  </MenuContentItemLabel>
594
554
  </MenuContentItem>
595
555
  <MenuContentItem onClick={showQueryProtocol}>
596
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
597
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
556
+ <MenuContentItemIcon />
557
+ <MenuContentItemLabel>
598
558
  Show Query Protocol
599
559
  </MenuContentItemLabel>
600
560
  </MenuContentItem>
@@ -606,10 +566,10 @@ export const QueryBuilder = observer(
606
566
  elevation: 7,
607
567
  }}
608
568
  >
609
- <div className="query-builder__sub-header__custom-action__label">
569
+ <div className="query-builder__header__advanced-dropdown__label">
610
570
  Advanced
611
571
  </div>
612
- <CaretDownIcon className="query-builder__sub-header__custom-action__icon" />
572
+ <CaretDownIcon className="query-builder__header__advanced-dropdown__icon" />
613
573
  </DropdownMenu>
614
574
  </div>
615
575
  </div>
@@ -709,16 +669,45 @@ export const QueryBuilder = observer(
709
669
  {queryBuilderState.textEditorState.mode && (
710
670
  <QueryBuilderTextEditor queryBuilderState={queryBuilderState} />
711
671
  )}
712
- {queryBuilderState.checkEntitlementsState.isCheckingEntitlements &&
713
- renderCheckEntitlementsEditor(
714
- queryBuilderState,
715
- applicationStore.pluginManager
716
- .getApplicationPlugins()
717
- .filter(
718
- (plugin) =>
719
- plugin instanceof QueryBuilder_LegendApplicationPlugin,
720
- ) as QueryBuilder_LegendApplicationPlugin[],
721
- )}
672
+ {queryBuilderState.checkEntitlementsState
673
+ .showCheckEntitlementsViewer && (
674
+ <Dialog
675
+ open={
676
+ queryBuilderState.checkEntitlementsState
677
+ .showCheckEntitlementsViewer
678
+ }
679
+ onClose={handleClose}
680
+ classes={{
681
+ root: 'editor-modal__root-container',
682
+ container: 'editor-modal__container',
683
+ paper: 'editor-modal__content',
684
+ }}
685
+ >
686
+ <Modal darkMode={true} className="editor-modal">
687
+ <ModalHeader title="Query Entitlements" />
688
+ <ModalBody className="query-builder__data-access-overview">
689
+ <div className="query-builder__data-access-overview__container">
690
+ {queryBuilderState.checkEntitlementsState
691
+ .dataAccessState ? (
692
+ <DataAccessOverview
693
+ dataAccessState={
694
+ queryBuilderState.checkEntitlementsState
695
+ .dataAccessState
696
+ }
697
+ />
698
+ ) : (
699
+ <BlankPanelContent>
700
+ No data access information available
701
+ </BlankPanelContent>
702
+ )}
703
+ </div>
704
+ </ModalBody>
705
+ <ModalFooter>
706
+ <ModalFooterButton text="Close" onClick={handleClose} />
707
+ </ModalFooter>
708
+ </Modal>
709
+ </Dialog>
710
+ )}
722
711
  </div>
723
712
  <QueryBuilderStatusBar queryBuilderState={queryBuilderState} />
724
713
  </div>
@@ -28,6 +28,7 @@ import { QUERY_BUILDER_SETTING_CONFIG } from '../__lib__/QueryBuilderSetting.js'
28
28
  import { QUERY_BUILDER_COMMAND_CONFIG } from '../stores/QueryBuilderCommand.js';
29
29
  import type { QueryBuilderState } from '../stores/QueryBuilderState.js';
30
30
  import { configureDataGridComponent } from '@finos/legend-lego/data-grid';
31
+ import { Chart as ChartJS, ArcElement, Tooltip } from 'chart.js';
31
32
 
32
33
  export type CheckEntitlementEditorRender = (
33
34
  queryBuilderState: QueryBuilderState,
@@ -50,6 +51,9 @@ export class QueryBuilder_LegendApplicationPlugin extends LegendApplicationPlugi
50
51
  return [
51
52
  async (applicationStore) => {
52
53
  configureDataGridComponent();
54
+
55
+ // configure chart component
56
+ ChartJS.register(ArcElement, Tooltip);
53
57
  },
54
58
  ];
55
59
  }
@@ -65,9 +69,4 @@ export class QueryBuilder_LegendApplicationPlugin extends LegendApplicationPlugi
65
69
  QUERY_BUILDER_SETTING_CONFIG,
66
70
  );
67
71
  }
68
-
69
- // TODO: rework and move this to query builder plugin (to be created) or `QueryBuilder_LegendApplicationPlugin_Extension`
70
- getCheckEntitlementsEditorRender(): CheckEntitlementEditorRender | undefined {
71
- return undefined;
72
- }
73
72
  }
@@ -86,7 +86,6 @@ const QueryPreviewViewer = observer(
86
86
  }
87
87
  isReadOnly={true}
88
88
  language={CODE_EDITOR_LANGUAGE.PURE}
89
- showMiniMap={true}
90
89
  />
91
90
  </ModalBody>
92
91
  <ModalFooter>
@@ -324,12 +323,16 @@ export const QueryLoader = observer(
324
323
  onChange={changeQueryNameInputValue}
325
324
  onKeyDown={(event) => {
326
325
  if (event.code === 'Enter') {
326
+ event.stopPropagation();
327
327
  renameQuery(query)();
328
328
  } else if (event.code === 'Escape') {
329
+ event.stopPropagation();
329
330
  hideEditQueryNameInput();
330
331
  }
331
332
  }}
332
333
  onBlur={() => hideEditQueryNameInput()}
334
+ // avoid clicking on the input causing the call to load query
335
+ onClick={(event) => event.stopPropagation()}
333
336
  />
334
337
  </div>
335
338
  ) : (