@finos/legend-query-builder 4.1.2 → 4.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  2. package/lib/components/QueryBuilderPropertyExpressionEditor.js +1 -1
  3. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  4. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderResultPanel.js +91 -24
  6. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  7. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  8. package/lib/components/QueryBuilderTextEditor.js +3 -1
  9. package/lib/components/QueryBuilderTextEditor.js.map +1 -1
  10. package/lib/components/execution-plan/AllocationExecutionNodeViewer.d.ts +23 -0
  11. package/lib/components/execution-plan/AllocationExecutionNodeViewer.d.ts.map +1 -0
  12. package/lib/components/execution-plan/AllocationExecutionNodeViewer.js +32 -0
  13. package/lib/components/execution-plan/AllocationExecutionNodeViewer.js.map +1 -0
  14. package/lib/components/execution-plan/ConstantExecutionNodeViewer.d.ts +23 -0
  15. package/lib/components/execution-plan/ConstantExecutionNodeViewer.d.ts.map +1 -0
  16. package/lib/components/execution-plan/ConstantExecutionNodeViewer.js +35 -0
  17. package/lib/components/execution-plan/ConstantExecutionNodeViewer.js.map +1 -0
  18. package/lib/components/execution-plan/DataTypeResultTypeViewer.d.ts +21 -0
  19. package/lib/components/execution-plan/DataTypeResultTypeViewer.d.ts.map +1 -0
  20. package/lib/components/execution-plan/DataTypeResultTypeViewer.js +31 -0
  21. package/lib/components/execution-plan/DataTypeResultTypeViewer.js.map +1 -0
  22. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts +10 -4
  23. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
  24. package/lib/components/execution-plan/ExecutionPlanViewer.js +74 -62
  25. package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
  26. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.d.ts +25 -0
  27. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.d.ts.map +1 -0
  28. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js +47 -0
  29. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js.map +1 -0
  30. package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.d.ts +23 -0
  31. package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.d.ts.map +1 -0
  32. package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.js +31 -0
  33. package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.js.map +1 -0
  34. package/lib/components/execution-plan/ResultTypeViewer.d.ts +21 -0
  35. package/lib/components/execution-plan/ResultTypeViewer.d.ts.map +1 -0
  36. package/lib/components/execution-plan/ResultTypeViewer.js +33 -0
  37. package/lib/components/execution-plan/ResultTypeViewer.js.map +1 -0
  38. package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts +9 -1
  39. package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts.map +1 -1
  40. package/lib/components/execution-plan/SQLExecutionNodeViewer.js +12 -6
  41. package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
  42. package/lib/components/execution-plan/SequenceExecutionNodeViewer.d.ts +23 -0
  43. package/lib/components/execution-plan/SequenceExecutionNodeViewer.d.ts.map +1 -0
  44. package/lib/components/execution-plan/SequenceExecutionNodeViewer.js +38 -0
  45. package/lib/components/execution-plan/SequenceExecutionNodeViewer.js.map +1 -0
  46. package/lib/components/execution-plan/TDSResultTypeViewer.d.ts +21 -0
  47. package/lib/components/execution-plan/TDSResultTypeViewer.d.ts.map +1 -0
  48. package/lib/components/execution-plan/TDSResultTypeViewer.js +25 -0
  49. package/lib/components/execution-plan/TDSResultTypeViewer.js.map +1 -0
  50. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  51. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +3 -3
  52. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  54. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +25 -34
  55. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  56. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +68 -22
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  60. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +4 -4
  61. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  62. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.js +21 -32
  64. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  65. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  66. package/lib/components/shared/LambdaEditor.js +10 -3
  67. package/lib/components/shared/LambdaEditor.js.map +1 -1
  68. package/lib/index.css +2 -2
  69. package/lib/index.css.map +1 -1
  70. package/lib/package.json +4 -4
  71. package/lib/stores/QueryBuilderResultState.d.ts +0 -3
  72. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  73. package/lib/stores/QueryBuilderResultState.js +2 -25
  74. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  75. package/lib/stores/QueryBuilderTextEditorState.d.ts +3 -1
  76. package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
  77. package/lib/stores/QueryBuilderTextEditorState.js +2 -2
  78. package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
  79. package/lib/stores/QueryLoaderState.d.ts +2 -0
  80. package/lib/stores/QueryLoaderState.d.ts.map +1 -1
  81. package/lib/stores/QueryLoaderState.js +7 -3
  82. package/lib/stores/QueryLoaderState.js.map +1 -1
  83. package/lib/stores/execution-plan/ExecutionPlanState.d.ts +14 -1
  84. package/lib/stores/execution-plan/ExecutionPlanState.d.ts.map +1 -1
  85. package/lib/stores/execution-plan/ExecutionPlanState.js +86 -3
  86. package/lib/stores/execution-plan/ExecutionPlanState.js.map +1 -1
  87. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  88. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +3 -1
  89. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  90. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +4 -1
  91. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  92. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +5 -3
  93. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  94. package/lib/stores/shared/LambdaEditorState.d.ts +7 -2
  95. package/lib/stores/shared/LambdaEditorState.d.ts.map +1 -1
  96. package/lib/stores/shared/LambdaEditorState.js +7 -2
  97. package/lib/stores/shared/LambdaEditorState.js.map +1 -1
  98. package/package.json +12 -12
  99. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +1 -2
  100. package/src/components/QueryBuilderResultPanel.tsx +146 -30
  101. package/src/components/QueryBuilderTextEditor.tsx +3 -1
  102. package/src/components/execution-plan/AllocationExecutionNodeViewer.tsx +77 -0
  103. package/src/components/execution-plan/ConstantExecutionNodeViewer.tsx +82 -0
  104. package/src/components/execution-plan/DataTypeResultTypeViewer.tsx +52 -0
  105. package/src/components/execution-plan/ExecutionPlanViewer.tsx +205 -195
  106. package/src/components/execution-plan/FunctionParametersValidationNodeViewer.tsx +118 -0
  107. package/src/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.tsx +68 -0
  108. package/src/components/execution-plan/ResultTypeViewer.tsx +37 -0
  109. package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +50 -19
  110. package/src/components/execution-plan/SequenceExecutionNodeViewer.tsx +95 -0
  111. package/src/components/execution-plan/TDSResultTypeViewer.tsx +59 -0
  112. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +5 -8
  113. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +37 -62
  114. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +161 -45
  115. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +6 -8
  116. package/src/components/filter/QueryBuilderFilterPanel.tsx +49 -73
  117. package/src/components/shared/LambdaEditor.tsx +10 -3
  118. package/src/stores/QueryBuilderResultState.ts +1 -42
  119. package/src/stores/QueryBuilderTextEditorState.ts +4 -2
  120. package/src/stores/QueryLoaderState.ts +11 -1
  121. package/src/stores/execution-plan/ExecutionPlanState.ts +142 -4
  122. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +3 -1
  123. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +8 -3
  124. package/src/stores/shared/LambdaEditorState.ts +12 -5
  125. package/tsconfig.json +8 -0
