@finos/legend-query-builder 4.14.52 → 4.14.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +1 -0
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.d.ts +2 -0
  5. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.d.ts.map +1 -1
  6. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js +14 -7
  7. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js.map +1 -1
  8. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  9. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +35 -10
  10. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  11. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  12. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -1
  13. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  14. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +3 -0
  15. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  16. package/lib/components/shared/QueryBuilderVariableSelector.js +2 -2
  17. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  18. package/lib/index.css +1 -17
  19. package/lib/index.css.map +1 -1
  20. package/lib/index.d.ts +1 -1
  21. package/lib/index.d.ts.map +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib/index.js.map +1 -1
  24. package/lib/package.json +1 -1
  25. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  26. package/lib/stores/QueryBuilderState.js +1 -0
  27. package/lib/stores/QueryBuilderState.js.map +1 -1
  28. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +1 -1
  29. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  30. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts +2 -2
  31. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
  32. package/lib/stores/milestoning/QueryBuilderMilestoningState.js +15 -4
  33. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
  34. package/package.json +9 -9
  35. package/src/components/QueryBuilder.tsx +1 -0
  36. package/src/components/explorer/QueryBuilderMilestoningParameterEditor.tsx +60 -22
  37. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +155 -59
  38. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +11 -1
  39. package/src/components/shared/QueryBuilderVariableSelector.tsx +9 -3
  40. package/src/index.ts +1 -0
  41. package/src/stores/QueryBuilderState.ts +1 -0
  42. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +1 -1
  43. package/src/stores/milestoning/QueryBuilderMilestoningState.ts +22 -9
@@ -25,6 +25,7 @@ import {
25
25
  PrimitiveInstanceValue,
26
26
  PRIMITIVE_TYPE,
27
27
  PrimitiveType,
28
+ VariableExpression,
28
29
  } from '@finos/legend-graph';
29
30
  import { useDrop } from 'react-dnd';
30
31
  import { PanelEntryDropZonePlaceholder } from '@finos/legend-art';
@@ -33,16 +34,27 @@ import {
33
34
  BasicValueSpecificationEditor,
34
35
  type QueryBuilderVariableDragSource,
35
36
  QUERY_BUILDER_VARIABLE_DND_TYPE,
37
+ EditableBasicValueSpecificationEditor,
36
38
  } from '../shared/BasicValueSpecificationEditor.js';
37
39
  import { instanceValue_setValues } from '../../stores/shared/ValueSpecificationModifierHelper.js';
40
+ import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../graph/QueryBuilderMetaModelConst.js';
41
+ import { createSupportedFunctionExpression } from '../../stores/shared/ValueSpecificationEditorHelper.js';
38
42
 
