@finos/legend-application-query 10.0.4 → 11.0.0

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 (117) hide show
  1. package/lib/application/LegendQuery.d.ts.map +1 -1
  2. package/lib/application/LegendQuery.js +7 -4
  3. package/lib/application/LegendQuery.js.map +1 -1
  4. package/lib/application/LegendQueryApplicationConfig.d.ts +0 -10
  5. package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
  6. package/lib/application/LegendQueryApplicationConfig.js +3 -13
  7. package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
  8. package/lib/application/LegendQueryApplicationNavigationContext.d.ts.map +1 -0
  9. package/lib/application/LegendQueryApplicationNavigationContext.js.map +1 -0
  10. package/lib/{stores/LegendQueryAppEvent.d.ts → application/LegendQueryEvent.d.ts} +1 -1
  11. package/lib/application/LegendQueryEvent.d.ts.map +1 -0
  12. package/lib/{stores/LegendQueryAppEvent.js → application/LegendQueryEvent.js} +1 -1
  13. package/lib/application/LegendQueryEvent.js.map +1 -0
  14. package/lib/{stores/LegendQueryEventService.d.ts → application/LegendQueryEventHelper.d.ts} +3 -6
  15. package/lib/application/LegendQueryEventHelper.d.ts.map +1 -0
  16. package/lib/application/LegendQueryEventHelper.js +22 -0
  17. package/lib/application/LegendQueryEventHelper.js.map +1 -0
  18. package/lib/{stores/LegendQueryRouter.d.ts → application/LegendQueryNavigation.d.ts} +26 -26
  19. package/lib/application/LegendQueryNavigation.d.ts.map +1 -0
  20. package/lib/{stores/LegendQueryRouter.js → application/LegendQueryNavigation.js} +27 -27
  21. package/lib/application/LegendQueryNavigation.js.map +1 -0
  22. package/lib/{stores/LegendQueryTelemetry.d.ts → application/LegendQueryTelemetryHelper.d.ts} +2 -2
  23. package/lib/application/LegendQueryTelemetryHelper.d.ts.map +1 -0
  24. package/lib/{stores/LegendQueryTelemetry.js → application/LegendQueryTelemetryHelper.js} +3 -3
  25. package/lib/application/LegendQueryTelemetryHelper.js.map +1 -0
  26. package/lib/components/CloneQueryServiceSetup.js +1 -1
  27. package/lib/components/CloneQueryServiceSetup.js.map +1 -1
  28. package/lib/components/Core_LegendQueryApplicationPlugin.js +3 -2
  29. package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
  30. package/lib/components/CreateMappingQuerySetup.js +1 -1
  31. package/lib/components/CreateMappingQuerySetup.js.map +1 -1
  32. package/lib/components/EditExistingQuerySetup.js +1 -1
  33. package/lib/components/EditExistingQuerySetup.js.map +1 -1
  34. package/lib/components/LegendQueryApplication.js +1 -1
  35. package/lib/components/LegendQueryApplication.js.map +1 -1
  36. package/lib/components/LoadProjectServiceQuerySetup.js +2 -2
  37. package/lib/components/LoadProjectServiceQuerySetup.js.map +1 -1
  38. package/lib/components/QueryEditor.d.ts.map +1 -1
  39. package/lib/components/QueryEditor.js +19 -22
  40. package/lib/components/QueryEditor.js.map +1 -1
  41. package/lib/components/QueryEditorComponentTestUtils.js +1 -1
  42. package/lib/components/QueryEditorComponentTestUtils.js.map +1 -1
  43. package/lib/components/QueryProductionizerSetup.js +1 -1
  44. package/lib/components/QueryProductionizerSetup.js.map +1 -1
  45. package/lib/components/QuerySetup.d.ts.map +1 -1
  46. package/lib/components/QuerySetup.js +6 -7
  47. package/lib/components/QuerySetup.js.map +1 -1
  48. package/lib/components/UpdateExistingServiceQuerySetup.js +1 -1
  49. package/lib/components/UpdateExistingServiceQuerySetup.js.map +1 -1
  50. package/lib/index.css +1 -1
  51. package/lib/index.d.ts +9 -10
  52. package/lib/index.d.ts.map +1 -1
  53. package/lib/index.js +11 -10
  54. package/lib/index.js.map +1 -1
  55. package/lib/package.json +4 -4
  56. package/lib/stores/CloneServiceQuerySetupStore.js +1 -1
  57. package/lib/stores/CloneServiceQuerySetupStore.js.map +1 -1
  58. package/lib/stores/CreateMappingQuerySetupStore.js +1 -1
  59. package/lib/stores/CreateMappingQuerySetupStore.js.map +1 -1
  60. package/lib/stores/LegendQueryBaseStore.d.ts.map +1 -1
  61. package/lib/stores/LegendQueryBaseStore.js +3 -3
  62. package/lib/stores/LegendQueryBaseStore.js.map +1 -1
  63. package/lib/stores/LoadProjectServiceQuerySetupStore.js +1 -1
  64. package/lib/stores/LoadProjectServiceQuerySetupStore.js.map +1 -1
  65. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  66. package/lib/stores/QueryEditorStore.js +10 -13
  67. package/lib/stores/QueryEditorStore.js.map +1 -1
  68. package/lib/stores/QueryProductionizerSetupStore.js +1 -1
  69. package/lib/stores/QueryProductionizerSetupStore.js.map +1 -1
  70. package/lib/stores/QuerySetupStore.js +2 -2
  71. package/lib/stores/QuerySetupStore.js.map +1 -1
  72. package/lib/stores/UpdateExistingServiceQuerySetupStore.js +1 -1
  73. package/lib/stores/UpdateExistingServiceQuerySetupStore.js.map +1 -1
  74. package/package.json +12 -12
  75. package/src/application/LegendQuery.tsx +7 -3
  76. package/src/application/LegendQueryApplicationConfig.ts +1 -19
  77. package/src/application/LegendQueryEventHelper.ts +31 -0
  78. package/src/{stores/LegendQueryRouter.ts → application/LegendQueryNavigation.ts} +38 -36
  79. package/src/{stores/LegendQueryTelemetry.ts → application/LegendQueryTelemetryHelper.ts} +2 -2
  80. package/src/components/CloneQueryServiceSetup.tsx +1 -1
  81. package/src/components/Core_LegendQueryApplicationPlugin.tsx +1 -1
  82. package/src/components/CreateMappingQuerySetup.tsx +1 -1
  83. package/src/components/EditExistingQuerySetup.tsx +1 -1
  84. package/src/components/LegendQueryApplication.tsx +1 -1
  85. package/src/components/LoadProjectServiceQuerySetup.tsx +1 -1
  86. package/src/components/QueryEditor.tsx +43 -64
  87. package/src/components/QueryEditorComponentTestUtils.tsx +1 -1
  88. package/src/components/QueryProductionizerSetup.tsx +1 -1
  89. package/src/components/QuerySetup.tsx +14 -28
  90. package/src/components/UpdateExistingServiceQuerySetup.tsx +1 -1
  91. package/src/index.ts +15 -17
  92. package/src/stores/CloneServiceQuerySetupStore.ts +1 -1
  93. package/src/stores/CreateMappingQuerySetupStore.ts +1 -1
  94. package/src/stores/LegendQueryBaseStore.ts +3 -5
  95. package/src/stores/LoadProjectServiceQuerySetupStore.ts +1 -1
  96. package/src/stores/QueryEditorStore.ts +12 -15
  97. package/src/stores/QueryProductionizerSetupStore.ts +1 -1
  98. package/src/stores/QuerySetupStore.ts +2 -2
  99. package/src/stores/UpdateExistingServiceQuerySetupStore.ts +1 -1
  100. package/tsconfig.json +6 -7
  101. package/tsconfig.package.json +1 -2
  102. package/lib/stores/LegendQueryAppEvent.d.ts.map +0 -1
  103. package/lib/stores/LegendQueryAppEvent.js.map +0 -1
  104. package/lib/stores/LegendQueryApplicationNavigationContext.d.ts.map +0 -1
  105. package/lib/stores/LegendQueryApplicationNavigationContext.js.map +0 -1
  106. package/lib/stores/LegendQueryEventService.d.ts.map +0 -1
  107. package/lib/stores/LegendQueryEventService.js +0 -29
  108. package/lib/stores/LegendQueryEventService.js.map +0 -1
  109. package/lib/stores/LegendQueryRouter.d.ts.map +0 -1
  110. package/lib/stores/LegendQueryRouter.js.map +0 -1
  111. package/lib/stores/LegendQueryTelemetry.d.ts.map +0 -1
  112. package/lib/stores/LegendQueryTelemetry.js.map +0 -1
  113. package/src/stores/LegendQueryEventService.ts +0 -41
  114. /package/lib/{stores → application}/LegendQueryApplicationNavigationContext.d.ts +0 -0
  115. /package/lib/{stores → application}/LegendQueryApplicationNavigationContext.js +0 -0
  116. /package/src/{stores → application}/LegendQueryApplicationNavigationContext.ts +0 -0
  117. /package/src/{stores/LegendQueryAppEvent.ts → application/LegendQueryEvent.ts} +0 -0
