@finos/legend-application-query 5.0.2 → 5.2.2

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 (233) hide show
  1. package/lib/application/LegendQueryApplicationConfig.d.ts +19 -1
  2. package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
  3. package/lib/application/LegendQueryApplicationConfig.js +25 -1
  4. package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
  5. package/lib/components/LegendQueryApplication.d.ts.map +1 -1
  6. package/lib/components/LegendQueryApplication.js +15 -5
  7. package/lib/components/LegendQueryApplication.js.map +1 -1
  8. package/lib/components/LegendQueryBaseStoreProvider.d.ts.map +1 -1
  9. package/lib/components/LegendQueryBaseStoreProvider.js +3 -1
  10. package/lib/components/LegendQueryBaseStoreProvider.js.map +1 -1
  11. package/lib/components/QueryBuilder.d.ts.map +1 -1
  12. package/lib/components/QueryBuilder.js +3 -1
  13. package/lib/components/QueryBuilder.js.map +1 -1
  14. package/lib/components/QueryBuilderExplorerPanel.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderExplorerPanel.js +7 -34
  16. package/lib/components/QueryBuilderExplorerPanel.js.map +1 -1
  17. package/lib/components/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  18. package/lib/components/QueryBuilderFetchStructurePanel.js +77 -66
  19. package/lib/components/QueryBuilderFetchStructurePanel.js.map +1 -1
  20. package/lib/components/QueryBuilderFilterPanel.d.ts.map +1 -1
  21. package/lib/components/QueryBuilderFilterPanel.js +42 -59
  22. package/lib/components/QueryBuilderFilterPanel.js.map +1 -1
  23. package/lib/components/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  24. package/lib/components/QueryBuilderFunctionsExplorerPanel.js +9 -39
  25. package/lib/components/QueryBuilderFunctionsExplorerPanel.js.map +1 -1
  26. package/lib/components/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  27. package/lib/components/QueryBuilderGraphFetchTreePanel.js +5 -5
  28. package/lib/components/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  29. package/lib/components/QueryBuilderLambdaEditor.d.ts +1 -0
  30. package/lib/components/QueryBuilderLambdaEditor.d.ts.map +1 -1
  31. package/lib/components/QueryBuilderLambdaEditor.js +2 -2
  32. package/lib/components/QueryBuilderLambdaEditor.js.map +1 -1
  33. package/lib/components/QueryBuilderMilestoneEditor.js +5 -5
  34. package/lib/components/QueryBuilderMilestoneEditor.js.map +1 -1
  35. package/lib/components/QueryBuilderPanelIssueCountBadge.d.ts +20 -0
  36. package/lib/components/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -0
  37. package/lib/components/QueryBuilderPanelIssueCountBadge.js +28 -0
  38. package/lib/components/QueryBuilderPanelIssueCountBadge.js.map +1 -0
  39. package/lib/components/QueryBuilderParameterPanel.d.ts.map +1 -1
  40. package/lib/components/QueryBuilderParameterPanel.js +13 -33
  41. package/lib/components/QueryBuilderParameterPanel.js.map +1 -1
  42. package/lib/components/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  43. package/lib/components/QueryBuilderPostFilterPanel.js +47 -59
  44. package/lib/components/QueryBuilderPostFilterPanel.js.map +1 -1
  45. package/lib/components/QueryBuilderProjectionPanel.d.ts.map +1 -1
  46. package/lib/components/QueryBuilderProjectionPanel.js +47 -63
  47. package/lib/components/QueryBuilderProjectionPanel.js.map +1 -1
  48. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  49. package/lib/components/QueryBuilderPropertyExpressionEditor.js +11 -11
  50. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  51. package/lib/components/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  52. package/lib/components/QueryBuilderPropertySearchPanel.js +3 -6
  53. package/lib/components/QueryBuilderPropertySearchPanel.js.map +1 -1
  54. package/lib/components/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  55. package/lib/components/QueryBuilderResultModifierPanel.js +3 -1
  56. package/lib/components/QueryBuilderResultModifierPanel.js.map +1 -1
  57. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  58. package/lib/components/QueryBuilderResultPanel.js +28 -18
  59. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  60. package/lib/components/QueryBuilderSetupPanel.d.ts.map +1 -1
  61. package/lib/components/QueryBuilderSetupPanel.js +10 -9
  62. package/lib/components/QueryBuilderSetupPanel.js.map +1 -1
  63. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  64. package/lib/components/QueryBuilderUnsupportedQueryEditor.js +4 -2
  65. package/lib/components/QueryBuilderUnsupportedQueryEditor.js.map +1 -1
  66. package/lib/components/QueryEditor.d.ts.map +1 -1
  67. package/lib/components/QueryEditor.js +16 -4
  68. package/lib/components/QueryEditor.js.map +1 -1
  69. package/lib/components/QueryEditorComponentTestUtils.d.ts +2 -0
  70. package/lib/components/QueryEditorComponentTestUtils.d.ts.map +1 -1
  71. package/lib/components/QueryEditorComponentTestUtils.js +3 -2
  72. package/lib/components/QueryEditorComponentTestUtils.js.map +1 -1
  73. package/lib/components/QueryEditorStoreProvider.d.ts.map +1 -1
  74. package/lib/components/QueryEditorStoreProvider.js +7 -3
  75. package/lib/components/QueryEditorStoreProvider.js.map +1 -1
  76. package/lib/components/QuerySetupStoreProvider.d.ts.map +1 -1
  77. package/lib/components/QuerySetupStoreProvider.js +3 -1
  78. package/lib/components/QuerySetupStoreProvider.js.map +1 -1
  79. package/lib/index.css +2 -2
  80. package/lib/index.css.map +1 -1
  81. package/lib/package.json +11 -9
  82. package/lib/stores/LegendQueryBaseStore.d.ts +4 -2
  83. package/lib/stores/LegendQueryBaseStore.d.ts.map +1 -1
  84. package/lib/stores/LegendQueryBaseStore.js +5 -1
  85. package/lib/stores/LegendQueryBaseStore.js.map +1 -1
  86. package/lib/stores/QueryBuilderExplorerState.d.ts.map +1 -1
  87. package/lib/stores/QueryBuilderExplorerState.js +5 -0
  88. package/lib/stores/QueryBuilderExplorerState.js.map +1 -1
  89. package/lib/stores/QueryBuilderFetchStructureState.d.ts +8 -1
  90. package/lib/stores/QueryBuilderFetchStructureState.d.ts.map +1 -1
  91. package/lib/stores/QueryBuilderFetchStructureState.js +10 -2
  92. package/lib/stores/QueryBuilderFetchStructureState.js.map +1 -1
  93. package/lib/stores/QueryBuilderFilterState.d.ts +8 -9
  94. package/lib/stores/QueryBuilderFilterState.d.ts.map +1 -1
  95. package/lib/stores/QueryBuilderFilterState.js +34 -13
  96. package/lib/stores/QueryBuilderFilterState.js.map +1 -1
  97. package/lib/stores/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  98. package/lib/stores/QueryBuilderGraphFetchTreeState.js +6 -3
  99. package/lib/stores/QueryBuilderGraphFetchTreeState.js.map +1 -1
  100. package/lib/stores/QueryBuilderLambdaProcessor.d.ts.map +1 -1
  101. package/lib/stores/QueryBuilderLambdaProcessor.js +2 -0
  102. package/lib/stores/QueryBuilderLambdaProcessor.js.map +1 -1
  103. package/lib/stores/QueryBuilderOperatorLoader.d.ts +47 -0
  104. package/lib/stores/QueryBuilderOperatorLoader.d.ts.map +1 -0
  105. package/lib/stores/QueryBuilderOperatorLoader.js +94 -0
  106. package/lib/stores/QueryBuilderOperatorLoader.js.map +1 -0
  107. package/lib/stores/QueryBuilderPostFilterState.d.ts +9 -6
  108. package/lib/stores/QueryBuilderPostFilterState.d.ts.map +1 -1
  109. package/lib/stores/QueryBuilderPostFilterState.js +31 -7
  110. package/lib/stores/QueryBuilderPostFilterState.js.map +1 -1
  111. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts +4 -3
  112. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
  113. package/lib/stores/QueryBuilderPreviewDataHelper.js +77 -97
  114. package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
  115. package/lib/stores/QueryBuilderProjectionState.d.ts +4 -8
  116. package/lib/stores/QueryBuilderProjectionState.d.ts.map +1 -1
  117. package/lib/stores/QueryBuilderProjectionState.js +17 -44
  118. package/lib/stores/QueryBuilderProjectionState.js.map +1 -1
  119. package/lib/stores/QueryBuilderSetupState.js +1 -1
  120. package/lib/stores/QueryBuilderSetupState.js.map +1 -1
  121. package/lib/stores/QueryBuilderState.d.ts +7 -1
  122. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  123. package/lib/stores/QueryBuilderState.js +17 -60
  124. package/lib/stores/QueryBuilderState.js.map +1 -1
  125. package/lib/stores/QueryBuilderTestUtils.d.ts +24 -0
  126. package/lib/stores/QueryBuilderTestUtils.d.ts.map +1 -0
  127. package/lib/stores/QueryBuilderTestUtils.js +49 -0
  128. package/lib/stores/QueryBuilderTestUtils.js.map +1 -0
  129. package/lib/stores/QueryBuilderTypeaheadHelper.d.ts +24 -0
  130. package/lib/stores/QueryBuilderTypeaheadHelper.d.ts.map +1 -0
  131. package/lib/stores/QueryBuilderTypeaheadHelper.js +89 -0
  132. package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -0
  133. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  134. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +7 -7
  135. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  136. package/lib/stores/QueryEditorStore.d.ts +6 -4
  137. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  138. package/lib/stores/QueryEditorStore.js +23 -10
  139. package/lib/stores/QueryEditorStore.js.map +1 -1
  140. package/lib/stores/QueryEditorStoreTestUtils.d.ts.map +1 -1
  141. package/lib/stores/QueryEditorStoreTestUtils.js +1 -0
  142. package/lib/stores/QueryEditorStoreTestUtils.js.map +1 -1
  143. package/lib/stores/QueryFunctionsExplorerState.d.ts +2 -6
  144. package/lib/stores/QueryFunctionsExplorerState.d.ts.map +1 -1
  145. package/lib/stores/QueryFunctionsExplorerState.js +2 -11
  146. package/lib/stores/QueryFunctionsExplorerState.js.map +1 -1
  147. package/lib/stores/QueryParametersState.d.ts +1 -3
  148. package/lib/stores/QueryParametersState.d.ts.map +1 -1
  149. package/lib/stores/QueryParametersState.js +1 -4
  150. package/lib/stores/QueryParametersState.js.map +1 -1
  151. package/lib/stores/QuerySetupStore.d.ts +3 -1
  152. package/lib/stores/QuerySetupStore.d.ts.map +1 -1
  153. package/lib/stores/QuerySetupStore.js +3 -1
  154. package/lib/stores/QuerySetupStore.js.map +1 -1
  155. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
  156. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.js +4 -1
  157. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.js.map +1 -1
  158. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
  159. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.js +4 -1
  160. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
  161. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  162. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.js +4 -1
  163. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
  164. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
  165. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.js +4 -1
  166. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
  167. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
  168. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.js +4 -1
  169. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
  170. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  171. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.js +4 -1
  172. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  173. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  174. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.js +4 -1
  175. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  176. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  177. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.js +4 -1
  178. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  179. package/package.json +18 -16
  180. package/src/application/LegendQueryApplicationConfig.ts +41 -2
  181. package/src/components/LegendQueryApplication.tsx +27 -10
  182. package/src/components/LegendQueryBaseStoreProvider.tsx +3 -0
  183. package/src/components/QueryBuilder.tsx +13 -2
  184. package/src/components/QueryBuilderExplorerPanel.tsx +17 -56
  185. package/src/components/QueryBuilderFetchStructurePanel.tsx +93 -77
  186. package/src/components/QueryBuilderFilterPanel.tsx +205 -219
  187. package/src/components/QueryBuilderFunctionsExplorerPanel.tsx +24 -68
  188. package/src/components/QueryBuilderGraphFetchTreePanel.tsx +34 -25
  189. package/src/components/QueryBuilderLambdaEditor.tsx +3 -0
  190. package/src/components/QueryBuilderMilestoneEditor.tsx +34 -34
  191. package/src/components/QueryBuilderPanelIssueCountBadge.tsx +38 -0
  192. package/src/components/QueryBuilderParameterPanel.tsx +23 -55
  193. package/src/components/QueryBuilderPostFilterPanel.tsx +223 -230
  194. package/src/components/QueryBuilderProjectionPanel.tsx +127 -154
  195. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +61 -57
  196. package/src/components/QueryBuilderPropertySearchPanel.tsx +8 -9
  197. package/src/components/QueryBuilderResultModifierPanel.tsx +4 -2
  198. package/src/components/QueryBuilderResultPanel.tsx +75 -50
  199. package/src/components/QueryBuilderSetupPanel.tsx +13 -12
  200. package/src/components/QueryBuilderUnsupportedQueryEditor.tsx +4 -2
  201. package/src/components/QueryEditor.tsx +39 -1
  202. package/src/components/QueryEditorComponentTestUtils.tsx +15 -5
  203. package/src/components/QueryEditorStoreProvider.tsx +7 -0
  204. package/src/components/QuerySetupStoreProvider.tsx +3 -0
  205. package/src/stores/LegendQueryBaseStore.ts +14 -1
  206. package/src/stores/QueryBuilderExplorerState.ts +5 -0
  207. package/src/stores/QueryBuilderFetchStructureState.ts +18 -2
  208. package/src/stores/QueryBuilderFilterState.ts +50 -12
  209. package/src/stores/QueryBuilderGraphFetchTreeState.ts +14 -8
  210. package/src/stores/QueryBuilderLambdaProcessor.ts +8 -0
  211. package/src/stores/QueryBuilderOperatorLoader.ts +133 -0
  212. package/src/stores/QueryBuilderPostFilterState.ts +47 -8
  213. package/src/stores/QueryBuilderPreviewDataHelper.ts +122 -217
  214. package/src/stores/QueryBuilderProjectionState.ts +30 -58
  215. package/src/stores/QueryBuilderSetupState.ts +1 -1
  216. package/src/stores/QueryBuilderState.ts +33 -96
  217. package/src/stores/QueryBuilderTestUtils.ts +93 -0
  218. package/src/stores/QueryBuilderTypeaheadHelper.ts +149 -0
  219. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +9 -7
  220. package/src/stores/QueryEditorStore.ts +29 -6
  221. package/src/stores/QueryEditorStoreTestUtils.ts +1 -0
  222. package/src/stores/QueryFunctionsExplorerState.ts +1 -11
  223. package/src/stores/QueryParametersState.ts +1 -3
  224. package/src/stores/QuerySetupStore.ts +4 -0
  225. package/src/stores/filterOperators/QueryBuilderFilterOperator_Equal.ts +8 -1
  226. package/src/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.ts +8 -1
  227. package/src/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.ts +8 -1
  228. package/src/stores/filterOperators/QueryBuilderFilterOperator_LessThan.ts +8 -1
  229. package/src/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.ts +8 -1
  230. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.ts +8 -1
  231. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.ts +8 -1
  232. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.ts +8 -1
  233. package/tsconfig.json +4 -0
