@finos/legend-query-builder 4.14.35 → 4.14.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +2 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +1 -0
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/__lib__/QueryBuilderTesting.d.ts +1 -0
  6. package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
  7. package/lib/__lib__/QueryBuilderTesting.js +1 -0
  8. package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
  9. package/lib/components/QueryBuilder.d.ts.map +1 -1
  10. package/lib/components/QueryBuilder.js +55 -19
  11. package/lib/components/QueryBuilder.js.map +1 -1
  12. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  13. package/lib/components/QueryBuilderConstantExpressionPanel.js +30 -13
  14. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  15. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  16. package/lib/components/QueryBuilderPropertyExpressionEditor.js +2 -1
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  18. package/lib/components/QueryBuilderSideBar.d.ts +0 -16
  19. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  20. package/lib/components/QueryBuilderSideBar.js +32 -104
  21. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  22. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  23. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +2 -1
  24. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  25. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  26. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +50 -5
  27. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  28. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -1
  30. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  31. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  32. package/lib/components/filter/QueryBuilderFilterPanel.js +2 -1
  33. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  34. package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
  35. package/lib/components/result/QueryBuilderResultPanel.js +18 -6
  36. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
  37. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  38. package/lib/components/shared/BasicValueSpecificationEditor.js +62 -28
  39. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  40. package/lib/components/shared/CustomDatePicker.d.ts +1 -0
  41. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
  42. package/lib/components/shared/CustomDatePicker.js +13 -9
  43. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  44. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +1 -0
  45. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  46. package/lib/components/shared/QueryBuilderVariableSelector.js +2 -2
  47. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  48. package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
  49. package/lib/components/workflows/ClassQueryBuilder.js +19 -16
  50. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  51. package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
  52. package/lib/components/workflows/MappingQueryBuilder.js +18 -15
  53. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  54. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  55. package/lib/components/workflows/ServiceQueryBuilder.js +13 -10
  56. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  57. package/lib/index.css +2 -2
  58. package/lib/index.css.map +1 -1
  59. package/lib/index.d.ts +2 -1
  60. package/lib/index.d.ts.map +1 -1
  61. package/lib/index.js +1 -0
  62. package/lib/index.js.map +1 -1
  63. package/lib/package.json +1 -1
  64. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
  65. package/lib/stores/QueryBuilderConstantsState.js +2 -1
  66. package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
  67. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +1 -1
  68. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  69. package/lib/stores/QueryBuilderPropertyEditorState.js +12 -34
  70. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  71. package/lib/stores/QueryBuilderState.d.ts +3 -0
  72. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  73. package/lib/stores/QueryBuilderState.js +15 -1
  74. package/lib/stores/QueryBuilderState.js.map +1 -1
  75. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  76. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  77. package/lib/stores/QueryBuilderValueSpecificationHelper.js +23 -1
  78. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  79. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +29 -0
  80. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  81. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -0
  82. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  83. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +2 -0
  84. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  85. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -0
  86. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  87. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +6 -0
  88. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  89. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
  90. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  91. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -0
  92. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  93. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +3 -0
  94. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  95. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +42 -3
  96. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  97. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
  98. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +6 -5
  99. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  100. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
  101. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +6 -5
  102. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  103. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  104. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +8 -37
  105. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  106. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  107. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +7 -10
  108. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  109. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  110. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +7 -10
  111. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  112. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
  113. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +6 -5
  114. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  115. package/lib/stores/filter/QueryBuilderFilterState.d.ts +3 -0
  116. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  117. package/lib/stores/filter/QueryBuilderFilterState.js +30 -2
  118. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  119. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
  120. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +5 -4
  121. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js.map +1 -1
  122. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.d.ts.map +1 -1
  123. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js +5 -4
  124. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js.map +1 -1
  125. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
  126. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js +7 -35
  127. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js.map +1 -1
  128. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
  129. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js +6 -8
  130. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
  131. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  132. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js +6 -8
  133. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
  134. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
  135. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +6 -8
  136. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
  137. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
  138. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js +6 -8
  139. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
  140. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.d.ts.map +1 -1
  141. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js +5 -4
  142. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
  143. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts +5 -0
  144. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts.map +1 -1
  145. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js +7 -0
  146. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js.map +1 -1
  147. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +1 -1
  148. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  149. package/lib/stores/shared/ValueSpecificationEditorHelper.js +20 -10
  150. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  151. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +0 -2
  152. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
  153. package/lib/stores/watermark/QueryBuilderWatermarkState.js +0 -6
  154. package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
  155. package/lib/stores/workflows/MappingQueryBuilderState.d.ts +2 -2
  156. package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
  157. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -1
  158. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  159. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -2
  160. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  161. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -1
  162. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  163. package/package.json +4 -4
  164. package/src/__lib__/QueryBuilderDocumentation.ts +1 -0
  165. package/src/__lib__/QueryBuilderTesting.ts +1 -0
  166. package/src/components/QueryBuilder.tsx +179 -54
  167. package/src/components/QueryBuilderConstantExpressionPanel.tsx +36 -14
  168. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +2 -0
  169. package/src/components/QueryBuilderSideBar.tsx +138 -339
  170. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +6 -1
  171. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +139 -1
  172. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +17 -0
  173. package/src/components/filter/QueryBuilderFilterPanel.tsx +6 -0
  174. package/src/components/result/QueryBuilderResultPanel.tsx +63 -6
  175. package/src/components/shared/BasicValueSpecificationEditor.tsx +96 -34
  176. package/src/components/shared/CustomDatePicker.tsx +18 -11
  177. package/src/components/shared/QueryBuilderVariableSelector.tsx +2 -2
  178. package/src/components/workflows/ClassQueryBuilder.tsx +79 -77
  179. package/src/components/workflows/MappingQueryBuilder.tsx +75 -76
  180. package/src/components/workflows/ServiceQueryBuilder.tsx +71 -70
  181. package/src/index.ts +2 -1
  182. package/src/stores/QueryBuilderConstantsState.ts +2 -0
  183. package/src/stores/QueryBuilderPropertyEditorState.ts +15 -53
  184. package/src/stores/QueryBuilderState.ts +23 -1
  185. package/src/stores/QueryBuilderValueSpecificationHelper.ts +32 -0
  186. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +39 -0
  187. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +4 -0
  188. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +8 -0
  189. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +32 -0
  190. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +59 -0
  191. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +5 -5
  192. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +5 -5
  193. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +10 -69
  194. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +7 -18
  195. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +7 -18
  196. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +5 -5
  197. package/src/stores/filter/QueryBuilderFilterState.ts +48 -2
  198. package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +5 -5
  199. package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +5 -5
  200. package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +10 -71
  201. package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +6 -14
  202. package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +6 -14
  203. package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +6 -14
  204. package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +6 -14
  205. package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +5 -5
  206. package/src/stores/query-workflow/QueryBuilderWorkFlowState.ts +10 -0
  207. package/src/stores/shared/ValueSpecificationEditorHelper.ts +32 -16
  208. package/src/stores/watermark/QueryBuilderWatermarkState.ts +0 -7
  209. package/src/stores/workflows/MappingQueryBuilderState.ts +7 -1
  210. package/src/stores/workflows/ServiceQueryBuilderState.ts +6 -1
  211. package/tsconfig.json +0 -1
  212. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -22
  213. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +0 -1
  214. package/lib/components/watermark/QueryBuilderWatermark.js +0 -83
  215. package/lib/components/watermark/QueryBuilderWatermark.js.map +0 -1
  216. package/src/components/watermark/QueryBuilderWatermark.tsx +0 -218
