@finos/legend-query-builder 4.7.2 → 4.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,6 @@ import {
30
30
  PanelDropZone,
31
31
  DragPreviewLayer,
32
32
  useDragPreviewLayer,
33
- OptionsIcon,
34
33
  PlusIcon,
35
34
  PanelContent,
36
35
  TrashIcon,
@@ -1063,97 +1062,92 @@ export const QueryBuilderTDSPanel = observer(
1063
1062
  return (
1064
1063
  <PanelContent>
1065
1064
  <div className="query-builder__projection__toolbar">
1066
- <button
1067
- className="panel__header__action"
1068
- onClick={openResultSetModifierEditor}
1069
- tabIndex={-1}
1070
- title="Configure result set modifiers..."
1071
- >
1072
- <OptionsIcon className="query-builder__icon query-builder__icon__query-option" />
1073
- </button>
1074
- <button
1075
- className="panel__header__action"
1076
- disabled={isEmpty}
1077
- onClick={clearAllProjectionColumns}
1078
- tabIndex={-1}
1079
- title={
1080
- isEmpty
1081
- ? 'No projection columns to clear'
1082
- : 'Clear all projection columns'
1065
+ <div
1066
+ className="query-builder__projection__result-modifier-prompt"
1067
+ data-testid={
1068
+ QUERY_BUILDER_TEST_ID.QUERY_BUILDER_TDS_RESULT_MODIFIER_PROMPT
1083
1069
  }
1084
1070
  >
1085
- <TrashIcon className="query-builder__icon query-builder__icon__query-option--small" />
1086
- </button>
1087
- <button
1088
- className="panel__header__action"
1089
- onClick={addNewBlankDerivation}
1090
- tabIndex={-1}
1091
- title="Add a new derivation"
1092
- >
1093
- <PlusIcon />
1094
- </button>
1095
- </div>
1096
- <div
1097
- className="query-builder__projection__result-modifier-prompt"
1098
- data-testid={
1099
- QUERY_BUILDER_TEST_ID.QUERY_BUILDER_TDS_RESULT_MODIFIER_PROMPT
1100
- }
1101
- >
1102
- <div className="query-builder__projection__result-modifier-prompt__header">
1103
- <button
1104
- className="query-builder__projection__result-modifier-prompt__header__label"
1105
- onClick={openResultSetModifierEditor}
1106
- >
1107
- <CogIcon className="query-builder__projection__result-modifier-prompt__header__label__icon" />
1108
- <div className="query-builder__projection__result-modifier-prompt__header__label__title">
1109
- Query Options
1110
- </div>
1111
- </button>
1112
- </div>
1113
- {tdsState.resultSetModifierState.limit && (
1114
- <div className="query-builder__projection__result-modifier-prompt__group">
1115
- <div className="query-builder__projection__result-modifier-prompt__group__label">
1116
- Max Rows
1117
- </div>
1118
- <div
1119
- className="query-builder__projection__result-modifier-prompt__group__content"
1071
+ <div className="query-builder__projection__result-modifier-prompt__header">
1072
+ <button
1073
+ className="query-builder__projection__result-modifier-prompt__header__label"
1120
1074
  onClick={openResultSetModifierEditor}
1075
+ title="Configure result set modifiers..."
1121
1076
  >
1122
- {tdsState.resultSetModifierState.limit}
1123
- </div>
1077
+ <CogIcon className="query-builder__projection__result-modifier-prompt__header__label__icon" />
1078
+ <div className="query-builder__projection__result-modifier-prompt__header__label__title">
1079
+ Query Options
1080
+ </div>
1081
+ </button>
1124
1082
  </div>
1125
- )}
1126
- {tdsState.resultSetModifierState.distinct && (
1127
- <div className="query-builder__projection__result-modifier-prompt__group">
1128
- <div className="query-builder__projection__result-modifier-prompt__group__label">
1129
- Eliminate Duplicate Rows
1083
+ {tdsState.resultSetModifierState.limit && (
1084
+ <div className="query-builder__projection__result-modifier-prompt__group">
1085
+ <div className="query-builder__projection__result-modifier-prompt__group__label">
1086
+ Max Rows
1087
+ </div>
1088
+ <div
1089
+ className="query-builder__projection__result-modifier-prompt__group__content"
1090
+ onClick={openResultSetModifierEditor}
1091
+ >
1092
+ {tdsState.resultSetModifierState.limit}
1093
+ </div>
1130
1094
  </div>
1131
- <div
1132
- className="query-builder__projection__result-modifier-prompt__group__content"
1133
- onClick={openResultSetModifierEditor}
1134
- >
1135
- Yes
1095
+ )}
1096
+ {tdsState.resultSetModifierState.distinct && (
1097
+ <div className="query-builder__projection__result-modifier-prompt__group">
1098
+ <div className="query-builder__projection__result-modifier-prompt__group__label">
1099
+ Eliminate Duplicate Rows
1100
+ </div>
1101
+ <div
1102
+ className="query-builder__projection__result-modifier-prompt__group__content"
1103
+ onClick={openResultSetModifierEditor}
1104
+ >
1105
+ Yes
1106
+ </div>
1136
1107
  </div>
1137
- </div>
1138
- )}
1139
- {tdsState.resultSetModifierState.sortColumns.length > 0 && (
1140
- <div className="query-builder__projection__result-modifier-prompt__group">
1141
- <div className="query-builder__projection__result-modifier-prompt__group__label">
1142
- Sort
1108
+ )}
1109
+ {tdsState.resultSetModifierState.sortColumns.length > 0 && (
1110
+ <div className="query-builder__projection__result-modifier-prompt__group">
1111
+ <div className="query-builder__projection__result-modifier-prompt__group__label">
1112
+ Sort
1113
+ </div>
1114
+ {tdsState.resultSetModifierState.sortColumns.map(
1115
+ (columnState) => (
1116
+ <div
1117
+ className="query-builder__projection__result-modifier-prompt__group__content"
1118
+ key={columnState.columnState.uuid}
1119
+ onClick={openResultSetModifierEditor}
1120
+ >
1121
+ {`${columnState.columnState.columnName} ${columnState.sortType}`}
1122
+ </div>
1123
+ ),
1124
+ )}
1143
1125
  </div>
1144
- {tdsState.resultSetModifierState.sortColumns.map(
1145
- (columnState) => (
1146
- <div
1147
- className="query-builder__projection__result-modifier-prompt__group__content"
1148
- key={columnState.columnState.uuid}
1149
- onClick={openResultSetModifierEditor}
1150
- >
1151
- {`${columnState.columnState.columnName} ${columnState.sortType}`}
1152
- </div>
1153
- ),
1154
- )}
1155
- </div>
1156
- )}
1126
+ )}
1127
+ </div>
1128
+ <div className="query-builder__projection__toolbar__actions">
1129
+ <button
1130
+ className="panel__header__action"
1131
+ disabled={isEmpty}
1132
+ onClick={clearAllProjectionColumns}
1133
+ tabIndex={-1}
1134
+ title={
1135
+ isEmpty
1136
+ ? 'No projection columns to clear'
1137
+ : 'Clear all projection columns'
1138
+ }
1139
+ >
1140
+ <TrashIcon className="query-builder__icon query-builder__icon__query-option--small" />
1141
+ </button>
1142
+ <button
1143
+ className="panel__header__action"
1144
+ onClick={addNewBlankDerivation}
1145
+ tabIndex={-1}
1146
+ title="Add a new derivation"
1147
+ >
1148
+ <PlusIcon />
1149
+ </button>
1150
+ </div>
1157
1151
  </div>
1158
1152
  <div className="query-builder__projection__content">
1159
1153
  <PanelDropZone
@@ -18,3 +18,5 @@ export enum QUERY_BUILDER_CALENDAR_TYPE {
18
18
  NY = 'NY',
19
19
  LDN = 'LDN',
20
20
  }
21
+
22
+ export const DEFAULT_LOCALE = 'en-US';
@@ -98,13 +98,13 @@ export class QueryBuilderResultState {
98
98
  mousedOverCell: observable,
99
99
  isRunningQuery: observable,
100
100
  isSelectingCells: observable,
101
- setIsSelectingCells: action,
102
101
  isQueryUsageViewerOpened: observable,
102
+ setIsSelectingCells: action,
103
103
  setIsRunningQuery: action,
104
104
  setExecutionResult: action,
105
105
  setExecutionDuration: action,
106
106
  setPreviewLimit: action,
107
- addCellData: action,
107
+ addSelectedCell: action,
108
108
  setSelectedCells: action,
109
109
  setMouseOverCell: action,
110
110
  setQueryRunPromise: action,
@@ -124,43 +124,41 @@ export class QueryBuilderResultState {
124
124
  );
125
125
  }
126
126
 
127
- setIsSelectingCells = (val: boolean): void => {
127
+ setIsSelectingCells(val: boolean): void {
128
128
  this.isSelectingCells = val;
129
- };
129
+ }
130
130
 
131
- setIsRunningQuery = (val: boolean): void => {
131
+ setIsRunningQuery(val: boolean): void {
132
132
  this.isRunningQuery = val;
133
- };
133
+ }
134
134
 
135
- setExecutionResult = (val: ExecutionResult | undefined): void => {
135
+ setExecutionResult(val: ExecutionResult | undefined): void {
136
136
  this.executionResult = val;
137
- };
137
+ }
138
138
 
139
- setExecutionDuration = (val: number | undefined): void => {
139
+ setExecutionDuration(val: number | undefined): void {
140
140
  this.executionDuration = val;
141
- };
141
+ }
142
142
 
143
- setPreviewLimit = (val: number): void => {
143
+ setPreviewLimit(val: number): void {
144
144
  this.previewLimit = Math.max(1, val);
145
- };
145
+ }
146
146
 
147
- addCellData = (val: QueryBuilderTDSResultCellData): void => {
147
+ addSelectedCell(val: QueryBuilderTDSResultCellData): void {
148
148
  this.selectedCells.push(val);
149
- };
149
+ }
150
150
 
151
- setSelectedCells = (val: QueryBuilderTDSResultCellData[]): void => {
151
+ setSelectedCells(val: QueryBuilderTDSResultCellData[]): void {
152
152
  this.selectedCells = val;
153
- };
153
+ }
154
154
 
155
- setMouseOverCell = (val: QueryBuilderTDSResultCellData | null): void => {
155
+ setMouseOverCell(val: QueryBuilderTDSResultCellData | null): void {
156
156
  this.mousedOverCell = val;
157
- };
157
+ }
158
158
 
159
- setQueryRunPromise = (
160
- promise: Promise<ExecutionResult> | undefined,
161
- ): void => {
159
+ setQueryRunPromise(promise: Promise<ExecutionResult> | undefined): void {
162
160
  this.queryRunPromise = promise;
163
- };
161
+ }
164
162
 
165
163
  setIsQueryUsageViewerOpened(val: boolean): void {
166
164
  this.isQueryUsageViewerOpened = val;