@@ -24,7 +24,7 @@ import {
24
24
  } from '@finos/legend-shared';
25
25
  import { generateGAVCoordinates } from '@finos/legend-storage';
26
26
 
27
- export enum LEGEND_QUERY_PATH_PARAM_TOKEN {
27
+ export enum LEGEND_QUERY_ROUTE_PATTERN_TOKEN {
28
28
  GAV = 'gav',
29
29
  QUERY_ID = 'queryId',
30
30
  MAPPING_PATH = 'mappingPath',
@@ -32,16 +32,6 @@ export enum LEGEND_QUERY_PATH_PARAM_TOKEN {
32
32
  SERVICE_PATH = 'servicePath',
33
33
  }
34
34
 
35
- export enum LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN {
36
- SHOW_ALL_GROUPS = 'showAllGroups',
37
- SHOW_ADVANCED_ACTIONS = 'showAdvancedActions',
38
- TAG = 'tag',
39
- }
40
-
41
- export enum LEGEND_QUERY_QUERY_PARAM_TOKEN {
42
- SERVICE_EXECUTION_KEY = 'executionKey',
43
- }
44
-
45
35
  export const LEGEND_QUERY_ROUTE_PATTERN = Object.freeze({
46
36
  SETUP: '/setup',
47
37
  EDIT_EXISTING_QUERY_SETUP: '/setup/existing-query',
@@ -50,15 +40,27 @@ export const LEGEND_QUERY_ROUTE_PATTERN = Object.freeze({
50
40
  QUERY_PRODUCTIONIZER_SETUP: '/setup/productionize-query',
51
41
  UPDATE_EXISTING_SERVICE_QUERY_SETUP: '/setup/update-existing-service-query',
52
42
  LOAD_PROJECT_SERVICE_QUERY_SETUP: '/setup/load-project-service-query',
53
- CREATE_FROM_MAPPING_QUERY: `/create/manual/:${LEGEND_QUERY_PATH_PARAM_TOKEN.GAV}/:${LEGEND_QUERY_PATH_PARAM_TOKEN.MAPPING_PATH}/:${LEGEND_QUERY_PATH_PARAM_TOKEN.RUNTIME_PATH}`,
54
- CREATE_FROM_SERVICE_QUERY: `/create-from-service/:${LEGEND_QUERY_PATH_PARAM_TOKEN.GAV}/:${LEGEND_QUERY_PATH_PARAM_TOKEN.SERVICE_PATH}`,
55
- EDIT_EXISTING_QUERY: `/edit/:${LEGEND_QUERY_PATH_PARAM_TOKEN.QUERY_ID}`,
43
+ CREATE_FROM_MAPPING_QUERY: `/create/manual/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV}/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.MAPPING_PATH}/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.RUNTIME_PATH}`,
44
+ CREATE_FROM_SERVICE_QUERY: `/create-from-service/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV}/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.SERVICE_PATH}`,
45
+ EDIT_EXISTING_QUERY: `/edit/:${LEGEND_QUERY_ROUTE_PATTERN_TOKEN.QUERY_ID}`,
56
46
  });
57
47
 
48
+ export enum LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN {
49
+ SHOW_ALL_GROUPS = 'showAllGroups',
50
+ SHOW_ADVANCED_ACTIONS = 'showAdvancedActions',
51
+ TAG = 'tag',
52
+ }
53
+
54
+ export enum LEGEND_QUERY_QUERY_PARAM_TOKEN {
55
+ SERVICE_EXECUTION_KEY = 'executionKey',
56
+ }
57
+
58
58
  export type QuerySetupQueryParams = {
59
- [LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ALL_GROUPS]?: string;
60
- [LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ADVANCED_ACTIONS]?: string;
61
- [LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.TAG]?: string;
59
+ [LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ALL_GROUPS]?: string | undefined;
60
+ [LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ADVANCED_ACTIONS]?:
61
+ | string
62
+ | undefined;
63
+ [LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.TAG]?: string | undefined;
62
64
  };
63
65
 
64
66
  export const generateQuerySetupRoute = (
@@ -117,20 +119,20 @@ export const generateMappingQueryCreatorRoute = (
117
119
  runtimePath: string,
118
120
  ): string =>
119
121
  generatePath(LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_MAPPING_QUERY, {
120
- [LEGEND_QUERY_PATH_PARAM_TOKEN.GAV]: generateGAVCoordinates(
122
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV]: generateGAVCoordinates(
121
123
  groupId,
122
124
  artifactId,
123
125
  versionId,
124
126
  ),
125
- [LEGEND_QUERY_PATH_PARAM_TOKEN.MAPPING_PATH]: mappingPath,
126
- [LEGEND_QUERY_PATH_PARAM_TOKEN.RUNTIME_PATH]: runtimePath,
127
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.MAPPING_PATH]: mappingPath,
128
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.RUNTIME_PATH]: runtimePath,
127
129
  });
128
130
 
129
- export interface MappingQueryCreatorPathParams {
130
- [LEGEND_QUERY_PATH_PARAM_TOKEN.GAV]: string;
131
- [LEGEND_QUERY_PATH_PARAM_TOKEN.MAPPING_PATH]: string;
132
- [LEGEND_QUERY_PATH_PARAM_TOKEN.RUNTIME_PATH]: string;
133
- }
131
+ export type MappingQueryCreatorPathParams = {
132
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV]: string;
133
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.MAPPING_PATH]: string;
134
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.RUNTIME_PATH]: string;
135
+ };
134
136
 
