@finos/legend-query-builder 4.14.47 → 4.14.48
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/QueryBuilderDocumentation.d.ts +3 -1
- package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderDocumentation.js +2 -0
- package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +14 -2
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +1 -5
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/explorer/{QueryBuilderMilestoningEditor.d.ts → QueryBuilderMilestoningParameterEditor.d.ts} +5 -2
- package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.d.ts.map +1 -0
- package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js +52 -0
- package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js.map +1 -0
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +192 -21
- 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 +13 -3
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/graph-manager/QueryBuilderConfig.d.ts +4 -0
- package/lib/graph-manager/QueryBuilderConfig.d.ts.map +1 -1
- package/lib/graph-manager/QueryBuilderConfig.js +5 -0
- package/lib/graph-manager/QueryBuilderConfig.js.map +1 -1
- package/lib/index.css +1 -17
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +2 -2
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/QueryLoaderState.d.ts +1 -0
- package/lib/stores/QueryLoaderState.d.ts.map +1 -1
- package/lib/stores/QueryLoaderState.js +1 -0
- package/lib/stores/QueryLoaderState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +8 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.js +4 -2
- package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.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 +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +2 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +13 -2
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +2 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +8 -1
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +25 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +2 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts +2 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js +22 -3
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +2 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +8 -1
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -1
- package/package.json +4 -4
- package/src/__lib__/QueryBuilderDocumentation.ts +2 -0
- package/src/components/QueryBuilder.tsx +44 -0
- package/src/components/QueryBuilderSideBar.tsx +0 -22
- package/src/components/explorer/QueryBuilderMilestoningParameterEditor.tsx +114 -0
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +445 -19
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +118 -21
- package/src/graph-manager/QueryBuilderConfig.ts +6 -0
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +3 -0
- package/src/stores/QueryLoaderState.ts +1 -0
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +11 -0
- package/src/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.ts +6 -2
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +1 -0
- package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +1 -0
- package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +23 -0
- package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +13 -0
- package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +45 -0
- package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +3 -0
- package/src/stores/milestoning/QueryBuilderMilestoningState.ts +41 -7
- package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +13 -0
- package/tsconfig.json +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +0 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +0 -102
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +0 -1
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +0 -364
@@ -1,102 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
-
/**
|
3
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
-
*
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
* you may not use this file except in compliance with the License.
|
7
|
-
* You may obtain a copy of the License at
|
8
|
-
*
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
*
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
* See the License for the specific language governing permissions and
|
15
|
-
* limitations under the License.
|
16
|
-
*/
|
17
|
-
import { observer } from 'mobx-react-lite';
|
18
|
-
import { useCallback } from 'react';
|
19
|
-
import { GenericType, GenericTypeExplicitReference, observe_PrimitiveInstanceValue, PrimitiveInstanceValue, PRIMITIVE_TYPE, PrimitiveType, } from '@finos/legend-graph';
|
20
|
-
import { guaranteeNonNullable } from '@finos/legend-shared';
|
21
|
-
import { useDrop } from 'react-dnd';
|
22
|
-
import { Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelEntryDropZonePlaceholder, PanelFormBooleanField, PanelFormSection, } from '@finos/legend-art';
|
23
|
-
import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
|
24
|
-
import { BasicValueSpecificationEditor, QUERY_BUILDER_VARIABLE_DND_TYPE, } from '../shared/BasicValueSpecificationEditor.js';
|
25
|
-
import { instanceValue_setValues } from '../../stores/shared/ValueSpecificationModifierHelper.js';
|
26
|
-
import { VariableSelector } from '../shared/QueryBuilderVariableSelector.js';
|
27
|
-
const MilestoningParameterEditor = observer((props) => {
|
28
|
-
const { queryBuilderState, parameter, setParameter } = props;
|
29
|
-
const handleDrop = useCallback((item) => {
|
30
|
-
setParameter(item.variable);
|
31
|
-
}, [setParameter]);
|
32
|
-
const [{ isDragOver }, dropConnector] = useDrop(() => ({
|
33
|
-
accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
|
34
|
-
drop: (item, monitor) => {
|
35
|
-
if (!monitor.didDrop()) {
|
36
|
-
handleDrop(item);
|
37
|
-
}
|
38
|
-
},
|
39
|
-
collect: (monitor) => ({
|
40
|
-
isDragOver: monitor.isOver({
|
41
|
-
shallow: true,
|
42
|
-
}),
|
43
|
-
}),
|
44
|
-
}), [handleDrop]);
|
45
|
-
const resetMilestoningParameter = () => {
|
46
|
-
const param = observe_PrimitiveInstanceValue(new PrimitiveInstanceValue(GenericTypeExplicitReference.create(new GenericType(PrimitiveType.STRICTDATE))), queryBuilderState.observerContext);
|
47
|
-
instanceValue_setValues(param, [generateDefaultValueForPrimitiveType(PRIMITIVE_TYPE.STRICTDATE)], queryBuilderState.observerContext);
|
48
|
-
setParameter(param);
|
49
|
-
};
|
50
|
-
return (_jsx("div", { ref: dropConnector, className: "query-builder__variable-editor", children: _jsx(PanelEntryDropZonePlaceholder, { isDragOver: isDragOver, label: "Change Milestoning Parameter Value", children: _jsx(BasicValueSpecificationEditor, { valueSpecification: parameter, graph: queryBuilderState.graphManagerState.graph, obseverContext: queryBuilderState.observerContext, setValueSpecification: (val) => setParameter(val), typeCheckOption: {
|
51
|
-
expectedType: PrimitiveType.DATE,
|
52
|
-
}, resetValue: resetMilestoningParameter, isConstant: queryBuilderState.constantState.isValueSpecConstant(parameter) }) }) }));
|
53
|
-
});
|
54
|
-
const BiTemporalMilestoningEditor = observer((props) => {
|
55
|
-
const { queryBuilderState } = props;
|
56
|
-
return (_jsxs(_Fragment, { children: [_jsxs(PanelFormSection, { children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Processing Date" }), _jsx(MilestoningParameterEditor, { queryBuilderState: queryBuilderState, parameter: guaranteeNonNullable(queryBuilderState.milestoningState.processingDate), setParameter: (val) => queryBuilderState.milestoningState.setProcessingDate(val) })] }), _jsxs(PanelFormSection, { children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Business Date" }), _jsx(MilestoningParameterEditor, { queryBuilderState: queryBuilderState, parameter: guaranteeNonNullable(queryBuilderState.milestoningState.businessDate), setParameter: (val) => queryBuilderState.milestoningState.setBusinessDate(val) })] })] }));
|
57
|
-
});
|
58
|
-
const BusinessTemporalMilestoningEditor = observer((props) => {
|
59
|
-
const { queryBuilderState } = props;
|
60
|
-
return (_jsxs(PanelFormSection, { children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Business Date" }), _jsx(MilestoningParameterEditor, { queryBuilderState: queryBuilderState, parameter: guaranteeNonNullable(queryBuilderState.milestoningState.businessDate), setParameter: (val) => queryBuilderState.milestoningState.setBusinessDate(val) }, "BusinessDate")] }));
|
61
|
-
});
|
62
|
-
const ProcessingTemporalMilestoningEditor = observer((props) => {
|
63
|
-
const { queryBuilderState } = props;
|
64
|
-
return (_jsxs(PanelFormSection, { children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Processing Date" }), _jsx(MilestoningParameterEditor, { queryBuilderState: queryBuilderState, parameter: guaranteeNonNullable(queryBuilderState.milestoningState.processingDate), setParameter: (val) => queryBuilderState.milestoningState.setProcessingDate(val) }, "BusinessDate")] }));
|
65
|
-
});
|
66
|
-
const TemporalMilestoningEditor = (props) => {
|
67
|
-
const { queryBuilderState } = props;
|
68
|
-
if (queryBuilderState.milestoningState.processingDate &&
|
69
|
-
queryBuilderState.milestoningState.businessDate) {
|
70
|
-
return (_jsx(BiTemporalMilestoningEditor, { queryBuilderState: queryBuilderState }));
|
71
|
-
}
|
72
|
-
else if (queryBuilderState.milestoningState.businessDate) {
|
73
|
-
return (_jsx(BusinessTemporalMilestoningEditor, { queryBuilderState: queryBuilderState }));
|
74
|
-
}
|
75
|
-
else if (queryBuilderState.milestoningState.processingDate) {
|
76
|
-
return (_jsx(ProcessingTemporalMilestoningEditor, { queryBuilderState: queryBuilderState }));
|
77
|
-
}
|
78
|
-
else {
|
79
|
-
return null;
|
80
|
-
}
|
81
|
-
};
|
82
|
-
const AllVersionsInRangelMilestoningParametersEditor = observer((props) => {
|
83
|
-
const { queryBuilderState } = props;
|
84
|
-
return (_jsxs("div", { className: "query-builder__milestoning-panel__all-versions-in-range-editor", children: [_jsxs(PanelFormSection, { children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Start Date" }), _jsx(MilestoningParameterEditor, { queryBuilderState: queryBuilderState, parameter: guaranteeNonNullable(queryBuilderState.milestoningState.startDate), setParameter: (val) => queryBuilderState.milestoningState.setStartDate(val) })] }), _jsxs(PanelFormSection, { children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "End Date" }), _jsx(MilestoningParameterEditor, { queryBuilderState: queryBuilderState, parameter: guaranteeNonNullable(queryBuilderState.milestoningState.endDate), setParameter: (val) => queryBuilderState.milestoningState.setEndDate(val) })] })] }));
|
85
|
-
});
|
86
|
-
export const MilestoningParametersEditor = observer((props) => {
|
87
|
-
const { queryBuilderState } = props;
|
88
|
-
const applicationStore = queryBuilderState.applicationStore;
|
89
|
-
const milestoningState = queryBuilderState.milestoningState;
|
90
|
-
const close = () => milestoningState.setShowMilestoningEditor(false);
|
91
|
-
const isCompatibleMilestoningParameter = (variable) => variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.STRICTDATE ||
|
92
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE ||
|
93
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.DATE ||
|
94
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.DATETIME;
|
95
|
-
return (_jsx(Dialog, { open: milestoningState.showMilestoningEditor, onClose: close, classes: {
|
96
|
-
root: 'editor-modal__root-container',
|
97
|
-
container: 'editor-modal__container',
|
98
|
-
paper: 'editor-modal__content',
|
99
|
-
}, children: _jsxs(Modal, { darkMode: !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled, className: "editor-modal query-builder__variables__modal", children: [_jsx(ModalHeader, { title: "Milestoning Parameters" }), _jsxs(ModalBody, { className: "query-builder__variables__modal__body", children: [milestoningState.isCurrentClassMilestoned && (_jsx(PanelFormBooleanField, { isReadOnly: false, value: milestoningState.isAllVersionsEnabled, name: "all Versions", prompt: "Query All Milestoned Versions of the Root Class", update: (value) => milestoningState.setAllVersions(value) })), milestoningState.isAllVersionsEnabled &&
|
100
|
-
milestoningState.isCurrentClassSupportsVersionsInRange && (_jsxs(_Fragment, { children: [_jsx(PanelFormBooleanField, { isReadOnly: false, value: milestoningState.isAllVersionsInRangeEnabled, name: " All Versions In Range", prompt: "Optionally apply a date range to get All Versions for", update: (value) => milestoningState.setAllVersionsInRange(value) }), milestoningState.isAllVersionsInRangeEnabled && (_jsx(AllVersionsInRangelMilestoningParametersEditor, { queryBuilderState: queryBuilderState }))] })), _jsx(TemporalMilestoningEditor, { queryBuilderState: queryBuilderState }), _jsx(PanelFormSection, { children: _jsx("div", { className: "panel__content__form__section__header__label", children: "List of compatible milestoning parameters" }) }), _jsx("div", { className: "panel__content__form__section__list__items", children: _jsx(VariableSelector, { queryBuilderState: queryBuilderState, filterBy: isCompatibleMilestoningParameter }) })] }), _jsx(ModalFooter, { children: _jsx(ModalFooterButton, { text: "Close", onClick: close, type: "secondary" }) })] }) }));
|
101
|
-
});
|
102
|
-
//# sourceMappingURL=QueryBuilderMilestoningEditor.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderMilestoningEditor.js","sourceRoot":"","sources":["../../../src/components/explorer/QueryBuilderMilestoningEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAGL,WAAW,EACX,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,6BAA6B,EAC7B,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oCAAoC,EAAE,MAAM,sDAAsD,CAAC;AAC5G,OAAO,EACL,6BAA6B,EAE7B,+BAA+B,GAChC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAE7E,MA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AoB,EAC5C,IAAI,EAAC,cAAc,EACnB,MAAM,EAAC,iDAAiD,EACxD,MAAM,EAAE,CAAC,KAA0B,EAAQ,EAAE,CAC3C,gBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,GAExC,CACH,EACA,gBAAgB,CAAC,oBAAoB;4BACpC,gBAAgB,CAAC,qCAAqC,IAAI,CACxD,8BACE,KAAC,qBAAqB,IACpB,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,gBAAgB,CAAC,2BAA2B,EACnD,IAAI,EAAC,wBAAwB,EAC7B,MAAM,EAAC,uDAAuD,EAC9D,MAAM,EAAE,CAAC,KAA0B,EAAQ,EAAE,CAC3C,gBAAgB,CAAC,qBAAqB,CAAC,KAAK,CAAC,GAE/C,EAED,gBAAgB,CAAC,2BAA2B,IAAI,CAC/C,KAAC,8CAA8C,IAC7C,iBAAiB,EAAE,iBAAiB,GACpC,CACH,IACA,CACJ,EACH,KAAC,yBAAyB,IAAC,iBAAiB,EAAE,iBAAiB,GAAI,EACnE,KAAC,gBAAgB,cACf,cAAK,SAAS,EAAC,8CAA8C,0DAEvD,GACW,EACnB,cAAK,SAAS,EAAC,4CAA4C,YACzD,KAAC,gBAAgB,IACf,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,gCAAgC,GAC1C,GACE,IACI,EACZ,KAAC,WAAW,cACV,KAAC,iBAAiB,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,WAAW,GAAG,GACvD,IACR,GACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
|
@@ -1,364 +0,0 @@
|
|
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 { observer } from 'mobx-react-lite';
|
18
|
-
import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
|
19
|
-
import { useCallback } from 'react';
|
20
|
-
import {
|
21
|
-
type ValueSpecification,
|
22
|
-
type VariableExpression,
|
23
|
-
GenericType,
|
24
|
-
GenericTypeExplicitReference,
|
25
|
-
observe_PrimitiveInstanceValue,
|
26
|
-
PrimitiveInstanceValue,
|
27
|
-
PRIMITIVE_TYPE,
|
28
|
-
PrimitiveType,
|
29
|
-
} from '@finos/legend-graph';
|
30
|
-
import { guaranteeNonNullable } from '@finos/legend-shared';
|
31
|
-
import { useDrop } from 'react-dnd';
|
32
|
-
import {
|
33
|
-
Dialog,
|
34
|
-
Modal,
|
35
|
-
ModalBody,
|
36
|
-
ModalFooter,
|
37
|
-
ModalFooterButton,
|
38
|
-
ModalHeader,
|
39
|
-
PanelEntryDropZonePlaceholder,
|
40
|
-
PanelFormBooleanField,
|
41
|
-
PanelFormSection,
|
42
|
-
} from '@finos/legend-art';
|
43
|
-
import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
|
44
|
-
import {
|
45
|
-
BasicValueSpecificationEditor,
|
46
|
-
type QueryBuilderVariableDragSource,
|
47
|
-
QUERY_BUILDER_VARIABLE_DND_TYPE,
|
48
|
-
} from '../shared/BasicValueSpecificationEditor.js';
|
49
|
-
import { instanceValue_setValues } from '../../stores/shared/ValueSpecificationModifierHelper.js';
|
50
|
-
import { VariableSelector } from '../shared/QueryBuilderVariableSelector.js';
|
51
|
-
|
52
|
-
const MilestoningParameterEditor = observer(
|
53
|
-
(props: {
|
54
|
-
queryBuilderState: QueryBuilderState;
|
55
|
-
parameter: ValueSpecification;
|
56
|
-
setParameter: (val: ValueSpecification) => void;
|
57
|
-
}) => {
|
58
|
-
const { queryBuilderState, parameter, setParameter } = props;
|
59
|
-
const handleDrop = useCallback(
|
60
|
-
(item: QueryBuilderVariableDragSource): void => {
|
61
|
-
setParameter(item.variable);
|
62
|
-
},
|
63
|
-
[setParameter],
|
64
|
-
);
|
65
|
-
const [{ isDragOver }, dropConnector] = useDrop<
|
66
|
-
QueryBuilderVariableDragSource,
|
67
|
-
void,
|
68
|
-
{ isDragOver: boolean }
|
69
|
-
>(
|
70
|
-
() => ({
|
71
|
-
accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
|
72
|
-
drop: (item, monitor): void => {
|
73
|
-
if (!monitor.didDrop()) {
|
74
|
-
handleDrop(item);
|
75
|
-
}
|
76
|
-
},
|
77
|
-
collect: (monitor): { isDragOver: boolean } => ({
|
78
|
-
isDragOver: monitor.isOver({
|
79
|
-
shallow: true,
|
80
|
-
}),
|
81
|
-
}),
|
82
|
-
}),
|
83
|
-
[handleDrop],
|
84
|
-
);
|
85
|
-
const resetMilestoningParameter = (): void => {
|
86
|
-
const param = observe_PrimitiveInstanceValue(
|
87
|
-
new PrimitiveInstanceValue(
|
88
|
-
GenericTypeExplicitReference.create(
|
89
|
-
new GenericType(PrimitiveType.STRICTDATE),
|
90
|
-
),
|
91
|
-
),
|
92
|
-
queryBuilderState.observerContext,
|
93
|
-
);
|
94
|
-
instanceValue_setValues(
|
95
|
-
param,
|
96
|
-
[generateDefaultValueForPrimitiveType(PRIMITIVE_TYPE.STRICTDATE)],
|
97
|
-
queryBuilderState.observerContext,
|
98
|
-
);
|
99
|
-
setParameter(param);
|
100
|
-
};
|
101
|
-
|
102
|
-
return (
|
103
|
-
<div ref={dropConnector} className="query-builder__variable-editor">
|
104
|
-
<PanelEntryDropZonePlaceholder
|
105
|
-
isDragOver={isDragOver}
|
106
|
-
label="Change Milestoning Parameter Value"
|
107
|
-
>
|
108
|
-
<BasicValueSpecificationEditor
|
109
|
-
valueSpecification={parameter}
|
110
|
-
graph={queryBuilderState.graphManagerState.graph}
|
111
|
-
obseverContext={queryBuilderState.observerContext}
|
112
|
-
setValueSpecification={(val: ValueSpecification): void =>
|
113
|
-
setParameter(val)
|
114
|
-
}
|
115
|
-
typeCheckOption={{
|
116
|
-
expectedType: PrimitiveType.DATE,
|
117
|
-
}}
|
118
|
-
resetValue={resetMilestoningParameter}
|
119
|
-
isConstant={queryBuilderState.constantState.isValueSpecConstant(
|
120
|
-
parameter,
|
121
|
-
)}
|
122
|
-
/>
|
123
|
-
</PanelEntryDropZonePlaceholder>
|
124
|
-
</div>
|
125
|
-
);
|
126
|
-
},
|
127
|
-
);
|
128
|
-
|
129
|
-
const BiTemporalMilestoningEditor = observer(
|
130
|
-
(props: { queryBuilderState: QueryBuilderState }) => {
|
131
|
-
const { queryBuilderState } = props;
|
132
|
-
return (
|
133
|
-
<>
|
134
|
-
<PanelFormSection>
|
135
|
-
<div className="panel__content__form__section__header__label">
|
136
|
-
Processing Date
|
137
|
-
</div>
|
138
|
-
<MilestoningParameterEditor
|
139
|
-
queryBuilderState={queryBuilderState}
|
140
|
-
parameter={guaranteeNonNullable(
|
141
|
-
queryBuilderState.milestoningState.processingDate,
|
142
|
-
)}
|
143
|
-
setParameter={(val: ValueSpecification): void =>
|
144
|
-
queryBuilderState.milestoningState.setProcessingDate(val)
|
145
|
-
}
|
146
|
-
/>
|
147
|
-
</PanelFormSection>
|
148
|
-
<PanelFormSection>
|
149
|
-
<div className="panel__content__form__section__header__label">
|
150
|
-
Business Date
|
151
|
-
</div>
|
152
|
-
<MilestoningParameterEditor
|
153
|
-
queryBuilderState={queryBuilderState}
|
154
|
-
parameter={guaranteeNonNullable(
|
155
|
-
queryBuilderState.milestoningState.businessDate,
|
156
|
-
)}
|
157
|
-
setParameter={(val: ValueSpecification): void =>
|
158
|
-
queryBuilderState.milestoningState.setBusinessDate(val)
|
159
|
-
}
|
160
|
-
/>
|
161
|
-
</PanelFormSection>
|
162
|
-
</>
|
163
|
-
);
|
164
|
-
},
|
165
|
-
);
|
166
|
-
|
167
|
-
const BusinessTemporalMilestoningEditor = observer(
|
168
|
-
(props: { queryBuilderState: QueryBuilderState }) => {
|
169
|
-
const { queryBuilderState } = props;
|
170
|
-
return (
|
171
|
-
<PanelFormSection>
|
172
|
-
<div className="panel__content__form__section__header__label">
|
173
|
-
Business Date
|
174
|
-
</div>
|
175
|
-
<MilestoningParameterEditor
|
176
|
-
key="BusinessDate"
|
177
|
-
queryBuilderState={queryBuilderState}
|
178
|
-
parameter={guaranteeNonNullable(
|
179
|
-
queryBuilderState.milestoningState.businessDate,
|
180
|
-
)}
|
181
|
-
setParameter={(val: ValueSpecification): void =>
|
182
|
-
queryBuilderState.milestoningState.setBusinessDate(val)
|
183
|
-
}
|
184
|
-
/>
|
185
|
-
</PanelFormSection>
|
186
|
-
);
|
187
|
-
},
|
188
|
-
);
|
189
|
-
|
190
|
-
const ProcessingTemporalMilestoningEditor = observer(
|
191
|
-
(props: { queryBuilderState: QueryBuilderState }) => {
|
192
|
-
const { queryBuilderState } = props;
|
193
|
-
return (
|
194
|
-
<PanelFormSection>
|
195
|
-
<div className="panel__content__form__section__header__label">
|
196
|
-
Processing Date
|
197
|
-
</div>
|
198
|
-
<MilestoningParameterEditor
|
199
|
-
key="BusinessDate"
|
200
|
-
queryBuilderState={queryBuilderState}
|
201
|
-
parameter={guaranteeNonNullable(
|
202
|
-
queryBuilderState.milestoningState.processingDate,
|
203
|
-
)}
|
204
|
-
setParameter={(val: ValueSpecification): void =>
|
205
|
-
queryBuilderState.milestoningState.setProcessingDate(val)
|
206
|
-
}
|
207
|
-
/>
|
208
|
-
</PanelFormSection>
|
209
|
-
);
|
210
|
-
},
|
211
|
-
);
|
212
|
-
|
213
|
-
const TemporalMilestoningEditor: React.FC<{
|
214
|
-
queryBuilderState: QueryBuilderState;
|
215
|
-
}> = (props) => {
|
216
|
-
const { queryBuilderState } = props;
|
217
|
-
|
218
|
-
if (
|
219
|
-
queryBuilderState.milestoningState.processingDate &&
|
220
|
-
queryBuilderState.milestoningState.businessDate
|
221
|
-
) {
|
222
|
-
return (
|
223
|
-
<BiTemporalMilestoningEditor queryBuilderState={queryBuilderState} />
|
224
|
-
);
|
225
|
-
} else if (queryBuilderState.milestoningState.businessDate) {
|
226
|
-
return (
|
227
|
-
<BusinessTemporalMilestoningEditor
|
228
|
-
queryBuilderState={queryBuilderState}
|
229
|
-
/>
|
230
|
-
);
|
231
|
-
} else if (queryBuilderState.milestoningState.processingDate) {
|
232
|
-
return (
|
233
|
-
<ProcessingTemporalMilestoningEditor
|
234
|
-
queryBuilderState={queryBuilderState}
|
235
|
-
/>
|
236
|
-
);
|
237
|
-
} else {
|
238
|
-
return null;
|
239
|
-
}
|
240
|
-
};
|
241
|
-
|
242
|
-
const AllVersionsInRangelMilestoningParametersEditor = observer(
|
243
|
-
(props: { queryBuilderState: QueryBuilderState }) => {
|
244
|
-
const { queryBuilderState } = props;
|
245
|
-
|
246
|
-
return (
|
247
|
-
<div className="query-builder__milestoning-panel__all-versions-in-range-editor">
|
248
|
-
<PanelFormSection>
|
249
|
-
<div className="panel__content__form__section__header__label">
|
250
|
-
Start Date
|
251
|
-
</div>
|
252
|
-
<MilestoningParameterEditor
|
253
|
-
queryBuilderState={queryBuilderState}
|
254
|
-
parameter={guaranteeNonNullable(
|
255
|
-
queryBuilderState.milestoningState.startDate,
|
256
|
-
)}
|
257
|
-
setParameter={(val: ValueSpecification): void =>
|
258
|
-
queryBuilderState.milestoningState.setStartDate(val)
|
259
|
-
}
|
260
|
-
/>
|
261
|
-
</PanelFormSection>
|
262
|
-
<PanelFormSection>
|
263
|
-
<div className="panel__content__form__section__header__label">
|
264
|
-
End Date
|
265
|
-
</div>
|
266
|
-
<MilestoningParameterEditor
|
267
|
-
queryBuilderState={queryBuilderState}
|
268
|
-
parameter={guaranteeNonNullable(
|
269
|
-
queryBuilderState.milestoningState.endDate,
|
270
|
-
)}
|
271
|
-
setParameter={(val: ValueSpecification): void =>
|
272
|
-
queryBuilderState.milestoningState.setEndDate(val)
|
273
|
-
}
|
274
|
-
/>
|
275
|
-
</PanelFormSection>
|
276
|
-
</div>
|
277
|
-
);
|
278
|
-
},
|
279
|
-
);
|
280
|
-
|
281
|
-
export const MilestoningParametersEditor = observer(
|
282
|
-
(props: { queryBuilderState: QueryBuilderState }) => {
|
283
|
-
const { queryBuilderState } = props;
|
284
|
-
const applicationStore = queryBuilderState.applicationStore;
|
285
|
-
const milestoningState = queryBuilderState.milestoningState;
|
286
|
-
const close = (): void => milestoningState.setShowMilestoningEditor(false);
|
287
|
-
const isCompatibleMilestoningParameter = (
|
288
|
-
variable: VariableExpression,
|
289
|
-
): boolean =>
|
290
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.STRICTDATE ||
|
291
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE ||
|
292
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.DATE ||
|
293
|
-
variable.genericType?.value.rawType.name === PRIMITIVE_TYPE.DATETIME;
|
294
|
-
|
295
|
-
return (
|
296
|
-
<Dialog
|
297
|
-
open={milestoningState.showMilestoningEditor}
|
298
|
-
onClose={close}
|
299
|
-
classes={{
|
300
|
-
root: 'editor-modal__root-container',
|
301
|
-
container: 'editor-modal__container',
|
302
|
-
paper: 'editor-modal__content',
|
303
|
-
}}
|
304
|
-
>
|
305
|
-
<Modal
|
306
|
-
darkMode={
|
307
|
-
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
308
|
-
}
|
309
|
-
className="editor-modal query-builder__variables__modal"
|
310
|
-
>
|
311
|
-
<ModalHeader title="Milestoning Parameters" />
|
312
|
-
<ModalBody className="query-builder__variables__modal__body">
|
313
|
-
{milestoningState.isCurrentClassMilestoned && (
|
314
|
-
<PanelFormBooleanField
|
315
|
-
isReadOnly={false}
|
316
|
-
value={milestoningState.isAllVersionsEnabled}
|
317
|
-
name="all Versions"
|
318
|
-
prompt="Query All Milestoned Versions of the Root Class"
|
319
|
-
update={(value: boolean | undefined): void =>
|
320
|
-
milestoningState.setAllVersions(value)
|
321
|
-
}
|
322
|
-
/>
|
323
|
-
)}
|
324
|
-
{milestoningState.isAllVersionsEnabled &&
|
325
|
-
milestoningState.isCurrentClassSupportsVersionsInRange && (
|
326
|
-
<>
|
327
|
-
<PanelFormBooleanField
|
328
|
-
isReadOnly={false}
|
329
|
-
value={milestoningState.isAllVersionsInRangeEnabled}
|
330
|
-
name=" All Versions In Range"
|
331
|
-
prompt="Optionally apply a date range to get All Versions for"
|
332
|
-
update={(value: boolean | undefined): void =>
|
333
|
-
milestoningState.setAllVersionsInRange(value)
|
334
|
-
}
|
335
|
-
/>
|
336
|
-
|
337
|
-
{milestoningState.isAllVersionsInRangeEnabled && (
|
338
|
-
<AllVersionsInRangelMilestoningParametersEditor
|
339
|
-
queryBuilderState={queryBuilderState}
|
340
|
-
/>
|
341
|
-
)}
|
342
|
-
</>
|
343
|
-
)}
|
344
|
-
<TemporalMilestoningEditor queryBuilderState={queryBuilderState} />
|
345
|
-
<PanelFormSection>
|
346
|
-
<div className="panel__content__form__section__header__label">
|
347
|
-
List of compatible milestoning parameters
|
348
|
-
</div>
|
349
|
-
</PanelFormSection>
|
350
|
-
<div className="panel__content__form__section__list__items">
|
351
|
-
<VariableSelector
|
352
|
-
queryBuilderState={queryBuilderState}
|
353
|
-
filterBy={isCompatibleMilestoningParameter}
|
354
|
-
/>
|
355
|
-
</div>
|
356
|
-
</ModalBody>
|
357
|
-
<ModalFooter>
|
358
|
-
<ModalFooterButton text="Close" onClick={close} type="secondary" />
|
359
|
-
</ModalFooter>
|
360
|
-
</Modal>
|
361
|
-
</Dialog>
|
362
|
-
);
|
363
|
-
},
|
364
|
-
);
|