@@ -29,7 +29,6 @@ import {
29
29
  CheckIcon,
30
30
  CaretDownIcon,
31
31
  DiffIcon,
32
- WaterDropIcon,
33
32
  MenuContentDivider,
34
33
  Dialog,
35
34
  Modal,
@@ -45,6 +44,8 @@ import {
45
44
  DataAccessIcon,
46
45
  AssistantIcon,
47
46
  clsx,
47
+ DocumentationIcon,
48
+ CodeIcon,
48
49
  } from '@finos/legend-art';
49
50
  import { QueryBuilderFilterPanel } from './filter/QueryBuilderFilterPanel.js';
50
51
  import { QueryBuilderExplorerPanel } from './explorer/QueryBuilderExplorerPanel.js';
@@ -74,16 +75,17 @@ import { QueryBuilderDiffViewPanelDiaglog } from './QueryBuilderDiffPanel.js';
74
75
  import { guaranteeType } from '@finos/legend-shared';
75
76
  import { QueryBuilderGraphFetchTreeState } from '../stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js';
76
77
  import { QueryBuilderPostTDSPanel } from './fetch-structure/QueryBuilderPostTDSPanel.js';
77
- import { QueryBuilderWatermarkEditor } from './watermark/QueryBuilderWatermark.js';
78
78
  import { QueryBuilderConstantExpressionPanel } from './QueryBuilderConstantExpressionPanel.js';
79
79
  import { QUERY_BUILDER_SETTING_KEY } from '../__lib__/QueryBuilderSetting.js';
80
80
  import { QUERY_BUILDER_COMPONENT_ELEMENT_ID } from './QueryBuilderComponentElement.js';
81
81
  import { DataAccessOverview } from './data-access/DataAccessOverview.js';
82
82
  import { QueryChat } from './QueryChat.js';
83
- import { useEffect, useRef } from 'react';
83
+ import { Fragment, useEffect, useRef } from 'react';
84
84
  import { RedoButton, UndoButton } from '@finos/legend-lego/application';
85
85
  import { FETCH_STRUCTURE_IMPLEMENTATION } from '../stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js';
86
86
  import { onChangeFetchStructureImplementation } from '../stores/fetch-structure/QueryBuilderFetchStructureState.js';
87
+ import type { QueryBuilder_LegendApplicationPlugin_Extension } from '../stores/QueryBuilder_LegendApplicationPlugin_Extension.js';
88
+ import { QUERY_BUILDER_DOCUMENTATION_KEY } from '../__lib__/QueryBuilderDocumentation.js';
87
89
 
88
90
  const QueryBuilderPostGraphFetchPanel = observer(
89
91
  (props: { graphFetchState: QueryBuilderGraphFetchTreeState }) => {
@@ -126,13 +128,18 @@ const QueryBuilderStatusBar = observer(
126
128
  className={clsx(
127
129
  'query-builder__status-bar__action query-builder__status-bar__view-diff-btn',
128
130
  )}
129
- disabled={!queryBuilderState.changeDetectionState.hasChanged}
131
+ disabled={
132
+ !queryBuilderState.changeDetectionState.hasChanged ||
133
+ !queryBuilderState.canBuildQuery
134
+ }
130
135
  onClick={showDiff}
131
136
  tabIndex={-1}
132
137
  title={
133
- queryBuilderState.changeDetectionState.hasChanged
134
- ? 'Show changes'
135
- : 'Query has not been changed'
138
+ !queryBuilderState.canBuildQuery
139
+ ? 'Please fix query errors to show changes'
140
+ : queryBuilderState.changeDetectionState.hasChanged
141
+ ? 'Show changes'
142
+ : 'Query has not been changed'
136
143
  }
137
144
  >
138
145
  <DiffIcon />
@@ -193,7 +200,12 @@ const QueryBuilderStatusBar = observer(
193
200
  openLambdaEditor(QueryBuilderTextEditorMode.JSON)
194
201
  }
195
202
  tabIndex={-1}
196
- title="View Query Protocol"
203
+ disabled={!queryBuilderState.canBuildQuery}
204
+ title={
205
+ !queryBuilderState.canBuildQuery
206
+ ? 'Please fix query errors to show query protocol'
207
+ : 'Show Query Protocol'
208
+ }
197
209
  >{`{ }`}</button>
198
210
  <button
199
211
  className={clsx(
@@ -208,7 +220,12 @@ const QueryBuilderStatusBar = observer(
208
220
  openLambdaEditor(QueryBuilderTextEditorMode.TEXT)
209
221
  }
210
222
  tabIndex={-1}
211
- title="View Query in Pure"
223
+ disabled={!queryBuilderState.canBuildQuery}
224
+ title={
225
+ !queryBuilderState.canBuildQuery
226
+ ? 'Please fix query errors to edit in Pure'
227
+ : 'Edit Query in Pure'
228
+ }
212
229
  >
213
230
  <HackerIcon />
214
231
  </button>
@@ -277,10 +294,6 @@ export const QueryBuilder = observer(
277
294
  }
278
295
  };
279
296
 
280
- const openWatermark = (): void => {
281
- queryBuilderState.watermarkState.setIsEditingWatermark(true);
282
- };
283
-
284
297
  const toggleEnableCalendar = (): void => {
285
298
  if (queryBuilderState.isCalendarEnabled) {
286
299
  queryBuilderState.applicationStore.alertService.setActionAlertInfo({
@@ -363,6 +376,9 @@ export const QueryBuilder = observer(
363
376
  const editQueryInPure = (): void => {
364
377
  openLambdaEditor(QueryBuilderTextEditorMode.TEXT);
365
378
  };
379
+ const showQueryInPure = (): void => {
380
+ openLambdaEditor(QueryBuilderTextEditorMode.TEXT);
381
+ };
366
382
  const showQueryProtocol = (): void => {
367
383
  openLambdaEditor(QueryBuilderTextEditorMode.JSON);
368
384
  };
@@ -418,8 +434,38 @@ export const QueryBuilder = observer(
418
434
  queryBuilderState.changeHistoryState.redo();
419
435
  };
420
436
 
437
+ const queryDocEntry = applicationStore.documentationService.getDocEntry(
438
+ QUERY_BUILDER_DOCUMENTATION_KEY.TUTORIAL_QUERY_BUILDER,
439
+ );
440
+ const openQueryTutorial = (): void => {
441
+ if (queryDocEntry?.url) {
442
+ applicationStore.navigationService.navigator.visitAddress(
443
+ queryDocEntry.url,
444
+ );
445
+ }
446
+ };
421
447
  const toggleAssistant = (): void =>
422
448
  applicationStore.assistantService.toggleAssistant();
449
+
450
+ const extraHelpMenuContentItems = applicationStore.pluginManager
451
+ .getApplicationPlugins()
452
+ .flatMap(
453
+ (plugin) =>
454
+ (
455
+ plugin as QueryBuilder_LegendApplicationPlugin_Extension
456
+ ).getExtraQueryBuilderHelpMenuActionConfigurations?.() ?? [],
457
+ )
458
+ .map((item) => (
459
+ <MenuContentItem
460
+ key={item.key}
461
+ title={item.title ?? ''}
462
+ onClick={() => item.onClick(queryBuilderState)}
463
+ >
464
+ {item.icon && <MenuContentItemIcon>{item.icon}</MenuContentItemIcon>}
465
+ <MenuContentItemLabel>{item.label}</MenuContentItemLabel>
466
+ </MenuContentItem>
467
+ ));
468
+
423
469
  const compileQuery = applicationStore.guardUnhandledError(() =>
424
470
  flowResult(queryBuilderState.compileQuery()),
425
471
  );
@@ -431,7 +477,11 @@ export const QueryBuilder = observer(
431
477
  useEffect(() => {
432
478
  // this condition is for passing all exisitng tests because when we initialize a queryBuilderState for a test,
433
479
  // we use an empty RawLambda with an empty class and this useEffect is called earlier than initializeWithQuery()
434
- if (queryBuilderState.isQuerySupported && queryBuilderState.class) {
480
+ if (
481
+ queryBuilderState.isQuerySupported &&
482
+ queryBuilderState.class &&
483
+ queryBuilderState.canBuildQuery
484
+ ) {
435
485
  queryBuilderState.changeHistoryState.cacheNewQuery(
436
486
  queryBuilderState.buildQuery(),
437
487
  );
@@ -457,19 +507,11 @@ export const QueryBuilder = observer(
457
507
  isLoading={queryBuilderState.resultState.exportState.isInProgress}
458
508
  />
459
509
  <div className="query-builder__content">
460
- <div className="query-builder__header">
510
+ <div
511
+ data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_ACTIONS}
512
+ className="query-builder__header"
513
+ >
461
514
  <div className="query-builder__header__statuses">
462
- {queryBuilderState.watermarkState.value && (
463
- <button
464
- className="query-builder__header__status query-builder__header__status--action"
465
- onClick={openWatermark}
466
- tabIndex={-1}
467
- title="Used watermark"
468
- name="Used watermark"
469
- >
470
- <WaterDropIcon />
471
- </button>
472
- )}
473
515
  {queryBuilderState.isCalendarEnabled && (
474
516
  <div
475
517
  className="query-builder__header__status"
@@ -478,11 +520,19 @@ export const QueryBuilder = observer(
478
520
  <CalendarClockIcon className="query-builder__header__status__icon--calendar" />
479
521
  </div>
480
522
  )}
481
- {queryBuilderState.watermarkState.isEditingWatermark && (
482
- <QueryBuilderWatermarkEditor
483
- queryBuilderState={queryBuilderState}
484
- />
485
- )}
523
+ {applicationStore.pluginManager
524
+ .getApplicationPlugins()
525
+ .flatMap(
526
+ (plugin) =>
527
+ (
528
+ plugin as QueryBuilder_LegendApplicationPlugin_Extension
529
+ ).getExtraQueryBuilderHeaderTitleConfigurations?.() ?? [],
530
+ )
531
+ .map((actionConfig) => (
532
+ <Fragment key={actionConfig.key}>
533
+ {actionConfig.renderer(queryBuilderState)}
534
+ </Fragment>
535
+ ))}
486
536
  </div>
487
537
  <div className="query-builder__header__actions">
488
538
  <div className="query-builder__header__actions__undo-redo">
@@ -503,6 +553,21 @@ export const QueryBuilder = observer(
503
553
  redo={redo}
504
554
  />
505
555
  </div>
556
+ {applicationStore.pluginManager
557
+ .getApplicationPlugins()
558
+ .flatMap(
559
+ (plugin) =>
560
+ (
561
+ plugin as QueryBuilder_LegendApplicationPlugin_Extension
562
+ ).getExtraQueryBuilderHeaderActionConfigurations?.() ??
563
+ [],
564
+ )
565
+ .sort((A, B) => B.category - A.category)
566
+ .map((actionConfig) => (
567
+ <Fragment key={actionConfig.key}>
568
+ {actionConfig.renderer(queryBuilderState)}
569
+ </Fragment>
570
+ ))}
506
571
  <DropdownMenu
507
572
  className="query-builder__header__advanced-dropdown"
508
573
  title="Show Advanced Menu..."
@@ -643,14 +708,6 @@ export const QueryBuilder = observer(
643
708
  Show Post-Filter
644
709
  </MenuContentItemLabel>
645
710
  </MenuContentItem>
646
- <MenuContentItem onClick={openWatermark}>
647
- <MenuContentItemIcon>
648
- <WaterDropIcon />
649
- </MenuContentItemIcon>
650
- <MenuContentItemLabel>
651
- Show Watermark
652
- </MenuContentItemLabel>
653
- </MenuContentItem>
654
711
  <MenuContentItem
655
712
  onClick={toggleEnableCalendar}
656
713
  disabled={
@@ -695,11 +752,17 @@ export const QueryBuilder = observer(
695
752
  <MenuContentItem
696
753
  onClick={openCheckEntitlmentsEditor}
697
754
  disabled={
698
- queryBuilderState.isQuerySupported &&
699
- queryBuilderState.fetchStructureState
700
- .implementation instanceof QueryBuilderTDSState &&
701
- queryBuilderState.fetchStructureState.implementation
702
- .projectionColumns.length === 0
755
+ (queryBuilderState.isQuerySupported &&
756
+ queryBuilderState.fetchStructureState
757
+ .implementation instanceof QueryBuilderTDSState &&
758
+ queryBuilderState.fetchStructureState.implementation
759
+ .projectionColumns.length === 0) ||
760
+ !queryBuilderState.canBuildQuery
761
+ }
762
+ title={
763
+ !queryBuilderState.canBuildQuery
764
+ ? 'Please fix query errors to check entitlements'
765
+ : ''
703
766
  }
704
767
  >
705
768
  <MenuContentItemIcon>
@@ -709,7 +772,15 @@ export const QueryBuilder = observer(
709
772
  Check Entitlements
710
773
  </MenuContentItemLabel>
711
774
  </MenuContentItem>
712
- <MenuContentItem onClick={editQueryInPure}>
775
+ <MenuContentItem
776
+ onClick={editQueryInPure}
777
+ disabled={!queryBuilderState.canBuildQuery}
778
+ title={
779
+ !queryBuilderState.canBuildQuery
780
+ ? 'Please fix query errors to edit in Pure'
781
+ : undefined
782
+ }
783
+ >
713
784
  <MenuContentItemIcon>
714
785
  <HackerIcon />
715
786
  </MenuContentItemIcon>
@@ -717,7 +788,31 @@ export const QueryBuilder = observer(
717
788
  Edit Query in Pure
718
789
  </MenuContentItemLabel>
719
790
  </MenuContentItem>
720
- <MenuContentItem onClick={showQueryProtocol}>
791
+ <MenuContentItem
792
+ onClick={showQueryInPure}
793
+ disabled={!queryBuilderState.canBuildQuery}
794
+ title={
795
+ !queryBuilderState.canBuildQuery
796
+ ? 'Please fix query errors to edit in Pure'
797
+ : undefined
798
+ }
799
+ >
800
+ <MenuContentItemIcon>
801
+ <CodeIcon />
802
+ </MenuContentItemIcon>
803
+ <MenuContentItemLabel>
804
+ Show Query in Pure
805
+ </MenuContentItemLabel>
806
+ </MenuContentItem>
807
+ <MenuContentItem
808
+ onClick={showQueryProtocol}
809
+ disabled={!queryBuilderState.canBuildQuery}
810
+ title={
811
+ !queryBuilderState.canBuildQuery
812
+ ? 'Please fix query errors to show query protocol'
813
+ : undefined
814
+ }
815
+ >
721
816
  <MenuContentItemIcon>
722
817
  <SerializeIcon />
723
818
  </MenuContentItemIcon>
@@ -765,14 +860,6 @@ export const QueryBuilder = observer(
765
860
  </MenuContentItemLabel>
766
861
  </MenuContentItem>
767
862
  )}
768
- <MenuContentItem onClick={toggleAssistant}>
769
- <MenuContentItemIcon>
770
- <AssistantIcon />
771
- </MenuContentItemIcon>
772
- <MenuContentItemLabel>
773
- Open Assistant
774
- </MenuContentItemLabel>
775
- </MenuContentItem>
776
863
  </MenuContent>
777
864
  }
778
865
  menuProps={{
@@ -786,6 +873,44 @@ export const QueryBuilder = observer(
786
873
  </div>
787
874
  <CaretDownIcon className="query-builder__header__advanced-dropdown__icon" />
788
875
  </DropdownMenu>
876
+ <DropdownMenu
877
+ className="query-builder__header__advanced-dropdown"
878
+ content={
879
+ <MenuContent>
880
+ {extraHelpMenuContentItems}
881
+ {queryDocEntry && (
882
+ <MenuContentItem onClick={openQueryTutorial}>
883
+ <MenuContentItemIcon>
884
+ <DocumentationIcon />
885
+ </MenuContentItemIcon>
886
+ <MenuContentItemLabel>
887
+ Open Documentation
888
+ </MenuContentItemLabel>
889
+ </MenuContentItem>
890
+ )}
891
+ <MenuContentItem onClick={toggleAssistant}>
892
+ <MenuContentItemIcon>
893
+ {!applicationStore.assistantService.isHidden ? (
894
+ <CheckIcon />
895
+ ) : (
896
+ <AssistantIcon />
897
+ )}
898
+ </MenuContentItemIcon>
899
+ <MenuContentItemLabel>
900
+ Show Virtual Assistant
901
+ </MenuContentItemLabel>
902
+ </MenuContentItem>
903
+ </MenuContent>
904
+ }
905
+ >
906
+ <div
907
+ className="query-builder__header__advanced-dropdown__label"
908
+ title="See more options"
909
+ >
910
+ Help...
911
+ </div>
912
+ <CaretDownIcon className="query-builder__header__advanced-dropdown__icon" />
913
+ </DropdownMenu>
789
914
  </div>
790
915
  </div>
791
916
  <div className="query-builder__main">
@@ -41,6 +41,7 @@ import {
41
41
  VariableExpression,
42
42
  Multiplicity,
43
43
  isValidIdentifier,
44
+ InstanceValue,
44
45
  } from '@finos/legend-graph';
45
46
  import { deepClone } from '@finos/legend-shared';
46
47
  import { observer } from 'mobx-react-lite';
@@ -60,6 +61,7 @@ import { variableExpression_setName } from '../stores/shared/ValueSpecificationM
60
61
  import { LambdaEditor } from './shared/LambdaEditor.js';
61
62
  import { VariableViewer } from './shared/QueryBuilderVariableSelector.js';
62
63
  import { flowResult } from 'mobx';
64
+ import { isValidInstanceValue } from '../stores/QueryBuilderValueSpecificationHelper.js';
63
65
 
64
66
  const getConstantNameValidationMessage = (
65
67
  constantInput: string,
@@ -93,13 +95,9 @@ const QueryBuilderSimpleConstantExpressionEditor = observer(
93
95
  const [selectedName, setSelectedName] = useState(stateName);
94
96
  const [isNameValid, setIsNameValid] = useState<boolean>(true);
95
97
  const [hasEditedName, setHasEditedName] = useState<boolean>(false);
96
- const [nameInputRef, setNameInputRef] = useState<HTMLInputElement | null>(
97
- null,
98
- );
99
98
  const handleNameInputRef = useCallback(
100
99
  (ref: HTMLInputElement | null): void => {
101
100
  ref?.focus();
102
- setNameInputRef(ref);
103
101
  },
104
102
  [],
105
103
  );
@@ -107,6 +105,17 @@ const QueryBuilderSimpleConstantExpressionEditor = observer(
107
105
  // Value
108
106
  const stateValue = constantState.value;
109
107
  const [selectedValue, setSelectedValue] = useState(deepClone(stateValue));
108
+ const [shouldFocusOnValue, setShouldFocusOnValue] =
109
+ useState<boolean>(!isCreating);
110
+ const handleValueInputRef = useCallback(
111
+ (ref: HTMLInputElement | null): void => {
112
+ if (shouldFocusOnValue) {
113
+ ref?.focus();
114
+ setShouldFocusOnValue(false);
115
+ }
116
+ },
117
+ [shouldFocusOnValue],
118
+ );
110
119
 
111
120
  // Type
112
121
  const stateType =
@@ -121,12 +130,28 @@ const QueryBuilderSimpleConstantExpressionEditor = observer(
121
130
  queryBuilderState.graphManagerState.graph,
122
131
  val.value,
123
132
  queryBuilderState.observerContext,
133
+ queryBuilderState.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
124
134
  );
125
135
  setSelectedValue(newValSpec);
126
136
  }
137
+ setShouldFocusOnValue(true);
127
138
  };
139
+ // Disabling binary, strict time, latest date, and byte as we
140
+ // don't support these constant types
141
+ const supportedPrimitiveTypes: PrimitiveType[] = [
142
+ PrimitiveType.STRING,
143
+ PrimitiveType.BOOLEAN,
144
+ PrimitiveType.NUMBER,
145
+ PrimitiveType.INTEGER,
146
+ PrimitiveType.FLOAT,
147
+ PrimitiveType.DECIMAL,
148
+ PrimitiveType.DATE,
149
+ PrimitiveType.STRICTDATE,
150
+ PrimitiveType.DATETIME,
151
+ ];
128
152
  const typeOptions: PackageableElementOption<Type>[] =
129
153
  queryBuilderState.graphManagerState.graph.primitiveTypes
154
+ .filter((type) => supportedPrimitiveTypes.includes(type))
130
155
  .map(buildElementOption)
131
156
  .concat(
132
157
  queryBuilderState.graphManagerState.graph.enumerations.map(
@@ -134,15 +159,6 @@ const QueryBuilderSimpleConstantExpressionEditor = observer(
134
159
  ),
135
160
  );
136
161
 
137
- const handleValueInputRef = (ref: HTMLInputElement | null): void => {
138
- if (
139
- (!isCreating || hasEditedName) &&
140
- document.activeElement !== nameInputRef
141
- ) {
142
- ref?.focus();
143
- }
144
- };
145
-
146
162
  // Modal lifecycle actions
147
163
  const handleCancel = (): void => {
148
164
  variableState.setSelectedConstant(undefined);
@@ -163,6 +179,7 @@ const QueryBuilderSimpleConstantExpressionEditor = observer(
163
179
  queryBuilderState.graphManagerState.graph,
164
180
  selectedType.value,
165
181
  queryBuilderState.observerContext,
182
+ queryBuilderState.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
166
183
  );
167
184
  setSelectedValue(valSpec);
168
185
  };
@@ -259,7 +276,11 @@ const QueryBuilderSimpleConstantExpressionEditor = observer(
259
276
  <ModalFooter>
260
277
  <ModalFooterButton
261
278
  text={isCreating ? 'Create' : 'Apply'}
262
- disabled={!isNameValid}
279
+ disabled={
280
+ !isNameValid ||
281
+ (selectedValue instanceof InstanceValue &&
282
+ !isValidInstanceValue(selectedValue))
283
+ }
263
284
  onClick={handleApply}
264
285
  />
265
286
  <ModalFooterButton
@@ -415,6 +436,7 @@ export const QueryBuilderConstantExpressionPanel = observer(
415
436
  graph,
416
437
  PrimitiveType.STRING,
417
438
  queryBuilderState.observerContext,
439
+ queryBuilderState.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
418
440
  );
419
441
  const variableEx = new VariableExpression('', Multiplicity.ONE);
420
442
  variableEx.genericType = defaultVal.genericType;
@@ -207,6 +207,8 @@ const DerivedPropertyParameterValueEditor = observer(
207
207
  variable,
208
208
  derivedPropertyExpressionState.queryBuilderState.graphManagerState
209
209
  .graph,
210
+ derivedPropertyExpressionState.queryBuilderState
211
+ .INTERNAL__enableInitializingDefaultSimpleExpressionValue,
210
212
  derivedPropertyExpressionState.queryBuilderState.observerContext,
211
213
  ),
212
214
  idx + 1,