135
137
  export const generateServiceQueryCreatorRoute = (
136
138
  groupId: string,
@@ -141,12 +143,12 @@ export const generateServiceQueryCreatorRoute = (
141
143
  ): string =>
142
144
  addQueryParamsStringToUrl(
143
145
  generatePath(LEGEND_QUERY_ROUTE_PATTERN.CREATE_FROM_SERVICE_QUERY, {
144
- [LEGEND_QUERY_PATH_PARAM_TOKEN.GAV]: generateGAVCoordinates(
146
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV]: generateGAVCoordinates(
145
147
  groupId,
146
148
  artifactId,
147
149
  versionId,
148
150
  ),
149
- [LEGEND_QUERY_PATH_PARAM_TOKEN.SERVICE_PATH]: servicePath,
151
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.SERVICE_PATH]: servicePath,
150
152
  }),
151
153
  stringifyQueryParams({
152
154
  [LEGEND_QUERY_QUERY_PARAM_TOKEN.SERVICE_EXECUTION_KEY]: executionKey
@@ -155,23 +157,23 @@ export const generateServiceQueryCreatorRoute = (
155
157
  }),
156
158
  );
157
159
 
158
- export interface ServiceQueryCreatorPathParams {
159
- [LEGEND_QUERY_PATH_PARAM_TOKEN.GAV]: string;
160
- [LEGEND_QUERY_PATH_PARAM_TOKEN.SERVICE_PATH]: string;
161
- }
160
+ export type ServiceQueryCreatorPathParams = {
161
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV]: string;
162
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.SERVICE_PATH]: string;
163
+ };
162
164
 
