@finos/legend-query-builder 4.14.16 → 4.14.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +5 -3
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderConstantExpressionPanel.js +71 -45
  6. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  7. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  8. package/lib/components/QueryBuilderDiffPanel.js +2 -1
  9. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  10. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  11. package/lib/components/QueryBuilderParametersPanel.js +25 -26
  12. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  13. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +11 -2
  14. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderPropertyExpressionEditor.js +35 -10
  16. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  17. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  18. package/lib/components/QueryBuilderSideBar.js +6 -1
  19. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  20. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  21. package/lib/components/QueryBuilderTextEditor.js +3 -3
  22. package/lib/components/QueryBuilderTextEditor.js.map +1 -1
  23. package/lib/components/QueryLoader.d.ts.map +1 -1
  24. package/lib/components/QueryLoader.js +5 -3
  25. package/lib/components/QueryLoader.js.map +1 -1
  26. package/lib/components/QueryUsageViewer.d.ts.map +1 -1
  27. package/lib/components/QueryUsageViewer.js +2 -2
  28. package/lib/components/QueryUsageViewer.js.map +1 -1
  29. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts +2 -0
  30. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  31. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +19 -2
  32. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  33. package/lib/components/data-access/DataAccessOverview.d.ts.map +1 -1
  34. package/lib/components/data-access/DataAccessOverview.js +6 -1
  35. package/lib/components/data-access/DataAccessOverview.js.map +1 -1
  36. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
  37. package/lib/components/execution-plan/ExecutionPlanViewer.js +6 -6
  38. package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
  39. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  40. package/lib/components/explorer/QueryBuilderExplorerPanel.js +3 -2
  41. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  42. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  43. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +3 -2
  44. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  45. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  46. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +6 -3
  47. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  48. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +4 -3
  50. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  52. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +11 -22
  53. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  54. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
  56. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  57. package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
  58. package/lib/components/result/QueryBuilderResultPanel.js +3 -3
  59. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
  60. package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -1
  61. package/lib/components/result/tds/QueryBuilderTDSGridResult.js +5 -1
  62. package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -1
  63. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts.map +1 -1
  64. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +11 -2
  65. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -1
  66. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  67. package/lib/components/shared/BasicValueSpecificationEditor.js +25 -22
  68. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  69. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
  70. package/lib/components/shared/CustomDatePicker.js +8 -5
  71. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  72. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  73. package/lib/components/shared/LambdaEditor.js +17 -3
  74. package/lib/components/shared/LambdaEditor.js.map +1 -1
  75. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  76. package/lib/components/shared/LambdaParameterValuesEditor.js +2 -2
  77. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  78. package/lib/components/shared/QueryBuilderPropertyInfoTooltip.d.ts +6 -0
  79. package/lib/components/shared/QueryBuilderPropertyInfoTooltip.d.ts.map +1 -1
  80. package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js +40 -3
  81. package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js.map +1 -1
  82. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  83. package/lib/components/watermark/QueryBuilderWatermark.js +28 -12
  84. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  85. package/lib/index.css +2 -2
  86. package/lib/index.css.map +1 -1
  87. package/lib/package.json +1 -1
  88. package/lib/stores/QueryBuilderConstantsState.d.ts +1 -0
  89. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
  90. package/lib/stores/QueryBuilderConstantsState.js +7 -1
  91. package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
  92. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +5 -0
  93. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  94. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +1 -2
  95. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
  96. package/lib/stores/watermark/QueryBuilderWatermarkState.js +2 -12
  97. package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
  98. package/package.json +8 -8
  99. package/src/components/QueryBuilder.tsx +14 -2
  100. package/src/components/QueryBuilderConstantExpressionPanel.tsx +145 -69
  101. package/src/components/QueryBuilderDiffPanel.tsx +10 -2
  102. package/src/components/QueryBuilderParametersPanel.tsx +42 -37
  103. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +87 -24
  104. package/src/components/QueryBuilderSideBar.tsx +20 -0
  105. package/src/components/QueryBuilderTextEditor.tsx +6 -4
  106. package/src/components/QueryLoader.tsx +12 -3
  107. package/src/components/QueryUsageViewer.tsx +7 -1
  108. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +40 -4
  109. package/src/components/data-access/DataAccessOverview.tsx +9 -1
  110. package/src/components/execution-plan/ExecutionPlanViewer.tsx +11 -8
  111. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +5 -2
  112. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +5 -2
  113. package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +12 -5
  114. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +8 -4
  115. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +56 -72
  116. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +8 -2
  117. package/src/components/result/QueryBuilderResultPanel.tsx +8 -2
  118. package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +6 -3
  119. package/src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx +14 -4
  120. package/src/components/shared/BasicValueSpecificationEditor.tsx +39 -25
  121. package/src/components/shared/CustomDatePicker.tsx +18 -5
  122. package/src/components/shared/LambdaEditor.tsx +27 -11
  123. package/src/components/shared/LambdaParameterValuesEditor.tsx +4 -1
  124. package/src/components/shared/QueryBuilderPropertyInfoTooltip.tsx +115 -64
  125. package/src/components/watermark/QueryBuilderWatermark.tsx +60 -19
  126. package/src/stores/QueryBuilderConstantsState.ts +12 -0
  127. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +9 -0
  128. package/src/stores/watermark/QueryBuilderWatermarkState.ts +2 -12
