@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.
Files changed (96) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +3 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +2 -0
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +14 -2
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderSideBar.js +1 -5
  10. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  11. package/lib/components/explorer/{QueryBuilderMilestoningEditor.d.ts → QueryBuilderMilestoningParameterEditor.d.ts} +5 -2
  12. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.d.ts.map +1 -0
  13. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js +52 -0
  14. package/lib/components/explorer/QueryBuilderMilestoningParameterEditor.js.map +1 -0
  15. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  16. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +192 -21
  17. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  18. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  19. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +13 -3
  20. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  21. package/lib/graph-manager/QueryBuilderConfig.d.ts +4 -0
  22. package/lib/graph-manager/QueryBuilderConfig.d.ts.map +1 -1
  23. package/lib/graph-manager/QueryBuilderConfig.js +5 -0
  24. package/lib/graph-manager/QueryBuilderConfig.js.map +1 -1
  25. package/lib/index.css +1 -17
  26. package/lib/index.css.map +1 -1
  27. package/lib/package.json +1 -1
  28. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  29. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  30. package/lib/stores/QueryBuilderValueSpecificationHelper.js +2 -2
  31. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  32. package/lib/stores/QueryLoaderState.d.ts +1 -0
  33. package/lib/stores/QueryLoaderState.d.ts.map +1 -1
  34. package/lib/stores/QueryLoaderState.js +1 -0
  35. package/lib/stores/QueryLoaderState.js.map +1 -1
  36. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -0
  37. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  38. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +8 -0
  39. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  40. package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.d.ts.map +1 -1
  41. package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.js +4 -2
  42. package/lib/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.js.map +1 -1
  43. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  44. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +1 -1
  45. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  46. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -1
  47. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +1 -1
  48. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
  49. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +2 -0
  50. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -1
  51. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +13 -2
  52. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -1
  53. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +2 -0
  54. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -1
  55. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +8 -1
  56. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -1
  57. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +1 -1
  58. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -1
  59. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +25 -1
  60. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -1
  61. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +2 -0
  62. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -1
  63. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -1
  64. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts +2 -0
  65. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
  66. package/lib/stores/milestoning/QueryBuilderMilestoningState.js +22 -3
  67. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
  68. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +2 -0
  69. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -1
  70. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +8 -1
  71. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -1
  72. package/package.json +4 -4
  73. package/src/__lib__/QueryBuilderDocumentation.ts +2 -0
  74. package/src/components/QueryBuilder.tsx +44 -0
  75. package/src/components/QueryBuilderSideBar.tsx +0 -22
  76. package/src/components/explorer/QueryBuilderMilestoningParameterEditor.tsx +114 -0
  77. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +445 -19
  78. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +118 -21
  79. package/src/graph-manager/QueryBuilderConfig.ts +6 -0
  80. package/src/stores/QueryBuilderValueSpecificationHelper.ts +3 -0
  81. package/src/stores/QueryLoaderState.ts +1 -0
  82. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +11 -0
  83. package/src/stores/fetch-structure/tds/aggregation/operators/QueryBuilderAggregateOperator_Percentile.ts +6 -2
  84. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +1 -0
  85. package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +1 -0
  86. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +23 -0
  87. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +13 -0
  88. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +45 -0
  89. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +3 -0
  90. package/src/stores/milestoning/QueryBuilderMilestoningState.ts +41 -7
  91. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +13 -0
  92. package/tsconfig.json +1 -1
  93. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +0 -1
  94. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +0 -102
  95. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +0 -1
  96. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +0 -364
@@ -46,6 +46,7 @@ import {
46
46
  clsx,
47
47
  DocumentationIcon,
48
48
  CodeIcon,
49
+ QuestionIcon,
49
50
  } from '@finos/legend-art';
50
51
  import { QueryBuilderFilterPanel } from './filter/QueryBuilderFilterPanel.js';
51
52
  import { QueryBuilderExplorerPanel } from './explorer/QueryBuilderExplorerPanel.js';