@@ -17,12 +17,40 @@
17
17
  import {
18
18
  assertNonNullable,
19
19
  guaranteeNonEmptyString,
20
+ SerializationFactory,
21
+ type PlainObject,
20
22
  } from '@finos/legend-shared';
21
23
  import {
22
24
  LegendApplicationConfig,
23
25
  type LegendApplicationConfigurationInput,
24
26
  type LegendApplicationConfigurationData,
25
27
  } from '@finos/legend-application';
28
+ import { createModelSchema, optional, primitive } from 'serializr';
29
+
30
+ class LegendQueryApplicationCoreOptions {
31
+ /**
32
+ * Indicates if we should enable theme switcher.
33
+ *
34
+ * NOTE: support for theme switcher is fairly basic at the moment, so we really should
35
+ * just keep this feature as a beta.
36
+ *
37
+ * This flag will be kept until we have full support for themeing
38
+ * See https://github.com/finos/legend-studio/issues/264
39
+ */
40
+ TEMPORARY__enableThemeSwitcher = false;
41
+
42
+ private static readonly serialization = new SerializationFactory(
43
+ createModelSchema(LegendQueryApplicationCoreOptions, {
44
+ TEMPORARY__enableThemeSwitcher: optional(primitive()),
45
+ }),
46
+ );
47
+
48
+ static create(
49
+ configData: PlainObject<LegendQueryApplicationCoreOptions>,
50
+ ): LegendQueryApplicationCoreOptions {
51
+ return LegendQueryApplicationCoreOptions.serialization.fromJson(configData);
52
+ }
53
+ }
26
54
 