39
43
  export const MilestoningParameterEditor = observer(
40
44
  (props: {
41
45
  queryBuilderState: QueryBuilderState;
42
46
  parameter: ValueSpecification;
43
47
  setParameter: (val: ValueSpecification) => void;
48
+ parameterValue: ValueSpecification | undefined;
49
+ setParameterValue: (val: ValueSpecification) => void;
44
50
  }) => {
45
- const { queryBuilderState, parameter, setParameter } = props;
51
+ const {
52
+ queryBuilderState,
53
+ parameter,
54
+ setParameter,
55
+ parameterValue,
56
+ setParameterValue,
57
+ } = props;
46
58
  const handleDrop = useCallback(
47
59
  (item: QueryBuilderVariableDragSource): void => {
48
60
  setParameter(item.variable);
@@ -87,27 +99,53 @@ export const MilestoningParameterEditor = observer(
87
99
  };
88
100
 
89
101
  return (
90
- <div ref={dropConnector} className="query-builder__variable-editor">
91
- <PanelEntryDropZonePlaceholder
92
- isDragOver={isDragOver}
93
- label="Change Milestoning Parameter Value"
94
- >
95
- <BasicValueSpecificationEditor
96
- valueSpecification={parameter}
97
- graph={queryBuilderState.graphManagerState.graph}
98
- observerContext={queryBuilderState.observerContext}
99
- setValueSpecification={(val: ValueSpecification): void =>
100
- setParameter(val)
101
- }
102
- typeCheckOption={{
103
- expectedType: PrimitiveType.DATE,
104
- }}
105
- resetValue={resetMilestoningParameter}
106
- isConstant={queryBuilderState.constantState.isValueSpecConstant(
107
- parameter,
108
- )}
109
- />
110
- </PanelEntryDropZonePlaceholder>
102
+ <div
103
+ ref={dropConnector}
104
+ className="query-builder__milestoning-panel__variable-editor"
105
+ >
106
+ <div className="query-builder__milestoning-panel__variable-editor__variable">
107
+ <PanelEntryDropZonePlaceholder
108
+ isDragOver={isDragOver}
109
+ label="Change Milestoning Parameter Value"
110
+ >
111
+ <BasicValueSpecificationEditor
112
+ valueSpecification={parameter}
113
+ graph={queryBuilderState.graphManagerState.graph}
114
+ observerContext={queryBuilderState.observerContext}
115
+ setValueSpecification={(val: ValueSpecification): void =>
116
+ setParameter(val)
117
+ }
118
+ typeCheckOption={{
119
+ expectedType: PrimitiveType.DATE,
120
+ }}
121
+ resetValue={resetMilestoningParameter}
122
+ isConstant={queryBuilderState.constantState.isValueSpecConstant(
123
+ parameter,
124
+ )}
125
+ />
126
+ </PanelEntryDropZonePlaceholder>
127
+ </div>
128
+ {parameter instanceof VariableExpression && parameterValue && (
129
+ <div className="query-builder__milestoning-panel__variable-editor__value">
130
+ <EditableBasicValueSpecificationEditor
131
+ valueSpecification={parameterValue}
132
+ setValueSpecification={setParameterValue}
133
+ graph={queryBuilderState.graphManagerState.graph}
134
+ observerContext={queryBuilderState.observerContext}
135
+ typeCheckOption={{
136
+ expectedType: PrimitiveType.DATE,
137
+ }}
138
+ resetValue={() => {
139
+ const now = createSupportedFunctionExpression(
140
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.NOW,
141
+ PrimitiveType.DATETIME,
142
+ );
143
+ setParameterValue(now);
144
+ }}
145
+ initializeAsEditable={true}
146
+ />
147
+ </div>
148
+ )}
111
149
  </div>
112
150
  );
113
151
  },
@@ -419,6 +419,22 @@ export const QueryResultModifierModal = observer(
419
419
  );
420
420
  const [startDate, setStartDate] = useState(milestoningState.startDate);
421
421
  const [endDate, setEndDate] = useState(milestoningState.endDate);
422
+ const [businessDateValue, setBusinessDateValue] = useState(
423
+ milestoningState.getMilestoningParameterValue(
424
+ milestoningState.businessDate,
425
+ ),
426
+ );
427
+ const [processingDateValue, setProcessingDateValue] = useState(
428
+ milestoningState.getMilestoningParameterValue(
429
+ milestoningState.processingDate,
430
+ ),
431
+ );
432
+ const [startDateValue, setStartDateValue] = useState(
433
+ milestoningState.getMilestoningParameterValue(milestoningState.startDate),
434
+ );
435
+ const [endDateValue, setEndDateValue] = useState(
436
+ milestoningState.getMilestoningParameterValue(milestoningState.endDate),
437
+ );
422
438
 
423
439
  const shouldFilterMilestoningParamIfNotUsed = (
424
440
  param: ValueSpecification | undefined,
@@ -491,28 +507,28 @@ export const QueryResultModifierModal = observer(
491
507
  );
492
508
  setParameterStates(allParamStates);
493
509
  if (!businessDate) {
494
- setBusinessDate(
495
- allParamStates.find(
496
- (ps) =>
497
- ps.variableName ===
498
- (milestoningState.businessDate &&
499
- milestoningState.businessDate instanceof VariableExpression
500
- ? milestoningState.businessDate.name
501
- : BUSINESS_DATE_MILESTONING_PROPERTY_NAME),
502
- )?.parameter,
510
+ const lambdaParamState = allParamStates.find(
511
+ (ps) =>
512
+ ps.variableName ===
513
+ (milestoningState.businessDate &&
514
+ milestoningState.businessDate instanceof VariableExpression
515
+ ? milestoningState.businessDate.name
516
+ : BUSINESS_DATE_MILESTONING_PROPERTY_NAME),
503
517
  );
518
+ setBusinessDate(lambdaParamState?.parameter);
519
+ setBusinessDateValue(lambdaParamState?.value);
504
520
  }
505
521
  if (!processingDate) {
506
- setProcessingDate(
507
- allParamStates.find(
508
- (ps) =>
509
- ps.variableName ===
510
- (milestoningState.businessDate &&
511
- milestoningState.processingDate instanceof VariableExpression
512
- ? milestoningState.processingDate.name
513
- : PROCESSING_DATE_MILESTONING_PROPERTY_NAME),
514
- )?.parameter,
522
+ const lambdaParamState = allParamStates.find(
523
+ (ps) =>
524
+ ps.variableName ===
525
+ (milestoningState.businessDate &&
526
+ milestoningState.processingDate instanceof VariableExpression
527
+ ? milestoningState.processingDate.name
528
+ : PROCESSING_DATE_MILESTONING_PROPERTY_NAME),
515
529
  );
530
+ setProcessingDate(lambdaParamState?.parameter);
531
+ setProcessingDateValue(lambdaParamState?.value);
516
532
  }
517
533
  }
518
534
  setIsAllVersionsEnabled(Boolean(value));
@@ -552,6 +568,7 @@ export const QueryResultModifierModal = observer(
552
568
  MILESTONING_START_DATE_PARAMETER_NAME,
553
569
  );
554
570
  setStartDate(startDateParameterState.parameter);
571
+ setStartDateValue(startDateParameterState.value);
555
572
  }
556
573
  if (!(endDate && endDate instanceof VariableExpression)) {
557
574
  endDateParameterState = getOrCreateNewLambdaParameterState(
@@ -559,6 +576,7 @@ export const QueryResultModifierModal = observer(
559
576
  MILESTONING_END_DATE_PARAMETER_NAME,
560
577
  );
561
578
  setEndDate(endDateParameterState.parameter);
579
+ setEndDateValue(endDateParameterState.value);
562
580
  }
563
581
  setParameterStates([
564
582
  ...new Set([
@@ -601,6 +619,24 @@ export const QueryResultModifierModal = observer(
601
619
  setParameterStates(
602
620
  milestoningState.queryBuilderState.parametersState.parameterStates,
603
621
  );
622
+ setStartDateValue(
623
+ milestoningState.getMilestoningParameterValue(
624
+ milestoningState.startDate,
625
+ ),
626
+ );
627
+ setEndDateValue(
628
+ milestoningState.getMilestoningParameterValue(milestoningState.endDate),
629
+ );
630
+ setProcessingDateValue(
631
+ milestoningState.getMilestoningParameterValue(
632
+ milestoningState.processingDate,
633
+ ),
634
+ );
635
+ setBusinessDateValue(
636
+ milestoningState.getMilestoningParameterValue(
637
+ milestoningState.businessDate,
638
+ ),
639
+ );
604
640
  };
605
641
 
606
642
  // Handle user actions
@@ -630,6 +666,11 @@ export const QueryResultModifierModal = observer(
630
666
  milestoningState.queryBuilderState.setGetAllFunction(
631
667
  QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS_IN_RANGE,
632
668
  );
669
+ milestoningState.updateMilestoningParameterValue(
670
+ startDate,
671
+ startDateValue,
672
+ );
673
+ milestoningState.updateMilestoningParameterValue(endDate, endDateValue);
633
674
  } else if (isAllVersionsEnabled) {
634
675
  milestoningState.clearGetAllParameters();
635
676
  milestoningState.queryBuilderState.setGetAllFunction(
@@ -644,6 +685,14 @@ export const QueryResultModifierModal = observer(
644
685
  milestoningState.queryBuilderState.setGetAllFunction(
645
686
  QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL,
646
687
  );
688
+ milestoningState.updateMilestoningParameterValue(
689
+ processingDate,
690
+ processingDateValue,
691
+ );
692
+ milestoningState.updateMilestoningParameterValue(
693
+ businessDate,
694
+ businessDateValue,
695
+ );
647
696
  }
648
697
  milestoningState.updateQueryBuilderState();
649
698
  };
@@ -660,7 +709,26 @@ export const QueryResultModifierModal = observer(
660
709
  setParameterStates(
661
710
  milestoningState.queryBuilderState.parametersState.parameterStates,
662
711
  );
712
+ setStartDateValue(
713
+ milestoningState.getMilestoningParameterValue(
714
+ milestoningState.startDate,
715
+ ),
716
+ );
717
+ setEndDateValue(
718
+ milestoningState.getMilestoningParameterValue(milestoningState.endDate),
719
+ );
720
+ setProcessingDateValue(
721
+ milestoningState.getMilestoningParameterValue(
722
+ milestoningState.processingDate,
723
+ ),
724
+ );
725
+ setBusinessDateValue(
726
+ milestoningState.getMilestoningParameterValue(
727
+ milestoningState.businessDate,
728
+ ),
729
+ );
663
730
  }, [
731
+ milestoningState,
664
732
  milestoningState.isAllVersionsEnabled,
665
733
  milestoningState.isAllVersionsInRangeEnabled,
666
734
  milestoningState.queryBuilderState.parametersState.parameterStates,
@@ -724,24 +792,34 @@ export const QueryResultModifierModal = observer(
724
792
  <div className="panel__content__form__section__header__label">
725
793
  Start Date
726
794
  </div>
795
+ <div className="panel__content__form__section__header__prompt">
796
+ Choose a value for this milestoning parameter
797
+ </div>
727
798
  <MilestoningParameterEditor
728
799
  queryBuilderState={
729
800
  milestoningState.queryBuilderState
730
801
  }
731
802
  parameter={startDate}
732
803
  setParameter={setStartDate}
804
+ parameterValue={startDateValue}
805
+ setParameterValue={setStartDateValue}
733
806
  />
734
807
  </PanelFormSection>
735
808
  <PanelFormSection>
736
809
  <div className="panel__content__form__section__header__label">
737
810
  End Date
738
811
  </div>
812
+ <div className="panel__content__form__section__header__prompt">
813
+ Choose a value for this milestoning parameter
814
+ </div>
739
815
  <MilestoningParameterEditor
740
816
  queryBuilderState={
741
817
  milestoningState.queryBuilderState
742
818
  }
743
819
  parameter={endDate}
744
820
  setParameter={setEndDate}
821
+ parameterValue={endDateValue}
822
+ setParameterValue={setEndDateValue}
745
823
  />
746
824
  </PanelFormSection>
747
825
  </div>
@@ -755,12 +833,17 @@ export const QueryResultModifierModal = observer(
755
833
  <div className="panel__content__form__section__header__label">
756
834
  Processing Date
757
835
  </div>
836
+ <div className="panel__content__form__section__header__prompt">
837
+ Choose a value for this milestoning parameter
838
+ </div>
758
839
  <MilestoningParameterEditor
759
840
  queryBuilderState={
760
841
  milestoningState.queryBuilderState
761
842
  }
762
843
  parameter={processingDate}
763
844
  setParameter={setProcessingDate}
845
+ parameterValue={processingDateValue}
846
+ setParameterValue={setProcessingDateValue}
764
847
  />
765
848
  </PanelFormSection>
766
849
  )}
@@ -769,58 +852,71 @@ export const QueryResultModifierModal = observer(
769
852
  <div className="panel__content__form__section__header__label">
770
853
  Business Date
771
854
  </div>
855
+ <div className="panel__content__form__section__header__prompt">
856
+ Choose a value for this milestoning parameter
857
+ </div>
772
858
  <MilestoningParameterEditor
773
859
  queryBuilderState={
774
860
  milestoningState.queryBuilderState
775
861
  }
776
862
  parameter={businessDate}
777
863
  setParameter={setBusinessDate}
864
+ parameterValue={businessDateValue}
865
+ setParameterValue={setBusinessDateValue}
778
866
  />
779
867
  </PanelFormSection>
780
868
  )}
781
869
  </>
782
870
  )}
783
- <PanelFormSection>
784
- <div className="panel__content__form__section__header__label">
785
- List of compatible milestoning parameters
786
- </div>
787
- </PanelFormSection>
788
- <div className="panel__content__form__section__list__items">
789
- <PanelFormListItems title="Available parameters">
790
- {filteredParameterStates.length === 0 && (
791
- <> No available parameters </>
792
- )}
793
- {filteredParameterStates.map((pState) => (
794
- <VariableViewer
795
- key={pState.uuid}
796
- variable={pState.parameter}
797
- isReadOnly={true}
798
- queryBuilderState={milestoningState.queryBuilderState}
799
- />
800
- ))}
801
- </PanelFormListItems>
802
- {Boolean(filteredConstantState.length) && (
803
- <PanelFormListItems title="Available constants">
804
- {filteredConstantState.map((constantState) => (
805
- <VariableViewer
806
- key={constantState.uuid}
807
- variable={constantState.variable}
808
- value={{
809
- val:
810
- constantState instanceof
811
- QueryBuilderSimpleConstantExpressionState
812
- ? constantState.value
813
- : undefined,
814
- }}
815
- queryBuilderState={
816
- milestoningState.queryBuilderState
817
- }
818
- isReadOnly={true}
819
- />
820
- ))}
821
- </PanelFormListItems>
822
- )}
823
- </div>
871
+ {!(isAllVersionsEnabled && !isAllVersionsInRangeEnabled) && (
872
+ <>
873
+ <PanelFormSection>
874
+ <div className="panel__content__form__section__header__label">
875
+ List of compatible milestoning parameters
876
+ </div>
877
+ </PanelFormSection>
878
+ <div className="panel__content__form__section__list__items">
879
+ {filteredParameterStates.length > 0 && (
880
+ <PanelFormListItems title="Available parameters">
881
+ {filteredParameterStates.map((pState) => (
882
+ <VariableViewer
883
+ key={pState.uuid}
884
+ variable={pState.parameter}
885
+ isReadOnly={true}
886
+ queryBuilderState={
887
+ milestoningState.queryBuilderState
888
+ }
889
+ option={{
890
+ hideMilestoningParameterValueString: true,
891
+ }}
892
+ />
893
+ ))}
894
+ </PanelFormListItems>
895
+ )}
896
+ {Boolean(filteredConstantState.length) && (
897
+ <PanelFormListItems title="Available constants">
898
+ {filteredConstantState.map((constantState) => (
899
+ <VariableViewer
900
+ key={constantState.uuid}
901
+ variable={constantState.variable}
902
+ value={{
903
+ val:
904
+ constantState instanceof
905
+ QueryBuilderSimpleConstantExpressionState
906
+ ? constantState.value
907
+ : undefined,
908
+ }}
909
+ queryBuilderState={
910
+ milestoningState.queryBuilderState
911
+ }
912
+ isReadOnly={true}
913
+ />
914
+ ))}
915
+ </PanelFormListItems>
916
+ )}
917
+ </div>
918
+ </>
919
+ )}
824
920
  <div className="query-builder__projection__options__section-name">
825
921
  Other
826
922
  </div>
@@ -1353,7 +1353,17 @@ export const QueryBuilderTDSPanel = observer(
1353
1353
  : 'Set Query Options'}
1354
1354
  </div>
1355
1355
  </button>
1356
- <div className="query-builder__projection__result-modifier-prompt__divider">
1356
+
1357
+ <div
1358
+ className={clsx(
1359
+ 'query-builder__projection__result-modifier-prompt__divider',
1360
+ {
1361
+ 'query-builder__projection__result-modifier-prompt__divider--light':
1362
+ applicationStore.layoutService
1363
+ .TEMPORARY__isLightColorThemeEnabled,
1364
+ },
1365
+ )}
1366
+ >
1357
1367
  {tdsState.isQueryOptionsSet && ' - '}
1358
1368
  </div>
1359
1369
  {tdsState.queryBuilderState.milestoningState
@@ -130,6 +130,9 @@ export const VariableViewer = observer(
130
130
  handler: () => void;
131
131
  }[]
132
132
  | undefined;
133
+ option?: {
134
+ hideMilestoningParameterValueString?: boolean;
135
+ };
133
136
  }) => {
134
137
  const {
135
138
  variable,
@@ -138,6 +141,7 @@ export const VariableViewer = observer(
138
141
  isReadOnly,
139
142
  queryBuilderState,
140
143
  extraContextMenuActions,
144
+ option,
141
145
  } = props;
142
146
  const isVariableUsed = queryBuilderState.isVariableUsed(variable);
143
147
  const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] =
@@ -247,9 +251,11 @@ export const VariableViewer = observer(
247
251
  <div className="query-builder__variables__variable__type__label query-builder__variables__variable__type__label--milestoning">
248
252
  milestoning
249
253
  </div>
250
- <div className="query-builder__constants__value">
251
- {milestoningParameterValueString}
252
- </div>
254
+ {!option?.hideMilestoningParameterValueString && (
255
+ <div className="query-builder__constants__value">
256
+ {milestoningParameterValueString}
257
+ </div>
258
+ )}
253
259
  </>
254
260
  )}
255
261
  </div>
package/src/index.ts CHANGED
@@ -54,6 +54,7 @@ export {
54
54
  TDS_COLUMN_GETTER,
55
55
  COLUMN_SORT_TYPE,
56
56
  QUERY_BUILDER_SUPPORTED_FUNCTIONS,
57
+ QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS,
57
58
  } from './graph/QueryBuilderMetaModelConst.js';
58
59
  export { getQueryBuilderGraphManagerExtension } from './graph-manager/protocol/pure/QueryBuilder_PureGraphManagerExtension.js';
59
60
  export type { ServiceExecutionAnalysisResult } from './graph-manager/action/analytics/ServiceExecutionAnalysis.js';
@@ -516,6 +516,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
516
516
  this.resetQueryResult();
517
517
  if (!options?.keepQueryContent) {
518
518
  this.resetQueryContent();
519
+ this.setGetAllFunction(QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL);
519
520
  this.milestoningState.updateMilestoningConfiguration();
520
521
  }
521
522
  this.executionContextState.setMapping(val);
@@ -86,7 +86,7 @@ export type QueryBuilderHeaderActionConfiguration = {
86
86
  export type QueryBuilderMenuActionConfiguration = {
87
87
  key: string;
88
88
  title?: string;
89
- disableFunc?: (queryBuilderState: QueryBuilderState) => void;
89
+ disableFunc?: (queryBuilderState: QueryBuilderState) => boolean;
90
90
  label: string;
91
91
  onClick: (queryBuilderState: QueryBuilderState) => void;
92
92
  icon?: React.ReactNode;
@@ -482,20 +482,22 @@ export class QueryBuilderMilestoningState implements Hashable {
482
482
  }
483
483
 
484
484
  updateMilestoningParameterValue(
485
- parameter: VariableExpression,
485
+ parameter: ValueSpecification | undefined,
486
486
  value: ValueSpecification | undefined,
487
487
  ): void {
488
- const variableState =
489
- this.queryBuilderState.parametersState.parameterStates.find(
490
- (param) => param.parameter.name === parameter.name,
491
- );
492
- if (variableState) {
493
- variableState.setValue(value);
488
+ if (parameter instanceof VariableExpression) {
489
+ const variableState =
490
+ this.queryBuilderState.parametersState.parameterStates.find(
491
+ (param) => param.parameter.name === parameter.name,
492
+ );
493
+ if (variableState) {
494
+ variableState.setValue(value);
495
+ }
494
496
  }
495
497
  }
496
498
 
497
499
  getMilestoningParameterValue(
498
- milestoningParameter: ValueSpecification,
500
+ milestoningParameter: ValueSpecification | undefined,
499
501
  ): ValueSpecification | undefined {
500
502
  let value: ValueSpecification | undefined = milestoningParameter;
501
503
  if (milestoningParameter instanceof VariableExpression) {
@@ -515,7 +517,18 @@ export class QueryBuilderMilestoningState implements Hashable {
515
517
  const usedInProcessingDate = this.processingDate
516
518
  ? isValueExpressionReferencedInValue(variable, this.processingDate)
517
519
  : false;
518
- return usedInBusiness || usedInProcessingDate;
520
+ const usedInStartDate = this.startDate
521
+ ? isValueExpressionReferencedInValue(variable, this.startDate)
522
+ : false;
523
+ const usedInEndState = this.endDate
524
+ ? isValueExpressionReferencedInValue(variable, this.endDate)
525
+ : false;
526
+ return (
527
+ usedInBusiness ||
528
+ usedInProcessingDate ||
529
+ usedInStartDate ||
530
+ usedInEndState
531
+ );
519
532
  }
520
533
 
521
534
  isMilestoningParameter(parameter: VariableExpression): boolean {