163
165
  export type ServiceQueryCreatorQueryParams = {
164
- [LEGEND_QUERY_QUERY_PARAM_TOKEN.SERVICE_EXECUTION_KEY]?: string;
166
+ [LEGEND_QUERY_QUERY_PARAM_TOKEN.SERVICE_EXECUTION_KEY]?: string | undefined;
165
167
  };
166
168
 
167
169
  export const generateExistingQueryEditorRoute = (queryId: string): string =>
168
170
  generatePath(LEGEND_QUERY_ROUTE_PATTERN.EDIT_EXISTING_QUERY, {
169
- [LEGEND_QUERY_PATH_PARAM_TOKEN.QUERY_ID]: queryId,
171
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.QUERY_ID]: queryId,
170
172
  });
171
173
 
172
- export interface ExistingQueryEditorPathParams {
173
- [LEGEND_QUERY_PATH_PARAM_TOKEN.QUERY_ID]: string;
174
- }
174
+ export type ExistingQueryEditorPathParams = {
175
+ [LEGEND_QUERY_ROUTE_PATTERN_TOKEN.QUERY_ID]: string;
176
+ };
175
177
 
176
178
  /**
177
179
  * @external_application_navigation This depends on Legend Studio routing and is hardcoded so it's potentially brittle
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import type { TelemetryService } from '@finos/legend-application';
18
- import { LEGEND_QUERY_APP_EVENT } from './LegendQueryAppEvent.js';
18
+ import { LEGEND_QUERY_APP_EVENT } from './LegendQueryEvent.js';
19
19
 
20
20
  type Query_TelemetryData = {
21
21
  query: {
@@ -27,7 +27,7 @@ type Query_TelemetryData = {
27
27
  };
28
28
  };
29
29
 
30
- export class LegendQueryTelemetry {
30
+ export class LegendQueryTelemetryHelper {
31
31
  static logEvent_ViewQuerySucceeded(
32
32
  telemetryService: TelemetryService,
33
33
  data: Query_TelemetryData,
@@ -29,7 +29,7 @@ import { useContext, useEffect } from 'react';
29
29
  import {
30
30
  generateQuerySetupRoute,
31
31
  generateServiceQueryCreatorRoute,
32
- } from '../stores/LegendQueryRouter.js';
32
+ } from '../application/LegendQueryNavigation.js';
33
33
  import {
34
34
  LATEST_VERSION_ALIAS,
35
35
  SNAPSHOT_VERSION_ALIAS,
@@ -37,7 +37,7 @@ import {
37
37
  generateQueryProductionizerSetupRoute,
38
38
  generateUpdateExistingServiceQuerySetup,
39
39
  LEGEND_QUERY_ROUTE_PATTERN,
40
- } from '../stores/LegendQueryRouter.js';
40
+ } from '../application/LegendQueryNavigation.js';
41
41
  import type { ApplicationPageEntry } from '@finos/legend-application';
42
42
  import { CloneQueryServiceSetup } from './CloneQueryServiceSetup.js';
43
43
  import { QueryProductionizerSetup } from './QueryProductionizerSetup.js';
@@ -29,7 +29,7 @@ import { useContext, useEffect } from 'react';
29
29
  import {
30
30
  generateMappingQueryCreatorRoute,
31
31
  generateQuerySetupRoute,
32
- } from '../stores/LegendQueryRouter.js';
32
+ } from '../application/LegendQueryNavigation.js';
33
33
  import {
34
34
  LATEST_VERSION_ALIAS,
35
35
  SNAPSHOT_VERSION_ALIAS,
@@ -32,7 +32,7 @@ import { useContext, useEffect, useMemo, useRef, useState } from 'react';
32
32
  import {
33
33
  generateExistingQueryEditorRoute,
34
34
  generateQuerySetupRoute,
35
- } from '../stores/LegendQueryRouter.js';
35
+ } from '../application/LegendQueryNavigation.js';
36
36
  import { useDepotServerClient } from '@finos/legend-server-depot';
37
37
  import {
38
38
  useApplicationStore,
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { observer } from 'mobx-react-lite';
18
- import { LEGEND_QUERY_ROUTE_PATTERN } from '../stores/LegendQueryRouter.js';
18
+ import { LEGEND_QUERY_ROUTE_PATTERN } from '../application/LegendQueryNavigation.js';
19
19
  import { QuerySetupLandingPage } from './QuerySetup.js';
20
20
  import {
21
21
  MappingQueryCreator,
@@ -19,7 +19,7 @@ import { guaranteeType } from '@finos/legend-shared';
19
19
  import { flowResult } from 'mobx';
20
20
  import { observer, useLocalObservable } from 'mobx-react-lite';
21
21
  import { useContext, useEffect } from 'react';
22
- import { generateQuerySetupRoute } from '../stores/LegendQueryRouter.js';
22
+ import { generateQuerySetupRoute } from '../application/LegendQueryNavigation.js';
23
23
  import { useDepotServerClient } from '@finos/legend-server-depot';
24
24
  import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
25
25
  import { LoadProjectServiceQuerySetupStore } from '../stores/LoadProjectServiceQuerySetupStore.js';
@@ -44,24 +44,18 @@ import {
44
44
  LightBulbIcon,
45
45
  EmptyLightBulbIcon,
46
46
  } from '@finos/legend-art';
47
- import {
48
- debounce,
49
- getQueryParameters,
50
- getQueryParameterValue,
51
- sanitizeURL,
52
- } from '@finos/legend-shared';
47
+ import { debounce } from '@finos/legend-shared';
53
48
  import { observer } from 'mobx-react-lite';
54
49
  import { Fragment, useEffect, useMemo, useRef, useState } from 'react';
55
50
  import {
56
51
  type MappingQueryCreatorPathParams,
57
52
  type ExistingQueryEditorPathParams,
58
53
  type ServiceQueryCreatorPathParams,
59
- type ServiceQueryCreatorQueryParams,
60
54
  LEGEND_QUERY_QUERY_PARAM_TOKEN,
61
- LEGEND_QUERY_PATH_PARAM_TOKEN,
55
+ LEGEND_QUERY_ROUTE_PATTERN_TOKEN,
62
56
  generateExistingQueryEditorRoute,
63
57
  generateQuerySetupRoute,
64
- } from '../stores/LegendQueryRouter.js';
58
+ } from '../application/LegendQueryNavigation.js';
65
59
  import {
66
60
  type QueryEditorStore,
67
61
  ExistingQueryEditorStore,
@@ -69,7 +63,11 @@ import {
69
63
  createViewProjectHandler,
70
64
  createViewSDLCProjectHandler,
71
65
  } from '../stores/QueryEditorStore.js';
72
- import { useApplicationStore, useParams } from '@finos/legend-application';
66
+ import {
67
+ LEGEND_APPLICATION_COLOR_THEME,
68
+ useApplicationStore,
69
+ useParams,
70
+ } from '@finos/legend-application';
73
71
  import {
74
72
  MappingQueryCreatorStoreProvider,
75
73
  ExistingQueryEditorStoreProvider,
@@ -402,10 +400,14 @@ const QueryEditorHeaderContent = observer(
402
400
  applicationStore.alertUnhandledError,
403
401
  );
404
402
  };
405
- const toggleLightDarkMode = (): void =>
406
- applicationStore.layoutService.TEMPORARY__setIsLightThemeEnabled(
407
- !applicationStore.layoutService.TEMPORARY__isLightThemeEnabled,
403
+ const TEMPORARY__toggleLightDarkMode = (): void => {
404
+ applicationStore.layoutService.setColorTheme(
405
+ applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
406
+ ? LEGEND_APPLICATION_COLOR_THEME.DEFAULT_DARK
407
+ : LEGEND_APPLICATION_COLOR_THEME.LEGACY_LIGHT,
408
+ { persist: true },
408
409
  );
410
+ };
409
411
  const saveQuery = (): void => {
410
412
  queryBuilderState
411
413
  .saveQuery(async (lambda: RawLambda) => {
@@ -470,24 +472,22 @@ const QueryEditorHeaderContent = observer(
470
472
  queryBuilderState={queryBuilderState}
471
473
  />
472
474
  )}
473
- {applicationStore.config.options.TEMPORARY__enableThemeSwitcher && (
474
- <button
475
- title="Toggle light/dark mode"
476
- onClick={toggleLightDarkMode}
477
- className="query-editor__header__action"
478
- disabled={editorStore.isViewProjectActionDisabled}
479
- >
480
- {applicationStore.layoutService.TEMPORARY__isLightThemeEnabled ? (
481
- <>
482
- <LightBulbIcon className="query-editor__header__action__icon--bulb--light" />
483
- </>
484
- ) : (
485
- <>
486
- <EmptyLightBulbIcon className="query-editor__header__action__icon--bulb--dark" />
487
- </>
488
- )}
489
- </button>
490
- )}
475
+ <button
476
+ title="Toggle light/dark mode"
477
+ onClick={TEMPORARY__toggleLightDarkMode}
478
+ className="query-editor__header__action"
479
+ >
480
+ {applicationStore.layoutService
481
+ .TEMPORARY__isLightColorThemeEnabled ? (
482
+ <>
483
+ <LightBulbIcon className="query-editor__header__action__icon--bulb--light" />
484
+ </>
485
+ ) : (
486
+ <>
487
+ <EmptyLightBulbIcon className="query-editor__header__action__icon--bulb--dark" />
488
+ </>
489
+ )}
490
+ </button>
491
491
 
492
492
  <DropdownMenu
493
493
  className="query-editor__header__action btn--medium"
@@ -561,23 +561,8 @@ export const QueryEditor = observer(() => {
561
561
  );
562
562
  }, [editorStore, applicationStore]);
563
563
 
564
- useEffect(() => {
565
- document.body.classList.toggle(
566
- 'light-theme',
567
- applicationStore.layoutService.TEMPORARY__isLightThemeEnabled,
568
- );
569
- }, [applicationStore.layoutService.TEMPORARY__isLightThemeEnabled]);
570
-
571
564
  return (
572
- <div
573
- className={clsx([
574
- 'query-editor ',
575
- {
576
- 'query-editor--light':
577
- applicationStore.layoutService.TEMPORARY__isLightThemeEnabled,
578
- },
579
- ])}
580
- >
565
+ <div className="query-editor">
581
566
  <div className="query-editor__header">
582
567
  <div className="query-editor__header__menu">
583
568
  <DropdownMenu
@@ -589,7 +574,6 @@ export const QueryEditor = observer(() => {
589
574
  }}
590
575
  content={
591
576
  <MenuContent>
592
- {/* <MenuContentItem onClick={openHelp}>Help...</MenuContentItem> */}
593
577
  <MenuContentItem
