@finos/legend-query-builder 4.14.29 → 4.14.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/lib/components/QueryBuilder.d.ts +1 -1
  2. package/lib/components/QueryBuilder.d.ts.map +1 -1
  3. package/lib/components/QueryBuilder.js +64 -7
  4. package/lib/components/QueryBuilder.js.map +1 -1
  5. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  6. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +2 -1
  7. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  8. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  9. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +5 -10
  10. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
  11. package/lib/graph/QueryBuilderMetaModelConst.d.ts +3 -0
  12. package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
  13. package/lib/graph/QueryBuilderMetaModelConst.js +5 -0
  14. package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
  15. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +4 -1
  16. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  17. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +1 -0
  18. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  19. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +51 -3
  20. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  21. package/lib/index.css +2 -2
  22. package/lib/index.css.map +1 -1
  23. package/lib/index.d.ts +1 -0
  24. package/lib/index.d.ts.map +1 -1
  25. package/lib/index.js +1 -0
  26. package/lib/index.js.map +1 -1
  27. package/lib/package.json +1 -1
  28. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  29. package/lib/stores/QueryBuilderResultState.js +1 -0
  30. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  31. package/lib/stores/QueryBuilderState.d.ts +10 -1
  32. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  33. package/lib/stores/QueryBuilderState.js +21 -2
  34. package/lib/stores/QueryBuilderState.js.map +1 -1
  35. package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -1
  36. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  37. package/lib/stores/QueryBuilderStateBuilder.js +33 -4
  38. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  39. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +5 -0
  40. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  41. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.d.ts.map +1 -1
  42. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +2 -1
  43. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
  44. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +1 -0
  45. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  46. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  47. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts +2 -1
  48. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
  49. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +7 -0
  50. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
  51. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +1 -0
  52. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  53. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -0
  54. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  55. package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.d.ts +2 -0
  56. package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.d.ts.map +1 -0
  57. package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.js +2 -0
  58. package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.js.map +1 -0
  59. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -0
  60. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  61. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +4 -0
  62. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  63. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +4 -3
  64. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  65. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +35 -3
  66. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  67. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts +2 -9
  68. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  69. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +45 -36
  70. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  71. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.d.ts +20 -0
  72. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.d.ts.map +1 -0
  73. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js +55 -0
  74. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js.map +1 -0
  75. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts +35 -0
  76. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts.map +1 -0
  77. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js +42 -0
  78. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js.map +1 -0
  79. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts +2 -1
  80. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts.map +1 -1
  81. package/lib/stores/workflows/FunctionQueryBuilderState.js +2 -2
  82. package/lib/stores/workflows/FunctionQueryBuilderState.js.map +1 -1
  83. package/lib/stores/workflows/MappingQueryBuilderState.d.ts +2 -1
  84. package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
  85. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -2
  86. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  87. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -1
  88. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  89. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -2
  90. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  91. package/package.json +3 -3
  92. package/src/components/QueryBuilder.tsx +214 -2
  93. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +2 -0
  94. package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +29 -29
  95. package/src/graph/QueryBuilderMetaModelConst.ts +7 -0
  96. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +3 -3
  97. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +122 -1
  98. package/src/index.ts +1 -0
  99. package/src/stores/QueryBuilderResultState.ts +1 -0
  100. package/src/stores/QueryBuilderState.ts +27 -0
  101. package/src/stores/QueryBuilderStateBuilder.ts +65 -5
  102. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +5 -0
  103. package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +2 -0
  104. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +1 -0
  105. package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +15 -0
  106. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +5 -0
  107. package/src/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.ts +0 -0
  108. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +5 -0
  109. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +76 -2
  110. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +90 -81
  111. package/src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.ts +108 -0
  112. package/src/stores/query-workflow/QueryBuilderWorkFlowState.ts +64 -0
  113. package/src/stores/workflows/FunctionQueryBuilderState.ts +3 -1
  114. package/src/stores/workflows/MappingQueryBuilderState.ts +9 -1
  115. package/src/stores/workflows/ServiceQueryBuilderState.ts +9 -1
  116. package/tsconfig.json +3 -0
@@ -26,8 +26,8 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
26
26
  onExecutionContextChange;
27
27
  TEMPORARY__setupPanelContentRenderer = () => renderServiceQueryBuilderSetupPanelContent(this);
28
28
  selectedExecutionContext;
