@finos/legend-query-builder 4.14.41 → 4.14.44
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +2 -20
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +14 -5
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -5
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +5 -10
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +3 -35
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -19
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.js +1 -2
- package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +9 -7
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.js +1 -8
- package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPreviewDataHelper.js +2 -2
- package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts +0 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +1 -2
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +0 -12
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +0 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +0 -8
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js +12 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +0 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +0 -16
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts +0 -3
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js +3 -49
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
- package/package.json +1 -1
- package/src/components/QueryBuilderParametersPanel.tsx +0 -55
- package/src/components/QueryBuilderSideBar.tsx +35 -0
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +46 -60
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +3 -53
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +19 -132
- package/src/components/result/QueryBuilderResultPanel.tsx +1 -9
- package/src/components/shared/BasicValueSpecificationEditor.tsx +29 -18
- package/src/components/shared/QueryBuilderVariableSelector.tsx +0 -22
- package/src/stores/QueryBuilderPreviewDataHelper.ts +2 -1
- package/src/stores/QueryBuilderPropertyEditorState.ts +1 -2
- package/src/stores/QueryBuilderState.ts +0 -14
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +0 -11
- package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.ts +26 -1
- package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +0 -24
- package/src/stores/milestoning/QueryBuilderMilestoningState.ts +7 -65
@@ -46,7 +46,7 @@ import { useApplicationStore } from '@finos/legend-application';
|
|
46
46
|
import type { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
|
47
47
|
import type { QueryBuilderTDSColumnState } from '../../stores/fetch-structure/tds/QueryBuilderTDSColumnState.js';
|
48
48
|
import { COLUMN_SORT_TYPE } from '../../graph/QueryBuilderMetaModelConst.js';
|
49
|
-
import { useCallback, useEffect,
|
49
|
+
import { useCallback, useEffect, useState } from 'react';
|
50
50
|
import type { QueryBuilderProjectionColumnState } from '../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
|
51
51
|
import { QUERY_BUILDER_TEST_ID } from '../../__lib__/QueryBuilderTesting.js';
|
52
52
|
import { VariableSelector } from '../shared/QueryBuilderVariableSelector.js';
|
@@ -63,7 +63,6 @@ import {
|
|
63
63
|
type QueryBuilderVariableDragSource,
|
64
64
|
} from '../shared/BasicValueSpecificationEditor.js';
|
65
65
|
import { useDrop } from 'react-dnd';
|
66
|
-
import { MilestoningParametersEditorContent } from '../explorer/QueryBuilderMilestoningEditor.js';
|
67
66
|
|
68
67
|
const ColumnSortEditor = observer(
|
69
68
|
(props: {
|
@@ -260,31 +259,6 @@ export const QueryResultModifierModal = observer(
|
|
260
259
|
deepClone(watermarkState.value),
|
261
260
|
);
|
262
261
|
|
263
|
-
//milestoning config
|
264
|
-
const milestoningState = tdsState.queryBuilderState.milestoningState;
|
265
|
-
const businessDate = useRef(milestoningState.businessDate);
|
266
|
-
const processingDate = useRef(milestoningState.processingDate);
|
267
|
-
const isAllVersionsEnabled = useRef(milestoningState.isAllVersionsEnabled);
|
268
|
-
const isAllVersionsInRangeEnabled = useRef(
|
269
|
-
milestoningState.isAllVersionsInRangeEnabled,
|
270
|
-
);
|
271
|
-
const startDate = useRef(milestoningState.startDate);
|
272
|
-
const endDate = useRef(milestoningState.endDate);
|
273
|
-
|
274
|
-
const resetMilestoningToInitial = (): void => {
|
275
|
-
if (isAllVersionsInRangeEnabled.current) {
|
276
|
-
milestoningState.setAllVersionsInRange(
|
277
|
-
isAllVersionsInRangeEnabled.current,
|
278
|
-
);
|
279
|
-
milestoningState.setStartDate(startDate.current);
|
280
|
-
milestoningState.setEndDate(endDate.current);
|
281
|
-
} else {
|
282
|
-
milestoningState.setAllVersions(isAllVersionsEnabled.current);
|
283
|
-
}
|
284
|
-
milestoningState.setBusinessDate(businessDate.current);
|
285
|
-
milestoningState.setProcessingDate(processingDate.current);
|
286
|
-
};
|
287
|
-
|
288
262
|
// Sync temp state with tdsState when modal is opened/closed
|
289
263
|
useEffect(() => {
|
290
264
|
setSortColumns(cloneSortColumnStateArray(stateSortColumns));
|
@@ -302,10 +276,7 @@ export const QueryResultModifierModal = observer(
|
|
302
276
|
]);
|
303
277
|
|
304
278
|
// Handle user actions
|
305
|
-
const closeModal = (): void =>
|
306
|
-
resetMilestoningToInitial();
|
307
|
-
resultSetModifierState.setShowModal(false);
|
308
|
-
};
|
279
|
+
const closeModal = (): void => resultSetModifierState.setShowModal(false);
|
309
280
|
const applyChanges = (): void => {
|
310
281
|
resultSetModifierState.setSortColumns(sortColumns);
|
311
282
|
resultSetModifierState.setDistinct(distinct);
|
@@ -317,13 +288,6 @@ export const QueryResultModifierModal = observer(
|
|
317
288
|
}
|
318
289
|
resultSetModifierState.setShowModal(false);
|
319
290
|
watermarkState.setValue(watermarkValue);
|
320
|
-
businessDate.current = milestoningState.businessDate;
|
321
|
-
processingDate.current = milestoningState.processingDate;
|
322
|
-
isAllVersionsEnabled.current = milestoningState.isAllVersionsEnabled;
|
323
|
-
isAllVersionsInRangeEnabled.current =
|
324
|
-
milestoningState.isAllVersionsInRangeEnabled;
|
325
|
-
startDate.current = milestoningState.startDate;
|
326
|
-
endDate.current = milestoningState.endDate;
|
327
291
|
};
|
328
292
|
|
329
293
|
const handleLimitResultsChange: React.ChangeEventHandler<
|
@@ -433,23 +397,9 @@ export const QueryResultModifierModal = observer(
|
|
433
397
|
}
|
434
398
|
className="editor-modal query-builder__projection__modal"
|
435
399
|
>
|
436
|
-
<ModalHeader title="
|
400
|
+
<ModalHeader title="Result Set Modifier" />
|
437
401
|
<ModalBody className="query-builder__projection__modal__body">
|
438
402
|
<div className="query-builder__projection__options">
|
439
|
-
{tdsState.queryBuilderState.milestoningState
|
440
|
-
.isMilestonedQuery && (
|
441
|
-
<>
|
442
|
-
<div className="query-builder__projection__options__section-name">
|
443
|
-
Milestoning
|
444
|
-
</div>
|
445
|
-
<MilestoningParametersEditorContent
|
446
|
-
queryBuilderState={tdsState.queryBuilderState}
|
447
|
-
/>
|
448
|
-
<div className="query-builder__projection__options__section-name">
|
449
|
-
Other
|
450
|
-
</div>
|
451
|
-
</>
|
452
|
-
)}
|
453
403
|
<ColumnsSortEditor
|
454
404
|
projectionColumns={tdsState.projectionColumns}
|
455
405
|
sortColumns={sortColumns}
|
@@ -1138,134 +1138,27 @@ export const QueryBuilderTDSPanel = observer(
|
|
1138
1138
|
>
|
1139
1139
|
<div className="query-builder__projection__result-modifier-prompt__header">
|
1140
1140
|
<button
|
1141
|
-
className="query-builder__projection__result-modifier-prompt__header__label
|
1141
|
+
className="query-builder__projection__result-modifier-prompt__header__label"
|
1142
1142
|
onClick={openResultSetModifierEditor}
|
1143
|
-
title="Configure
|
1143
|
+
title="Configure result set modifiers..."
|
1144
1144
|
>
|
1145
1145
|
<CogIcon className="query-builder__projection__result-modifier-prompt__header__label__icon" />
|
1146
1146
|
<div className="query-builder__projection__result-modifier-prompt__header__label__title">
|
1147
|
-
|
1148
|
-
? 'Query Options'
|
1149
|
-
: 'Set Query Options'}
|
1147
|
+
Query Options
|
1150
1148
|
</div>
|
1151
1149
|
</button>
|
1152
|
-
<div className="query-builder__projection__result-modifier-prompt__divider">
|
1153
|
-
{tdsState.isQueryOptionsSet && ' - '}
|
1154
|
-
</div>
|
1155
|
-
{tdsState.queryBuilderState.milestoningState.businessDate && (
|
1156
|
-
<div className="query-builder__projection__result-modifier-prompt__group">
|
1157
|
-
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1158
|
-
Business Date
|
1159
|
-
</div>
|
1160
|
-
<button
|
1161
|
-
className="query-builder__projection__result-modifier-prompt__header__label editable-value"
|
1162
|
-
onClick={openResultSetModifierEditor}
|
1163
|
-
>
|
1164
|
-
<div className="query-builder__projection__result-modifier-prompt__header__label__title">
|
1165
|
-
{getNameOfValueSpecification(
|
1166
|
-
tdsState.queryBuilderState.milestoningState.getMilestoningParameterValue(
|
1167
|
-
tdsState.queryBuilderState.milestoningState
|
1168
|
-
.businessDate,
|
1169
|
-
) ??
|
1170
|
-
tdsState.queryBuilderState.milestoningState
|
1171
|
-
.businessDate,
|
1172
|
-
tdsState.queryBuilderState,
|
1173
|
-
)}
|
1174
|
-
</div>
|
1175
|
-
</button>
|
1176
|
-
</div>
|
1177
|
-
)}
|
1178
|
-
{tdsState.queryBuilderState.milestoningState.processingDate && (
|
1179
|
-
<div className="query-builder__projection__result-modifier-prompt__group">
|
1180
|
-
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1181
|
-
Processing Date
|
1182
|
-
</div>
|
1183
|
-
<button
|
1184
|
-
className="query-builder__projection__result-modifier-prompt__header__label editable-value"
|
1185
|
-
onClick={openResultSetModifierEditor}
|
1186
|
-
>
|
1187
|
-
<div className="query-builder__projection__result-modifier-prompt__header__label__title">
|
1188
|
-
{getNameOfValueSpecification(
|
1189
|
-
tdsState.queryBuilderState.milestoningState.getMilestoningParameterValue(
|
1190
|
-
tdsState.queryBuilderState.milestoningState
|
1191
|
-
.processingDate,
|
1192
|
-
) ??
|
1193
|
-
tdsState.queryBuilderState.milestoningState
|
1194
|
-
.processingDate,
|
1195
|
-
tdsState.queryBuilderState,
|
1196
|
-
)}
|
1197
|
-
</div>
|
1198
|
-
</button>
|
1199
|
-
</div>
|
1200
|
-
)}
|
1201
|
-
{tdsState.queryBuilderState.milestoningState
|
1202
|
-
.isAllVersionsEnabled &&
|
1203
|
-
!tdsState.queryBuilderState.milestoningState
|
1204
|
-
.isAllVersionsInRangeEnabled && (
|
1205
|
-
<div className="query-builder__projection__result-modifier-prompt__group">
|
1206
|
-
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1207
|
-
All Versions
|
1208
|
-
</div>
|
1209
|
-
<button
|
1210
|
-
className="query-builder__projection__result-modifier-prompt__header__label editable-value"
|
1211
|
-
onClick={openResultSetModifierEditor}
|
1212
|
-
>
|
1213
|
-
<div className="query-builder__projection__result-modifier-prompt__header__label__title">
|
1214
|
-
Yes
|
1215
|
-
</div>
|
1216
|
-
</button>
|
1217
|
-
</div>
|
1218
|
-
)}
|
1219
|
-
{tdsState.queryBuilderState.milestoningState
|
1220
|
-
.isAllVersionsInRangeEnabled &&
|
1221
|
-
tdsState.queryBuilderState.milestoningState.startDate &&
|
1222
|
-
tdsState.queryBuilderState.milestoningState.endDate && (
|
1223
|
-
<div className="query-builder__projection__result-modifier-prompt__group">
|
1224
|
-
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1225
|
-
All Versions
|
1226
|
-
</div>
|
1227
|
-
<button
|
1228
|
-
className="query-builder__projection__result-modifier-prompt__header__label editable-value"
|
1229
|
-
onClick={openResultSetModifierEditor}
|
1230
|
-
>
|
1231
|
-
<div className="query-builder__projection__result-modifier-prompt__header__label__title">
|
1232
|
-
(
|
1233
|
-
{getNameOfValueSpecification(
|
1234
|
-
tdsState.queryBuilderState.milestoningState.getMilestoningParameterValue(
|
1235
|
-
tdsState.queryBuilderState.milestoningState
|
1236
|
-
.startDate,
|
1237
|
-
) ??
|
1238
|
-
tdsState.queryBuilderState.milestoningState
|
1239
|
-
.startDate,
|
1240
|
-
tdsState.queryBuilderState,
|
1241
|
-
)}{' '}
|
1242
|
-
-{' '}
|
1243
|
-
{getNameOfValueSpecification(
|
1244
|
-
tdsState.queryBuilderState.milestoningState.getMilestoningParameterValue(
|
1245
|
-
tdsState.queryBuilderState.milestoningState.endDate,
|
1246
|
-
) ??
|
1247
|
-
tdsState.queryBuilderState.milestoningState.endDate,
|
1248
|
-
tdsState.queryBuilderState,
|
1249
|
-
)}
|
1250
|
-
)
|
1251
|
-
</div>
|
1252
|
-
</button>
|
1253
|
-
</div>
|
1254
|
-
)}
|
1255
1150
|
</div>
|
1256
1151
|
{tdsState.resultSetModifierState.limit && (
|
1257
1152
|
<div className="query-builder__projection__result-modifier-prompt__group">
|
1258
1153
|
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1259
1154
|
Max Rows
|
1260
1155
|
</div>
|
1261
|
-
<
|
1262
|
-
className="query-builder__projection__result-modifier-
|
1156
|
+
<div
|
1157
|
+
className="query-builder__projection__result-modifier-prompt__group__content"
|
1263
1158
|
onClick={openResultSetModifierEditor}
|
1264
1159
|
>
|
1265
|
-
|
1266
|
-
|
1267
|
-
</div>
|
1268
|
-
</button>
|
1160
|
+
{tdsState.resultSetModifierState.limit}
|
1161
|
+
</div>
|
1269
1162
|
</div>
|
1270
1163
|
)}
|
1271
1164
|
{tdsState.resultSetModifierState.distinct && (
|
@@ -1273,14 +1166,12 @@ export const QueryBuilderTDSPanel = observer(
|
|
1273
1166
|
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1274
1167
|
Eliminate Duplicate Rows
|
1275
1168
|
</div>
|
1276
|
-
<
|
1277
|
-
className="query-builder__projection__result-modifier-
|
1169
|
+
<div
|
1170
|
+
className="query-builder__projection__result-modifier-prompt__group__content"
|
1278
1171
|
onClick={openResultSetModifierEditor}
|
1279
1172
|
>
|
1280
|
-
|
1281
|
-
|
1282
|
-
</div>
|
1283
|
-
</button>
|
1173
|
+
Yes
|
1174
|
+
</div>
|
1284
1175
|
</div>
|
1285
1176
|
)}
|
1286
1177
|
{tdsState.resultSetModifierState.sortColumns.length > 0 && (
|
@@ -1290,15 +1181,13 @@ export const QueryBuilderTDSPanel = observer(
|
|
1290
1181
|
</div>
|
1291
1182
|
{tdsState.resultSetModifierState.sortColumns.map(
|
1292
1183
|
(columnState) => (
|
1293
|
-
<
|
1184
|
+
<div
|
1185
|
+
className="query-builder__projection__result-modifier-prompt__group__content"
|
1294
1186
|
key={columnState.columnState.uuid}
|
1295
|
-
className="query-builder__projection__result-modifier-prompt__header__label editable-value"
|
1296
1187
|
onClick={openResultSetModifierEditor}
|
1297
1188
|
>
|
1298
|
-
|
1299
|
-
|
1300
|
-
</div>
|
1301
|
-
</button>
|
1189
|
+
{`${columnState.columnState.columnName} ${columnState.sortType}`}
|
1190
|
+
</div>
|
1302
1191
|
),
|
1303
1192
|
)}
|
1304
1193
|
</div>
|
@@ -1308,14 +1197,12 @@ export const QueryBuilderTDSPanel = observer(
|
|
1308
1197
|
<div className="query-builder__projection__result-modifier-prompt__group__label">
|
1309
1198
|
Slice
|
1310
1199
|
</div>
|
1311
|
-
<
|
1312
|
-
className="query-builder__projection__result-modifier-
|
1200
|
+
<div
|
1201
|
+
className="query-builder__projection__result-modifier-prompt__group__content"
|
1313
1202
|
onClick={openResultSetModifierEditor}
|
1314
1203
|
>
|
1315
|
-
|
1316
|
-
|
1317
|
-
</div>
|
1318
|
-
</button>
|
1204
|
+
{`${tdsState.resultSetModifierState.slice[0]},${tdsState.resultSetModifierState.slice[1]}`}
|
1205
|
+
</div>
|
1319
1206
|
</div>
|
1320
1207
|
)}
|
1321
1208
|
{tdsState.queryBuilderState.watermarkState.value && (
|
@@ -204,15 +204,7 @@ export const QueryBuilderResultPanel = observer(
|
|
204
204
|
const runQuery = (): void => {
|
205
205
|
resultState.setSelectedCells([]);
|
206
206
|
resultState.pressedRunQuery.inProgress();
|
207
|
-
if (
|
208
|
-
queryParametersState.parameterStates.length &&
|
209
|
-
queryParametersState.parameterStates.find(
|
210
|
-
(param) =>
|
211
|
-
!queryBuilderState.milestoningState.isMilestoningParameter(
|
212
|
-
param.parameter,
|
213
|
-
),
|
214
|
-
)
|
215
|
-
) {
|
207
|
+
if (queryParametersState.parameterStates.length) {
|
216
208
|
queryParametersState.parameterValuesEditorState.open(
|
217
209
|
(): Promise<void> =>
|
218
210
|
flowResult(resultState.runQuery()).catch(
|
@@ -727,16 +727,26 @@ const PrimitiveCollectionInstanceValueEditor = observer(
|
|
727
727
|
const convertInputValueToValueSpec = (): ValueSpecification | null => {
|
728
728
|
const trimmedInputValue = inputValue.trim();
|
729
729
|
|
730
|
-
if (isValueAlreadySelected(trimmedInputValue)) {
|
731
|
-
return null;
|
732
|
-
}
|
733
|
-
|
734
730
|
if (trimmedInputValue.length) {
|
735
|
-
|
731
|
+
const newValueSpec = convertTextToPrimitiveInstanceValue(
|
736
732
|
expectedType,
|
737
733
|
trimmedInputValue,
|
738
734
|
observerContext,
|
739
735
|
);
|
736
|
+
|
737
|
+
if (
|
738
|
+
newValueSpec === null ||
|
739
|
+
getValueSpecificationStringValue(newValueSpec) === undefined ||
|
740
|
+
isValueAlreadySelected(
|
741
|
+
guaranteeNonNullable(
|
742
|
+
getValueSpecificationStringValue(newValueSpec),
|
743
|
+
),
|
744
|
+
)
|
745
|
+
) {
|
746
|
+
return null;
|
747
|
+
}
|
748
|
+
|
749
|
+
return newValueSpec;
|
740
750
|
}
|
741
751
|
return null;
|
742
752
|
};
|
@@ -830,19 +840,20 @@ const PrimitiveCollectionInstanceValueEditor = observer(
|
|
830
840
|
if (!parsedData) {
|
831
841
|
return;
|
832
842
|
}
|
833
|
-
const newValues = uniq(
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
843
|
+
const newValues = uniq(
|
844
|
+
uniq(parsedData)
|
845
|
+
.map((value) => {
|
846
|
+
const newValueSpec = convertTextToPrimitiveInstanceValue(
|
847
|
+
expectedType,
|
848
|
+
value,
|
849
|
+
observerContext,
|
850
|
+
);
|
851
|
+
return newValueSpec
|
852
|
+
? getValueSpecificationStringValue(newValueSpec)
|
853
|
+
: null;
|
854
|
+
})
|
855
|
+
.filter(isNonNullable),
|
856
|
+
).filter((value) => !isValueAlreadySelected(value));
|
846
857
|
setSelectedOptions([
|
847
858
|
...selectedOptions,
|
848
859
|
...newValues.map((value) => ({ label: value, value })),
|
@@ -149,18 +149,6 @@ export const VariableViewer = observer(
|
|
149
149
|
const variableTypeName =
|
150
150
|
variable.genericType?.value.rawType.name ??
|
151
151
|
(isConstant ? CALCULATED : undefined);
|
152
|
-
const isMilestoningParameter =
|
153
|
-
queryBuilderState.milestoningState.isMilestoningParameter(variable);
|
154
|
-
const milestoningParameterValue =
|
155
|
-
queryBuilderState.milestoningState.getMilestoningParameterValue(variable);
|
156
|
-
const milestoningParameterValueString = isMilestoningParameter
|
157
|
-
? milestoningParameterValue
|
158
|
-
? getNameOfValueSpecification(
|
159
|
-
milestoningParameterValue,
|
160
|
-
queryBuilderState,
|
161
|
-
)
|
162
|
-
: undefined
|
163
|
-
: undefined;
|
164
152
|
const deleteDisabled = isReadOnly || isVariableUsed;
|
165
153
|
const deleteTitle = isVariableUsed ? 'Used in query' : 'Remove';
|
166
154
|
const editVariable = (): void => {
|
@@ -239,16 +227,6 @@ export const VariableViewer = observer(
|
|
239
227
|
<div className="query-builder__variables__variable__type__label">
|
240
228
|
{variableTypeName ?? 'unknown'}
|
241
229
|
</div>
|
242
|
-
{isMilestoningParameter && (
|
243
|
-
<>
|
244
|
-
<div className="query-builder__variables__variable__type__label query-builder__variables__variable__type__label--milestoning">
|
245
|
-
milestoning
|
246
|
-
</div>
|
247
|
-
<div className="query-builder__constants__value">
|
248
|
-
{milestoningParameterValueString}
|
249
|
-
</div>
|
250
|
-
</>
|
251
|
-
)}
|
252
230
|
</div>
|
253
231
|
)}
|
254
232
|
</div>
|
@@ -136,7 +136,7 @@ export const buildNumericPreviewDataQuery = (
|
|
136
136
|
const valAggOp = guaranteeNonNullable(
|
137
137
|
aggregationState.operators.find((t) => t instanceof val[1]),
|
138
138
|
);
|
139
|
-
aggregationState.changeColumnAggregateOperator(valAggOp, colState);
|
139
|
+
aggregationState.changeColumnAggregateOperator(valAggOp, colState, true);
|
140
140
|
});
|
141
141
|
|
142
142
|
return builderState.resultState.buildExecutionRawLambda({
|
@@ -189,6 +189,7 @@ export const buildNonNumericPreviewDataQuery = (
|
|
189
189
|
tdsState.aggregationState.changeColumnAggregateOperator(
|
190
190
|
distinctCountOp,
|
191
191
|
valueCountProjectionState,
|
192
|
+
true,
|
192
193
|
);
|
193
194
|
// result set
|
194
195
|
tdsState.resultSetModifierState.limit = PREVIEW_DATA_TAKE_LIMIT;
|
@@ -161,8 +161,7 @@ export const generateValueSpecificationForParameter = (
|
|
161
161
|
return createNullishValue(graph);
|
162
162
|
};
|
163
163
|
|
164
|
-
|
165
|
-
export const fillDerivedPropertyParameterValues = (
|
164
|
+
const fillDerivedPropertyParameterValues = (
|
166
165
|
derivedPropertyExpressionState: QueryBuilderDerivedPropertyExpressionState,
|
167
166
|
): void => {
|
168
167
|
const parameterValues: ValueSpecification[] =
|
@@ -110,8 +110,6 @@ import type { QueryBuilderConfig } from '../graph-manager/QueryBuilderConfig.js'
|
|
110
110
|
import { QUERY_BUILDER_EVENT } from '../__lib__/QueryBuilderEvent.js';
|
111
111
|
import { QueryBuilderChangeHistoryState } from './QueryBuilderChangeHistoryState.js';
|
112
112
|
import { type QueryBuilderWorkflowState } from './query-workflow/QueryBuilderWorkFlowState.js';
|
113
|
-
import { initializeMilestoningStateFromDerivedProperty } from './milestoning/QueryBuilderMilestoningHelper.js';
|
114
|
-
import { QueryBuilderSimpleProjectionColumnState } from './fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
|
115
113
|
|
116
114
|
export interface QuerySDLC {}
|
117
115
|
|
@@ -699,18 +697,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
699
697
|
);
|
700
698
|
}
|
701
699
|
if (this.parametersState.parameterStates.length > 0) {
|
702
|
-
const fetchStructureStateImp = this.fetchStructureState.implementation;
|
703
|
-
if (fetchStructureStateImp instanceof QueryBuilderTDSState) {
|
704
|
-
fetchStructureStateImp.projectionColumns.forEach((colState) => {
|
705
|
-
if (colState instanceof QueryBuilderSimpleProjectionColumnState) {
|
706
|
-
colState.propertyExpressionState.derivedPropertyExpressionStates.forEach(
|
707
|
-
(state) => {
|
708
|
-
initializeMilestoningStateFromDerivedProperty(state);
|
709
|
-
},
|
710
|
-
);
|
711
|
-
}
|
712
|
-
});
|
713
|
-
}
|
714
700
|
this.setShowParametersPanel(true);
|
715
701
|
}
|
716
702
|
this.fetchStructureState.initializeWithQuery();
|
@@ -146,7 +146,6 @@ export class QueryBuilderTDSState
|
|
146
146
|
TEMPORARY__showPostFetchStructurePanel: computed,
|
147
147
|
derivations: computed,
|
148
148
|
hasParserError: computed,
|
149
|
-
isQueryOptionsSet: computed,
|
150
149
|
addColumn: action,
|
151
150
|
moveColumn: action,
|
152
151
|
removeAllColumns: action,
|
@@ -357,16 +356,6 @@ export class QueryBuilderTDSState
|
|
357
356
|
return fetchStructureValidationIssues;
|
358
357
|
}
|
359
358
|
|
360
|
-
get isQueryOptionsSet(): boolean {
|
361
|
-
return (
|
362
|
-
this.resultSetModifierState.limit !== undefined ||
|
363
|
-
this.queryBuilderState.milestoningState.isMilestonedQuery ||
|
364
|
-
this.resultSetModifierState.slice !== undefined ||
|
365
|
-
this.resultSetModifierState.sortColumns.length > 0 ||
|
366
|
-
this.resultSetModifierState.distinct
|
367
|
-
);
|
368
|
-
}
|
369
|
-
|
370
359
|
get tdsColumns(): QueryBuilderTDSColumnState[] {
|
371
360
|
const aggregationStateCols = this.aggregationState.columns.map(
|
372
361
|
(c) => c.projectionColumnState,
|
@@ -155,6 +155,7 @@ export class QueryBuilderAggregationState implements Hashable {
|
|
155
155
|
changeColumnAggregateOperator(
|
156
156
|
val: QueryBuilderAggregateOperator | undefined,
|
157
157
|
projectionColumnState: QueryBuilderProjectionColumnState,
|
158
|
+
hideOperatorInColumnName?: boolean,
|
158
159
|
): void {
|
159
160
|
const aggregateColumnState = this.columns.find(
|
160
161
|
(column) => column.projectionColumnState === projectionColumnState,
|
@@ -167,8 +168,24 @@ export class QueryBuilderAggregationState implements Hashable {
|
|
167
168
|
return;
|
168
169
|
}
|
169
170
|
if (aggregateColumnState) {
|
171
|
+
if (!hideOperatorInColumnName) {
|
172
|
+
const colName =
|
173
|
+
aggregateColumnState.projectionColumnState.columnName.split(
|
174
|
+
`(${aggregateColumnState.operator.getLabel(
|
175
|
+
aggregateColumnState.projectionColumnState,
|
176
|
+
)})`,
|
177
|
+
)[0] ?? '';
|
178
|
+
aggregateColumnState.projectionColumnState.setColumnName(
|
179
|
+
`${colName} (${val.getLabel(projectionColumnState)})`,
|
180
|
+
);
|
181
|
+
}
|
170
182
|
aggregateColumnState.setOperator(val);
|
171
183
|
} else {
|
184
|
+
if (!hideOperatorInColumnName) {
|
185
|
+
projectionColumnState.setColumnName(
|
186
|
+
`${projectionColumnState.columnName} (${val.getLabel(projectionColumnState)})`,
|
187
|
+
);
|
188
|
+
}
|
172
189
|
const newAggregateColumnState = new QueryBuilderAggregateColumnState(
|
173
190
|
this,
|
174
191
|
projectionColumnState,
|
@@ -190,11 +207,19 @@ export class QueryBuilderAggregationState implements Hashable {
|
|
190
207
|
if (aggregateColumnState) {
|
191
208
|
// automatically move the column to the last position before the aggregate columns
|
192
209
|
// NOTE: `moveColumn` will take care of this placement calculation
|
210
|
+
if (!hideOperatorInColumnName) {
|
211
|
+
const colName =
|
212
|
+
aggregateColumnState.projectionColumnState.columnName.split(
|
213
|
+
`(${aggregateColumnState.operator.getLabel(
|
214
|
+
aggregateColumnState.projectionColumnState,
|
215
|
+
)})`,
|
216
|
+
)[0] ?? '';
|
217
|
+
aggregateColumnState.projectionColumnState.setColumnName(colName);
|
218
|
+
}
|
193
219
|
this.tdsState.moveColumn(
|
194
220
|
this.tdsState.projectionColumns.indexOf(projectionColumnState),
|
195
221
|
0,
|
196
222
|
);
|
197
|
-
|
198
223
|
this.removeColumn(aggregateColumnState);
|
199
224
|
}
|
200
225
|
}
|
@@ -290,30 +290,6 @@ export const generateMilestonedPropertyParameterValue = (
|
|
290
290
|
);
|
291
291
|
};
|
292
292
|
|
293
|
-
export const initializeMilestoningStateFromDerivedProperty = (
|
294
|
-
derivedPropertyExpressionState: QueryBuilderDerivedPropertyExpressionState,
|
295
|
-
): void => {
|
296
|
-
const milestoningState =
|
297
|
-
derivedPropertyExpressionState.queryBuilderState.milestoningState;
|
298
|
-
const temporalTarget =
|
299
|
-
derivedPropertyExpressionState.propertyExpression.func.value.genericType
|
300
|
-
.value.rawType instanceof Class &&
|
301
|
-
derivedPropertyExpressionState.propertyExpression.func.value._OWNER
|
302
|
-
._generatedMilestonedProperties.length !== 0
|
303
|
-
? getMilestoneTemporalStereotype(
|
304
|
-
derivedPropertyExpressionState.propertyExpression.func.value
|
305
|
-
.genericType.value.rawType,
|
306
|
-
derivedPropertyExpressionState.queryBuilderState.graphManagerState
|
307
|
-
.graph,
|
308
|
-
)
|
309
|
-
: undefined;
|
310
|
-
if (temporalTarget) {
|
311
|
-
milestoningState
|
312
|
-
.getMilestoningImplementation(temporalTarget)
|
313
|
-
.initializeMilestoningParameters();
|
314
|
-
}
|
315
|
-
};
|
316
|
-
|
317
293
|
export const validateMilestoningPropertyExpressionChain = (
|
318
294
|
sourceStereotype: MILESTONING_STEREOTYPE | undefined,
|
319
295
|
targetStereotype: MILESTONING_STEREOTYPE,
|