@finos/legend-application 4.0.3 → 5.1.0

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.
Files changed (145) hide show
  1. package/lib/application/LegendApplication.d.ts +9 -1
  2. package/lib/application/LegendApplication.d.ts.map +1 -1
  3. package/lib/application/LegendApplication.js +54 -1
  4. package/lib/application/LegendApplication.js.map +1 -1
  5. package/lib/components/VirtualAssistant.d.ts.map +1 -1
  6. package/lib/components/VirtualAssistant.js +91 -11
  7. package/lib/components/VirtualAssistant.js.map +1 -1
  8. package/lib/components/{BasicValueSpecificationEditor.d.ts → shared/BasicValueSpecificationEditor.d.ts} +2 -2
  9. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -0
  10. package/lib/components/{BasicValueSpecificationEditor.js → shared/BasicValueSpecificationEditor.js} +29 -20
  11. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -0
  12. package/lib/components/{CustomDatePicker.d.ts → shared/CustomDatePicker.d.ts} +1 -1
  13. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -0
  14. package/lib/components/{CustomDatePicker.js → shared/CustomDatePicker.js} +20 -20
  15. package/lib/components/shared/CustomDatePicker.js.map +1 -0
  16. package/lib/components/{DocumentationLink.d.ts → shared/DocumentationLink.d.ts} +0 -0
  17. package/lib/components/shared/DocumentationLink.d.ts.map +1 -0
  18. package/lib/components/{DocumentationLink.js → shared/DocumentationLink.js} +1 -1
  19. package/lib/components/shared/DocumentationLink.js.map +1 -0
  20. package/lib/components/{LambdaEditor.d.ts → shared/LambdaEditor.d.ts} +1 -1
  21. package/lib/components/shared/LambdaEditor.d.ts.map +1 -0
  22. package/lib/components/{LambdaEditor.js → shared/LambdaEditor.js} +3 -3
  23. package/lib/components/shared/LambdaEditor.js.map +1 -0
  24. package/lib/components/{LambdaParameterValuesEditor.d.ts → shared/LambdaParameterValuesEditor.d.ts} +1 -1
  25. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -0
  26. package/lib/components/{LambdaParameterValuesEditor.js → shared/LambdaParameterValuesEditor.js} +2 -2
  27. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -0
  28. package/lib/components/shared/PackageableElementOptionRenderer.d.ts +21 -0
  29. package/lib/components/shared/PackageableElementOptionRenderer.d.ts.map +1 -0
  30. package/lib/components/shared/PackageableElementOptionRenderer.js +8 -0
  31. package/lib/components/shared/PackageableElementOptionRenderer.js.map +1 -0
  32. package/lib/components/{TextInputEditor.d.ts → shared/TextInputEditor.d.ts} +1 -1
  33. package/lib/components/shared/TextInputEditor.d.ts.map +1 -0
  34. package/lib/components/{TextInputEditor.js → shared/TextInputEditor.js} +2 -2
  35. package/lib/components/shared/TextInputEditor.js.map +1 -0
  36. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.d.ts +28 -0
  37. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.d.ts.map +1 -0
  38. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.js +182 -0
  39. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.js.map +1 -0
  40. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.d.ts +31 -0
  41. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.d.ts.map +1 -0
  42. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.js +32 -0
  43. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.js.map +1 -0
  44. package/lib/const.d.ts +0 -3
  45. package/lib/const.d.ts.map +1 -1
  46. package/lib/const.js +0 -3
  47. package/lib/const.js.map +1 -1
  48. package/lib/index.css +2 -2
  49. package/lib/index.css.map +1 -1
  50. package/lib/index.d.ts +12 -9
  51. package/lib/index.d.ts.map +1 -1
  52. package/lib/index.js +13 -9
  53. package/lib/index.js.map +1 -1
  54. package/lib/stores/ApplicationEvent.d.ts +4 -2
  55. package/lib/stores/ApplicationEvent.d.ts.map +1 -1
  56. package/lib/stores/ApplicationEvent.js +4 -2
  57. package/lib/stores/ApplicationEvent.js.map +1 -1
  58. package/lib/stores/ApplicationStore.d.ts.map +1 -1
  59. package/lib/stores/ApplicationStore.js +2 -1
  60. package/lib/stores/ApplicationStore.js.map +1 -1
  61. package/lib/stores/LegendApplicationAssistantService.d.ts +7 -2
  62. package/lib/stores/LegendApplicationAssistantService.d.ts.map +1 -1
  63. package/lib/stores/LegendApplicationAssistantService.js +22 -10
  64. package/lib/stores/LegendApplicationAssistantService.js.map +1 -1
  65. package/lib/stores/LegendApplicationConfig.d.ts +8 -5
  66. package/lib/stores/LegendApplicationConfig.d.ts.map +1 -1
  67. package/lib/stores/LegendApplicationConfig.js +15 -13
  68. package/lib/stores/LegendApplicationConfig.js.map +1 -1
  69. package/lib/stores/LegendApplicationDocumentationService.d.ts +34 -24
  70. package/lib/stores/LegendApplicationDocumentationService.d.ts.map +1 -1
  71. package/lib/stores/LegendApplicationDocumentationService.js +64 -60
  72. package/lib/stores/LegendApplicationDocumentationService.js.map +1 -1
  73. package/lib/stores/LegendApplicationPlugin.d.ts +14 -3
  74. package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
  75. package/lib/stores/LegendApplicationPlugin.js.map +1 -1
  76. package/lib/stores/PureLanguageSupport.d.ts.map +1 -1
  77. package/lib/stores/PureLanguageSupport.js +8 -3
  78. package/lib/stores/PureLanguageSupport.js.map +1 -1
  79. package/lib/stores/shared/ExecutionPlanState.d.ts +62 -0
  80. package/lib/stores/shared/ExecutionPlanState.d.ts.map +1 -0
  81. package/lib/stores/shared/ExecutionPlanState.js +118 -0
  82. package/lib/stores/shared/ExecutionPlanState.js.map +1 -0
  83. package/lib/stores/{LambdaEditorState.d.ts → shared/LambdaEditorState.d.ts} +0 -0
  84. package/lib/stores/shared/LambdaEditorState.d.ts.map +1 -0
  85. package/lib/stores/{LambdaEditorState.js → shared/LambdaEditorState.js} +0 -0
  86. package/lib/stores/shared/LambdaEditorState.js.map +1 -0
  87. package/lib/stores/{LambdaParameterState.d.ts → shared/LambdaParameterState.d.ts} +1 -3
  88. package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -0
  89. package/lib/stores/{LambdaParameterState.js → shared/LambdaParameterState.js} +3 -52
  90. package/lib/stores/shared/LambdaParameterState.js.map +1 -0
  91. package/lib/stores/{PackageableElementOption.d.ts → shared/PackageableElementOption.d.ts} +0 -0
  92. package/lib/stores/shared/PackageableElementOption.d.ts.map +1 -0
  93. package/lib/stores/{PackageableElementOption.js → shared/PackageableElementOption.js} +0 -0
  94. package/lib/stores/shared/PackageableElementOption.js.map +1 -0
  95. package/lib/stores/{ValueSpecificationModifierHelper.d.ts → shared/ValueSpecificationModifierHelper.d.ts} +0 -0
  96. package/lib/stores/shared/ValueSpecificationModifierHelper.d.ts.map +1 -0
  97. package/lib/stores/{ValueSpecificationModifierHelper.js → shared/ValueSpecificationModifierHelper.js} +0 -0
  98. package/lib/stores/shared/ValueSpecificationModifierHelper.js.map +1 -0
  99. package/package.json +13 -12
  100. package/src/application/LegendApplication.tsx +100 -4
  101. package/src/components/VirtualAssistant.tsx +106 -16
  102. package/src/components/{BasicValueSpecificationEditor.tsx → shared/BasicValueSpecificationEditor.tsx} +50 -19
  103. package/src/components/{CustomDatePicker.tsx → shared/CustomDatePicker.tsx} +44 -27
  104. package/src/components/{DocumentationLink.tsx → shared/DocumentationLink.tsx} +1 -1
  105. package/src/components/{LambdaEditor.tsx → shared/LambdaEditor.tsx} +4 -4
  106. package/src/components/{LambdaParameterValuesEditor.tsx → shared/LambdaParameterValuesEditor.tsx} +5 -3
  107. package/src/components/shared/PackageableElementOptionRenderer.tsx +40 -0
  108. package/src/components/{TextInputEditor.tsx → shared/TextInputEditor.tsx} +2 -2
  109. package/src/components/shared/execution-plan-viewer/ExecutionPlanViewer.tsx +550 -0
  110. package/src/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.tsx +46 -0
  111. package/src/const.ts +0 -5
  112. package/src/index.ts +16 -13
  113. package/src/stores/ApplicationEvent.ts +4 -2
  114. package/src/stores/ApplicationStore.ts +3 -1
  115. package/src/stores/LegendApplicationAssistantService.ts +30 -16
  116. package/src/stores/LegendApplicationConfig.ts +28 -27
  117. package/src/stores/LegendApplicationDocumentationService.ts +128 -124
  118. package/src/stores/LegendApplicationPlugin.ts +17 -3
  119. package/src/stores/PureLanguageSupport.ts +8 -3
  120. package/src/stores/shared/ExecutionPlanState.ts +154 -0
  121. package/src/stores/{LambdaEditorState.ts → shared/LambdaEditorState.ts} +0 -0
  122. package/src/stores/{LambdaParameterState.ts → shared/LambdaParameterState.ts} +2 -100
  123. package/src/stores/{PackageableElementOption.ts → shared/PackageableElementOption.ts} +0 -0
  124. package/src/stores/{ValueSpecificationModifierHelper.ts → shared/ValueSpecificationModifierHelper.ts} +0 -0
  125. package/tsconfig.json +14 -10
  126. package/lib/components/BasicValueSpecificationEditor.d.ts.map +0 -1
  127. package/lib/components/BasicValueSpecificationEditor.js.map +0 -1
  128. package/lib/components/CustomDatePicker.d.ts.map +0 -1
  129. package/lib/components/CustomDatePicker.js.map +0 -1
  130. package/lib/components/DocumentationLink.d.ts.map +0 -1
  131. package/lib/components/DocumentationLink.js.map +0 -1
  132. package/lib/components/LambdaEditor.d.ts.map +0 -1
  133. package/lib/components/LambdaEditor.js.map +0 -1
  134. package/lib/components/LambdaParameterValuesEditor.d.ts.map +0 -1
  135. package/lib/components/LambdaParameterValuesEditor.js.map +0 -1
  136. package/lib/components/TextInputEditor.d.ts.map +0 -1
  137. package/lib/components/TextInputEditor.js.map +0 -1
  138. package/lib/stores/LambdaEditorState.d.ts.map +0 -1
  139. package/lib/stores/LambdaEditorState.js.map +0 -1
  140. package/lib/stores/LambdaParameterState.d.ts.map +0 -1
  141. package/lib/stores/LambdaParameterState.js.map +0 -1
  142. package/lib/stores/PackageableElementOption.d.ts.map +0 -1
  143. package/lib/stores/PackageableElementOption.js.map +0 -1
  144. package/lib/stores/ValueSpecificationModifierHelper.d.ts.map +0 -1
  145. package/lib/stores/ValueSpecificationModifierHelper.js.map +0 -1
