@finos/legend-query-builder 0.3.1 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +24 -20
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +4 -8
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +2 -2
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +4 -2
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderTextEditor.js +4 -4
- package/lib/components/QueryBuilderTextEditor.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +5 -5
- package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +6 -6
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.js +6 -6
- package/lib/components/fetch-structure/QueryBuilderOlapGroupByPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +3 -3
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +3 -3
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.js +3 -3
- package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts +23 -0
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -0
- package/lib/components/watermark/QueryBuilderWatermark.js +67 -0
- package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -0
- package/lib/graphManager/QueryBuilderHashUtils.d.ts +1 -0
- package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
- package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
- package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts +1 -0
- package/lib/graphManager/QueryBuilderSupportedFunctions.d.ts.map +1 -1
- package/lib/graphManager/QueryBuilderSupportedFunctions.js +2 -0
- package/lib/graphManager/QueryBuilderSupportedFunctions.js.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +4 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +1 -0
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +29 -2
- package/lib/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.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/QueryBuilderState.d.ts +4 -0
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +12 -0
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +12 -1
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +7 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +2 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +31 -0
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -0
- package/lib/stores/watermark/QueryBuilderWatermarkState.js +69 -0
- package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -0
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +19 -0
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -0
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +30 -0
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -0
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +19 -0
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -0
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +30 -0
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -0
- package/package.json +4 -4
- package/src/components/QueryBuilder.tsx +141 -109
- package/src/components/QueryBuilderParametersPanel.tsx +27 -35
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +16 -11
- package/src/components/QueryBuilderResultPanel.tsx +18 -0
- package/src/components/QueryBuilderTextEditor.tsx +22 -17
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +20 -13
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +27 -18
- package/src/components/fetch-structure/QueryBuilderOlapGroupByPanel.tsx +22 -18
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +11 -9
- package/src/components/shared/LambdaEditor.tsx +20 -17
- package/src/components/shared/LambdaParameterValuesEditor.tsx +17 -10
- package/src/components/watermark/QueryBuilderWatermark.tsx +185 -0
- package/src/graphManager/QueryBuilderHashUtils.ts +3 -0
- package/src/graphManager/QueryBuilderSupportedFunctions.ts +2 -0
- package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +14 -0
- package/src/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +76 -0
- package/src/stores/QueryBuilderState.ts +14 -0
- package/src/stores/QueryBuilderStateBuilder.ts +17 -1
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +11 -1
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +2 -1
- package/src/stores/watermark/QueryBuilderWatermarkState.ts +114 -0
- package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +50 -0
- package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +46 -0
- package/tsconfig.json +4 -0
@@ -34,7 +34,15 @@ import {
|
|
34
34
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
35
35
|
import { useDrop } from 'react-dnd';
|
36
36
|
import { VariableExpressionViewer } from '../QueryBuilderParametersPanel.js';
|
37
|
-
import {
|
37
|
+
import {
|
38
|
+
Dialog,
|
39
|
+
Modal,
|
40
|
+
ModalBody,
|
41
|
+
ModalFooter,
|
42
|
+
ModalHeader,
|
43
|
+
PanelEntryDropZonePlaceholder,
|
44
|
+
PanelFormSection,
|
45
|
+
} from '@finos/legend-art';
|
38
46
|
import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
|
39
47
|
import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
|
40
48
|
import { instanceValue_setValues } from '../../stores/shared/ValueSpecificationModifierHelper.js';
|
@@ -152,7 +160,7 @@ const BiTemporalMilestoningEditor = observer(
|
|
152
160
|
const { queryBuilderState } = props;
|
153
161
|
return (
|
154
162
|
<>
|
155
|
-
<
|
163
|
+
<PanelFormSection>
|
156
164
|
<div className="panel__content__form__section__header__label">
|
157
165
|
Processing Date
|
158
166
|
</div>
|
@@ -160,8 +168,8 @@ const BiTemporalMilestoningEditor = observer(
|
|
160
168
|
queryBuilderState={queryBuilderState}
|
161
169
|
stereotype={MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL}
|
162
170
|
/>
|
163
|
-
</
|
164
|
-
<
|
171
|
+
</PanelFormSection>
|
172
|
+
<PanelFormSection>
|
165
173
|
<div className="panel__content__form__section__header__label">
|
166
174
|
Business Date
|
167
175
|
</div>
|
@@ -169,7 +177,7 @@ const BiTemporalMilestoningEditor = observer(
|
|
169
177
|
queryBuilderState={queryBuilderState}
|
170
178
|
stereotype={MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL}
|
171
179
|
/>
|
172
|
-
</
|
180
|
+
</PanelFormSection>
|
173
181
|
</>
|
174
182
|
);
|
175
183
|
},
|
@@ -179,7 +187,7 @@ const BusinessTemporalMilestoningEditor = observer(
|
|
179
187
|
(props: { queryBuilderState: QueryBuilderState }) => {
|
180
188
|
const { queryBuilderState } = props;
|
181
189
|
return (
|
182
|
-
<
|
190
|
+
<PanelFormSection>
|
183
191
|
<div className="panel__content__form__section__header__label">
|
184
192
|
Business Date
|
185
193
|
</div>
|
@@ -188,7 +196,7 @@ const BusinessTemporalMilestoningEditor = observer(
|
|
188
196
|
queryBuilderState={queryBuilderState}
|
189
197
|
stereotype={MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL}
|
190
198
|
/>
|
191
|
-
</
|
199
|
+
</PanelFormSection>
|
192
200
|
);
|
193
201
|
},
|
194
202
|
);
|
@@ -197,7 +205,7 @@ const ProcessingTemporalMilestoningEditor = observer(
|
|
197
205
|
(props: { queryBuilderState: QueryBuilderState }) => {
|
198
206
|
const { queryBuilderState } = props;
|
199
207
|
return (
|
200
|
-
<
|
208
|
+
<PanelFormSection>
|
201
209
|
<div className="panel__content__form__section__header__label">
|
202
210
|
Processing Date
|
203
211
|
</div>
|
@@ -206,7 +214,7 @@ const ProcessingTemporalMilestoningEditor = observer(
|
|
206
214
|
queryBuilderState={queryBuilderState}
|
207
215
|
stereotype={MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL}
|
208
216
|
/>
|
209
|
-
</
|
217
|
+
</PanelFormSection>
|
210
218
|
);
|
211
219
|
},
|
212
220
|
);
|
@@ -256,11 +264,12 @@ export const MilestoningParametersEditor = observer(
|
|
256
264
|
paper: 'editor-modal__content',
|
257
265
|
}}
|
258
266
|
>
|
259
|
-
<
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
<
|
267
|
+
<Modal
|
268
|
+
darkMode={true}
|
269
|
+
className="editor-modal query-builder__parameters__modal"
|
270
|
+
>
|
271
|
+
<ModalHeader title="Milestoning Parameters" />
|
272
|
+
<ModalBody className="query-builder__parameters__modal__body">
|
264
273
|
<TemporalMilestoningEditor queryBuilderState={queryBuilderState} />
|
265
274
|
<div className="panel__content__form__section__header__label">
|
266
275
|
List of compatible milestoning parameters
|
@@ -288,13 +297,13 @@ export const MilestoningParametersEditor = observer(
|
|
288
297
|
/>
|
289
298
|
))}
|
290
299
|
</div>
|
291
|
-
</
|
292
|
-
<
|
300
|
+
</ModalBody>
|
301
|
+
<ModalFooter>
|
293
302
|
<button className="btn modal__footer__close-btn" onClick={close}>
|
294
303
|
Close
|
295
304
|
</button>
|
296
|
-
</
|
297
|
-
</
|
305
|
+
</ModalFooter>
|
306
|
+
</Modal>
|
298
307
|
</Dialog>
|
299
308
|
);
|
300
309
|
},
|
@@ -38,6 +38,10 @@ import {
|
|
38
38
|
WindowIcon,
|
39
39
|
BasePopover,
|
40
40
|
EditIcon,
|
41
|
+
ModalHeader,
|
42
|
+
Modal,
|
43
|
+
ModalFooter,
|
44
|
+
PanelFormSection,
|
41
45
|
} from '@finos/legend-art';
|
42
46
|
import { assertErrorThrown, guaranteeNonNullable } from '@finos/legend-shared';
|
43
47
|
import { observer } from 'mobx-react-lite';
|
@@ -260,16 +264,16 @@ const QueryBuilderOlapColumnModalEditor = observer(
|
|
260
264
|
paper: 'editor-modal__content',
|
261
265
|
}}
|
262
266
|
>
|
263
|
-
<
|
264
|
-
<
|
265
|
-
|
266
|
-
|
267
|
+
<Modal darkMode={true} className="query-builder__olap__modal">
|
268
|
+
<ModalHeader
|
269
|
+
title={
|
270
|
+
createNewOlap
|
267
271
|
? 'Create OLAP GroupBy Column'
|
268
|
-
: 'Update OLAP GroupByColumn'
|
269
|
-
|
270
|
-
|
272
|
+
: 'Update OLAP GroupByColumn'
|
273
|
+
}
|
274
|
+
/>
|
271
275
|
<div className="query-builder__olap__modal__body">
|
272
|
-
<
|
276
|
+
<PanelFormSection>
|
273
277
|
<div className="panel__content__form__section__header__label">
|
274
278
|
OLAP Column Name
|
275
279
|
</div>
|
@@ -285,8 +289,8 @@ const QueryBuilderOlapColumnModalEditor = observer(
|
|
285
289
|
isDuplicatedColumnName ? 'Duplicated column' : undefined
|
286
290
|
}
|
287
291
|
/>
|
288
|
-
</
|
289
|
-
<
|
292
|
+
</PanelFormSection>
|
293
|
+
<PanelFormSection>
|
290
294
|
<div className="panel__content__form__section__header__label">
|
291
295
|
OLAP Operator
|
292
296
|
</div>
|
@@ -371,8 +375,8 @@ const QueryBuilderOlapColumnModalEditor = observer(
|
|
371
375
|
</div>
|
372
376
|
</div>
|
373
377
|
</div>
|
374
|
-
</
|
375
|
-
<
|
378
|
+
</PanelFormSection>
|
379
|
+
<PanelFormSection>
|
376
380
|
<div className="panel__content__form__section__header__label">
|
377
381
|
Window Columns
|
378
382
|
</div>
|
@@ -407,8 +411,8 @@ const QueryBuilderOlapColumnModalEditor = observer(
|
|
407
411
|
</button>
|
408
412
|
</div>
|
409
413
|
</div>
|
410
|
-
</
|
411
|
-
<
|
414
|
+
</PanelFormSection>
|
415
|
+
<PanelFormSection>
|
412
416
|
<div className="panel__content__form__section__header__label">
|
413
417
|
Sort By
|
414
418
|
</div>
|
@@ -497,9 +501,9 @@ const QueryBuilderOlapColumnModalEditor = observer(
|
|
497
501
|
</DropdownMenu>
|
498
502
|
</div>
|
499
503
|
</div>
|
500
|
-
</
|
504
|
+
</PanelFormSection>
|
501
505
|
</div>
|
502
|
-
<
|
506
|
+
<ModalFooter>
|
503
507
|
{createNewOlap ? (
|
504
508
|
<button className="btn modal__footer__close-btn" onClick={create}>
|
505
509
|
Create
|
@@ -509,8 +513,8 @@ const QueryBuilderOlapColumnModalEditor = observer(
|
|
509
513
|
Close
|
510
514
|
</button>
|
511
515
|
)}
|
512
|
-
</
|
513
|
-
</
|
516
|
+
</ModalFooter>
|
517
|
+
</Modal>
|
514
518
|
</Dialog>
|
515
519
|
);
|
516
520
|
},
|
@@ -24,6 +24,10 @@ import {
|
|
24
24
|
SortDownAltIcon,
|
25
25
|
SquareIcon,
|
26
26
|
TimesIcon,
|
27
|
+
Modal,
|
28
|
+
ModalBody,
|
29
|
+
ModalFooter,
|
30
|
+
ModalHeader,
|
27
31
|
} from '@finos/legend-art';
|
28
32
|
import {
|
29
33
|
COLUMN_SORT_TYPE,
|
@@ -192,11 +196,9 @@ export const QueryResultModifierModal = observer(
|
|
192
196
|
paper: 'editor-modal__content',
|
193
197
|
}}
|
194
198
|
>
|
195
|
-
<
|
196
|
-
<
|
197
|
-
|
198
|
-
</div>
|
199
|
-
<div className="modal__body query-builder__projection__modal__body">
|
199
|
+
<Modal darkMode={true} className="editor-modal">
|
200
|
+
<ModalHeader title="Result Set Modifier" />
|
201
|
+
<ModalBody className="query-builder__projection__modal__body">
|
200
202
|
<div className="query-builder__projection__options">
|
201
203
|
<ColumnsSortEditor tdsState={tdsState} />
|
202
204
|
<div className="panel__content__form__section">
|
@@ -241,13 +243,13 @@ export const QueryResultModifierModal = observer(
|
|
241
243
|
/>
|
242
244
|
</div>
|
243
245
|
</div>
|
244
|
-
</
|
245
|
-
<
|
246
|
+
</ModalBody>
|
247
|
+
<ModalFooter>
|
246
248
|
<button className="btn modal__footer__close-btn" onClick={close}>
|
247
249
|
Close
|
248
250
|
</button>
|
249
|
-
</
|
250
|
-
</
|
251
|
+
</ModalFooter>
|
252
|
+
</Modal>
|
251
253
|
</Dialog>
|
252
254
|
);
|
253
255
|
},
|
@@ -30,6 +30,11 @@ import {
|
|
30
30
|
useResizeDetector,
|
31
31
|
clearMarkers,
|
32
32
|
setErrorMarkers,
|
33
|
+
Modal,
|
34
|
+
ModalBody,
|
35
|
+
ModalFooter,
|
36
|
+
ModalHeader,
|
37
|
+
ModalTitle,
|
33
38
|
} from '@finos/legend-art';
|
34
39
|
import type { LambdaEditorState } from '../../stores/shared/LambdaEditorState.js';
|
35
40
|
import {
|
@@ -589,25 +594,23 @@ const LambdaEditorPopUp = observer(
|
|
589
594
|
paper: 'editor-modal__content',
|
590
595
|
}}
|
591
596
|
>
|
592
|
-
<
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
},
|
600
|
-
)}
|
597
|
+
<Modal
|
598
|
+
darkMode={true}
|
599
|
+
className={clsx('editor-modal lambda-editor__popup__modal', {
|
600
|
+
'lambda-editor__popup__modal--has-error': Boolean(
|
601
|
+
lambdaEditorState.parserError,
|
602
|
+
),
|
603
|
+
})}
|
601
604
|
>
|
602
|
-
<
|
603
|
-
<
|
605
|
+
<ModalHeader>
|
606
|
+
<ModalTitle title="Edit Lambda" />
|
604
607
|
{lambdaEditorState.parserError && (
|
605
608
|
<div className="modal__title__error-badge">
|
606
609
|
Failed to parse lambda
|
607
610
|
</div>
|
608
611
|
)}
|
609
|
-
</
|
610
|
-
<
|
612
|
+
</ModalHeader>
|
613
|
+
<ModalBody>
|
611
614
|
<div className={clsx('lambda-editor__popup__content', className)}>
|
612
615
|
<div
|
613
616
|
ref={ref}
|
@@ -617,8 +620,8 @@ const LambdaEditorPopUp = observer(
|
|
617
620
|
<div className="text-editor__body" ref={textInputRef} />
|
618
621
|
</div>
|
619
622
|
</div>
|
620
|
-
</
|
621
|
-
<
|
623
|
+
</ModalBody>
|
624
|
+
<ModalFooter>
|
622
625
|
<button
|
623
626
|
className="btn btn--dark btn--caution"
|
624
627
|
onClick={discardChanges}
|
@@ -632,8 +635,8 @@ const LambdaEditorPopUp = observer(
|
|
632
635
|
>
|
633
636
|
Close
|
634
637
|
</button>
|
635
|
-
</
|
636
|
-
</
|
638
|
+
</ModalFooter>
|
639
|
+
</Modal>
|
637
640
|
</Dialog>
|
638
641
|
);
|
639
642
|
},
|
@@ -15,7 +15,13 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { useApplicationStore } from '@finos/legend-application';
|
18
|
-
import {
|
18
|
+
import {
|
19
|
+
Dialog,
|
20
|
+
Modal,
|
21
|
+
ModalBody,
|
22
|
+
ModalFooter,
|
23
|
+
ModalHeader,
|
24
|
+
} from '@finos/legend-art';
|
19
25
|
import {
|
20
26
|
type PureModel,
|
21
27
|
type ValueSpecification,
|
@@ -55,11 +61,12 @@ export const LambdaParameterValuesEditor = observer(
|
|
55
61
|
paper: 'editor-modal__content',
|
56
62
|
}}
|
57
63
|
>
|
58
|
-
<
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<
|
64
|
+
<Modal
|
65
|
+
darkMode={true}
|
66
|
+
className="editor-modal lambda-parameter-values__modal"
|
67
|
+
>
|
68
|
+
<ModalHeader title="Set Parameter Values" />
|
69
|
+
<ModalBody className="lambda-parameter-values__modal__body">
|
63
70
|
{lambdaParametersState.parameterStates.map((paramState) => {
|
64
71
|
const stringType = graph.getPrimitiveType(PRIMITIVE_TYPE.STRING);
|
65
72
|
const variableType = paramState.variableType ?? stringType;
|
@@ -99,8 +106,8 @@ export const LambdaParameterValuesEditor = observer(
|
|
99
106
|
</div>
|
100
107
|
);
|
101
108
|
})}
|
102
|
-
</
|
103
|
-
<
|
109
|
+
</ModalBody>
|
110
|
+
<ModalFooter>
|
104
111
|
{submitAction && (
|
105
112
|
<button
|
106
113
|
className="btn modal__footer__close-btn"
|
@@ -113,8 +120,8 @@ export const LambdaParameterValuesEditor = observer(
|
|
113
120
|
<button className="btn modal__footer__close-btn" onClick={close}>
|
114
121
|
Close
|
115
122
|
</button>
|
116
|
-
</
|
117
|
-
</
|
123
|
+
</ModalFooter>
|
124
|
+
</Modal>
|
118
125
|
</Dialog>
|
119
126
|
);
|
120
127
|
},
|
@@ -0,0 +1,185 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import {
|
18
|
+
Dialog,
|
19
|
+
PanelDropZone,
|
20
|
+
PanelFormBooleanField,
|
21
|
+
PanelForm,
|
22
|
+
PanelDivider,
|
23
|
+
Modal,
|
24
|
+
ModalBody,
|
25
|
+
ModalFooter,
|
26
|
+
ModalHeader,
|
27
|
+
PanelFormListItems,
|
28
|
+
PanelFormSection,
|
29
|
+
} from '@finos/legend-art';
|
30
|
+
import { PRIMITIVE_TYPE, type ValueSpecification } from '@finos/legend-graph';
|
31
|
+
import { observer } from 'mobx-react-lite';
|
32
|
+
import { useCallback } from 'react';
|
33
|
+
import { useDrop } from 'react-dnd';
|
34
|
+
import {
|
35
|
+
type QueryBuilderParameterDragSource,
|
36
|
+
QUERY_BUILDER_PARAMETER_DND_TYPE,
|
37
|
+
} from '../../stores/QueryBuilderParametersState.js';
|
38
|
+
import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
|
39
|
+
import type { QueryBuilderWatermarkState } from '../../stores/watermark/QueryBuilderWatermarkState.js';
|
40
|
+
import { VariableExpressionViewer } from '../QueryBuilderParametersPanel.js';
|
41
|
+
import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
|
42
|
+
|
43
|
+
const WatermarkValueEditor = observer(
|
44
|
+
(props: {
|
45
|
+
watermarkValue: ValueSpecification;
|
46
|
+
watermarkState: QueryBuilderWatermarkState;
|
47
|
+
}) => {
|
48
|
+
const { watermarkValue, watermarkState } = props;
|
49
|
+
|
50
|
+
const graph = watermarkState.queryBuilderState.graphManagerState.graph;
|
51
|
+
|
52
|
+
const handleDrop = useCallback(
|
53
|
+
(item: QueryBuilderParameterDragSource): void => {
|
54
|
+
watermarkState.setValue(item.variable.parameter);
|
55
|
+
},
|
56
|
+
[watermarkState],
|
57
|
+
);
|
58
|
+
|
59
|
+
const [{ isParameterValueDragOver }, dropTargetConnector] = useDrop<
|
60
|
+
QueryBuilderParameterDragSource,
|
61
|
+
void,
|
62
|
+
{ isParameterValueDragOver: boolean }
|
63
|
+
>(
|
64
|
+
() => ({
|
65
|
+
accept: [QUERY_BUILDER_PARAMETER_DND_TYPE],
|
66
|
+
drop: (item, monitor): void => {
|
67
|
+
if (
|
68
|
+
!monitor.didDrop() &&
|
69
|
+
// Only allows parameters with muliplicity 1 and type string
|
70
|
+
watermarkState.isParamaterCompatibleWithWaterMark(
|
71
|
+
item.variable.parameter,
|
72
|
+
)
|
73
|
+
) {
|
74
|
+
handleDrop(item);
|
75
|
+
} // prevent drop event propagation to accomondate for nested DnD
|
76
|
+
},
|
77
|
+
collect: (monitor) => ({
|
78
|
+
isParameterValueDragOver: monitor.isOver({
|
79
|
+
shallow: true,
|
80
|
+
}),
|
81
|
+
}),
|
82
|
+
}),
|
83
|
+
[handleDrop],
|
84
|
+
);
|
85
|
+
|
86
|
+
return (
|
87
|
+
<PanelFormSection>
|
88
|
+
<div className="query-builder__parameter-editor">
|
89
|
+
<PanelDropZone
|
90
|
+
isDragOver={isParameterValueDragOver}
|
91
|
+
dropTargetConnector={dropTargetConnector}
|
92
|
+
>
|
93
|
+
<BasicValueSpecificationEditor
|
94
|
+
valueSpecification={watermarkValue}
|
95
|
+
setValueSpecification={(val: ValueSpecification): void => {
|
96
|
+
watermarkState.setValue(val);
|
97
|
+
}}
|
98
|
+
graph={graph}
|
99
|
+
obseverContext={
|
100
|
+
watermarkState.queryBuilderState.observableContext
|
101
|
+
}
|
102
|
+
typeCheckOption={{
|
103
|
+
expectedType: graph.getPrimitiveType(PRIMITIVE_TYPE.STRING),
|
104
|
+
}}
|
105
|
+
resetValue={(): void => {
|
106
|
+
watermarkState.resetValue();
|
107
|
+
}}
|
108
|
+
/>
|
109
|
+
</PanelDropZone>
|
110
|
+
</div>
|
111
|
+
</PanelFormSection>
|
112
|
+
);
|
113
|
+
},
|
114
|
+
);
|
115
|
+
|
116
|
+
export const QueryBuilderWatermarkEditor = observer(
|
117
|
+
(props: { queryBuilderState: QueryBuilderState }) => {
|
118
|
+
const { queryBuilderState } = props;
|
119
|
+
const watermarkState = queryBuilderState.watermarkState;
|
120
|
+
const handleClose = (): void => {
|
121
|
+
watermarkState.setIsEditingWatermark(false);
|
122
|
+
};
|
123
|
+
const compatibleParameters =
|
124
|
+
queryBuilderState.parametersState.parameterStates.filter((p) =>
|
125
|
+
watermarkState.isParamaterCompatibleWithWaterMark(p.parameter),
|
126
|
+
);
|
127
|
+
|
128
|
+
return (
|
129
|
+
<Dialog
|
130
|
+
open={Boolean(watermarkState.isEditingWatermark)}
|
131
|
+
onClose={handleClose}
|
132
|
+
classes={{
|
133
|
+
root: 'editor-modal__root-container',
|
134
|
+
container: 'editor-modal__container',
|
135
|
+
paper: 'editor-modal__content',
|
136
|
+
}}
|
137
|
+
>
|
138
|
+
<Modal darkMode={true} className="editor-modal">
|
139
|
+
<ModalHeader title="Watermark" />
|
140
|
+
<ModalBody>
|
141
|
+
<PanelForm>
|
142
|
+
<PanelFormBooleanField
|
143
|
+
isReadOnly={false}
|
144
|
+
value={watermarkState.value !== undefined}
|
145
|
+
prompt="Enable watermark"
|
146
|
+
update={(): void => watermarkState.enableWatermark()}
|
147
|
+
/>
|
148
|
+
{watermarkState.value && (
|
149
|
+
<>
|
150
|
+
<WatermarkValueEditor
|
151
|
+
watermarkState={watermarkState}
|
152
|
+
watermarkValue={watermarkState.value}
|
153
|
+
/>
|
154
|
+
<PanelDivider />
|
155
|
+
<PanelFormListItems title="List of available parameters">
|
156
|
+
{compatibleParameters.length === 0 && (
|
157
|
+
<> No available parameters </>
|
158
|
+
)}
|
159
|
+
{compatibleParameters.map((parameter) => (
|
160
|
+
<VariableExpressionViewer
|
161
|
+
key={parameter.uuid}
|
162
|
+
queryBuilderState={queryBuilderState}
|
163
|
+
variableExpressionState={parameter}
|
164
|
+
isReadOnly={true}
|
165
|
+
hideActions={true}
|
166
|
+
/>
|
167
|
+
))}
|
168
|
+
</PanelFormListItems>
|
169
|
+
</>
|
170
|
+
)}
|
171
|
+
</PanelForm>
|
172
|
+
</ModalBody>
|
173
|
+
<ModalFooter>
|
174
|
+
<button
|
175
|
+
className="btn modal__footer__close-btn"
|
176
|
+
onClick={handleClose}
|
177
|
+
>
|
178
|
+
Done
|
179
|
+
</button>
|
180
|
+
</ModalFooter>
|
181
|
+
</Modal>
|
182
|
+
</Dialog>
|
183
|
+
);
|
184
|
+
},
|
185
|
+
);
|
@@ -61,6 +61,9 @@ export enum QUERY_BUILDER_HASH_STRUCTURE {
|
|
61
61
|
POST_FILTER_OPERATOR_NOT_START_WITH = 'POST_FILTER_OPERATOR_NOT_START_WITH',
|
62
62
|
POST_FILTER_STATE = 'POST_FILTER_STATE',
|
63
63
|
|
64
|
+
// watermark state
|
65
|
+
WATERMARK_STATE = 'WATERMARK_STATE',
|
66
|
+
|
64
67
|
// OLAPGroup state
|
65
68
|
OLAP_GROUPBY_STATE = 'OLAP_GROUPBY_STATE',
|
66
69
|
OLAP_GROUPBY_OPERATION_STATE = 'OLAP_GROUPBY_OPERATION_STATE',
|
@@ -65,6 +65,8 @@ export enum QUERY_BUILDER_SUPPORTED_FUNCTIONS {
|
|
65
65
|
STD_DEV_SAMPLE = 'meta::pure::functions::math::stdDevSample',
|
66
66
|
SUM = 'meta::pure::functions::math::sum',
|
67
67
|
UNIQUE_VALUE_ONLY = 'meta::pure::functions::collection::uniqueValueOnly',
|
68
|
+
// watermark
|
69
|
+
WATERMARK = 'meta::datalake::functions::forWatermark',
|
68
70
|
// OLAP
|
69
71
|
OLAP_GROUPBY = 'meta::pure::tds::olapGroupBy',
|
70
72
|
OLAP_RANK = 'meta::pure::functions::math::olap::rank',
|
@@ -23,6 +23,7 @@ import {
|
|
23
23
|
V1_buildOlapGroupByFunctionExpression,
|
24
24
|
V1_buildProjectFunctionExpression,
|
25
25
|
V1_buildSubTypePropertyExpressionTypeInference,
|
26
|
+
V1_buildWatermarkFunctionExpression,
|
26
27
|
} from './v1/V1_QueryValueSpecificationBuilderHelper.js';
|
27
28
|
import {
|
28
29
|
type V1_GraphBuilderContext,
|
@@ -96,6 +97,19 @@ export class QueryBuilder_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
96
97
|
compileContext,
|
97
98
|
processingContext,
|
98
99
|
);
|
100
|
+
} else if (
|
101
|
+
matchFunctionName(
|
102
|
+
functionName,
|
103
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.WATERMARK,
|
104
|
+
)
|
105
|
+
) {
|
106
|
+
return V1_buildWatermarkFunctionExpression(
|
107
|
+
functionName,
|
108
|
+
parameters,
|
109
|
+
openVariables,
|
110
|
+
compileContext,
|
111
|
+
processingContext,
|
112
|
+
);
|
99
113
|
} else if (
|
100
114
|
matchFunctionName(
|
101
115
|
functionName,
|