594
578
  disabled={!appDocUrl}
595
579
  onClick={goToDocumentation}
@@ -651,7 +635,7 @@ export const QueryEditor = observer(() => {
651
635
 
652
636
  export const ExistingQueryEditor = observer(() => {
653
637
  const params = useParams<ExistingQueryEditorPathParams>();
654
- const queryId = params[LEGEND_QUERY_PATH_PARAM_TOKEN.QUERY_ID];
638
+ const queryId = params[LEGEND_QUERY_ROUTE_PATTERN_TOKEN.QUERY_ID];
655
639
 
656
640
  return (
657
641
  <ExistingQueryEditorStoreProvider queryId={queryId}>
@@ -662,18 +646,13 @@ export const ExistingQueryEditor = observer(() => {
662
646
 
663
647
  export const ServiceQueryCreator = observer(() => {
664
648
  const applicationStore = useApplicationStore();
665
- const params = useParams<ServiceQueryCreatorPathParams>();
666
- const gav = params[LEGEND_QUERY_PATH_PARAM_TOKEN.GAV];
667
- const servicePath = params[LEGEND_QUERY_PATH_PARAM_TOKEN.SERVICE_PATH];
668
- const executionKey = getQueryParameterValue(
669
- getQueryParameters<ServiceQueryCreatorQueryParams>(
670
- sanitizeURL(
671
- applicationStore.navigationService.navigator.getCurrentAddress(),
672
- ),
673
- true,
674
- ),
675
- LEGEND_QUERY_QUERY_PARAM_TOKEN.SERVICE_EXECUTION_KEY,
676
- );
649
+ const parameters = useParams<ServiceQueryCreatorPathParams>();
650
+ const gav = parameters[LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV];
651
+ const servicePath = parameters[LEGEND_QUERY_ROUTE_PATTERN_TOKEN.SERVICE_PATH];
652
+ const executionKey =
653
+ applicationStore.navigationService.navigator.getAddressParameterValue(
654
+ LEGEND_QUERY_QUERY_PARAM_TOKEN.SERVICE_EXECUTION_KEY,
655
+ );
677
656
 
678
657
  return (
679
658
  <ServiceQueryCreatorStoreProvider
@@ -688,9 +667,9 @@ export const ServiceQueryCreator = observer(() => {
688
667
 
689
668
  export const MappingQueryCreator = observer(() => {
690
669
  const params = useParams<MappingQueryCreatorPathParams>();
691
- const gav = params[LEGEND_QUERY_PATH_PARAM_TOKEN.GAV];
692
- const mappingPath = params[LEGEND_QUERY_PATH_PARAM_TOKEN.MAPPING_PATH];
693
- const runtimePath = params[LEGEND_QUERY_PATH_PARAM_TOKEN.RUNTIME_PATH];
670
+ const gav = params[LEGEND_QUERY_ROUTE_PATTERN_TOKEN.GAV];
671
+ const mappingPath = params[LEGEND_QUERY_ROUTE_PATTERN_TOKEN.MAPPING_PATH];
672
+ const runtimePath = params[LEGEND_QUERY_ROUTE_PATTERN_TOKEN.RUNTIME_PATH];
694
673
 
695
674
  return (
696
675
  <MappingQueryCreatorStoreProvider
@@ -46,7 +46,7 @@ import {
46
46
  import { TEST__getTestLegendQueryApplicationConfig } from '../stores/QueryEditorStoreTestUtils.js';
47
47
  import { LegendQueryPluginManager } from '../application/LegendQueryPluginManager.js';
48
48
  import { ExistingQueryEditor } from './QueryEditor.js';
49
- import { generateExistingQueryEditorRoute } from '../stores/LegendQueryRouter.js';
49
+ import { generateExistingQueryEditorRoute } from '../application/LegendQueryNavigation.js';
50
50
  import type { Entity } from '@finos/legend-storage';
51
51
  import { ExistingQueryEditorStore } from '../stores/QueryEditorStore.js';
52
52
  import { LegendQueryBaseStoreProvider } from './LegendQueryBaseStoreProvider.js';
@@ -41,7 +41,7 @@ import {
41
41
  buildQueryOption,
42
42
  type QueryOption,
43
43
  } from '@finos/legend-query-builder';
44
- import { generateQuerySetupRoute } from '../stores/LegendQueryRouter.js';
44
+ import { generateQuerySetupRoute } from '../application/LegendQueryNavigation.js';
45
45
 
46
46
  const QueryProductionizerSetupStoreProvider: React.FC<{
47
47
  children: React.ReactNode;
@@ -32,18 +32,10 @@ import {
32
32
  MenuContentDivider,
33
33
  AssistantIcon,
34
34
  } from '@finos/legend-art';
35
- import {
36
- getQueryParameters,
37
- getQueryParameterValue,
38
- guaranteeNonNullable,
39
- sanitizeURL,
40
- } from '@finos/legend-shared';
35
+ import { guaranteeNonNullable } from '@finos/legend-shared';
41
36
  import { observer, useLocalObservable } from 'mobx-react-lite';
42
37
  import React, { createContext, useContext, useEffect } from 'react';
43
- import {
44
- LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN,
45
- type QuerySetupQueryParams,
46
- } from '../stores/LegendQueryRouter.js';
38
+ import { LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN } from '../application/LegendQueryNavigation.js';
47
39
  import {
48
40
  QuerySetupLandingPageStore,
49
41
  type BaseQuerySetupStore,
@@ -261,24 +253,18 @@ export const QuerySetupLandingPage = withQuerySetupLandingPageStore(
261
253
  observer(() => {
262
254
  const setupStore = useQuerySetupLandingPageStore();
263
255
  const applicationStore = useLegendQueryApplicationStore();
264
- const params = getQueryParameters<QuerySetupQueryParams>(
265
- sanitizeURL(
266
- applicationStore.navigationService.navigator.getCurrentAddress(),
267
- ),
268
- true,
269
- );
270
- const showAdvancedActions = getQueryParameterValue(
271
- params,
272
- LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ADVANCED_ACTIONS,
273
- );
274
- const showAllGroups = getQueryParameterValue(
275
- params,
276
- LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ALL_GROUPS,
277
- );
278
- const tagToFocus = getQueryParameterValue(
279
- params,
280
- LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.TAG,
281
- );
256
+ const showAdvancedActions =
257
+ applicationStore.navigationService.navigator.getAddressParameterValue(
258
+ LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ADVANCED_ACTIONS,
259
+ );
260
+ const showAllGroups =
261
+ applicationStore.navigationService.navigator.getAddressParameterValue(
262
+ LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.SHOW_ALL_GROUPS,
263
+ );
264
+ const tagToFocus =
265
+ applicationStore.navigationService.navigator.getAddressParameterValue(
266
+ LEGEND_QUERY_SETUP_QUERY_PARAM_TOKEN.TAG,
267
+ );
282
268
  const goToStudio = (): void =>
283
269
  applicationStore.navigationService.navigator.visitAddress(
284
270
  applicationStore.config.studioUrl,
@@ -24,7 +24,7 @@ import { debounce, guaranteeType } from '@finos/legend-shared';
24
24
  import { flowResult } from 'mobx';
25
25
  import { observer, useLocalObservable } from 'mobx-react-lite';
26
26
  import { useContext, useEffect, useMemo, useRef, useState } from 'react';
27
- import { generateQuerySetupRoute } from '../stores/LegendQueryRouter.js';
27
+ import { generateQuerySetupRoute } from '../application/LegendQueryNavigation.js';
28
28
  import { useDepotServerClient } from '@finos/legend-server-depot';
29
29
  import { useLegendQueryApplicationStore } from './LegendQueryBaseStoreProvider.js';
30
30
  import { UpdateExistingServiceQuerySetupStore } from '../stores/UpdateExistingServiceQuerySetupStore.js';
package/src/index.ts CHANGED
@@ -14,22 +14,19 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ // application
17
18
  export * from './application/LegendQuery.js';
18
- export * from './components/LegendQueryBaseStoreProvider.js';
19
- export * from './stores/LegendQueryBaseStore.js';
20
-
21
- export {
22
- QueryEditorStoreContext,
23
- useQueryEditorStore,
24
- } from './components/QueryEditorStoreProvider.js';
25
- export { QueryEditor } from './components/QueryEditor.js';
26
-
27
- export { LegendQueryPluginManager } from './application/LegendQueryPluginManager.js';
19
+ export * from './application/LegendQueryApplicationConfig.js';
20
+ export * from './application/LegendQueryPluginManager.js';
21
+ export * from './application/LegendQueryEvent.js';
22
+ export * from './application/LegendQueryEventHelper.js';
23
+ export { useLegendQueryApplicationStore } from './components/LegendQueryBaseStoreProvider.js';
24
+ export type { LegendQueryApplicationStore } from './stores/LegendQueryBaseStore.js';
25
+ export { generateExistingQueryEditorRoute } from './application/LegendQueryNavigation.js';
28
26
 
27
+ // stores
29
28
  export * from './stores/LegendQueryApplicationPlugin.js';
30
- export * from './stores/LegendQueryRouter.js';
31
29
  export { BaseQuerySetupStore } from './stores/QuerySetupStore.js';
32
- export { LegendQueryApplicationConfig } from './application/LegendQueryApplicationConfig.js';
33
30
  export {
34
31
  createViewProjectHandler,
35
32
  createViewSDLCProjectHandler,
@@ -37,9 +34,10 @@ export {
37
34
  ExistingQueryEditorStore,
38
35
  type QueryExportConfiguration,
39
36
  } from './stores/QueryEditorStore.js';
37
+
38
+ // components
40
39
  export {
41
- LegendQueryBaseStore,
42
- type LegendQueryApplicationStore,
43
- } from './stores/LegendQueryBaseStore.js';
44
- export { LEGEND_QUERY_APP_EVENT } from './stores/LegendQueryAppEvent.js';
45
- export { LegendQueryEventService } from './stores/LegendQueryEventService.js';
40
+ QueryEditorStoreContext,
41
+ useQueryEditorStore,
42
+ } from './components/QueryEditorStoreProvider.js';
43
+ export { QueryEditor } from './components/QueryEditor.js';
@@ -31,7 +31,7 @@ import {
31
31
  } from '@finos/legend-shared';
32
32
  import type { EntitiesWithOrigin, Entity } from '@finos/legend-storage';
33
33
  import { action, flow, flowResult, makeObservable, observable } from 'mobx';
34
- import { LEGEND_QUERY_APP_EVENT } from './LegendQueryAppEvent.js';
34
+ import { LEGEND_QUERY_APP_EVENT } from '../application/LegendQueryEvent.js';
35
35
  import type { LegendQueryApplicationStore } from './LegendQueryBaseStore.js';
36
36
  import { BaseQuerySetupStore } from './QuerySetupStore.js';
37
37
  import type { Service } from '@finos/legend-graph';
@@ -39,7 +39,7 @@ import {
39
39
  makeObservable,
40
40
  observable,
41
41
  } from 'mobx';
42
- import { LEGEND_QUERY_APP_EVENT } from './LegendQueryAppEvent.js';
42
+ import { LEGEND_QUERY_APP_EVENT } from '../application/LegendQueryEvent.js';
43
43
  import type { LegendQueryApplicationStore } from './LegendQueryBaseStore.js';
44
44
  import { BaseQuerySetupStore } from './QuerySetupStore.js';
45
45
 
@@ -17,7 +17,7 @@
17
17
  import type { DepotServerClient } from '@finos/legend-server-depot';
18
18
  import {
19
19
  type ApplicationStore,
20
- ApplicationTelemetry,
20
+ LegendApplicationTelemetryHelper,
21
21
  APPLICATION_EVENT,
22
22
  } from '@finos/legend-application';
23
23
  import type { LegendQueryPluginManager } from '../application/LegendQueryPluginManager.js';
@@ -79,9 +79,7 @@ export class LegendQueryBaseStore {
79
79
  } catch (error) {
80
80
  assertErrorThrown(error);
81
81
  this.applicationStore.logService.error(
82
- LogEvent.create(
83
- APPLICATION_EVENT.APPLICATION_IDENTITY_AUTO_FETCH__FAILURE,
84
- ),
82
+ LogEvent.create(APPLICATION_EVENT.IDENTITY_AUTO_FETCH__FAILURE),
85
83
  error,
86
84
  );
87
85
  this.applicationStore.notificationService.notifyWarning(error.message);
@@ -90,7 +88,7 @@ export class LegendQueryBaseStore {
90
88
  // setup telemetry service
91
89
  this.applicationStore.telemetryService.setup();
92
90
 
93
- ApplicationTelemetry.logEvent_ApplicationInitializationSucceeded(
91
+ LegendApplicationTelemetryHelper.logEvent_ApplicationInitializationSucceeded(
94
92
  this.applicationStore.telemetryService,
95
93
  this.applicationStore,
96
94
  );
@@ -27,7 +27,7 @@ import {
27
27
  import { parseProjectIdentifier } from '@finos/legend-storage';
28
28
  import { flow, makeObservable, observable } from 'mobx';
29
29
  import type { LegendQueryApplicationStore } from './LegendQueryBaseStore.js';
30
- import { EXTERNAL_APPLICATION_NAVIGATION__generateStudioUpdateProjectServiceQueryUrl } from './LegendQueryRouter.js';
30
+ import { EXTERNAL_APPLICATION_NAVIGATION__generateStudioUpdateProjectServiceQueryUrl } from '../application/LegendQueryNavigation.js';
31
31
  import { BaseQuerySetupStore } from './QuerySetupStore.js';
32
32
 
33
33
  export class LoadProjectServiceQuerySetupStore extends BaseQuerySetupStore {