@@ -0,0 +1,37 @@
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 {
19
+ type ResultType,
20
+ TDSResultType,
21
+ DataTypeResultType,
22
+ } from '@finos/legend-graph';
23
+ import { DataTypeResultTypeViewer } from './DataTypeResultTypeViewer.js';
24
+ import { TDSResultTypeViewer } from './TDSResultTypeViewer.js';
25
+
26
+ export const ResultTypeViewer: React.FC<{
27
+ resultType: ResultType;
28
+ }> = observer((props) => {
29
+ const { resultType } = props;
30
+ if (resultType instanceof DataTypeResultType) {
31
+ return <DataTypeResultTypeViewer resultType={resultType} />;
32
+ } else if (resultType instanceof TDSResultType) {
33
+ return <TDSResultTypeViewer resultType={resultType} />;
34
+ } else {
35
+ return <></>;
36
+ }
37
+ });
@@ -19,7 +19,11 @@ import {
19
19
  type ExecutionPlanState,
20
20
  EXECUTION_PLAN_VIEW_MODE,
21
21
  } from '../../stores/execution-plan/ExecutionPlanState.js';
22
- import { type SQLResultColumn, stringifyDataType } from '@finos/legend-graph';
22
+ import {
23
+ type SQLResultColumn,
24
+ stringifyDataType,
25
+ type ResultType,
26
+ } from '@finos/legend-graph';
23
27
  import {
24
28
  PanelListItem,
25
29
  CopyIcon,
@@ -28,6 +32,7 @@ import {
28
32
  PanelContent,
29
33
  } from '@finos/legend-art';
30
34
  import { tryToFormatSql } from '../QueryBuilderResultPanel.js';
35
+ import { ResultTypeViewer } from './ResultTypeViewer.js';
31
36
  import {
32
37
  CodeEditor,
33
38
  CODE_EDITOR_LANGUAGE,
@@ -40,13 +45,14 @@ import {
40
45
  * @modularize
41
46
  * See https://github.com/finos/legend-studio/issues/65
42
47
  */
43
- export const SQLExecutionNodeViewer: React.FC<{
48
+
49
+ export const SQLExecutionNodeViewerHelper: React.FC<{
44
50
  query: string;
45
51
  resultColumns: SQLResultColumn[];
52
+ resultType: ResultType;
46
53
  executionPlanState: ExecutionPlanState;
47
54
  }> = observer((props) => {
48
- const { query, resultColumns, executionPlanState } = props;
49
-
55
+ const { query, resultColumns, resultType, executionPlanState } = props;
50
56
  const applicationStore = executionPlanState.applicationStore;
51
57
  const copyExpression = (value: string): void => {
52
58
  applicationStore.clipboardService
@@ -60,12 +66,9 @@ export const SQLExecutionNodeViewer: React.FC<{
60
66
  )
61
67
  .catch(applicationStore.alertUnhandledError);
62
68
  };
69
+
63
70
  return (
64
- <PanelContent
65
- darkMode={
66
- !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
67
- }
68
- >
71
+ <>
69
72
  <div className="query-builder__sql__container">
70
73
  <PanelDivider />
71
74
  <div key={query}>
@@ -125,17 +128,45 @@ export const SQLExecutionNodeViewer: React.FC<{
125
128
  </table>
126
129
  </div>
127
130
  </div>
128
- <PanelDivider />
131
+ <ResultTypeViewer resultType={resultType} />
132
+ </>
133
+ );
134
+ });
129
135
 
130
- <div className="query-builder__sql__container">
131
- <Button
132
- className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
133
- onClick={(): void =>
134
- executionPlanState.setViewMode(EXECUTION_PLAN_VIEW_MODE.JSON)
135
- }
136
- text="View JSON"
137
- />
138
- </div>
136
+ export const SQLExecutionNodeViewer: React.FC<{
137
+ query: string;
138
+ resultColumns: SQLResultColumn[];
139
+ resultType: ResultType;
140
+ executionPlanState: ExecutionPlanState;
141
+ viewJson: boolean;
142
+ }> = observer((props) => {
143
+ const { query, resultColumns, resultType, executionPlanState, viewJson } =
144
+ props;
145
+ const applicationStore = executionPlanState.applicationStore;
146
+
147
+ return (
148
+ <PanelContent
149
+ darkMode={
150
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
151
+ }
152
+ >
153
+ <SQLExecutionNodeViewerHelper
154
+ query={query}
155
+ resultColumns={resultColumns}
156
+ resultType={resultType}
157
+ executionPlanState={executionPlanState}
158
+ />
159
+ {viewJson && (
160
+ <div className="query-builder__sql__container">
161
+ <Button
162
+ className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
163
+ onClick={(): void =>
164
+ executionPlanState.setViewMode(EXECUTION_PLAN_VIEW_MODE.JSON)
165
+ }
166
+ text="View JSON"
167
+ />
168
+ </div>
169
+ )}
139
170
  <PanelDivider />
140
171
  </PanelContent>
141
172
  );
@@ -0,0 +1,95 @@
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 { generateExecutionNodeLabel } from './ExecutionPlanViewer.js';
19
+ import {
20
+ type ExecutionPlanState,
21
+ EXECUTION_PLAN_VIEW_MODE,
22
+ ExecutionPlanViewTreeNodeData,
23
+ ExecutionNodeTreeNodeData,
24
+ } from '../../stores/execution-plan/ExecutionPlanState.js';
25
+
26
+ import {
27
+ PanelListItem,
28
+ PanelDivider,
29
+ Button,
30
+ PanelContent,
31
+ } from '@finos/legend-art';
32
+ import type { ExecutionNode, SequenceExecutionNode } from '@finos/legend-graph';
33
+ import { ResultTypeViewer } from './ResultTypeViewer.js';
34
+
35
+ export const SequenceExecutionNodeViewer: React.FC<{
36
+ node: SequenceExecutionNode;
37
+ executionPlanState: ExecutionPlanState;
38
+ }> = observer((props) => {
39
+ const { node, executionPlanState } = props;
40
+ const resultType = node.resultType;
41
+ const applicationStore = executionPlanState.applicationStore;
42
+ const openExecutionNode = (child: ExecutionNode): void => {
43
+ const newNode = executionPlanState.treeData?.nodes.get(child._UUID);
44
+ if (newNode instanceof ExecutionPlanViewTreeNodeData) {
45
+ executionPlanState.transformMetadataToProtocolJson(newNode.executionPlan);
46
+ } else if (newNode instanceof ExecutionNodeTreeNodeData) {
47
+ executionPlanState.transformMetadataToProtocolJson(newNode.executionNode);
48
+ }
49
+ executionPlanState.setSelectedNode(newNode);
50
+ };
51
+
52
+ return (
53
+ <PanelContent
54
+ darkMode={
55
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
56
+ }
57
+ >
58
+ <div className="query-builder__sequence__container">
59
+ <div>
60
+ <PanelListItem className="query-builder__sequence__container__item__label">
61
+ Execution Nodes
62
+ </PanelListItem>
63
+ <PanelDivider />
64
+ {node.executionNodes.map((child, index) => (
65
+ <div
66
+ className="query-builder__sequence__container__item"
67
+ key={child._UUID}
68
+ >
69
+ <button
70
+ className="query-builder__sequence__container__item__btn"
71
+ onClick={() => openExecutionNode(child)}
72
+ tabIndex={-1}
73
+ title={`Go to ${generateExecutionNodeLabel(child)}`}
74
+ >
75
+ {`${index + 1}: ${generateExecutionNodeLabel(child)}`}
76
+ </button>
77
+ </div>
78
+ ))}
79
+ </div>
80
+ </div>
81
+ <PanelDivider />
82
+ <ResultTypeViewer resultType={resultType} />
83
+ <div className="query-builder__execution__container">
84
+ <Button
85
+ className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
86
+ onClick={(): void =>
87
+ executionPlanState.setViewMode(EXECUTION_PLAN_VIEW_MODE.JSON)
88
+ }
89
+ text="View JSON"
90
+ />
91
+ </div>
92
+ <PanelDivider />
93
+ </PanelContent>
94
+ );
95
+ });
@@ -0,0 +1,59 @@
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 { PanelListItem, PanelDivider } from '@finos/legend-art';
19
+ import {
20
+ PackageableElementImplicitReference,
21
+ type TDSResultType,
22
+ } from '@finos/legend-graph';
23
+
24
+ export const TDSResultTypeViewer: React.FC<{
25
+ resultType: TDSResultType;
26
+ }> = observer((props) => {
27
+ const { resultType } = props;
28
+
29
+ return (
30
+ <div className="query-builder__result__container">
31
+ <PanelListItem className="query-builder__result__container__item__tds">
32
+ Result type: TDS
33
+ </PanelListItem>
34
+ <PanelDivider />
35
+ {
36
+ <table className="table query-builder__result__container__table">
37
+ <thead>
38
+ <tr>
39
+ <th className="table__cell--left">Label</th>
40
+ <th className="table__cell--left">Result DataType</th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ {resultType.tdsColumns.map((column) => (
45
+ <tr key={column.name}>
46
+ <td className="table__cell--left">{column.name}</td>
47
+ <td className="table__cell--left">
48
+ {column.type instanceof PackageableElementImplicitReference &&
49
+ (column.type.input ?? '')}
50
+ </td>
51
+ </tr>
52
+ ))}
53
+ </tbody>
54
+ </table>
55
+ }
56
+ <PanelDivider />
57
+ </div>
58
+ );
59
+ });
@@ -65,10 +65,10 @@ const MilestoningParameterEditor = observer(
65
65
  },
66
66
  [queryBuilderState, stereotype],
67
67
  );
68
- const [{ isMilestoningParameterValueDragOver }, dropConnector] = useDrop<
68
+ const [{ isDragOver }, dropConnector] = useDrop<
69
69
  QueryBuilderVariableDragSource,
70
70
  void,
71
- { isMilestoningParameterValueDragOver: boolean }
71
+ { isDragOver: boolean }
72
72
  >(
73
73
  () => ({
74
74
  accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
@@ -77,10 +77,8 @@ const MilestoningParameterEditor = observer(
77
77
  handleDrop(item);
78
78
  }
79
79
  },
80
- collect: (
81
- monitor,
82
- ): { isMilestoningParameterValueDragOver: boolean } => ({
83
- isMilestoningParameterValueDragOver: monitor.isOver({
80
+ collect: (monitor): { isDragOver: boolean } => ({
81
+ isDragOver: monitor.isOver({
84
82
  shallow: true,
85
83
  }),
86
84
  }),
@@ -121,9 +119,8 @@ const MilestoningParameterEditor = observer(
121
119
  return (
122
120
  <div ref={dropConnector} className="query-builder__variable-editor">
123
121
  <PanelEntryDropZonePlaceholder
124
- showPlaceholder={isMilestoningParameterValueDragOver}
122
+ isDragOver={isDragOver}
125
123
  label="Change Milestoning Parameter Value"
126
- className="query-builder__dnd__placeholder"
127
124
  >
128
125
  <BasicValueSpecificationEditor
129
126
  valueSpecification={milestoningParameter}
@@ -153,9 +153,9 @@ const QueryBuilderPostFilterGroupConditionEditor = observer(
153
153
  (props: {
154
154
  node: QueryBuilderPostFilterTreeGroupNodeData;
155
155
  isDragOver: boolean;
156
- showDroppableSuggestion: boolean;
156
+ isDroppable: boolean;
157
157
  }) => {
158
- const { node, isDragOver, showDroppableSuggestion } = props;
158
+ const { node, isDragOver, isDroppable: isDroppable } = props;
159
159
  const switchOperation: React.MouseEventHandler<HTMLDivElement> = (
160
160
  event,
161
161
  ): void => {
@@ -166,19 +166,16 @@ const QueryBuilderPostFilterGroupConditionEditor = observer(
166
166
  : QUERY_BUILDER_GROUP_OPERATION.AND,
167
167
  );
168
168
  };
169
+
170
+ const operationName =
171
+ node.groupOperation === QUERY_BUILDER_GROUP_OPERATION.AND ? 'AND' : 'OR';
172
+
169
173
  return (
170
174
  <div className="query-builder-post-filter-tree__node__label__content dnd__entry__container">
171
- {showDroppableSuggestion && (
172
- <div
173
- className={clsx('dnd__entry--droppable__indicator ', {
174
- 'dnd__entry--droppable__indicator--dragover': isDragOver,
175
- })}
176
- ></div>
177
- )}
178
175
  <PanelEntryDropZonePlaceholder
179
- showPlaceholder={isDragOver}
180
- label="Add to Logical Group"
181
- className="query-builder__dnd__placeholder"
176
+ isDragOver={isDragOver}
177
+ isDroppable={isDroppable}
178
+ label={`Add to Logical Group '${operationName}'`}
182
179
  >
183
180
  <div
184
181
  className={clsx('query-builder-post-filter-tree__group-node', {
@@ -243,9 +240,8 @@ export const QueryBuilderColumnBadge = observer(
243
240
  return (
244
241
  <div ref={dropConnector} className="query-builder-column-badge">
245
242
  <PanelEntryDropZonePlaceholder
246
- showPlaceholder={isDragOver}
243
+ isDragOver={isDragOver}
247
244
  label="Change Property"
248
- className="query-builder__dnd__placeholder"
249
245
  >
250
246
  <div className="query-builder-column-badge__content">
251
247
  {type && (
@@ -367,8 +363,8 @@ const QueryBuilderPostFilterConditionEditor = observer(
367
363
  cleanUpReloadValues,
368
364
  };
369
365
 
370
- const { showDroppableSuggestion } = useDragLayer((monitor) => ({
371
- showDroppableSuggestion:
366
+ const { isDroppable } = useDragLayer((monitor) => ({
367
+ isDroppable:
372
368
  monitor.isDragging() &&
373
369
  (monitor.getItemType() === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE ||
374
370
  monitor.getItemType() === QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE),
@@ -376,20 +372,10 @@ const QueryBuilderPostFilterConditionEditor = observer(
376
372
 
377
373
  return (
378
374
  <div className="query-builder-post-filter-tree__node__label__content dnd__entry__container">
379
- {showDroppableSuggestion && (
380
- <div
381
- className={clsx(
382
- 'dnd__entry--droppable__indicator query-builder-post-filter-tree__droppable--full',
383
- {
384
- 'dnd__entry--droppable__indicator--dragover': isDragOver,
385
- },
386
- )}
387
- ></div>
388
- )}
389
375
  <PanelEntryDropZonePlaceholder
390
- showPlaceholder={isDragOver}
376
+ isDragOver={isDragOver}
377
+ isDroppable={isDroppable}
391
378
  label="Add New Logical Group"
392
- className="query-builder__dnd__placeholder"
393
379
  >
394
380
  <div className="query-builder-post-filter-tree__condition-node">
395
381
  <div className="query-builder-post-filter-tree__condition-node__property">
@@ -433,9 +419,8 @@ const QueryBuilderPostFilterConditionEditor = observer(
433
419
  className="query-builder-post-filter-tree__condition-node__value"
434
420
  >
435
421
  <PanelEntryDropZonePlaceholder
436
- showPlaceholder={isFilterValueDragOver}
422
+ isDragOver={isFilterValueDragOver}
437
423
  label="Change Filter Value"
438
- className="query-builder__dnd__placeholder"
439
424
  >
440
425
  <BasicValueSpecificationEditor
441
426
  valueSpecification={node.condition.value}
@@ -467,22 +452,17 @@ const QueryBuilderPostFilterBlankConditionEditor = observer(
467
452
  (props: {
468
453
  node: QueryBuilderPostFilterTreeBlankConditionNodeData;
469
454
  isDragOver: boolean;
470
- showDroppableSuggestion: boolean;
455
+ isDroppable: boolean;
471
456
  }) => {
472
- const { isDragOver, showDroppableSuggestion } = props;
457
+ const { isDragOver, isDroppable } = props;
473
458
  return (
474
459
  <div className="query-builder-post-filter-tree__node__label__content">
475
460
  <PanelEntryDropZonePlaceholder
476
- showPlaceholder={isDragOver}
461
+ isDragOver={isDragOver}
462
+ isDroppable={isDroppable}
477
463
  label="Create Condition"
478
- className="query-builder__dnd__placeholder"
479
464
  >
480
- <div
481
- className={clsx('query-builder-post-filter-tree__blank-node', {
482
- 'query-builder-post-filter-tree__blank-node--droppable':
483
- showDroppableSuggestion,
484
- })}
485
- >
465
+ <div className="query-builder-post-filter-tree__blank-node">
486
466
  blank
487
467
  </div>
488
468
  </PanelEntryDropZonePlaceholder>
@@ -646,8 +626,8 @@ const QueryBuilderPostFilterTreeNodeContainer = observer(
646
626
  const onContextMenuOpen = (): void => setIsSelectedFromContextMenu(true);
647
627
  const onContextMenuClose = (): void => setIsSelectedFromContextMenu(false);
648
628
 
649
- const { showDroppableSuggestion } = useDragLayer((monitor) => ({
650
- showDroppableSuggestion:
629
+ const { isDroppable } = useDragLayer((monitor) => ({
630
+ isDroppable:
651
631
  monitor.isDragging() &&
652
632
  (monitor.getItemType() === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE ||
653
633
  monitor.getItemType() === QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE),
@@ -698,16 +678,12 @@ const QueryBuilderPostFilterTreeNodeContainer = observer(
698
678
  <div
699
679
  className={clsx(
700
680
  'tree-view__node__label query-builder-post-filter-tree__node__label',
701
- {
702
- 'query-builder-post-filter-tree__node__label--expandable':
703
- isExpandable,
704
- },
705
681
  )}
706
682
  >
707
683
  {node instanceof QueryBuilderPostFilterTreeGroupNodeData && (
708
684
  <QueryBuilderPostFilterGroupConditionEditor
709
685
  node={node}
710
- showDroppableSuggestion={showDroppableSuggestion}
686
+ isDroppable={isDroppable}
711
687
  isDragOver={isDragOver}
712
688
  />
713
689
  )}
@@ -722,7 +698,7 @@ const QueryBuilderPostFilterTreeNodeContainer = observer(
722
698
  <QueryBuilderPostFilterBlankConditionEditor
723
699
  node={node}
724
700
  isDragOver={isDragOver}
725
- showDroppableSuggestion={showDroppableSuggestion}
701
+ isDroppable={isDroppable}
726
702
  />
727
703
  )}
728
704
  </div>
@@ -962,8 +938,8 @@ const QueryBuilderPostFilterPanelContent = observer(
962
938
  const addPostFilterRef = useRef<HTMLInputElement>(null);
963
939
  dropTargetConnector(addPostFilterRef);
964
940
 
965
- const { showDroppableSuggestion } = useDragLayer((monitor) => ({
966
- showDroppableSuggestion:
941
+ const { isDroppable } = useDragLayer((monitor) => ({
942
+ isDroppable:
967
943
  monitor.isDragging() &&
968
944
  (monitor.getItemType() === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE ||
969
945
  monitor.getItemType() === QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE),
@@ -1055,10 +1031,7 @@ const QueryBuilderPostFilterPanelContent = observer(
1055
1031
  <PanelContent>
1056
1032
  <PanelDropZone
1057
1033
  isDragOver={isDragOver && postFilterState.isEmpty}
1058
- showDroppableSuggestion={
1059
- showDroppableSuggestion && postFilterState.isEmpty
1060
- }
1061
- className="query-builder__panel--droppable"
1034
+ isDroppable={isDroppable && postFilterState.isEmpty}
1062
1035
  dropTargetConnector={dropTargetConnector}
1063
1036
  >
1064
1037
  {postFilterState.isEmpty && (
@@ -1078,17 +1051,19 @@ const QueryBuilderPostFilterPanelContent = observer(
1078
1051
  <QueryBuilderPostFilterTree tdsState={tdsState} />
1079
1052
  </>
1080
1053
  )}
1081
- {showDroppableSuggestion && !postFilterState.isEmpty && (
1054
+ {isDroppable && !postFilterState.isEmpty && (
1082
1055
  <div
1083
1056
  ref={addPostFilterRef}
1084
- className={clsx(
1085
- 'query-builder-post-filter-tree__blank-node--droppable--tall',
1086
- {
1087
- 'dnd__entry--droppable__indicator--dragover': isDragOver,
1088
- },
1089
- )}
1057
+ className="query-builder-post-filter-tree__free-drop-zone__container"
1090
1058
  >
1091
- Add post-filter to main group
1059
+ <PanelEntryDropZonePlaceholder
1060
+ isDragOver={isDragOver}
1061
+ isDroppable={isDroppable}
1062
+ className="query-builder-post-filter-tree__free-drop-zone"
1063
+ label="Add post-filter to main group"
1064
+ >
1065
+ <></>{' '}
1066
+ </PanelEntryDropZonePlaceholder>
1092
1067
  </div>
1093
1068
  )}
1094
1069
  </PanelDropZone>