27
55
  export interface LegendQueryApplicationConfigurationData
28
56
  extends LegendApplicationConfigurationData {
@@ -38,15 +66,17 @@ export interface LegendQueryApplicationConfigurationData
38
66
  TEMPORARY__useLegacyDepotServerAPIRoutes?: boolean;
39
67
  };
40
68
  engine: { url: string; queryUrl?: string };
41
- studio: { url: string };
42
- extensions?: Record<PropertyKey, unknown>;
69
+ studio: { url: string; sdlcUrl: string };
43
70
  }
44
71
 
45
72
  export class LegendQueryApplicationConfig extends LegendApplicationConfig {
73
+ readonly options = new LegendQueryApplicationCoreOptions();
74
+
46
75
  readonly engineServerUrl: string;
47
76
  readonly engineQueryServerUrl?: string | undefined;
48
77
  readonly depotServerUrl: string;
49
78
  readonly studioUrl: string;
79
+ readonly sdlcUrl: string;
50
80
  readonly TEMPORARY__useLegacyDepotServerAPIRoutes?: boolean | undefined;
51
81
 
52
82
  constructor(
@@ -71,7 +101,16 @@ export class LegendQueryApplicationConfig extends LegendApplicationConfig {
71
101
  input.configData.studio.url,
72
102
  `Can't configure application: 'studio.url' field is missing or empty`,
73
103
  );
104
+ this.sdlcUrl = guaranteeNonEmptyString(
105
+ input.configData.studio.sdlcUrl,
106
+ `Can't configure application: 'studio.sdlcUrl' field is missing or empty`,
107
+ );
74
108
  this.TEMPORARY__useLegacyDepotServerAPIRoutes =
75
109
  input.configData.depot.TEMPORARY__useLegacyDepotServerAPIRoutes;
110
+
111
+ this.options = LegendQueryApplicationCoreOptions.create(
112
+ (input.configData.extensions?.core ??
113
+ {}) as PlainObject<LegendQueryApplicationCoreOptions>,
114
+ );
76
115
  }
77
116
  }