@@ -14,18 +14,25 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { useEffect, useRef, useCallback, useState, forwardRef } from 'react';
17
+ import {
18
+ useEffect,
19
+ useRef,
20
+ useCallback,
21
+ useState,
22
+ forwardRef,
23
+ type ChangeEvent,
24
+ } from 'react';
18
25
  import { observer } from 'mobx-react-lite';
19
26
  import {
20
27
  clsx,
21
28
  BlankPanelPlaceholder,
29
+ CalculatorIcon,
22
30
  TimesIcon,
23
31
  DropdownMenu,
24
32
  MenuContent,
25
33
  MenuContentItem,
26
34
  CaretDownIcon,
27
35
  ContextMenu,
28
- InputWithInlineValidation,
29
36
  SigmaIcon,
30
37
  PanelDropZone,
31
38
  DragPreviewLayer,
@@ -34,7 +41,6 @@ import {
34
41
  PanelContent,
35
42
  TrashIcon,
36
43
  PanelDnDEntry,
37
- PanelEntryDragHandle,
38
44
  CalendarIcon,
39
45
  CalendarClockIcon,
40
46
  CustomSelectorInput,
@@ -62,7 +68,10 @@ import {
62
68
  QueryBuilderSimpleProjectionColumnState,
63
69
  QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
64
70
  } from '../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
65
- import { QueryBuilderPropertyExpressionBadge } from '../QueryBuilderPropertyExpressionEditor.js';
71
+ import {
72
+ QueryBuilderEditablePropertyName,
73
+ QueryBuilderPropertyExpressionBadge,
74
+ } from '../QueryBuilderPropertyExpressionEditor.js';
66
75
  import { QueryResultModifierModal } from './QueryBuilderResultModifierPanel.js';
67
76
  import { QUERY_BUILDER_TEST_ID } from '../../__lib__/QueryBuilderTesting.js';
68
77
  import { flowResult } from 'mobx';
@@ -110,7 +119,10 @@ import {
110
119
  } from '../../stores/QueryBuilderPropertyEditorState.js';
111
120
  import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
112
121
  import { QUERY_BUILDER_CALENDAR_TYPE } from '../../graph-manager/QueryBuilderConst.js';
113
- import { QueryBuilderPropertyInfoTooltip } from '../shared/QueryBuilderPropertyInfoTooltip.js';
122
+ import {
123
+ QueryBuilderDerivationInfoTooltip,
124
+ QueryBuilderPropertyInfoTooltip,
125
+ } from '../shared/QueryBuilderPropertyInfoTooltip.js';
114
126
 
115
127
  const QueryBuilderProjectionColumnContextMenu = observer(
116
128
  forwardRef<
@@ -149,10 +161,10 @@ const QueryBuilderProjectionColumnContextMenu = observer(
149
161
  const QueryBuilderSimpleProjectionColumnEditor = observer(
150
162
  (props: {
151
163
  projectionColumnState: QueryBuilderSimpleProjectionColumnState;
152
- setIsEditingColumnName: (isEditing: boolean) => void;
153
- error?: boolean | undefined;
164
+ changeColumnName: (event: ChangeEvent<HTMLInputElement>) => void;
165
+ error?: string | undefined;
154
166
  }) => {
155
- const { projectionColumnState, setIsEditingColumnName, error } = props;
167
+ const { projectionColumnState, changeColumnName, error } = props;
156
168
  const onPropertyExpressionChange = (
157
169
  node: QueryBuilderExplorerTreePropertyNodeData,
158
170
  ): void =>
@@ -163,17 +175,13 @@ const QueryBuilderSimpleProjectionColumnEditor = observer(
163
175
  );
164
176
 
165
177
  return (
166
- <div className="query-builder__projection__column__value__property">
167
- <QueryBuilderPropertyExpressionBadge
168
- columnName={projectionColumnState.columnName}
169
- propertyExpressionState={
170
- projectionColumnState.propertyExpressionState
171
- }
172
- onPropertyExpressionChange={onPropertyExpressionChange}
173
- setIsEditingColumnName={setIsEditingColumnName}
174
- error={error}
175
- />
176
- </div>
178
+ <QueryBuilderPropertyExpressionBadge
179
+ columnName={projectionColumnState.columnName}
180
+ propertyExpressionState={projectionColumnState.propertyExpressionState}
181
+ onPropertyExpressionChange={onPropertyExpressionChange}
182
+ changeColumnName={changeColumnName}
183
+ error={error}
184
+ />
177
185
  );
178
186
  },
179
187
  );
@@ -388,13 +396,6 @@ const QueryBuilderProjectionColumnEditor = observer(
388
396
  ) => projectionColumnState.setColumnName(event.target.value);
389
397
  const isDuplicatedColumnName =
390
398
  projectionColumnState.tdsState.isDuplicateColumn(projectionColumnState);
391
- const [isEditingColumnName, setIsEditingColumnName] = useState(false);
392
- const columnNameInputRef = useRef<HTMLInputElement>(null);
393
- useEffect(() => {
394
- if (isEditingColumnName) {
395
- columnNameInputRef.current?.focus();
396
- }
397
- }, [isEditingColumnName, columnNameInputRef]);
398
399
 
399
400
  // aggregation
400
401
  const aggregateColumnState = tdsState.aggregationState.columns.find(
@@ -705,6 +706,7 @@ const QueryBuilderProjectionColumnEditor = observer(
705
706
  }),
706
707
  [handleDrop],
707
708
  );
709
+
708
710
  return (
709
711
  <PanelDnDEntry
710
712
  ref={ref}
@@ -752,13 +754,12 @@ const QueryBuilderProjectionColumnEditor = observer(
752
754
  data-testid={
753
755
  QUERY_BUILDER_TEST_ID.QUERY_BUILDER_TDS_PROJECTION_COLUMN
754
756
  }
755
- className="query-builder__projection__column__container"
757
+ ref={dragHandleRef}
758
+ className={clsx('query-builder__projection__column__container', {
759
+ 'query-builder__projection__column__container--dragging':
760
+ projectionColumnBeingDragged !== undefined,
761
+ })}
756
762
  >
757
- <PanelEntryDragHandle
758
- isDragging={false}
759
- dragSourceConnector={dragHandleRef}
760
- className="query-builder__projection__column__drag-handle__container"
761
- />
762
763
  {projectionColumnState instanceof
763
764
  QueryBuilderSimpleProjectionColumnState && (
764
765
  <>
@@ -783,55 +784,38 @@ const QueryBuilderProjectionColumnEditor = observer(
783
784
  <InfoCircleIcon />
784
785
  </div>
785
786
  </QueryBuilderPropertyInfoTooltip>
786
- {isEditingColumnName ? (
787
- <div className="query-builder__projection__column__name">
788
- <InputWithInlineValidation
789
- className="query-builder__projection__column__name__input input-group__input"
790
- spellCheck={false}
791
- value={projectionColumnState.columnName}
792
- onChange={changeColumnName}
793
- onKeyDown={(
794
- event: React.KeyboardEvent<HTMLInputElement>,
795
- ) => {
796
- if (event.key === 'Enter') {
797
- setIsEditingColumnName(false);
798
- }
799
- }}
800
- onBlur={() => {
801
- setIsEditingColumnName(false);
802
- }}
803
- error={
804
- isDuplicatedColumnName ? 'Duplicated column' : undefined
805
- }
806
- ref={columnNameInputRef}
807
- />
808
- </div>
809
- ) : (
810
- <div className="query-builder__projection__column__value">
811
- <QueryBuilderSimpleProjectionColumnEditor
812
- projectionColumnState={projectionColumnState}
813
- setIsEditingColumnName={setIsEditingColumnName}
814
- error={isDuplicatedColumnName}
815
- />
816
- </div>
817
- )}
787
+ <div className="query-builder__projection__column__value">
788
+ <QueryBuilderSimpleProjectionColumnEditor
789
+ projectionColumnState={projectionColumnState}
790
+ changeColumnName={changeColumnName}
791
+ error={
792
+ isDuplicatedColumnName ? 'Duplicated column' : undefined
793
+ }
794
+ />
795
+ </div>
818
796
  </>
819
797
  )}
820
798
  {projectionColumnState instanceof
821
799
  QueryBuilderDerivationProjectionColumnState && (
822
800
  <>
823
- <div className="query-builder__projection__column__name query-builder__projection__column__name__derivation">
824
- <InputWithInlineValidation
825
- className="query-builder__projection__column__name__input input-group__input"
826
- spellCheck={false}
827
- value={projectionColumnState.columnName}
828
- onChange={changeColumnName}
801
+ <QueryBuilderDerivationInfoTooltip
802
+ title={projectionColumnState.columnName}
803
+ type={projectionColumnState.returnType}
804
+ placement="bottom-start"
805
+ >
806
+ <div className="query-builder-property-expression-badge__property__info">
807
+ <CalculatorIcon />
808
+ </div>
809
+ </QueryBuilderDerivationInfoTooltip>
810
+ <div className="query-builder__projection__column__value">
811
+ <QueryBuilderEditablePropertyName
812
+ columnName={projectionColumnState.columnName}
813
+ changeColumnName={changeColumnName}
829
814
  error={
830
815
  isDuplicatedColumnName ? 'Duplicated column' : undefined
831
816
  }
817
+ title={projectionColumnState.columnName}
832
818
  />
833
- </div>
834
- <div className="query-builder__projection__column__value">
835
819
  <QueryBuilderDerivationProjectionColumnEditor
836
820
  projectionColumnState={projectionColumnState}
837
821
  />
@@ -274,7 +274,9 @@ const QueryBuilderWindowColumnModalEditor = observer(
274
274
  }}
275
275
  >
276
276
  <Modal
277
- darkMode={true}
277
+ darkMode={
278
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
279
+ }
278
280
  className={clsx([
279
281
  'query-builder__olap__modal',
280
282
  {
@@ -525,7 +527,11 @@ const QueryBuilderWindowColumnModalEditor = observer(
525
527
  {createNewWindow ? (
526
528
  <ModalFooterButton text="Create" onClick={create} />
527
529
  ) : (
528
- <ModalFooterButton text="Close" onClick={close} />
530
+ <ModalFooterButton
531
+ text="Close"
532
+ onClick={close}
533
+ type="secondary"
534
+ />
529
535
  )}
530
536
  </ModalFooter>
531
537
  </Modal>
@@ -226,7 +226,6 @@ export const QueryBuilderResultPanel = observer(
226
226
  const allowSettingPreviewLimit = queryBuilderState.isQuerySupported;
227
227
 
228
228
  const allowSettingLocalMode =
229
- queryBuilderState.isQuerySupported &&
230
229
  queryBuilderState.config?.TEMPORARY__enableGridEnterpriseMode;
231
230
 
232
231
  const copyExpression = (value: string): void => {
@@ -317,7 +316,13 @@ export const QueryBuilderResultPanel = observer(
317
316
  open={Boolean(showSqlModal)}
318
317
  onClose={() => setShowSqlModal(false)}
319
318
  >
320
- <Modal className="editor-modal" darkMode={true}>
319
+ <Modal
320
+ className="editor-modal"
321
+ darkMode={
322
+ !applicationStore.layoutService
323
+ .TEMPORARY__isLightColorThemeEnabled
324
+ }
325
+ >
321
326
  <ModalHeader title="Executed SQL Query" />
322
327
  <ModalBody className="query-builder__sql__modal">
323
328
  <>
@@ -341,6 +346,7 @@ export const QueryBuilderResultPanel = observer(
341
346
  <ModalFooterButton
342
347
  onClick={() => setShowSqlModal(false)}
343
348
  text="Close"
349
+ type="secondary"
344
350
  />
345
351
  </ModalFooter>
346
352
  </Modal>
@@ -230,6 +230,8 @@ export const QueryBuilderTDSGridResult = observer(
230
230
  const colDefs = isLocalModeEnabled
231
231
  ? getLocalColDefs(executionResult, resultState)
232
232
  : getColDefs(executionResult, resultState);
233
+ const darkMode =
234
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
233
235
 
234
236
  const onSaveGridColumnState = (): void => {
235
237
  if (!columnAPi) {
@@ -338,9 +340,10 @@ export const QueryBuilderTDSGridResult = observer(
338
340
  className="query-builder__result__values__table"
339
341
  >
340
342
  <div
341
- className={clsx(
342
- 'ag-theme-balham-dark query-builder__result__tds-grid',
343
- )}
343
+ className={clsx('query-builder__result__tds-grid', {
344
+ 'ag-theme-balham': !darkMode,
345
+ 'ag-theme-balham-dark': darkMode,
346
+ })}
344
347
  >
345
348
  {isLocalModeEnabled ? (
346
349
  <DataGrid
@@ -49,6 +49,9 @@ const QueryResultCellRenderer = observer(
49
49
  resultState.queryBuilderState.fetchStructureState.implementation;
50
50
  const applicationStore = resultState.queryBuilderState.applicationStore;
51
51
  const cellValue = params.value as QueryBuilderTDSResultCellDataType;
52
+ const darkMode =
53
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
54
+
52
55
  const formattedCellValue = (): QueryBuilderTDSResultCellDataType => {
53
56
  if (isNumber(cellValue)) {
54
57
  return Intl.NumberFormat(DEFAULT_LOCALE, {
@@ -311,7 +314,10 @@ const QueryResultCellRenderer = observer(
311
314
  !resultState.mousedOverCell
312
315
  }
313
316
  menuProps={{ elevation: 7 }}
314
- className={clsx('ag-theme-balham-dark query-builder__result__tds-grid')}
317
+ className={clsx('query-builder__result__tds-grid', {
318
+ 'ag-theme-balham': !darkMode,
319
+ 'ag-theme-balham-dark': darkMode,
320
+ })}
315
321
  >
316
322
  <div
317
323
  className={clsx('query-builder__result__values__table__cell', {
@@ -342,6 +348,9 @@ export const QueryBuilderTDSSimpleGridResult = observer(
342
348
  }) => {
343
349
  const { executionResult, queryBuilderState } = props;
344
350
  const resultState = queryBuilderState.resultState;
351
+ const darkMode =
352
+ !queryBuilderState.applicationStore.layoutService
353
+ .TEMPORARY__isLightColorThemeEnabled;
345
354
  const colDefs = executionResult.result.columns.map(
346
355
  (colName) =>
347
356
  ({
@@ -364,9 +373,10 @@ export const QueryBuilderTDSSimpleGridResult = observer(
364
373
  className="query-builder__result__values__table"
365
374
  >
366
375
  <div
367
- className={clsx(
368
- 'ag-theme-balham-dark query-builder__result__tds-grid',
369
- )}
376
+ className={clsx('query-builder__result__tds-grid', {
377
+ 'ag-theme-balham': !darkMode,
378
+ 'ag-theme-balham-dark': darkMode,
379
+ })}
370
380
  >
371
381
  <DataGrid
372
382
  rowData={getRowDataFromExecutionResult(executionResult)}
@@ -190,6 +190,7 @@ const VariableExpressionParameterEditor = observer(
190
190
 
191
191
  <button
192
192
  className="value-spec-editor__variable__reset-btn"
193
+ name="Reset"
193
194
  title="Reset"
194
195
  onClick={resetValue}
195
196
  >
@@ -310,6 +311,7 @@ const StringPrimitiveInstanceValueEditor = observer(
310
311
  )}
311
312
  <button
312
313
  className="value-spec-editor__reset-btn"
314
+ name="Reset"
313
315
  title="Reset"
314
316
  onClick={resetValue}
315
317
  >
@@ -353,6 +355,7 @@ const BooleanPrimitiveInstanceValueEditor = observer(
353
355
  </button>
354
356
  <button
355
357
  className="value-spec-editor__reset-btn"
358
+ name="Reset"
356
359
  title="Reset"
357
360
  onClick={resetValue}
358
361
  >
@@ -388,8 +391,26 @@ const NumberPrimitiveInstanceValueEditor = observer(
388
391
  ? Number.parseInt(Number(value).toString(), 10)
389
392
  : Number(value);
390
393
 
391
- const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) => {
394
+ const updateValueSpecIfValid = (val: string): void => {
395
+ const parsedValue = isInteger
396
+ ? Number.parseInt(Number(val).toString(), 10)
397
+ : Number(val);
398
+ if (!isNaN(parsedValue) && parsedValue !== valueSpecification.values[0]) {
399
+ instanceValue_setValue(
400
+ valueSpecification,
401
+ parsedValue,
402
+ 0,
403
+ obseverContext,
404
+ );
405
+ setValueSpecification(valueSpecification);
406
+ }
407
+ };
408
+
409
+ const handleInputChange: React.ChangeEventHandler<HTMLInputElement> = (
410
+ event,
411
+ ) => {
392
412
  setValue(event.target.value);
413
+ updateValueSpecIfValid(event.target.value);
393
414
  };
394
415
 
395
416
  // Support expression evaluation
@@ -397,15 +418,16 @@ const NumberPrimitiveInstanceValueEditor = observer(
397
418
  if (isNaN(numericValue)) {
398
419
  try {
399
420
  const calculatedValue = guaranteeIsNumber(evaluate(value));
400
- setValue(
401
- isInteger
402
- ? Number.parseInt(calculatedValue.toString(), 10).toString()
403
- : Number(calculatedValue).toString(),
404
- );
421
+ updateValueSpecIfValid(calculatedValue.toString());
422
+ setValue(calculatedValue.toString());
405
423
  } catch {
424
+ updateValueSpecIfValid(
425
+ (valueSpecification.values[0] as number).toString(),
426
+ );
406
427
  setValue((valueSpecification.values[0] as number).toString());
407
428
  }
408
429
  } else {
430
+ updateValueSpecIfValid(numericValue.toString());
409
431
  setValue(numericValue.toString());
410
432
  }
411
433
  };
@@ -419,29 +441,14 @@ const NumberPrimitiveInstanceValueEditor = observer(
419
441
  }
420
442
  };
421
443
 
422
- useEffect(() => {
423
- setValue((valueSpecification.values[0] as number).toString());
424
- }, [valueSpecification]);
425
-
426
444
  useEffect(() => {
427
445
  if (
428
446
  !isNaN(numericValue) &&
429
447
  numericValue !== valueSpecification.values[0]
430
448
  ) {
431
- instanceValue_setValue(
432
- valueSpecification,
433
- numericValue,
434
- 0,
435
- obseverContext,
436
- );
437
- setValueSpecification(valueSpecification);
449
+ setValue((valueSpecification.values[0] as number).toString());
438
450
  }
439
- }, [
440
- numericValue,
441
- valueSpecification,
442
- setValueSpecification,
443
- obseverContext,
444
- ]);
451
+ }, [numericValue, valueSpecification]);
445
452
 
446
453
  return (
447
454
  <div className={clsx('value-spec-editor', className)}>
@@ -453,7 +460,7 @@ const NumberPrimitiveInstanceValueEditor = observer(
453
460
  type="text" // NOTE: we leave this as text so that we can support expression evaluation
454
461
  inputMode="numeric"
455
462
  value={value}
456
- onChange={changeValue}
463
+ onChange={handleInputChange}
457
464
  onBlur={calculateExpression}
458
465
  onKeyDown={onKeyDown}
459
466
  />
@@ -469,6 +476,7 @@ const NumberPrimitiveInstanceValueEditor = observer(
469
476
  </div>
470
477
  <button
471
478
  className="value-spec-editor__reset-btn"
479
+ name="Reset"
472
480
  title="Reset"
473
481
  onClick={resetValue}
474
482
  >
@@ -494,6 +502,7 @@ const EnumValueInstanceValueEditor = observer(
494
502
  setValueSpecification,
495
503
  obseverContext,
496
504
  } = props;
505
+ const applicationStore = useApplicationStore();
497
506
  const enumValueRef = guaranteeNonNullable(valueSpecification.values[0]);
498
507
  const enumValue = enumValueRef.value;
499
508
  const options = enumValue._OWNER.values.map((value) => ({
@@ -517,10 +526,13 @@ const EnumValueInstanceValueEditor = observer(
517
526
  options={options}
518
527
  onChange={changeValue}
519
528
  value={{ value: enumValue, label: enumValue.name }}
520
- darkMode={true}
529
+ darkMode={
530
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
531
+ }
521
532
  />
522
533
  <button
523
534
  className="value-spec-editor__reset-btn"
535
+ name="Reset"
524
536
  title="Reset"
525
537
  onClick={resetValue}
526
538
  >
@@ -857,6 +869,7 @@ const CollectionValueInstanceValueEditor = observer(
857
869
  </button>
858
870
  <button
859
871
  className="value-spec-editor__reset-btn"
872
+ name="Reset"
860
873
  title="Reset"
861
874
  onClick={resetValue}
862
875
  >
@@ -917,6 +930,7 @@ const DateInstanceValueEditor = observer(
917
930
  />
918
931
  <button
919
932
  className="value-spec-editor__reset-btn"
933
+ name="Reset"
920
934
  title="Reset"
921
935
  onClick={resetValue}
922
936
  >
@@ -913,6 +913,7 @@ const CustomDateInstanceValueEditor: React.FC<{
913
913
  setDatePickerOption,
914
914
  observerContext,
915
915
  } = props;
916
+ const applicationStore = useApplicationStore();
916
917
  const inputRef = useRef<HTMLInputElement>(null);
917
918
  const [durationValue, setDurationValue] = useState(
918
919
  customDateOptionValue.duration,
@@ -1015,7 +1016,9 @@ const CustomDateInstanceValueEditor: React.FC<{
1015
1016
  );
1016
1017
  }}
1017
1018
  value={{ value: unitValue, label: unitValue }}
1018
- darkMode={true}
1019
+ darkMode={
1020
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
1021
+ }
1019
1022
  />
1020
1023
  </div>
1021
1024
  <div className="value-spec-editor__date-picker__custom-date__input">
@@ -1038,7 +1041,9 @@ const CustomDateInstanceValueEditor: React.FC<{
1038
1041
  );
1039
1042
  }}
1040
1043
  value={{ value: directionValue, label: directionValue }}
1041
- darkMode={true}
1044
+ darkMode={
1045
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
1046
+ }
1042
1047
  />
1043
1048
  </div>
1044
1049
  <div className="value-spec-editor__date-picker__custom-date__input">
@@ -1058,7 +1063,9 @@ const CustomDateInstanceValueEditor: React.FC<{
1058
1063
  changeValue(durationValue, unitValue, directionValue, val.value);
1059
1064
  }}
1060
1065
  value={{ value: referenceMomentValue, label: referenceMomentValue }}
1061
- darkMode={true}
1066
+ darkMode={
1067
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
1068
+ }
1062
1069
  />
1063
1070
  </div>
1064
1071
  </div>
@@ -1079,6 +1086,7 @@ const CustomFirstDayOfValueSpecificationEditor: React.FC<{
1079
1086
  setValueSpecification,
1080
1087
  setDatePickerOption,
1081
1088
  } = props;
1089
+ const applicationStore = useApplicationStore();
1082
1090
  const selectorRef = useRef<SelectComponent>(null);
1083
1091
  const [unitValue, setUnitValue] = useState(
1084
1092
  customDateAdjustOptionValue instanceof CustomFirstDayOfOption
@@ -1130,7 +1138,9 @@ const CustomFirstDayOfValueSpecificationEditor: React.FC<{
1130
1138
  }
1131
1139
  }}
1132
1140
  value={unitValue ? { value: unitValue, label: unitValue } : null}
1133
- darkMode={true}
1141
+ darkMode={
1142
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
1143
+ }
1134
1144
  />
1135
1145
  </div>
1136
1146
  </div>
@@ -1151,6 +1161,7 @@ const CustomPreviousDayOfWeekValueSpecificationEditor: React.FC<{
1151
1161
  setValueSpecification,
1152
1162
  setDatePickerOption,
1153
1163
  } = props;
1164
+ const applicationStore = useApplicationStore();
1154
1165
  const selectorRef = useRef<SelectComponent>(null);
1155
1166
  const [dayOfWeekValue, setDayOfWeekValue] = useState(
1156
1167
  customDateAdjustOptionValue instanceof CustomPreviousDayOfWeekOption
@@ -1200,7 +1211,9 @@ const CustomPreviousDayOfWeekValueSpecificationEditor: React.FC<{
1200
1211
  ? { value: dayOfWeekValue, label: dayOfWeekValue }
1201
1212
  : null
1202
1213
  }
1203
- darkMode={true}
1214
+ darkMode={
1215
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
1216
+ }
1204
1217
  />
1205
1218
  </div>
1206
1219
  </div>
@@ -28,6 +28,7 @@ import {
28
28
  ModalFooter,
29
29
  ModalHeader,
30
30
  ModalTitle,
31
+ ModalFooterButton,
31
32
  } from '@finos/legend-art';
32
33
  import {
33
34
  disposeCodeEditor,
@@ -224,6 +225,21 @@ const LambdaEditor_Inner = observer(
224
225
  }
225
226
  }, [editor, isExpanded]);
226
227
 
228
+ // set styling when theme changes
229
+ useEffect(() => {
230
+ if (editor) {
231
+ editor.updateOptions({
232
+ theme: applicationStore.layoutService
233
+ .TEMPORARY__isLightColorThemeEnabled
234
+ ? CODE_EDITOR_THEME.BUILT_IN__VSCODE_LIGHT
235
+ : CODE_EDITOR_THEME.DEFAULT_DARK,
236
+ });
237
+ }
238
+ }, [
239
+ editor,
240
+ applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled,
241
+ ]);
242
+
227
243
  // set backdrop to force user to fix parser error when it happens
228
244
  useEffect(() => {
229
245
  if (parserError) {
@@ -605,7 +621,9 @@ const LambdaEditor_PopUp = observer(
605
621
  }}
606
622
  >
607
623
  <Modal
608
- darkMode={true}
624
+ darkMode={
625
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
626
+ }
609
627
  className={clsx(
610
628
  'editor-modal lambda-editor__popup__modal',
611
629
  {
@@ -639,19 +657,17 @@ const LambdaEditor_PopUp = observer(
639
657
  </div>
640
658
  </ModalBody>
641
659
  <ModalFooter>
642
- <button
643
- className="btn btn--dark btn--caution"
660
+ <ModalFooterButton
661
+ className="btn--caution"
662
+ text="Discard changes"
644
663
  onClick={discardChanges}
645
- >
646
- Discard changes
647
- </button>
648
- <button
649
- className="btn btn--dark"
664
+ />
665
+ <ModalFooterButton
666
+ text="Close"
650
667
  onClick={onClose}
651
668
  disabled={Boolean(lambdaEditorState.parserError)}
652
- >
653
- Close
654
- </button>
669
+ type="secondary"
670
+ />
655
671
  </ModalFooter>
656
672
  </Modal>
657
673
  </Dialog>
@@ -71,7 +71,9 @@ export const LambdaParameterValuesEditor = observer(
71
71
  }}
72
72
  >
73
73
  <Modal
74
- darkMode={true}
74
+ darkMode={
75
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
76
+ }
75
77
  className="editor-modal lambda-parameter-values__modal"
76
78
  >
77
79
  <ModalHeader title="Set Parameter Values" />
@@ -131,6 +133,7 @@ export const LambdaParameterValuesEditor = observer(
131
133
  inProgressText={isClosingAction ? 'Closing...' : undefined}
132
134
  onClick={close}
133
135
  text="Close"
136
+ type="secondary"
134
137
  />
135
138
  </ModalFooter>
136
139
  </Modal>