29
- constructor(applicationStore, graphManagerState, service, usableServices, executionContextKey, onServiceChange, onExecutionContextChange, config, sourceInfo) {
30
- super(applicationStore, graphManagerState, config, sourceInfo);
29
+ constructor(applicationStore, graphManagerState, workflowState, service, usableServices, executionContextKey, onServiceChange, onExecutionContextChange, config, sourceInfo) {
30
+ super(applicationStore, graphManagerState, workflowState, config, sourceInfo);
31
31
  makeObservable(this, {
32
32
  selectedExecutionContext: observable,
33
33
  setSelectedExecutionContext: action,
@@ -1 +1 @@
1
- {"version":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gBACrC,wBAAwB,CAAC,YAAY,CAAC;SACzC;IACH,CAAC;IAED,2BAA2B,CAAC,GAA4B;QACtD,IAAI,CAAC,wBAAwB,GAAG,GAAG,CAAC;IACtC,CAAC;IAED,IAAa,gBAAgB;QAC3B,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM;YAClC,CAAC,CAAC,uDAAuD;YACzD,CAAC,CAAC,+BAA+B,CAAC;IACtC,CAAC;IAED,IAAa,iBAAiB;QAC5B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC;IACtD,CAAC;IAED,IAAa,iBAAiB;QAC5B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACH,+BAA+B,CAC7B,gBAAyC;QAEzC,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;QACzC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAElD,MAAM,iBAAiB,GAAG,2BAA2B,CACnD,OAAO,EACP,IAAI,CAAC,iBAAiB,CAAC,aAAa,CACrC,CAAC;QACF,kEAAkE;QAClE,4DAA4D;QAC5D,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC1D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;YAClE,IAAI,gBAAgB,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;aACpC;SACF;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"ServiceQueryBuilderState.js","sourceRoot":"","sources":["../../../src/stores/workflows/ServiceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,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GAAG,GAAG,CAAC;IACtC,CAAC;IAED,IAAa,gBAAgB;QAC3B,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM;YAClC,CAAC,CAAC,uDAAuD;YACzD,CAAC,CAAC,+BAA+B,CAAC;IACtC,CAAC;IAED,IAAa,iBAAiB;QAC5B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC;IACtD,CAAC;IAED,IAAa,iBAAiB;QAC5B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACH,+BAA+B,CAC7B,gBAAyC;QAEzC,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;QACzC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAElD,MAAM,iBAAiB,GAAG,2BAA2B,CACnD,OAAO,EACP,IAAI,CAAC,iBAAiB,CAAC,aAAa,CACrC,CAAC;QACF,kEAAkE;QAClE,4DAA4D;QAC5D,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC1D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;YAClE,IAAI,gBAAgB,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;aACpC;SACF;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-query-builder",
3
- "version": "4.14.29",
3
+ "version": "4.14.31",
4
4
  "description": "Legend query builder core",
5
5
  "keywords": [
6
6
  "legend",
@@ -44,8 +44,8 @@
44
44
  "dependencies": {
45
45
  "@finos/legend-application": "15.0.75",
46
46
  "@finos/legend-art": "7.1.27",
47
- "@finos/legend-graph": "31.9.13",
48
- "@finos/legend-lego": "1.2.27",
47
+ "@finos/legend-graph": "31.9.14",
48
+ "@finos/legend-lego": "1.2.28",
49
49
  "@finos/legend-server-depot": "6.0.39",
50
50
  "@finos/legend-shared": "10.0.34",
51
51
  "@finos/legend-storage": "3.0.84",
@@ -44,13 +44,17 @@ import {
44
44
  SerializeIcon,
45
45
  DataAccessIcon,
46
46
  AssistantIcon,
47
+ clsx,
47
48
  } from '@finos/legend-art';
48
49
  import { QueryBuilderFilterPanel } from './filter/QueryBuilderFilterPanel.js';
49
50
  import { QueryBuilderExplorerPanel } from './explorer/QueryBuilderExplorerPanel.js';
50
51
  import { QueryBuilderSidebar } from './QueryBuilderSideBar.js';
51
52
  import { QueryBuilderResultPanel } from './result/QueryBuilderResultPanel.js';
52
53
  import { QueryBuilderTextEditor } from './QueryBuilderTextEditor.js';
53
- import type { QueryBuilderState } from '../stores/QueryBuilderState.js';
54
+ import {
55
+ QUERY_BUILDER_LAMBDA_WRITER_MODE,
56
+ type QueryBuilderState,
57
+ } from '../stores/QueryBuilderState.js';
54
58
  import { QueryBuilderTextEditorMode } from '../stores/QueryBuilderTextEditorState.js';
55
59
  import { QueryBuilderFetchStructurePanel } from './fetch-structure/QueryBuilderFetchStructurePanel.js';
56
60
  import { QUERY_BUILDER_TEST_ID } from '../__lib__/QueryBuilderTesting.js';
@@ -61,6 +65,7 @@ import {
61
65
  useCommands,
62
66
  ActionAlertActionType,
63
67
  ActionAlertType,
68
+ useApplicationStore,
64
69
  } from '@finos/legend-application';
65
70
  import { QueryBuilderParametersPanel } from './QueryBuilderParametersPanel.js';
66
71
  import { QueryBuilderFunctionsExplorerPanel } from './explorer/QueryBuilderFunctionsExplorerPanel.js';
@@ -77,6 +82,8 @@ import { DataAccessOverview } from './data-access/DataAccessOverview.js';
77
82
  import { QueryChat } from './QueryChat.js';
78
83
  import { useEffect, useRef } from 'react';
79
84
  import { RedoButton, UndoButton } from '@finos/legend-lego/application';
85
+ import { FETCH_STRUCTURE_IMPLEMENTATION } from '../stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js';
86
+ import { onChangeFetchStructureImplementation } from '../stores/fetch-structure/QueryBuilderFetchStructureState.js';
80
87
 
81
88
  const QueryBuilderPostGraphFetchPanel = observer(
82
89
  (props: { graphFetchState: QueryBuilderGraphFetchTreeState }) => {
@@ -93,6 +100,138 @@ const QueryBuilderPostGraphFetchPanel = observer(
93
100
  },
94
101
  );
95
102
 
103
+ const QueryBuilderStatusBar = observer(
104
+ (props: { queryBuilderState: QueryBuilderState }) => {
105
+ const { queryBuilderState } = props;
106
+ const applicationStore = useApplicationStore();
107
+ const showDiff = (): void =>
108
+ queryBuilderState.changeDetectionState.showDiffViewPanel();
109
+ const openLambdaEditor = (mode: QueryBuilderTextEditorMode): void =>
110
+ queryBuilderState.textEditorState.openModal(mode);
111
+ const compile = applicationStore.guardUnhandledError(() =>
112
+ flowResult(queryBuilderState.compileQuery()),
113
+ );
114
+ const toggleAssistant = (): void =>
115
+ applicationStore.assistantService.toggleAssistant();
116
+ const openQueryChat = (): void =>
117
+ queryBuilderState.setIsQueryChatOpened(true);
118
+
119
+ return (
120
+ <div className="query-builder__status-bar">
121
+ <div className="query-builder__status-bar__left"></div>
122
+ <div className="query-builder__status-bar__right">
123
+ {queryBuilderState.changeDetectionState.initState.hasCompleted && (
124
+ <>
125
+ <button
126
+ className={clsx(
127
+ 'query-builder__status-bar__action query-builder__status-bar__view-diff-btn',
128
+ )}
129
+ disabled={!queryBuilderState.changeDetectionState.hasChanged}
130
+ onClick={showDiff}
131
+ tabIndex={-1}
132
+ title={
133
+ queryBuilderState.changeDetectionState.hasChanged
134
+ ? 'Show changes'
135
+ : 'Query has not been changed'
136
+ }
137
+ >
138
+ <DiffIcon />
139
+ </button>
140
+ {queryBuilderState.changeDetectionState.diffViewState && (
141
+ <QueryBuilderDiffViewPanelDiaglog
142
+ diffViewState={
143
+ queryBuilderState.changeDetectionState.diffViewState
144
+ }
145
+ />
146
+ )}
147
+ </>
148
+ )}
149
+ {queryBuilderState.isQueryChatOpened && (
150
+ <QueryChat queryBuilderState={queryBuilderState} />
151
+ )}
152
+ {!queryBuilderState.config?.TEMPORARY__disableQueryBuilderChat && (
153
+ <button
154
+ className={clsx(
155
+ 'query-builder__status-bar__action query-builder__status-bar__action__toggler',
156
+ {
157
+ 'query-builder__status-bar__action__toggler--toggled':
158
+ queryBuilderState.isQueryChatOpened === true,
159
+ },
160
+ )}
161
+ onClick={openQueryChat}
162
+ tabIndex={-1}
163
+ title="Open Query Chat"
164
+ >
165
+ <ChatIcon />
166
+ </button>
167
+ )}
168
+ <button
169
+ className={clsx(
170
+ 'query-builder__status-bar__action query-builder__status-bar__compile-btn',
171
+ {
172
+ 'query-builder__status-bar__compile-btn--wiggling':
173
+ queryBuilderState.queryCompileState.isInProgress,
174
+ },
175
+ )}
176
+ disabled={queryBuilderState.queryCompileState.isInProgress}
177
+ onClick={compile}
178
+ tabIndex={-1}
179
+ title="Compile (F9)"
180
+ >
181
+ <HammerIcon />
182
+ </button>
183
+ <button
184
+ className={clsx(
185
+ 'query-builder__status-bar__action query-builder__status-bar__action__toggler',
186
+ {
187
+ 'query-builder__status-bar__action__toggler--toggled':
188
+ queryBuilderState.textEditorState.mode ===
189
+ QueryBuilderTextEditorMode.JSON,
190
+ },
191
+ )}
192
+ onClick={(): void =>
193
+ openLambdaEditor(QueryBuilderTextEditorMode.JSON)
194
+ }
195
+ tabIndex={-1}
196
+ title="View Query Protocol"
197
+ >{`{ }`}</button>
198
+ <button
199
+ className={clsx(
200
+ 'query-builder__status-bar__action query-builder__status-bar__action__toggler',
201
+ {
202
+ 'query-builder__status-bar__action__toggler--toggled':
203
+ queryBuilderState.textEditorState.mode ===
204
+ QueryBuilderTextEditorMode.TEXT,
205
+ },
206
+ )}
207
+ onClick={(): void =>
208
+ openLambdaEditor(QueryBuilderTextEditorMode.TEXT)
209
+ }
210
+ tabIndex={-1}
211
+ title="View Query in Pure"
212
+ >
213
+ <HackerIcon />
214
+ </button>
215
+ <button
216
+ className={clsx(
217
+ 'query-builder__status-bar__action query-builder__status-bar__action__toggler',
218
+ {
219
+ 'query-builder__status-bar__action__toggler--toggled':
220
+ !applicationStore.assistantService.isHidden,
221
+ },
222
+ )}
223
+ onClick={toggleAssistant}
224
+ tabIndex={-1}
225
+ title="Toggle assistant"
226
+ >
227
+ <AssistantIcon />
228
+ </button>
229
+ </div>
230
+ </div>
231
+ );
232
+ },
233
+ );
234
+
96
235
  export const QueryBuilder = observer(
97
236
  (props: { queryBuilderState: QueryBuilderState }) => {
98
237
  const { queryBuilderState } = props;
@@ -191,6 +330,36 @@ export const QueryBuilder = observer(
191
330
  }
192
331
  };
193
332
 
333
+ const toggleTypedRelation = (): void => {
334
+ if (queryBuilderState.isFetchStructureTyped) {
335
+ queryBuilderState.setLambdaWriteMode(
336
+ QUERY_BUILDER_LAMBDA_WRITER_MODE.STANDARD,
337
+ );
338
+ } else {
339
+ queryBuilderState.applicationStore.alertService.setActionAlertInfo({
340
+ message:
341
+ 'You are about to change to use typed TDS functions. Please proceed with caution as this is still an experimental feature.',
342
+ prompt: ' Do you want to proceed?',
343
+ type: ActionAlertType.CAUTION,
344
+ actions: [
345
+ {
346
+ label: 'Proceed',
347
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
348
+ handler: (): void =>
349
+ queryBuilderState.setLambdaWriteMode(
350
+ QUERY_BUILDER_LAMBDA_WRITER_MODE.TYPED_FETCH_STRUCTURE,
351
+ ),
352
+ },
353
+ {
354
+ label: 'Cancel',
355
+ type: ActionAlertActionType.PROCEED,
356
+ default: true,
357
+ },
358
+ ],
359
+ });
360
+ }
361
+ };
362
+
194
363
  const editQueryInPure = (): void => {
195
364
  openLambdaEditor(QueryBuilderTextEditorMode.TEXT);
196
365
  };
@@ -278,7 +447,12 @@ export const QueryBuilder = observer(
278
447
  <BackdropContainer
279
448
  elementId={QUERY_BUILDER_COMPONENT_ELEMENT_ID.BACKDROP_CONTAINER}
280
449
  />
281
- <div className="query-builder__body">
450
+ <div
451
+ className={clsx('query-builder__body', {
452
+ 'query-builder__body__status-bar':
453
+ queryBuilderState.workflowState.showStatusBar,
454
+ })}
455
+ >
282
456
  <PanelLoadingIndicator
283
457
  isLoading={queryBuilderState.resultState.exportState.isInProgress}
284
458
  />
@@ -401,6 +575,22 @@ export const QueryBuilder = observer(
401
575
  </MenuContentItemIcon>
402
576
  <MenuContentItemLabel>Show Filter</MenuContentItemLabel>
403
577
  </MenuContentItem>
578
+ <MenuContentItem
579
+ onClick={onChangeFetchStructureImplementation(
580
+ isTDSState
581
+ ? FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH
582
+ : FETCH_STRUCTURE_IMPLEMENTATION.TABULAR_DATA_STRUCTURE,
583
+ fetchStructureState,
584
+ )}
585
+ disabled={!queryBuilderState.isQuerySupported}
586
+ >
587
+ <MenuContentItemIcon>
588
+ {isTDSState ? <CheckIcon /> : null}
589
+ </MenuContentItemIcon>
590
+ <MenuContentItemLabel>
591
+ Tabular Data Structure
592
+ </MenuContentItemLabel>
593
+ </MenuContentItem>
404
594
  <MenuContentDivider />
405
595
  <MenuContentItem
406
596
  onClick={toggleShowOLAPGroupByPanel}
@@ -482,6 +672,25 @@ export const QueryBuilder = observer(
482
672
  Enable Calendar
483
673
  </MenuContentItemLabel>
484
674
  </MenuContentItem>
675
+ <MenuContentItem
676
+ onClick={toggleTypedRelation}
677
+ disabled={
678
+ !queryBuilderState.isQuerySupported ||
679
+ !(
680
+ queryBuilderState.fetchStructureState
681
+ .implementation instanceof QueryBuilderTDSState
682
+ )
683
+ }
684
+ >
685
+ <MenuContentItemIcon>
686
+ {queryBuilderState.isFetchStructureTyped ? (
687
+ <CheckIcon />
688
+ ) : null}
689
+ </MenuContentItemIcon>
690
+ <MenuContentItemLabel>
691
+ Enable Typed TDS (BETA)
692
+ </MenuContentItemLabel>
693
+ </MenuContentItem>
485
694
  <MenuContentDivider />
486
695
  <MenuContentItem
487
696
  onClick={openCheckEntitlmentsEditor}
@@ -735,6 +944,9 @@ export const QueryBuilder = observer(
735
944
  </Dialog>
736
945
  )}
737
946
  </div>
947
+ {queryBuilderState.workflowState.showStatusBar ? (
948
+ <QueryBuilderStatusBar queryBuilderState={queryBuilderState} />
949
+ ) : null}
738
950
  </div>
739
951
  );
740
952
  },
@@ -51,6 +51,7 @@ import {
51
51
  } from '../../stores/__test-utils__/QueryBuilderStateTestUtils.js';
52
52
  import { STYLE_PREFIX, STYLE_PREFIX__DARK } from '@finos/legend-art';
53
53
  import { expect } from '@jest/globals';
54
+ import { QueryBuilderAdvancedWorkflowState } from '../../stores/query-workflow/QueryBuilderWorkFlowState.js';
54
55
 
55
56
  const getSelectorContainerClassName = (lightMode?: boolean): string =>
56
57
  '.' + `${lightMode ? STYLE_PREFIX : STYLE_PREFIX__DARK}__value-container`;
@@ -198,6 +199,7 @@ export const TEST__setUpQueryBuilder = async (
198
199
  const queryBuilderState = new INTERNAL__BasicQueryBuilderState(
199
200
  MOCK__applicationStore,
200
201
  graphManagerState,
202
+ QueryBuilderAdvancedWorkflowState.INSTANCE,
201
203
  undefined,
202
204
  );
203
205
  const mapping = graphManagerState.graph.getMapping(mappingPath);
@@ -32,6 +32,7 @@ import { QueryBuilderGraphFetchTreeState } from '../../stores/fetch-structure/gr
32
32
  import { QueryBuilderPanelIssueCountBadge } from '../shared/QueryBuilderPanelIssueCountBadge.js';
33
33
  import { FETCH_STRUCTURE_IMPLEMENTATION } from '../../stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js';
34
34
  import { QUERY_BUILDER_TEST_ID } from '../../__lib__/QueryBuilderTesting.js';
35
+ import { onChangeFetchStructureImplementation } from '../../stores/fetch-structure/QueryBuilderFetchStructureState.js';
35
36
 
36
37
  const QueryBuilderFetchStructureEditor = observer(
37
38
  (props: { queryBuilderState: QueryBuilderState }) => {
@@ -68,24 +69,18 @@ export const QueryBuilderFetchStructurePanel = observer(
68
69
  (props: { queryBuilderState: QueryBuilderState }) => {
69
70
  const { queryBuilderState } = props;
70
71
  const fetchStructureState = queryBuilderState.fetchStructureState;
71
-
72
- const onChangeFetchStructureImplementation =
73
- (implementationType: FETCH_STRUCTURE_IMPLEMENTATION): (() => void) =>
74
- (): void => {
75
- if (fetchStructureState.implementation.type !== implementationType) {
76
- fetchStructureState.implementation.checkBeforeChangingImplementation(
77
- () => {
78
- fetchStructureState.changeImplementation(implementationType);
79
- },
80
- );
81
- }
82
- };
72
+ const fetchConfig =
73
+ queryBuilderState.workflowState.getFetchStructureLayoutConfig(
74
+ queryBuilderState,
75
+ );
83
76
 
84
77
  return (
85
78
  <Panel data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_FETCH_STRUCTURE}>
86
79
  <PanelHeader>
87
80
  <div className="panel__header__title">
88
- <div className="panel__header__title__label">fetch structure</div>
81
+ <div className="panel__header__title__label">
82
+ {fetchConfig.label}
83
+ </div>
89
84
  {fetchStructureState.implementation.fetchStructureValidationIssues
90
85
  .length !== 0 && (
91
86
  <QueryBuilderPanelIssueCountBadge
@@ -96,22 +91,27 @@ export const QueryBuilderFetchStructurePanel = observer(
96
91
  />
97
92
  )}
98
93
  </div>
99
- <PanelHeaderActions>
100
- <div className="query-builder__fetch__structure__modes">
101
- {Object.values(FETCH_STRUCTURE_IMPLEMENTATION).map((type) => (
102
- <button
103
- onClick={onChangeFetchStructureImplementation(type)}
104
- className={clsx('query-builder__fetch__structure__mode', {
105
- 'query-builder__fetch__structure__mode--selected':
106
- type === fetchStructureState.implementation.type,
107
- })}
108
- key={type}
109
- >
110
- {prettyCONSTName(type)}
111
- </button>
112
- ))}
113
- </div>
114
- </PanelHeaderActions>
94
+ {fetchConfig.showInFetchPanel ? (
95
+ <PanelHeaderActions>
96
+ <div className="query-builder__fetch__structure__modes">
97
+ {Object.values(FETCH_STRUCTURE_IMPLEMENTATION).map((type) => (
98
+ <button
99
+ onClick={onChangeFetchStructureImplementation(
100
+ type,
101
+ fetchStructureState,
102
+ )}
103
+ className={clsx('query-builder__fetch__structure__mode', {
104
+ 'query-builder__fetch__structure__mode--selected':
105
+ type === fetchStructureState.implementation.type,
106
+ })}
107
+ key={type}
108
+ >
109
+ {prettyCONSTName(type)}
110
+ </button>
111
+ ))}
112
+ </div>
113
+ </PanelHeaderActions>
114
+ ) : null}
115
115
  </PanelHeader>
116
116
  <QueryBuilderFetchStructureEditor
117
117
  queryBuilderState={queryBuilderState}
@@ -24,6 +24,8 @@ export enum QUERY_BUILDER_PURE_PATH {
24
24
  DURATION_UNIT = 'meta::pure::functions::date::DurationUnit',
25
25
  DAY_OF_WEEK = 'meta::pure::functions::date::DayOfWeek',
26
26
 
27
+ // RELATION
28
+ RELATION = 'meta::pure::metamodel::relation::Relation',
27
29
  // serialization
28
30
  SERIALIZE_CONFIG = 'meta::pure::graphFetch::execution::AlloySerializationConfig',
29
31
  }
@@ -31,6 +33,7 @@ export enum QUERY_BUILDER_PURE_PATH {
31
33
  export enum QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS {
32
34
  CALENDAR_ANNUALIZED = 'meta::pure::functions::date::calendar::annualized',
33
35
  CALENDAR_CME = ' meta::pure::functions::date::calendar::cme',
36
+
34
37
  CALENDAR_CW = 'meta::pure::functions::date::calendar::cw',
35
38
  CALENDAR_CW_FM = 'meta::pure::functions::date::calendar::cw_fm',
36
39
  CALENDAR_CY_MINUS2 = 'meta::pure::functions::date::calendar::CYMinus2',
@@ -114,6 +117,10 @@ export enum QUERY_BUILDER_SUPPORTED_FUNCTIONS {
114
117
  TDS_RESTRICT = 'meta::pure::tds::restrict',
115
118
  TDS_FUNC = 'meta::pure::tds::func',
116
119
 
120
+ // Relation
121
+ RELATION_PROJECT = 'meta::pure::functions::relation::project',
122
+ RELATION_LIMIT = 'meta::pure::functions::relation::limit',
123
+
117
124
  // filter
118
125
  CONTAINS = 'meta::pure::functions::string::contains',
119
126
  ENDS_WITH = 'meta::pure::functions::string::endsWith',
@@ -146,10 +146,10 @@ export class QueryBuilder_PureProtocolProcessorPlugin extends PureProtocolProces
146
146
  processingContext,
147
147
  );
148
148
  } else if (
149
- matchFunctionName(
150
- functionName,
149
+ matchFunctionName(functionName, [
151
150
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT,
152
- )
151
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_PROJECT,
152
+ ])
153
153
  ) {
154
154
  return V1_buildProjectFunctionExpression(
155
155
  functionName,
@@ -21,6 +21,7 @@ import {
21
21
  filterByType,
22
22
  guaranteeNonNullable,
23
23
  guaranteeType,
24
+ isNonNullable,
24
25
  returnUndefOnError,
25
26
  } from '@finos/legend-shared';
26
27
  import {
@@ -56,6 +57,11 @@ import {
56
57
  LambdaFunction,
57
58
  LambdaFunctionInstanceValue,
58
59
  PackageableElementExplicitReference,
60
+ V1_ClassInstance,
61
+ V1_ColSpecArray,
62
+ ColSpecArrayInstance,
63
+ ColSpecArray,
64
+ ColSpec,
59
65
  } from '@finos/legend-graph';
60
66
  import {
61
67
  QUERY_BUILDER_PURE_PATH,
@@ -574,6 +580,110 @@ export const V1_buildFilterFunctionExpression = (
574
580
  return expression;
575
581
  };
576
582
 
583
+ export const V1_buildTypedProjectFunctionExpression = (
584
+ functionName: string,
585
+ parameters: V1_ValueSpecification[],
586
+ openVariables: string[],
587
+ compileContext: V1_GraphBuilderContext,
588
+ processingContext: V1_ProcessingContext,
589
+ ): SimpleFunctionExpression => {
590
+ assertTrue(
591
+ parameters.length === 2,
592
+ `Can't build relation project() expression: project() expects 2 arguments`,
593
+ );
594
+
595
+ let topLevelLambdaParameters: V1_Variable[] = [];
596
+ const precedingExperession = (
597
+ parameters[0] as V1_ValueSpecification
598
+ ).accept_ValueSpecificationVisitor(
599
+ new V1_ValueSpecificationBuilder(
600
+ compileContext,
601
+ processingContext,
602
+ openVariables,
603
+ ),
604
+ );
605
+ assertNonNullable(
606
+ precedingExperession.genericType,
607
+ `Can't build relation project() expression: preceding expression return type is missing`,
608
+ );
609
+
610
+ const classInstance = parameters[1];
611
+ assertType(
612
+ classInstance,
613
+ V1_ClassInstance,
614
+ `Can't build relation project() expression: project() expects argument #1 to be a ClassInstance`,
615
+ );
616
+ const specArray = guaranteeType(
617
+ classInstance.value,
618
+ V1_ColSpecArray,
619
+ `Can't build relation project() expression: project() expects argument #1 to hold spec array instances value`,
620
+ );
621
+
622
+ topLevelLambdaParameters = specArray.colSpecs
623
+ .map((e) => e.function1)
624
+ .filter(isNonNullable)
625
+ .filter(filterByType(V1_Lambda))
626
+ .map((lambda) => lambda.parameters)
627
+ .flat();
628
+
629
+ const variables = new Set<string>();
630
+ // Make sure top-level lambdas have their lambda parameter types set properly
631
+ topLevelLambdaParameters.forEach((variable) => {
632
+ if (!variables.has(variable.name) && !variable.class) {
633
+ const variableExpression = new VariableExpression(
634
+ variable.name,
635
+ precedingExperession.multiplicity,
636
+ );
637
+ variableExpression.genericType = precedingExperession.genericType;
638
+ processingContext.addInferredVariables(variable.name, variableExpression);
639
+ }
640
+ });
641
+ const processedExpression = new ColSpecArrayInstance(Multiplicity.ONE);
642
+ const processedColSpecArray = new ColSpecArray();
643
+ processedExpression.values = [processedColSpecArray];
644
+
645
+ processedColSpecArray.colSpecs = specArray.colSpecs.map((colSpec) => {
646
+ const pColSpec = new ColSpec();
647
+ let lambda: ValueSpecification;
648
+ const _funct = guaranteeType(
649
+ colSpec.function1,
650
+ V1_ValueSpecification,
651
+ `Can't build relation col spec() expression: expects function1 to be a lambda`,
652
+ );
653
+ try {
654
+ lambda = buildProjectionColumnLambda(
655
+ _funct,
656
+ openVariables,
657
+ compileContext,
658
+ processingContext,
659
+ );
660
+ } catch {
661
+ lambda = new INTERNAL__UnknownValueSpecification(
662
+ V1_serializeValueSpecification(
663
+ _funct,
664
+ compileContext.extensions.plugins,
665
+ ),
666
+ );
667
+ }
668
+ pColSpec.function1 = lambda;
669
+ pColSpec.name = colSpec.name;
670
+ return pColSpec;
671
+ });
672
+
673
+ const expression = V1_buildBaseSimpleFunctionExpression(
674
+ [precedingExperession, processedExpression],
675
+ functionName,
676
+ compileContext,
677
+ );
678
+ expression.genericType = GenericTypeExplicitReference.create(
679
+ new GenericType(
680
+ compileContext.resolveType(QUERY_BUILDER_PURE_PATH.RELATION).value,
681
+ ),
682
+ );
683
+
684
+ return expression;
685
+ };
686
+
577
687
  export const V1_buildProjectFunctionExpression = (
578
688
  functionName: string,
579
689
  parameters: V1_ValueSpecification[],
@@ -581,8 +691,19 @@ export const V1_buildProjectFunctionExpression = (
581
691
  compileContext: V1_GraphBuilderContext,
582
692
  processingContext: V1_ProcessingContext,
583
693
  ): SimpleFunctionExpression => {
694
+ if (parameters.length === 2) {
695
+ return V1_buildTypedProjectFunctionExpression(
696
+ functionName,
697
+ parameters,
698
+ openVariables,
699
+ compileContext,
700
+ processingContext,
701
+ );
702
+ }
703
+
704
+ const length = parameters.length;
584
705
  assertTrue(
585
- parameters.length === 3,
706
+ length === 3 || length === 2,
586
707
  `Can't build project() expression: project() expects 2 arguments`,
587
708
  );
588
709
 
package/src/index.ts CHANGED
@@ -93,3 +93,4 @@ export * from './stores/QueryBuilder_LegendApplicationPlugin_Extension.js';
93
93
 
94
94
  export * from './stores/data-access/DataAccessState.js';
95
95
  export * from './components/data-access/DataAccessOverview.js';
96
+ export * from './stores/query-workflow/QueryBuilderWorkFlowState.js';
@@ -312,6 +312,7 @@ export class QueryBuilderResultState {
312
312
  if (this.queryBuilderState.isQuerySupported) {
313
313
  const lambdaFunction = buildLambdaFunction(this.queryBuilderState, {
314
314
  isBuildingExecutionQuery: true,
315
+ useTypedRelationFunctions: this.queryBuilderState.isFetchStructureTyped,
315
316
  ...executionOptions,
316
317
  });
317
318
  query = buildRawLambdaFromLambdaFunction(