@@ -33,13 +33,23 @@ import type { LegendQueryApplicationConfig } from '../application/LegendQueryApp
33
33
  import {
34
34
  LegendQueryBaseStoreProvider,
35
35
  useLegendQueryApplicationStore,
36
+ useLegendQueryBaseStore,
36
37
  } from './LegendQueryBaseStoreProvider.js';
38
+ import { SDLCServerClientProvider } from '@finos/legend-server-sdlc';
39
+ import { useEffect } from 'react';
40
+ import { flowResult } from 'mobx';
37
41
 
38
42
  const LegendQueryApplicationRoot = observer(() => {
43
+ const baseStore = useLegendQueryBaseStore();
39
44
  const applicationStore = useLegendQueryApplicationStore();
40
45
  const extraApplicationPageEntries = applicationStore.pluginManager
41
46
  .getApplicationPlugins()
42
47
  .flatMap((plugin) => plugin.getExtraApplicationPageEntries?.() ?? []);
48
+ useEffect(() => {
49
+ flowResult(
50
+ baseStore.applicationSDLCSetupState.initializeSDLCServerClient(),
51
+ ).catch(applicationStore.alertUnhandledError);
52
+ }, [applicationStore, baseStore]);
43
53
 
44
54
  return (
45
55
  <div className="app">
@@ -86,19 +96,26 @@ export const LegendQueryApplication = observer(
86
96
  const { config, pluginManager } = props;
87
97
 
88
98
  return (
89
- <DepotServerClientProvider
99
+ <SDLCServerClientProvider
90
100
  config={{
91
- serverUrl: config.depotServerUrl,
92
- TEMPORARY__useLegacyDepotServerAPIRoutes:
93
- config.TEMPORARY__useLegacyDepotServerAPIRoutes,
101
+ env: config.env,
102
+ serverUrl: config.sdlcUrl,
94
103
  }}
95
104
  >
96
- <LegendQueryBaseStoreProvider pluginManager={pluginManager}>
97
- <LegendApplicationComponentFrameworkProvider>
98
- <LegendQueryApplicationRoot />
99
- </LegendApplicationComponentFrameworkProvider>
100
- </LegendQueryBaseStoreProvider>
101
- </DepotServerClientProvider>
105
+ <DepotServerClientProvider
106
+ config={{
107
+ serverUrl: config.depotServerUrl,
108
+ TEMPORARY__useLegacyDepotServerAPIRoutes:
109
+ config.TEMPORARY__useLegacyDepotServerAPIRoutes,
110
+ }}
111
+ >
112
+ <LegendQueryBaseStoreProvider pluginManager={pluginManager}>
113
+ <LegendApplicationComponentFrameworkProvider>
114
+ <LegendQueryApplicationRoot />
115
+ </LegendApplicationComponentFrameworkProvider>
116
+ </LegendQueryBaseStoreProvider>
117
+ </DepotServerClientProvider>
118
+ </SDLCServerClientProvider>
102
119
  );
103
120
  },
104
121
  );
@@ -26,6 +26,7 @@ import {
26
26
  type ApplicationStore,
27
27
  useApplicationStore,
28
28
  } from '@finos/legend-application';
29
+ import { useSDLCServerClient } from '@finos/legend-server-sdlc';
29
30
 
30
31
  export const useLegendQueryApplicationStore = (): ApplicationStore<
31
32
  LegendQueryApplicationConfig,
@@ -46,11 +47,13 @@ export const LegendQueryBaseStoreProvider: React.FC<{
46
47
  }> = ({ children, pluginManager }) => {
47
48
  const applicationStore = useLegendQueryApplicationStore();
48
49
  const depotServerClient = useDepotServerClient();
50
+ const sdlcServerClient = useSDLCServerClient();
49
51
  const store = useLocalObservable(
50
52
  () =>
51
53
  new LegendQueryBaseStore(
52
54
  applicationStore,
53
55
  depotServerClient,
56
+ sdlcServerClient,
54
57
  pluginManager,
55
58
  ),
56
59
  );
@@ -176,7 +176,13 @@ export const QueryBuilder = observer(
176
176
  Show Function(s)
177
177
  </MenuContentItemLabel>
178
178
  </MenuContentItem>
179
- <MenuContentItem onClick={toggleShowParameterPanel}>
179
+ <MenuContentItem
180
+ onClick={toggleShowParameterPanel}
181
+ disabled={
182
+ queryBuilderState.queryParametersState.parameterStates
183
+ .length > 0
184
+ }
185
+ >
180
186
  <MenuContentItemIcon>
181
187
  {queryBuilderState.showParameterPanel ? (
182
188
  <CheckIcon />
@@ -188,7 +194,12 @@ export const QueryBuilder = observer(
188
194
  </MenuContentItem>
189
195
  <MenuContentItem
190
196
  onClick={toggleShowPostFilterPanel}
191
- disabled={queryBuilderState.fetchStructureState.isGraphFetchMode()}
197
+ disabled={
198
+ queryBuilderState.fetchStructureState.isGraphFetchMode() ||
199
+ Array.from(
200
+ queryBuilderState.postFilterState.nodes.values(),
201
+ ).length > 0
202
+ }
192
203
  >
193
204
  <MenuContentItemIcon>
194
205
  {queryBuilderState.showPostFilterPanel ? (
@@ -46,6 +46,8 @@ import {
46
46
  CheckIcon,
47
47
  SearchIcon,
48
48
  PanelLoadingIndicator,
49
+ DragPreviewLayer,
50
+ useDragPreviewLayer,
49
51
  } from '@finos/legend-art';
50
52
  import {
51
53
  type QueryBuilderExplorerTreeDragSource,
@@ -58,9 +60,8 @@ import {
58
60
  getQueryBuilderPropertyNodeData,
59
61
  getQueryBuilderSubTypeNodeData,
60
62
  } from '../stores/QueryBuilderExplorerState.js';
61
- import { useDrag, useDragLayer } from 'react-dnd';
63
+ import { useDrag } from 'react-dnd';
62
64
  import { QueryBuilderPropertyInfoTooltip } from './QueryBuilderPropertyInfoTooltip.js';
63
- import { getEmptyImage } from 'react-dnd-html5-backend';
64
65
  import type { QueryBuilderState } from '../stores/QueryBuilderState.js';
65
66
  import { addQueryBuilderPropertyNode } from '../stores/QueryBuilderGraphFetchTreeUtil.js';
66
67
  import { QueryBuilderSimpleProjectionColumnState } from '../stores/QueryBuilderProjectionState.js';
@@ -233,51 +234,6 @@ const QueryBuilderExplorerPreviewDataModal = observer(
233
234
  },
234
235
  );
235
236
 
236
- const QueryBuilderExplorerPropertyDragLayer = observer(
237
- (props: { queryBuilderState: QueryBuilderState }) => {
238
- const { queryBuilderState } = props;
239
- const explorerState = queryBuilderState.explorerState;
240
- const { itemType, item, isDragging, currentPosition } = useDragLayer(
241
- (monitor) => ({
242
- itemType: monitor.getItemType() as QUERY_BUILDER_EXPLORER_TREE_DND_TYPE,
243
- item: monitor.getItem<QueryBuilderExplorerTreeDragSource | null>(),
244
- isDragging: monitor.isDragging(),
245
- initialOffset: monitor.getInitialSourceClientOffset(),
246
- currentPosition: monitor.getClientOffset(),
247
- }),
248
- );
249
-
250
- if (
251
- !isDragging ||
252
- !item ||
253
- !Object.values(QUERY_BUILDER_EXPLORER_TREE_DND_TYPE).includes(itemType)
254
- ) {
255
- return null;
256
- }
257
- return (
258
- <div className="query-builder-explorer-tree__drag-preview-layer">
259
- <div
260
- className="query-builder-explorer-tree__drag-preview"
261
- // added some offset so the mouse doesn't overlap the label too much
262
- style={
263
- !currentPosition
264
- ? { display: 'none' }
265
- : {
266
- transform: `translate(${currentPosition.x + 20}px, ${
267
- currentPosition.y + 10
268
- }px)`,
269
- }
270
- }
271
- >
272
- {explorerState.humanizePropertyName
273
- ? prettyPropertyName(item.node.label)
274
- : item.node.label}
275
- </div>
276
- </div>
277
- );
278
- },
279
- );
280
-
281
237
  const QueryBuilderExplorerContextMenu = observer(
282
238
  forwardRef<
283
239
  HTMLDivElement,
@@ -442,7 +398,9 @@ const QueryBuilderExplorerTreeNodeContainer = observer(
442
398
  useState(false);
443
399
  const applicationStore = useApplicationStore();
444
400
  const explorerState = queryBuilderState.explorerState;
445
- const [, dragConnector, dragPreviewConnector] = useDrag(
401
+ const [, dragConnector, dragPreviewConnector] = useDrag<{
402
+ node?: QueryBuilderExplorerTreePropertyNodeData;
403
+ }>(
446
404
  () => ({
447
405
  type:
448
406
  node instanceof QueryBuilderExplorerTreePropertyNodeData
@@ -452,13 +410,15 @@ const QueryBuilderExplorerTreeNodeContainer = observer(
452
410
  ? QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.CLASS_PROPERTY
453
411
  : QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.PRIMITIVE_PROPERTY
454
412
  : QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.ROOT,
455
- item: (): { node?: QueryBuilderExplorerTreePropertyNodeData } =>
413
+ item: () =>
456
414
  node instanceof QueryBuilderExplorerTreePropertyNodeData
457
415
  ? { node }
458
416
  : {},
459
417
  }),
460
418
  [node],
461
419
  );
420
+ useDragPreviewLayer(dragPreviewConnector);
421
+
462
422
  const isExpandable = Boolean(node.childrenIds.length);
463
423
  const isDerivedProperty =
464
424
  node instanceof QueryBuilderExplorerTreePropertyNodeData &&
@@ -506,10 +466,6 @@ const QueryBuilderExplorerTreeNodeContainer = observer(
506
466
  ).catch(applicationStore.alertUnhandledError);
507
467
  }
508
468
  };
509
- // hide default HTML5 preview image
510
- useEffect(() => {
511
- dragPreviewConnector(getEmptyImage(), { captureDraggingState: true });
512
- }, [dragPreviewConnector]);
513
469
 
514
470
  if (!node.mappingData.mapped && !explorerState.showUnmappedProperties) {
515
471
  return null;
@@ -595,7 +551,7 @@ const QueryBuilderExplorerTreeNodeContainer = observer(
595
551
  >
596
552
  <div
597
553
  className={clsx(
598
- 'query-builder-explorer-tree__node__label--property--name',
554
+ 'query-builder-explorer-tree__node__label--property__name',
599
555
  {
600
556
  'query-builder-explorer-tree__node__label--deprecated':
601
557
  checkForDeprecatedNode(
@@ -968,8 +924,13 @@ export const QueryBuilderExplorerPanel = observer(
968
924
  explorerState.mappingModelCoverageAnalysisState.isInProgress
969
925
  }
970
926
  />
971
- <QueryBuilderExplorerPropertyDragLayer
972
- queryBuilderState={queryBuilderState}
927
+ <DragPreviewLayer
928
+ labelGetter={(item: QueryBuilderExplorerTreeDragSource): string =>
929
+ explorerState.humanizePropertyName
930
+ ? prettyPropertyName(item.node.label)
931
+ : item.node.label
932
+ }
933
+ types={Object.values(QUERY_BUILDER_EXPLORER_TREE_DND_TYPE)}
973
934
  />
974
935
  {explorerState.mappingModelCoverageAnalysisState.isInProgress ? (
975
936
  <BlankPanelContent>
@@ -34,6 +34,7 @@ import {
34
34
  } from '@finos/legend-application';
35
35
  import { QueryBuilderProjectionState } from '../stores/QueryBuilderProjectionState.js';
36
36
  import { QueryBuilderGraphFetchTreeState } from '../stores/QueryBuilderGraphFetchTreeState.js';
37
+ import { QueryBuilderPanelIssueCountBadge } from './QueryBuilderPanelIssueCountBadge.js';
37
38
 
38
39
  const QueryBuilderUnsupportedFetchStructure = observer(
39
40
  (props: { mode: FETCH_STRUCTURE_MODE }) => {
@@ -89,84 +90,96 @@ export const QueryBuilderFetchStructurePanel = observer(
89
90
  const onChangeFetchStructureMode =
90
91
  (fetchMode: FETCH_STRUCTURE_MODE): (() => void) =>
91
92
  (): void => {
93
+ const reset = (): void => {
94
+ fetchStructureState.setFetchStructureMode(fetchMode);
95
+ queryBuilderState.changeFetchStructure();
96
+ queryBuilderState.postFilterState = new QueryBuilderPostFilterState(
97
+ queryBuilderState,
98
+ queryBuilderState.postFilterOperators,
99
+ );
100
+ queryBuilderState.setShowPostFilterPanel(false);
101
+ };
92
102
  if (fetchStructureState.fetchStructureMode !== fetchMode) {
93
- if (
94
- fetchMode === FETCH_STRUCTURE_MODE.GRAPH_FETCH &&
95
- queryBuilderState.fetchStructureState.projectionState.columns
96
- .length > 0
97
- ) {
98
- applicationStore.setActionAlertInfo({
99
- message:
100
- queryBuilderState.showPostFilterPanel &&
101
- queryBuilderState.postFilterState.nodes.size > 0
102
- ? 'With graph fetch, post filter is not supported. Current projection columns and post filters will be lost when switching to the graph fetch panel. Do you still want to proceed?'
103
- : 'Current projection columns will be lost when switching to the graph fetch panel. Do you still want to proceed?',
104
- type: ActionAlertType.CAUTION,
105
- actions: [
106
- {
107
- label: 'Proceed',
108
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
109
- handler: applicationStore.guardUnhandledError(async () => {
110
- fetchStructureState.setFetchStructureMode(fetchMode);
111
- queryBuilderState.changeFetchStructure();
112
- queryBuilderState.fetchStructureState.projectionState =
113
- new QueryBuilderProjectionState(queryBuilderState);
114
- queryBuilderState.postFilterState =
115
- new QueryBuilderPostFilterState(
116
- queryBuilderState,
117
- queryBuilderState.postFilterOperators,
118
- );
119
- queryBuilderState.setShowPostFilterPanel(false);
120
- }),
121
- },
122
- {
123
- label: 'Cancel',
124
- type: ActionAlertActionType.PROCEED,
125
- default: true,
126
- },
127
- ],
128
- });
129
- } else if (
130
- fetchMode === FETCH_STRUCTURE_MODE.PROJECTION &&
131
- queryBuilderState.fetchStructureState.graphFetchTreeState.treeData
132
- ?.rootIds.length
133
- ) {
134
- applicationStore.setActionAlertInfo({
135
- message:
136
- 'Current graph fetch nodes will be lost when switching to the projection panel. Do you still want to proceed?',
137
- type: ActionAlertType.CAUTION,
138
- actions: [
139
- {
140
- label: 'Proceed',
141
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
142
- handler: applicationStore.guardUnhandledError(async () => {
143
- fetchStructureState.setFetchStructureMode(fetchMode);
144
- queryBuilderState.changeFetchStructure();
145
- queryBuilderState.fetchStructureState.graphFetchTreeState =
146
- new QueryBuilderGraphFetchTreeState(queryBuilderState);
147
- queryBuilderState.postFilterState =
148
- new QueryBuilderPostFilterState(
149
- queryBuilderState,
150
- queryBuilderState.postFilterOperators,
151
- );
152
- queryBuilderState.setShowPostFilterPanel(false);
153
- }),
154
- },
155
- {
156
- label: 'Cancel',
157
- type: ActionAlertActionType.PROCEED,
158
- default: true,
159
- },
160
- ],
161
- });
162
- } else {
163
- fetchStructureState.setFetchStructureMode(fetchMode);
164
- queryBuilderState.changeFetchStructure();
165
- queryBuilderState.postFilterState = new QueryBuilderPostFilterState(
166
- queryBuilderState,
167
- queryBuilderState.postFilterOperators,
168
- );
169
- queryBuilderState.setShowPostFilterPanel(false);
103
+ switch (fetchMode) {
104
+ case FETCH_STRUCTURE_MODE.GRAPH_FETCH: {
105
+ if (
106
+ queryBuilderState.fetchStructureState.projectionState.columns
107
+ .length > 0
108
+ // NOTE: here we could potentially check for the presence of post-filter as well
109
+ // but we make the assumption that if there is no projection column, there should
110
+ // not be any post-filter at all
111
+ ) {
112
+ applicationStore.setActionAlertInfo({
113
+ message:
114
+ queryBuilderState.showPostFilterPanel &&
115
+ queryBuilderState.postFilterState.nodes.size > 0
116
+ ? 'With graph-fetch mode, post filter is not supported. Current projection columns and post filters will be lost when switching to the graph-fetch mode. Do you still want to proceed?'
117
+ : 'Current projection columns will be lost when switching to the graph-fetch mode. Do you still want to proceed?',
118
+ type: ActionAlertType.CAUTION,
119
+ actions: [
120
+ {
121
+ label: 'Proceed',
122
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
123
+ handler: applicationStore.guardUnhandledError(
124
+ async () => {
125
+ queryBuilderState.fetchStructureState.projectionState =
126
+ new QueryBuilderProjectionState(
127
+ queryBuilderState,
128
+ queryBuilderState.fetchStructureState.projectionState.aggregationState.operators,
129
+ );
130
+ reset();
131
+ },
132
+ ),
133
+ },
134
+ {
135
+ label: 'Cancel',
136
+ type: ActionAlertActionType.PROCEED,
137
+ default: true,
138
+ },
139
+ ],
140
+ });
141
+ } else {
142
+ reset();
143
+ }
144
+ return;
145
+ }
146
+ case FETCH_STRUCTURE_MODE.PROJECTION: {
147
+ if (
148
+ queryBuilderState.fetchStructureState.graphFetchTreeState
149
+ .treeData?.rootIds.length
150
+ ) {
151
+ applicationStore.setActionAlertInfo({
152
+ message:
153
+ 'Current graph-fetch will be lost when switching to projection mode. Do you still want to proceed?',
154
+ type: ActionAlertType.CAUTION,
155
+ actions: [
156
+ {
157
+ label: 'Proceed',
158
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
159
+ handler: applicationStore.guardUnhandledError(
160
+ async () => {
161
+ queryBuilderState.fetchStructureState.graphFetchTreeState =
162
+ new QueryBuilderGraphFetchTreeState(
163
+ queryBuilderState,
164
+ );
165
+ reset();
166
+ },
167
+ ),
168
+ },
169
+ {
170
+ label: 'Cancel',
171
+ type: ActionAlertActionType.PROCEED,
172
+ default: true,
173
+ },
174
+ ],
175
+ });
176
+ } else {
177
+ reset();
178
+ }
179
+ return;
180
+ }
181
+ default:
182
+ return;
170
183
  }
171
184
  }
172
185
  };
@@ -176,6 +189,9 @@ export const QueryBuilderFetchStructurePanel = observer(
176
189
  <div className="panel__header">
177
190
  <div className="panel__header__title">
178
191
  <div className="panel__header__title__label">fetch structure</div>
192
+ <QueryBuilderPanelIssueCountBadge
193
+ issues={fetchStructureState.validationIssues}
194
+ />
179
195
  </div>
180
196
  <div className="panel__header__actions">
181
197
  {fetchStructureStateMode === FETCH_STRUCTURE_MODE.PROJECTION && (