@@ -60,7 +60,7 @@ import { useEffect, useRef, useState } from 'react';
60
60
  import {
61
61
  instanceValue_changeValue,
62
62
  instanceValue_changeValues,
63
- } from '../stores/ValueSpecificationModifierHelper.js';
63
+ } from '../../stores/shared/ValueSpecificationModifierHelper.js';
64
64
  import { CustomDatePicker } from './CustomDatePicker.js';
65
65
 
66
66
  type TypeCheckOption = {
@@ -168,13 +168,16 @@ const StringPrimitiveInstanceValueEditor = observer(
168
168
  (props: {
169
169
  valueSpecification: PrimitiveInstanceValue;
170
170
  className?: string | undefined;
171
+ setValueSpecification: (val: ValueSpecification) => void;
171
172
  resetValue: () => void;
172
173
  }) => {
173
- const { valueSpecification, className, resetValue } = props;
174
+ const { valueSpecification, className, resetValue, setValueSpecification } =
175
+ props;
174
176
  const value = valueSpecification.values[0] as string;
175
- const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) =>
177
+ const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) => {
176
178
  instanceValue_changeValue(valueSpecification, event.target.value, 0);
177
-
179
+ setValueSpecification(valueSpecification);
180
+ };
178
181
  return (
179
182
  <div className={clsx('value-spec-editor', className)}>
180
183
  <input
@@ -201,11 +204,15 @@ const BooleanPrimitiveInstanceValueEditor = observer(
201
204
  valueSpecification: PrimitiveInstanceValue;
202
205
  className?: string | undefined;
203
206
  resetValue: () => void;
207
+ setValueSpecification: (val: ValueSpecification) => void;
204
208
  }) => {
205
- const { valueSpecification, className, resetValue } = props;
209
+ const { valueSpecification, className, resetValue, setValueSpecification } =
210
+ props;
206
211
  const value = valueSpecification.values[0] as boolean;
207
- const toggleValue = (): void =>
212
+ const toggleValue = (): void => {
208
213
  instanceValue_changeValue(valueSpecification, !value, 0);
214
+ setValueSpecification(valueSpecification);
215
+ };
209
216
 
210
217
  return (
211
218
  <div className={clsx('value-spec-editor', className)}>
@@ -235,8 +242,15 @@ const NumberPrimitiveInstanceValueEditor = observer(
235
242
  isInteger: boolean;
236
243
  className?: string | undefined;
237
244
  resetValue: () => void;
245
+ setValueSpecification: (val: ValueSpecification) => void;
238
246
  }) => {
239
- const { valueSpecification, isInteger, className, resetValue } = props;
247
+ const {
248
+ valueSpecification,
249
+ isInteger,
250
+ className,
251
+ resetValue,
252
+ setValueSpecification,
253
+ } = props;
240
254
  const value = valueSpecification.values[0] as number;
241
255
  const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) => {
242
256
  let inputVal = isInteger
@@ -244,6 +258,7 @@ const NumberPrimitiveInstanceValueEditor = observer(
244
258
  : parseFloat(event.target.value);
245
259
  inputVal = isNaN(inputVal) ? 0 : inputVal;
246
260
  instanceValue_changeValue(valueSpecification, inputVal, 0);
261
+ setValueSpecification(valueSpecification);
247
262
  };
248
263
 
249
264
  return (
@@ -271,9 +286,11 @@ const EnumValueInstanceValueEditor = observer(
271
286
  (props: {
272
287
  valueSpecification: EnumValueInstanceValue;
273
288
  className?: string | undefined;
289
+ setValueSpecification: (val: ValueSpecification) => void;
274
290
  resetValue: () => void;
275
291
  }) => {
276
- const { valueSpecification, className, resetValue } = props;
292
+ const { valueSpecification, className, resetValue, setValueSpecification } =
293
+ props;
277
294
  const enumValueRef = guaranteeNonNullable(valueSpecification.values[0]);
278
295
  const enumValue = enumValueRef.value;
279
296
  const options = enumValue._OWNER.values.map((value) => ({
@@ -286,6 +303,7 @@ const EnumValueInstanceValueEditor = observer(
286
303
  EnumValueExplicitReference.create(val.value),
287
304
  0,
288
305
  );
306
+ setValueSpecification(valueSpecification);
289
307
  };
290
308
 
291
309
  return (
@@ -441,9 +459,16 @@ const CollectionValueInstanceValueEditor = observer(
441
459
  expectedType: Type;
442
460
  className?: string | undefined;
443
461
  resetValue: () => void;
462
+ setValueSpecification: (val: ValueSpecification) => void;
444
463
  }) => {
445
- const { valueSpecification, graph, expectedType, className, resetValue } =
446
- props;
464
+ const {
465
+ valueSpecification,
466
+ graph,
467
+ expectedType,
468
+ className,
469
+ resetValue,
470
+ setValueSpecification,
471
+ } = props;
447
472
  const inputRef = useRef<HTMLInputElement>(null);
448
473
  const [text, setText] = useState(stringifyValue(valueSpecification.values));
449
474
  const [editable, setEditable] = useState(false);
@@ -466,6 +491,7 @@ const CollectionValueInstanceValueEditor = observer(
466
491
  setEditable(false);
467
492
  setCollectionValue(valueSpecification, graph, expectedType, text);
468
493
  setText(stringifyValue(valueSpecification.values));
494
+ setValueSpecification(valueSpecification);
469
495
  };
470
496
  const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) =>
471
497
  setText(event.target.value);
@@ -534,12 +560,12 @@ const DateInstanceValueEditor = observer(
534
560
  graph: PureModel;
535
561
  typeCheckOption: TypeCheckOption;
536
562
  className?: string | undefined;
537
- updateValue: (val: ValueSpecification) => void;
563
+ setValueSpecification: (val: ValueSpecification) => void;
538
564
  resetValue: () => void;
539
565
  }) => {
540
566
  const {
541
567
  valueSpecification,
542
- updateValue,
568
+ setValueSpecification,
543
569
  graph,
544
570
  typeCheckOption,
545
571
  resetValue,
@@ -551,7 +577,7 @@ const DateInstanceValueEditor = observer(
551
577
  valueSpecification={valueSpecification}
552
578
  graph={graph}
553
579
  typeCheckOption={typeCheckOption}
554
- updateValue={updateValue}
580
+ setValueSpecification={setValueSpecification}
555
581
  />
556
582
  <button
557
583
  className="value-spec-editor__reset-btn"
@@ -566,7 +592,7 @@ const DateInstanceValueEditor = observer(
566
592
  );
567
593
 
568
594
  /**
569
- * TODO we should pass in the props `setValueSpecification` and `resetValueSpecification`. Reset
595
+ * TODO we should pass in the props `resetValueSpecification`. Reset
570
596
  * should be part of this editor. Also through here we can call `observe_` accordingly.
571
597
  *
572
598
  * See https://github.com/finos/legend-studio/pull/1021
@@ -576,7 +602,7 @@ export const BasicValueSpecificationEditor: React.FC<{
576
602
  graph: PureModel;
577
603
  typeCheckOption: TypeCheckOption;
578
604
  className?: string | undefined;
579
- updateValue: (val: ValueSpecification) => void;
605
+ setValueSpecification: (val: ValueSpecification) => void;
580
606
  resetValue: () => void;
581
607
  }> = (props) => {
582
608
  const {
@@ -584,7 +610,7 @@ export const BasicValueSpecificationEditor: React.FC<{
584
610
  valueSpecification,
585
611
  graph,
586
612
  typeCheckOption,
587
- updateValue,
613
+ setValueSpecification,
588
614
  resetValue,
589
615
  } = props;
590
616
  if (valueSpecification instanceof PrimitiveInstanceValue) {
@@ -594,6 +620,7 @@ export const BasicValueSpecificationEditor: React.FC<{
594
620
  return (
595
621
  <StringPrimitiveInstanceValueEditor
596
622
  valueSpecification={valueSpecification}
623
+ setValueSpecification={setValueSpecification}
597
624
  className={className}
598
625
  resetValue={resetValue}
599
626
  />
@@ -602,6 +629,7 @@ export const BasicValueSpecificationEditor: React.FC<{
602
629
  return (
603
630
  <BooleanPrimitiveInstanceValueEditor
604
631
  valueSpecification={valueSpecification}
632
+ setValueSpecification={setValueSpecification}
605
633
  className={className}
606
634
  resetValue={resetValue}
607
635
  />
@@ -614,6 +642,7 @@ export const BasicValueSpecificationEditor: React.FC<{
614
642
  <NumberPrimitiveInstanceValueEditor
615
643
  valueSpecification={valueSpecification}
616
644
  isInteger={_type.path === PRIMITIVE_TYPE.INTEGER}
645
+ setValueSpecification={setValueSpecification}
617
646
  className={className}
618
647
  resetValue={resetValue}
619
648
  />
@@ -628,7 +657,7 @@ export const BasicValueSpecificationEditor: React.FC<{
628
657
  graph={graph}
629
658
  typeCheckOption={typeCheckOption}
630
659
  className={className}
631
- updateValue={updateValue}
660
+ setValueSpecification={setValueSpecification}
632
661
  resetValue={resetValue}
633
662
  />
634
663
  );
@@ -641,6 +670,7 @@ export const BasicValueSpecificationEditor: React.FC<{
641
670
  valueSpecification={valueSpecification}
642
671
  className={className}
643
672
  resetValue={resetValue}
673
+ setValueSpecification={setValueSpecification}
644
674
  />
645
675
  );
646
676
  } else if (
@@ -657,6 +687,7 @@ export const BasicValueSpecificationEditor: React.FC<{
657
687
  expectedType={typeCheckOption.expectedType}
658
688
  className={className}
659
689
  resetValue={resetValue}
690
+ setValueSpecification={setValueSpecification}
660
691
  />
661
692
  );
662
693
  }
@@ -675,7 +706,7 @@ export const BasicValueSpecificationEditor: React.FC<{
675
706
  valueSpecification={valueSpecification.getValue()}
676
707
  graph={graph}
677
708
  typeCheckOption={typeCheckOption}
678
- updateValue={updateValue}
709
+ setValueSpecification={setValueSpecification}
679
710
  resetValue={resetValue}
680
711
  />
681
712
  );
@@ -694,7 +725,7 @@ export const BasicValueSpecificationEditor: React.FC<{
694
725
  graph={graph}
695
726
  typeCheckOption={typeCheckOption}
696
727
  className={className}
697
- updateValue={updateValue}
728
+ setValueSpecification={setValueSpecification}
698
729
  resetValue={resetValue}
699
730
  />
700
731
  );
@@ -47,7 +47,7 @@ import { useEffect, useState } from 'react';
47
47
  import {
48
48
  genericType_setRawType,
49
49
  instanceValue_changeValue,
50
- } from '../stores/ValueSpecificationModifierHelper.js';
50
+ } from '../../stores/shared/ValueSpecificationModifierHelper.js';
51
51
 
52
52
  enum CUSTOM_DATE_PICKER_OPTION {
53
53
  ABSOLUTE_DATE = 'Absolute Date',
@@ -673,10 +673,15 @@ const buildDatePickerOption = (
673
673
  const AbsoluteDateValueSpecificationEditor: React.FC<{
674
674
  valueSpecification: SimpleFunctionExpression | PrimitiveInstanceValue;
675
675
  graph: PureModel;
676
- updateValue: (val: ValueSpecification) => void;
676
+ setValueSpecification: (val: ValueSpecification) => void;
677
677
  setDatePickerOption: (datePickerOption: DatePickerOption) => void;
678
678
  }> = (props) => {
679
- const { valueSpecification, graph, updateValue, setDatePickerOption } = props;
679
+ const {
680
+ valueSpecification,
681
+ graph,
682
+ setValueSpecification,
683
+ setDatePickerOption,
684
+ } = props;
680
685
  const absoluteDateValue =
681
686
  valueSpecification instanceof SimpleFunctionExpression
682
687
  ? ''
@@ -685,7 +690,7 @@ const AbsoluteDateValueSpecificationEditor: React.FC<{
685
690
  event,
686
691
  ) => {
687
692
  if (valueSpecification instanceof SimpleFunctionExpression) {
688
- updateValue(
693
+ setValueSpecification(
689
694
  buildPrimitiveInstanceValue(
690
695
  graph,
691
696
  PRIMITIVE_TYPE.STRICTDATE,
@@ -727,10 +732,15 @@ const AbsoluteDateValueSpecificationEditor: React.FC<{
727
732
  const AbsoluteTimeValueSpecificationEditor: React.FC<{
728
733
  valueSpecification: SimpleFunctionExpression | PrimitiveInstanceValue;
729
734
  graph: PureModel;
730
- updateValue: (val: ValueSpecification) => void;
735
+ setValueSpecification: (val: ValueSpecification) => void;
731
736
  setDatePickerOption: (datePickerOption: DatePickerOption) => void;
732
737
  }> = (props) => {
733
- const { valueSpecification, graph, updateValue, setDatePickerOption } = props;
738
+ const {
739
+ valueSpecification,
740
+ graph,
741
+ setValueSpecification,
742
+ setDatePickerOption,
743
+ } = props;
734
744
  const absoluteTimeValue =
735
745
  valueSpecification instanceof SimpleFunctionExpression
736
746
  ? ''
@@ -739,7 +749,7 @@ const AbsoluteTimeValueSpecificationEditor: React.FC<{
739
749
  event,
740
750
  ) => {
741
751
  if (valueSpecification instanceof SimpleFunctionExpression) {
742
- updateValue(
752
+ setValueSpecification(
743
753
  buildPrimitiveInstanceValue(
744
754
  graph,
745
755
  PRIMITIVE_TYPE.DATETIME,
@@ -783,11 +793,15 @@ const AbsoluteTimeValueSpecificationEditor: React.FC<{
783
793
  const CustomDateInstanceValueEditor: React.FC<{
784
794
  customDateOptionValue: CustomDateOption;
785
795
  graph: PureModel;
786
- updateValue: (val: ValueSpecification) => void;
796
+ setValueSpecification: (val: ValueSpecification) => void;
787
797
  setDatePickerOption: (datePickerOption: DatePickerOption) => void;
788
798
  }> = (props) => {
789
- const { customDateOptionValue, graph, updateValue, setDatePickerOption } =
790
- props;
799
+ const {
800
+ customDateOptionValue,
801
+ graph,
802
+ setValueSpecification,
803
+ setDatePickerOption,
804
+ } = props;
791
805
  const [durationValue, setDurationValue] = useState(
792
806
  customDateOptionValue.duration,
793
807
  );
@@ -821,7 +835,7 @@ const CustomDateInstanceValueEditor: React.FC<{
821
835
  latestDirectionValue as CUSTOM_DATE_OPTION_DIRECTION,
822
836
  latestReferenceMomentValue as CUSTOM_DATE_OPTION_REFERENCE_MOMENT,
823
837
  );
824
- updateValue(buildPureAdjustDateFunction(dateOption, graph));
838
+ setValueSpecification(buildPureAdjustDateFunction(dateOption, graph));
825
839
  const matchedPreservedCustomAdjustDates =
826
840
  reservedCustomDateOptions.filter(
827
841
  (t) => t.generateDisplayLabel() === dateOption.generateDisplayLabel(),
@@ -933,13 +947,13 @@ const CustomDateInstanceValueEditor: React.FC<{
933
947
  const CustomFirstDayOfValueSpecificationEditor: React.FC<{
934
948
  customDateAdjustOptionValue: DatePickerOption;
935
949
  graph: PureModel;
936
- updateValue: (val: ValueSpecification) => void;
950
+ setValueSpecification: (val: ValueSpecification) => void;
937
951
  setDatePickerOption: (datePickerOption: DatePickerOption) => void;
938
952
  }> = (props) => {
939
953
  const {
940
954
  customDateAdjustOptionValue,
941
955
  graph,
942
- updateValue,
956
+ setValueSpecification,
943
957
  setDatePickerOption,
944
958
  } = props;
945
959
  const [unitValue, setUnitValue] = useState(
@@ -959,7 +973,9 @@ const CustomFirstDayOfValueSpecificationEditor: React.FC<{
959
973
  latestUnitValue as CUSTOM_DATE_FIRST_DAY_OF_UNIT,
960
974
  )
961
975
  : new CustomFirstDayOfOption('', undefined);
962
- updateValue(buildPureDateFunctionExpression(startDayOfDateOption, graph));
976
+ setValueSpecification(
977
+ buildPureDateFunctionExpression(startDayOfDateOption, graph),
978
+ );
963
979
  setDatePickerOption(startDayOfDateOption);
964
980
  }
965
981
  };
@@ -991,13 +1007,13 @@ const CustomFirstDayOfValueSpecificationEditor: React.FC<{
991
1007
  const CustomPreviousDayOfWeekValueSpecificationEditor: React.FC<{
992
1008
  customDateAdjustOptionValue: DatePickerOption;
993
1009
  graph: PureModel;
994
- updateValue: (val: ValueSpecification) => void;
1010
+ setValueSpecification: (val: ValueSpecification) => void;
995
1011
  setDatePickerOption: (datePickerOption: DatePickerOption) => void;
996
1012
  }> = (props) => {
997
1013
  const {
998
1014
  customDateAdjustOptionValue,
999
1015
  graph,
1000
- updateValue,
1016
+ setValueSpecification,
1001
1017
  setDatePickerOption,
1002
1018
  } = props;
1003
1019
  const [dayOfWeekValue, setDayOfWeekValue] = useState(
@@ -1011,7 +1027,7 @@ const CustomPreviousDayOfWeekValueSpecificationEditor: React.FC<{
1011
1027
  `Previous ${latestDurationUnitValue}`,
1012
1028
  latestDurationUnitValue as CUSTOM_DATE_DAY_OF_WEEK,
1013
1029
  );
1014
- updateValue(
1030
+ setValueSpecification(
1015
1031
  buildPureDateFunctionExpression(previousDayOfWeekDateOption, graph),
1016
1032
  );
1017
1033
  setDatePickerOption(previousDayOfWeekDateOption);
@@ -1064,9 +1080,10 @@ export const CustomDatePicker: React.FC<{
1064
1080
  */
1065
1081
  match?: boolean;
1066
1082
  };
1067
- updateValue: (val: ValueSpecification) => void;
1083
+ setValueSpecification: (val: ValueSpecification) => void;
1068
1084
  }> = (props) => {
1069
- const { valueSpecification, updateValue, graph, typeCheckOption } = props;
1085
+ const { valueSpecification, setValueSpecification, graph, typeCheckOption } =
1086
+ props;
1070
1087
  // For some cases where types need to be matched strictly.
1071
1088
  // Some options need to be filtered out for DateTime.
1072
1089
  const targetDateOptionsEnum = typeCheckOption.match
@@ -1102,7 +1119,7 @@ export const CustomDatePicker: React.FC<{
1102
1119
  if (
1103
1120
  CUSTOM_DATE_PICKER_OPTION.LATEST_DATE === chosenDatePickerOption.value
1104
1121
  ) {
1105
- updateValue(
1122
+ setValueSpecification(
1106
1123
  buildPrimitiveInstanceValue(
1107
1124
  graph,
1108
1125
  PRIMITIVE_TYPE.LATESTDATE,
@@ -1123,13 +1140,13 @@ export const CustomDatePicker: React.FC<{
1123
1140
  (d) => d.value === chosenDatePickerOption.value,
1124
1141
  );
1125
1142
  theReservedCustomDateOption.length > 0
1126
- ? updateValue(
1143
+ ? setValueSpecification(
1127
1144
  buildPureAdjustDateFunction(
1128
1145
  guaranteeNonNullable(theReservedCustomDateOption[0]),
1129
1146
  graph,
1130
1147
  ),
1131
1148
  )
1132
- : updateValue(
1149
+ : setValueSpecification(
1133
1150
  buildPureDateFunctionExpression(chosenDatePickerOption, graph),
1134
1151
  );
1135
1152
  }
@@ -1142,7 +1159,7 @@ export const CustomDatePicker: React.FC<{
1142
1159
  <AbsoluteDateValueSpecificationEditor
1143
1160
  graph={graph}
1144
1161
  valueSpecification={valueSpecification}
1145
- updateValue={updateValue}
1162
+ setValueSpecification={setValueSpecification}
1146
1163
  setDatePickerOption={setDatePickerOption}
1147
1164
  />
1148
1165
  );
@@ -1151,7 +1168,7 @@ export const CustomDatePicker: React.FC<{
1151
1168
  <AbsoluteTimeValueSpecificationEditor
1152
1169
  graph={graph}
1153
1170
  valueSpecification={valueSpecification}
1154
- updateValue={updateValue}
1171
+ setValueSpecification={setValueSpecification}
1155
1172
  setDatePickerOption={setDatePickerOption}
1156
1173
  />
1157
1174
  );
@@ -1160,7 +1177,7 @@ export const CustomDatePicker: React.FC<{
1160
1177
  <CustomDateInstanceValueEditor
1161
1178
  graph={graph}
1162
1179
  customDateOptionValue={buildCustomDateOption(valueSpecification)}
1163
- updateValue={updateValue}
1180
+ setValueSpecification={setValueSpecification}
1164
1181
  setDatePickerOption={setDatePickerOption}
1165
1182
  />
1166
1183
  );
@@ -1171,7 +1188,7 @@ export const CustomDatePicker: React.FC<{
1171
1188
  customDateAdjustOptionValue={buildDatePickerOption(
1172
1189
  valueSpecification,
1173
1190
  )}
1174
- updateValue={updateValue}
1191
+ setValueSpecification={setValueSpecification}
1175
1192
  setDatePickerOption={setDatePickerOption}
1176
1193
  />
1177
1194
  );
@@ -1182,7 +1199,7 @@ export const CustomDatePicker: React.FC<{
1182
1199
  customDateAdjustOptionValue={buildDatePickerOption(
1183
1200
  valueSpecification,
1184
1201
  )}
1185
- updateValue={updateValue}
1202
+ setValueSpecification={setValueSpecification}
1186
1203
  setDatePickerOption={setDatePickerOption}
1187
1204
  />
1188
1205
  );
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { clsx, QuestionCircleIcon } from '@finos/legend-art';
18
- import { useApplicationStore } from './ApplicationStoreProvider.js';
18
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
19
19
 
20
20
  export const DocumentationLink: React.FC<{
21
21
  documentationKey: string;
@@ -35,7 +35,7 @@ import {
35
35
  LongArrowAltUpIcon,
36
36
  Dialog,
37
37
  } from '@finos/legend-art';
38
- import type { LambdaEditorState } from '../stores/LambdaEditorState.js';
38
+ import type { LambdaEditorState } from '../../stores/shared/LambdaEditorState.js';
39
39
  import {
40
40
  debounce,
41
41
  noop,
@@ -44,9 +44,9 @@ import {
44
44
  } from '@finos/legend-shared';
45
45
  import { flowResult } from 'mobx';
46
46
  import { ParserError, type EngineError, type Type } from '@finos/legend-graph';
47
- import { APPLICATION_TEST_ID } from './ApplicationTestID.js';
48
- import { useApplicationStore } from './ApplicationStoreProvider.js';
49
- import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const.js';
47
+ import { APPLICATION_TEST_ID } from '../ApplicationTestID.js';
48
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
49
+ import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../../const.js';
50
50
 
51
51
  export type LambdaEditorOnKeyDownEventHandler = {
52
52
  matcher: (event: IKeyboardEvent) => boolean;
@@ -22,8 +22,8 @@ import {
22
22
  } from '@finos/legend-graph';
23
23
  import { prettyCONSTName } from '@finos/legend-shared';
24
24
  import { observer } from 'mobx-react-lite';
25
- import type { LambdaParametersState } from '../stores/LambdaParameterState.js';
26
- import { useApplicationStore } from './ApplicationStoreProvider.js';
25
+ import type { LambdaParametersState } from '../../stores/shared/LambdaParameterState.js';
26
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
27
27
  import { BasicValueSpecificationEditor } from './BasicValueSpecificationEditor.js';
28
28
 
29
29
  // TODO we may want to further componentize this by removing the dialog wrapper
@@ -75,7 +75,9 @@ export const LambdaParameterValuesEditor = observer(
75
75
  {paramState.value && (
76
76
  <BasicValueSpecificationEditor
77
77
  valueSpecification={paramState.value}
78
- updateValue={(val: ValueSpecification): void => {
78
+ setValueSpecification={(
79
+ val: ValueSpecification,
80
+ ): void => {
79
81
  paramState.setValue(val);
80
82
  }}
81
83
  graph={graph}
@@ -0,0 +1,40 @@
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 type { PackageableElement } from '@finos/legend-graph';
18
+ import type { PackageableElementOption } from '../../index.js';
19
+
20
+ export const getPackageableElementOptionalFormatter = (props?: {
21
+ darkMode?: boolean;
22
+ }): ((
23
+ option: PackageableElementOption<PackageableElement>,
24
+ ) => React.ReactNode) =>
25
+ function PackageableElementOptionLabel(
26
+ option: PackageableElementOption<PackageableElement>,
27
+ ): React.ReactNode {
28
+ const className = props?.darkMode
29
+ ? 'packageable-element-format-option-label--dark'
30
+ : 'packageable-element-format-option-label';
31
+
32
+ return (
33
+ <div className={className}>
34
+ <div className={`${className}__name`}>{option.label}</div>
35
+ {option.value.package && (
36
+ <div className={`${className}__tag`}>{option.value.path}</div>
37
+ )}
38
+ </div>
39
+ );
40
+ };
@@ -29,8 +29,8 @@ import {
29
29
  getEditorValue,
30
30
  normalizeLineEnding,
31
31
  } from '@finos/legend-art';
32
- import { type EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const.js';
33
- import { useApplicationStore } from './ApplicationStoreProvider.js';
32
+ import { type EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../../const.js';
33
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
34
34
 
35
35
  export type TextInputEditorOnKeyDownEventHandler = {
36
36
  matcher: (event: IKeyboardEvent) => boolean;