@finos/legend-query-builder 0.6.24 → 0.6.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +27 -27
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderComponentTestUtils.d.ts.map +1 -1
- package/lib/components/QueryBuilderComponentTestUtils.js +4 -5
- package/lib/components/QueryBuilderComponentTestUtils.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +5 -4
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.js +2 -2
- package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +13 -8
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +10 -2
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilder_TestID.d.ts +3 -1
- package/lib/components/QueryBuilder_TestID.d.ts.map +1 -1
- package/lib/components/QueryBuilder_TestID.js +2 -0
- package/lib/components/QueryBuilder_TestID.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +23 -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 +2 -2
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +2 -2
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +9 -7
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -2
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +2 -2
- package/lib/components/shared/CustomDatePicker.d.ts +33 -0
- package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +4 -4
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.js +12 -1
- package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.js +2 -2
- package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +9 -9
- package/lib/stores/QueryBuilderState.d.ts +2 -0
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +6 -0
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/package.json +16 -16
- package/src/components/QueryBuilder.tsx +8 -6
- package/src/components/QueryBuilderComponentTestUtils.tsx +6 -5
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +12 -11
- package/src/components/QueryBuilderDiffPanel.tsx +2 -3
- package/src/components/QueryBuilderParametersPanel.tsx +13 -7
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +27 -7
- package/src/components/QueryBuilder_TestID.ts +2 -0
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +39 -5
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +2 -3
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +2 -2
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +34 -14
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +2 -2
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +3 -6
- package/src/components/filter/QueryBuilderFilterPanel.tsx +2 -2
- package/src/components/shared/CustomDatePicker.tsx +3 -3
- package/src/components/shared/QueryBuilderVariableSelector.tsx +18 -4
- package/src/components/watermark/QueryBuilderWatermark.tsx +2 -6
- package/src/stores/QueryBuilderState.ts +8 -0
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
valueSpecification_setGenericType,
|
|
57
57
|
} from '../../stores/shared/ValueSpecificationModifierHelper.js';
|
|
58
58
|
|
|
59
|
-
enum CUSTOM_DATE_PICKER_OPTION {
|
|
59
|
+
export enum CUSTOM_DATE_PICKER_OPTION {
|
|
60
60
|
ABSOLUTE_DATE = 'Absolute Date',
|
|
61
61
|
ABSOLUTE_TIME = 'Absolute Time',
|
|
62
62
|
TODAY = 'Today',
|
|
@@ -431,7 +431,7 @@ const buildPureDurationEnumValue = (
|
|
|
431
431
|
};
|
|
432
432
|
|
|
433
433
|
/**
|
|
434
|
-
* Generate the pure date
|
|
434
|
+
* Generate the pure date adjust() function based on the CustomDateOption.
|
|
435
435
|
*/
|
|
436
436
|
const buildPureAdjustDateFunction = (
|
|
437
437
|
customDateOption: CustomDateOption,
|
|
@@ -634,7 +634,7 @@ const buildCustomDateOption = (
|
|
|
634
634
|
/**
|
|
635
635
|
* Build DatePickerOption from pure date functions or PrimitiveInstanceValue
|
|
636
636
|
*/
|
|
637
|
-
const buildDatePickerOption = (
|
|
637
|
+
export const buildDatePickerOption = (
|
|
638
638
|
valueSpecification: SimpleFunctionExpression | PrimitiveInstanceValue,
|
|
639
639
|
): DatePickerOption => {
|
|
640
640
|
if (valueSpecification instanceof SimpleFunctionExpression) {
|
|
@@ -23,9 +23,10 @@ import {
|
|
|
23
23
|
TimesIcon,
|
|
24
24
|
useDragPreviewLayer,
|
|
25
25
|
} from '@finos/legend-art';
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
import {
|
|
27
|
+
SimpleFunctionExpression,
|
|
28
|
+
type ValueSpecification,
|
|
29
|
+
type VariableExpression,
|
|
29
30
|
} from '@finos/legend-graph';
|
|
30
31
|
import { observer } from 'mobx-react-lite';
|
|
31
32
|
import { useDrag } from 'react-dnd';
|
|
@@ -36,6 +37,7 @@ import {
|
|
|
36
37
|
QUERY_BUILDER_VARIABLE_DND_TYPE,
|
|
37
38
|
VariableInfoTooltip,
|
|
38
39
|
} from './BasicValueSpecificationEditor.js';
|
|
40
|
+
import { buildDatePickerOption } from './CustomDatePicker.js';
|
|
39
41
|
|
|
40
42
|
export const VariableViewer = observer(
|
|
41
43
|
(props: {
|
|
@@ -50,8 +52,19 @@ export const VariableViewer = observer(
|
|
|
50
52
|
}) => {
|
|
51
53
|
const { variable, constantValue, actions, isReadOnly, queryBuilderState } =
|
|
52
54
|
props;
|
|
55
|
+
|
|
56
|
+
const getNameOfValue = (value: ValueSpecification): string | undefined => {
|
|
57
|
+
if (value instanceof SimpleFunctionExpression) {
|
|
58
|
+
const possibleDateLabel = buildDatePickerOption(value).label;
|
|
59
|
+
if (possibleDateLabel) {
|
|
60
|
+
return possibleDateLabel;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return getValueSpecificationStringValue(value);
|
|
64
|
+
};
|
|
65
|
+
|
|
53
66
|
const valueString = constantValue
|
|
54
|
-
?
|
|
67
|
+
? getNameOfValue(constantValue)
|
|
55
68
|
: undefined;
|
|
56
69
|
const name = variable.name;
|
|
57
70
|
const variableType = variable.genericType?.value.rawType;
|
|
@@ -159,6 +172,7 @@ export const VariableSelector = observer(
|
|
|
159
172
|
queryBuilderState.constantState.constants.filter((c) =>
|
|
160
173
|
filterBy ? filterBy(c.variable) : true,
|
|
161
174
|
);
|
|
175
|
+
|
|
162
176
|
return (
|
|
163
177
|
<>
|
|
164
178
|
<PanelFormListItems title="Available parameters">
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
ModalFooter,
|
|
26
26
|
ModalHeader,
|
|
27
27
|
PanelFormSection,
|
|
28
|
+
ModalFooterButton,
|
|
28
29
|
} from '@finos/legend-art';
|
|
29
30
|
import {
|
|
30
31
|
areMultiplicitiesEqual,
|
|
@@ -169,12 +170,7 @@ export const QueryBuilderWatermarkEditor = observer(
|
|
|
169
170
|
</PanelForm>
|
|
170
171
|
</ModalBody>
|
|
171
172
|
<ModalFooter>
|
|
172
|
-
<
|
|
173
|
-
className="btn modal__footer__close-btn"
|
|
174
|
-
onClick={handleClose}
|
|
175
|
-
>
|
|
176
|
-
Done
|
|
177
|
-
</button>
|
|
173
|
+
<ModalFooterButton text="Done" onClick={handleClose} />
|
|
178
174
|
</ModalFooter>
|
|
179
175
|
</Modal>
|
|
180
176
|
</Dialog>
|
|
@@ -99,6 +99,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
|
99
99
|
textEditorState: QueryBuilderTextEditorState;
|
|
100
100
|
unsupportedQueryState: QueryBuilderUnsupportedQueryState;
|
|
101
101
|
observableContext: ObserverContext;
|
|
102
|
+
titleOfQuery: string | undefined;
|
|
102
103
|
|
|
103
104
|
queryCompileState = ActionState.create();
|
|
104
105
|
showFunctionsExplorerPanel = false;
|
|
@@ -126,6 +127,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
|
126
127
|
fetchStructureState: observable,
|
|
127
128
|
filterState: observable,
|
|
128
129
|
watermarkState: observable,
|
|
130
|
+
titleOfQuery: observable,
|
|
129
131
|
checkEntitlementsState: observable,
|
|
130
132
|
resultState: observable,
|
|
131
133
|
textEditorState: observable,
|
|
@@ -151,6 +153,8 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
|
151
153
|
setMapping: action,
|
|
152
154
|
setRuntimeValue: action,
|
|
153
155
|
|
|
156
|
+
setTitleOfQuery: action,
|
|
157
|
+
|
|
154
158
|
resetQueryResult: action,
|
|
155
159
|
resetQueryContent: action,
|
|
156
160
|
changeClass: action,
|
|
@@ -253,6 +257,10 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
|
253
257
|
this.runtimeValue = val;
|
|
254
258
|
}
|
|
255
259
|
|
|
260
|
+
setTitleOfQuery(val: string | undefined): void {
|
|
261
|
+
this.titleOfQuery = val;
|
|
262
|
+
}
|
|
263
|
+
|
|
256
264
|
get isQuerySupported(): boolean {
|
|
257
265
|
return !this.unsupportedQueryState.rawLambda;
|
|
258
266
|
}
|