@@ -442,6 +443,14 @@ export const QueryBuilder = observer(
442
443
  const queryDocEntry = applicationStore.documentationService.getDocEntry(
443
444
  QUERY_BUILDER_DOCUMENTATION_KEY.TUTORIAL_QUERY_BUILDER,
444
445
  );
446
+ const frequentlyAskedQuestionEntry =
447
+ applicationStore.documentationService.getDocEntry(
448
+ QUERY_BUILDER_DOCUMENTATION_KEY.FREQUENTLY_ASKED_QUESTIONS,
449
+ );
450
+ const supportTicketsEntry =
451
+ applicationStore.documentationService.getDocEntry(
452
+ QUERY_BUILDER_DOCUMENTATION_KEY.SUPPORT_TICKETS_LINK,
453
+ );
445
454
  const openQueryTutorial = (): void => {
446
455
  if (queryDocEntry?.url) {
447
456
  applicationStore.navigationService.navigator.visitAddress(
@@ -449,6 +458,21 @@ export const QueryBuilder = observer(
449
458
  );
450
459
  }
451
460
  };
461
+ const openFrequentlyAskedQuestions = (): void => {
462
+ if (frequentlyAskedQuestionEntry?.url) {
463
+ applicationStore.navigationService.navigator.visitAddress(
464
+ frequentlyAskedQuestionEntry.url,
465
+ );
466
+ }
467
+ };
468
+ const openSupportTickets = (): void => {
469
+ if (supportTicketsEntry?.url) {
470
+ applicationStore.navigationService.navigator.visitAddress(
471
+ supportTicketsEntry.url,
472
+ );
473
+ }
474
+ };
475
+
452
476
  const toggleAssistant = (): void =>
453
477
  applicationStore.assistantService.toggleAssistant();
454
478
 
@@ -893,6 +917,26 @@ export const QueryBuilder = observer(
893
917
  </MenuContentItemLabel>
894
918
  </MenuContentItem>
895
919
  )}
920
+ {frequentlyAskedQuestionEntry && (
921
+ <MenuContentItem onClick={openFrequentlyAskedQuestions}>
922
+ <MenuContentItemIcon>
923
+ <QuestionIcon />
924
+ </MenuContentItemIcon>
925
+ <MenuContentItemLabel>
926
+ Frequently Asked Questions
927
+ </MenuContentItemLabel>
928
+ </MenuContentItem>
929
+ )}
930
+ {supportTicketsEntry && (
931
+ <MenuContentItem onClick={openSupportTickets}>
932
+ <MenuContentItemIcon>
933
+ <QuestionIcon />
934
+ </MenuContentItemIcon>
935
+ <MenuContentItemLabel>
936
+ Open Support Tickets
937
+ </MenuContentItemLabel>
938
+ </MenuContentItem>
939
+ )}
896
940
  <MenuContentItem onClick={toggleAssistant}>
897
941
  <MenuContentItemIcon>
898
942
  {!applicationStore.assistantService.isHidden ? (
@@ -47,7 +47,6 @@ import {
47
47
  getPackageableElementOptionFormatter,
48
48
  type PackageableElementOption,
49
49
  } from '@finos/legend-lego/graph-editor';
50
- import { MilestoningParametersEditor } from './explorer/QueryBuilderMilestoningEditor.js';
51
50
  import type { QueryBuilder_LegendApplicationPlugin_Extension } from '../stores/QueryBuilder_LegendApplicationPlugin_Extension.js';
52
51
 
53
52
  export const getParameterValue = (
@@ -120,7 +119,6 @@ export const QueryBuilderClassSelector = observer(
120
119
  noMatchMessage?: string | undefined;
121
120
  }) => {
122
121
  const { queryBuilderState, classes, onClassChange, noMatchMessage } = props;
123
- const milestoningState = queryBuilderState.milestoningState;
124
122
  const applicationStore = useApplicationStore();
125
123
 
126
124
  // class
@@ -151,10 +149,6 @@ export const QueryBuilderClassSelector = observer(
151
149
  onClassChange?.(val.value);
152
150
  };
153
151
 
154
- // milestoning
155
- const showMilestoningEditor = (): void =>
156
- milestoningState.setShowMilestoningEditor(true);
157
-
158
152
  return (
159
153
  <div className="query-builder__setup__config-group query-builder__setup__config-group--class">
160
154
  <div className="query-builder__setup__config-group__item ">
@@ -192,22 +186,6 @@ export const QueryBuilderClassSelector = observer(
192
186
  .TEMPORARY__isLightColorThemeEnabled,
193
187
  })}
194
188
  />
195
- {queryBuilderState.isQuerySupported && (
196
- <button
197
- className="btn--dark btn__icon--dark query-builder__setup__milestoning"
198
- tabIndex={-1}
199
- onClick={showMilestoningEditor}
200
- disabled={!milestoningState.isMilestonedQuery}
201
- title="Edit Milestoning Parameters"
202
- >
203
- <ClockIcon />
204
- </button>
205
- )}
206
- {milestoningState.isMilestonedQuery && (
207
- <MilestoningParametersEditor
208
- queryBuilderState={queryBuilderState}
209
- />
210
- )}
211
189
  </div>
212
190
  </div>
213
191
  );
@@ -0,0 +1,114 @@
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
+ GenericType,
23
+ GenericTypeExplicitReference,
24
+ observe_PrimitiveInstanceValue,
25
+ PrimitiveInstanceValue,
26
+ PRIMITIVE_TYPE,
27
+ PrimitiveType,
28
+ } from '@finos/legend-graph';
29
+ import { useDrop } from 'react-dnd';
30
+ import { PanelEntryDropZonePlaceholder } from '@finos/legend-art';
31
+ import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
32
+ import {
33
+ BasicValueSpecificationEditor,
34
+ type QueryBuilderVariableDragSource,
35
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
36
+ } from '../shared/BasicValueSpecificationEditor.js';
37
+ import { instanceValue_setValues } from '../../stores/shared/ValueSpecificationModifierHelper.js';
38
+
39
+ export const MilestoningParameterEditor = observer(
40
+ (props: {
41
+ queryBuilderState: QueryBuilderState;
42
+ parameter: ValueSpecification;
43
+ setParameter: (val: ValueSpecification) => void;
44
+ }) => {
45
+ const { queryBuilderState, parameter, setParameter } = props;
46
+ const handleDrop = useCallback(
47
+ (item: QueryBuilderVariableDragSource): void => {
48
+ setParameter(item.variable);
49
+ },
50
+ [setParameter],
51
+ );
52
+ const [{ isDragOver }, dropConnector] = useDrop<
53
+ QueryBuilderVariableDragSource,
54
+ void,
55
+ { isDragOver: boolean }
56
+ >(
57
+ () => ({
58
+ accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
59
+ drop: (item, monitor): void => {
60
+ if (!monitor.didDrop()) {
61
+ handleDrop(item);
62
+ }
63
+ },
64
+ collect: (monitor): { isDragOver: boolean } => ({
65
+ isDragOver: monitor.isOver({
66
+ shallow: true,
67
+ }),
68
+ }),
69
+ }),
70
+ [handleDrop],
71
+ );
72
+ const resetMilestoningParameter = (): void => {
73
+ const param = observe_PrimitiveInstanceValue(
74
+ new PrimitiveInstanceValue(
75
+ GenericTypeExplicitReference.create(
76
+ new GenericType(PrimitiveType.STRICTDATE),
77
+ ),
78
+ ),
79
+ queryBuilderState.observerContext,
80
+ );
81
+ instanceValue_setValues(
82
+ param,
83
+ [generateDefaultValueForPrimitiveType(PRIMITIVE_TYPE.STRICTDATE)],
84
+ queryBuilderState.observerContext,
85
+ );
86
+ setParameter(param);
87
+ };
88
+
89
+ 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
+ obseverContext={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>
111
+ </div>
112
+ );
113
+ },
114
+ );