@finos/legend-application-studio 28.13.2 → 28.13.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.
Files changed (95) hide show
  1. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts +1 -0
  2. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -0
  4. package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
  5. package/lib/application/LegendStudioApplicationConfig.d.ts +5 -9
  6. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendStudioApplicationConfig.js +6 -10
  8. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  9. package/lib/components/editor/ActivityBar.d.ts.map +1 -1
  10. package/lib/components/editor/ActivityBar.js +3 -3
  11. package/lib/components/editor/ActivityBar.js.map +1 -1
  12. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +15 -15
  13. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  14. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +1 -1
  15. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  16. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +55 -104
  17. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  18. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.d.ts.map +1 -1
  19. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js +3 -3
  20. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js.map +1 -1
  21. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts +22 -0
  22. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts.map +1 -0
  23. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js +267 -0
  24. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js.map +1 -0
  25. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  26. package/lib/components/editor/side-bar/Explorer.js +1 -25
  27. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  28. package/lib/index.css +1 -1
  29. package/lib/package.json +1 -1
  30. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorPromoteState.d.ts → FunctionActivatorState.d.ts} +9 -9
  31. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -0
  32. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorPromoteState.js → FunctionActivatorState.js} +24 -24
  33. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -0
  34. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +6 -5
  35. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +6 -5
  37. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  38. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorBuilderState.d.ts → ToDelete_FunctionActivatorBuilderState.d.ts} +1 -1
  39. package/lib/stores/editor/editor-state/element-editor-state/ToDelete_FunctionActivatorBuilderState.d.ts.map +1 -0
  40. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorBuilderState.js → ToDelete_FunctionActivatorBuilderState.js} +1 -1
  41. package/lib/stores/editor/editor-state/element-editor-state/ToDelete_FunctionActivatorBuilderState.js.map +1 -0
  42. package/lib/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js +1 -1
  43. package/lib/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js.map +1 -1
  44. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts +1 -1
  45. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts.map +1 -1
  46. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js +2 -2
  47. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js.map +1 -1
  48. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +87 -0
  49. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -0
  50. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +422 -0
  51. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -0
  52. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  53. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +1 -1
  54. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  55. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +3 -17
  56. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  57. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +8 -69
  58. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  59. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +26 -3
  60. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
  61. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +72 -1
  62. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
  63. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts +4 -1
  64. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts.map +1 -1
  65. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js +10 -1
  66. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js.map +1 -1
  67. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.d.ts +3 -2
  68. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.d.ts.map +1 -1
  69. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.js +3 -0
  70. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.js.map +1 -1
  71. package/package.json +4 -4
  72. package/src/__lib__/LegendStudioApplicationNavigationContext.ts +1 -0
  73. package/src/application/LegendStudioApplicationConfig.ts +7 -12
  74. package/src/components/editor/ActivityBar.tsx +4 -3
  75. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +36 -36
  76. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +136 -345
  77. package/src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx +3 -10
  78. package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx +879 -0
  79. package/src/components/editor/side-bar/Explorer.tsx +0 -59
  80. package/src/stores/editor/editor-state/element-editor-state/{FunctionActivatorPromoteState.ts → FunctionActivatorState.ts} +23 -23
  81. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +7 -6
  82. package/src/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.ts +1 -1
  83. package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts +2 -2
  84. package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +646 -0
  85. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -4
  86. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +16 -97
  87. package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +105 -3
  88. package/src/stores/graph-modifier/DomainGraphModifierHelper.ts +34 -2
  89. package/src/stores/graph-modifier/Testable_GraphModifierHelper.ts +9 -1
  90. package/tsconfig.json +4 -2
  91. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.d.ts.map +0 -1
  92. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.js.map +0 -1
  93. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.d.ts.map +0 -1
  94. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.js.map +0 -1
  95. /package/src/stores/editor/editor-state/element-editor-state/{FunctionActivatorBuilderState.ts → ToDelete_FunctionActivatorBuilderState.ts} +0 -0
@@ -91,7 +91,6 @@ import { flowResult } from 'mobx';
91
91
  import { useEditorStore } from '../EditorStoreProvider.js';
92
92
  import {
93
93
  type PackageableElement,
94
- type FunctionActivatorConfiguration,
95
94
  ELEMENT_PATH_DELIMITER,
96
95
  ROOT_PACKAGE_NAME,
97
96
  Package,
@@ -144,7 +143,6 @@ import {
144
143
  CodeEditor,
145
144
  } from '@finos/legend-lego/code-editor';
146
145
  import { DatabaseBuilderWizard } from '../editor-group/connection-editor/DatabaseBuilderWizard.js';
147
- import { FunctionEditorState } from '../../../stores/editor/editor-state/element-editor-state/FunctionEditorState.js';
148
146
  import { DatabaseModelBuilder } from '../editor-group/connection-editor/DatabaseModelBuilder.js';
149
147
  import { queryService } from '../editor-group/service-editor/ServiceExecutionQueryEditor.js';
150
148
  import { QueryDatabaseState } from '../../../stores/editor/editor-state/element-editor-state/database/QueryDatabaseState.js';
@@ -755,50 +753,6 @@ const ExplorerContextMenu = observer(
755
753
  ).catch(applicationStore.alertUnhandledError);
756
754
  }
757
755
  };
758
- const activateFunction = (): void => {
759
- if (node?.packageableElement instanceof ConcreteFunctionDefinition) {
760
- editorStore.setQuickInputState({
761
- title: 'Activate function',
762
- placeholder: 'Select an activation...',
763
- options: editorStore.graphState.functionActivatorConfigurations.map(
764
- (config) => ({
765
- value: config,
766
- label: (
767
- <div
768
- className="function-editor__activator__selector__option"
769
- title={config.description}
770
- >
771
- <div className="function-editor__activator__selector__option__name">
772
- {config.name}
773
- </div>
774
- <div className="function-editor__activator__selector__option__description">
775
- {config.description}
776
- </div>
777
- </div>
778
- ),
779
- }),
780
- ),
781
- getSearchValue: (option: {
782
- value: FunctionActivatorConfiguration;
783
- label: React.ReactNode;
784
- }): string => option.value.name,
785
- onSelect: (option: {
786
- value: FunctionActivatorConfiguration;
787
- label: React.ReactNode;
788
- }) => {
789
- editorStore.graphEditorMode.openElement(node.packageableElement);
790
- editorStore.tabManagerState
791
- .getCurrentEditorState(FunctionEditorState)
792
- .activatorBuilderState.setCurrentActivatorConfiguration(
793
- option.value,
794
- );
795
- },
796
- customization: {
797
- rowHeight: 70,
798
- },
799
- });
800
- }
801
- };
802
756
 
803
757
  if (isDependencyProjectRoot()) {
804
758
  return (
@@ -878,19 +832,6 @@ const ExplorerContextMenu = observer(
878
832
  <MenuContentDivider />
879
833
  </>
880
834
  )}
881
- {node.packageableElement instanceof ConcreteFunctionDefinition && (
882
- <>
883
- {editorStore.applicationStore.config.options
884
- .TEMPORARY__enableFunctionActivatorSupport && (
885
- <>
886
- <MenuContentItem onClick={activateFunction}>
887
- Activate...
888
- </MenuContentItem>
889
- <MenuContentDivider />
890
- </>
891
- )}
892
- </>
893
- )}
894
835
  {isRelationalDatabaseConnection(node.packageableElement) && (
895
836
  <>
896
837
  <MenuContentItem onClick={openSQLPlayground}>
@@ -27,54 +27,54 @@ import {
27
27
  SnowflakeAppType,
28
28
  } from '@finos/legend-graph';
29
29
  import { type GeneratorFn } from '@finos/legend-shared';
30
- import { FUNCTION_PROMOTE_TYPE } from '../../../../components/editor/editor-group/function-activator/FunctionEditor.js';
30
+ import { FUNCTION_ACTIVATE_TYPE } from '../../../../components/editor/editor-group/function-activator/FunctionEditor.js';
31
31
 
32
32
  const BASE_ACTIVATOR_NAME = 'NewActivator';
33
33
 
34
- export class FunctionActivatorPromoteState {
34
+ export class FunctionActivatorState {
35
35
  readonly functionEditorState: FunctionEditorState;
36
36
 
37
37
  activatorPath: string;
38
- isPromotingFunction = false;
38
+ isActivatingFunction = false;
39
39
  isFunctionActivatorEditorOpen = false;
40
- promoteType: string | undefined;
40
+ activateType: string | undefined;
41
41
 
42
42
  constructor(functionEditorState: FunctionEditorState) {
43
43
  makeObservable(this, {
44
44
  activatorPath: observable,
45
- isPromotingFunction: observable,
45
+ isActivatingFunction: observable,
46
46
  isFunctionActivatorEditorOpen: observable,
47
- promoteType: observable,
48
- setPromoteType: action,
47
+ activateType: observable,
48
+ setAcitvateType: action,
49
49
  updateActivatorPath: action,
50
- setIsPromotingFunction: action,
50
+ setIsActivatingFunction: action,
51
51
  setIsFunctionActivatorEditorOpen: action,
52
- promote: flow,
52
+ activate: flow,
53
53
  });
54
54
 
55
55
  this.functionEditorState = functionEditorState;
56
- this.promoteType = FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP;
56
+ this.activateType = FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP;
57
57
  this.activatorPath = `${this.functionEditorState.functionElement.package?.path}::${BASE_ACTIVATOR_NAME}`;
58
58
  }
59
59
 
60
- setIsPromotingFunction(val: boolean): void {
61
- this.isPromotingFunction = val;
60
+ setIsActivatingFunction(val: boolean): void {
61
+ this.isActivatingFunction = val;
62
62
  }
63
63
 
64
64
  setIsFunctionActivatorEditorOpen(val: boolean): void {
65
65
  this.isFunctionActivatorEditorOpen = val;
66
66
  }
67
67
 
68
- setPromoteType(val: string | undefined): void {
69
- this.promoteType = val;
68
+ setAcitvateType(val: string | undefined): void {
69
+ this.activateType = val;
70
70
  }
71
71
 
72
- showFunctionPromoteModal(): void {
73
- this.setIsPromotingFunction(true);
72
+ showFunctionActivateModal(): void {
73
+ this.setIsActivatingFunction(true);
74
74
  }
75
75
 
76
- closeFunctionPromoteModal(): void {
77
- this.setIsPromotingFunction(false);
76
+ closeFunctionActivateModal(): void {
77
+ this.setIsActivatingFunction(false);
78
78
  }
79
79
 
80
80
  updateActivatorPath(val: string): void {
@@ -84,9 +84,9 @@ export class FunctionActivatorPromoteState {
84
84
  createFunctionActivator(
85
85
  functionElement: ConcreteFunctionDefinition,
86
86
  ): FunctionActivator | undefined {
87
- const type = this.promoteType;
87
+ const type = this.activateType;
88
88
  switch (type) {
89
- case FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP: {
89
+ case FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP: {
90
90
  const activatorName = this.activatorPath.includes('::')
91
91
  ? extractElementNameFromPath(this.activatorPath)
92
92
  : this.activatorPath;
@@ -106,7 +106,7 @@ export class FunctionActivatorPromoteState {
106
106
  }
107
107
  }
108
108
 
109
- *promote(functionElement: ConcreteFunctionDefinition): GeneratorFn<void> {
109
+ *activate(functionElement: ConcreteFunctionDefinition): GeneratorFn<void> {
110
110
  const functionActivator = this.createFunctionActivator(functionElement);
111
111
  if (!functionActivator) {
112
112
  return;
@@ -121,10 +121,10 @@ export class FunctionActivatorPromoteState {
121
121
  );
122
122
  } catch {
123
123
  this.functionEditorState.editorStore.applicationStore.notificationService.notifyError(
124
- `Can't promote function`,
124
+ `Can't activate function`,
125
125
  );
126
126
  } finally {
127
- this.setPromoteType(FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP);
127
+ this.setAcitvateType(FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP);
128
128
  }
129
129
  }
130
130
  }
@@ -65,13 +65,14 @@ import {
65
65
  buildExecutionParameterValues,
66
66
  getExecutionQueryFromRawLambda,
67
67
  } from '@finos/legend-query-builder';
68
- import { FunctionActivatorBuilderState } from './FunctionActivatorBuilderState.js';
69
- import { FunctionActivatorPromoteState } from './FunctionActivatorPromoteState.js';
68
+ import { FunctionActivatorState } from './FunctionActivatorState.js';
69
+ import { FunctionTestableState } from './function-activator/testable/FunctionTestableState.js';
70
70
 
71
71
  export enum FUNCTION_EDITOR_TAB {
72
72
  DEFINITION = 'DEFINITION',
73
73
  TAGGED_VALUES = 'TAGGED_VALUES',
74
74
  STEREOTYPES = 'STEREOTYPES',
75
+ TEST_SUITES = 'TEST_SUITES',
75
76
  }
76
77
 
77
78
  export class FunctionDefinitionEditorState extends LambdaEditorState {
@@ -244,8 +245,8 @@ export class FunctionParametersState extends LambdaParametersState {
244
245
 
245
246
  export class FunctionEditorState extends ElementEditorState {
246
247
  readonly functionDefinitionEditorState: FunctionDefinitionEditorState;
247
- readonly activatorBuilderState: FunctionActivatorBuilderState; // to be removed
248
- readonly activatorPromoteState: FunctionActivatorPromoteState;
248
+ readonly activatorPromoteState: FunctionActivatorState;
249
+ readonly functionTestableEditorState: FunctionTestableState;
249
250
 
250
251
  selectedTab: FUNCTION_EDITOR_TAB;
251
252
 
@@ -288,13 +289,13 @@ export class FunctionEditorState extends ElementEditorState {
288
289
  element,
289
290
  this.editorStore,
290
291
  );
291
- this.activatorBuilderState = new FunctionActivatorBuilderState(this);
292
- this.activatorPromoteState = new FunctionActivatorPromoteState(this);
292
+ this.activatorPromoteState = new FunctionActivatorState(this);
293
293
  this.executionPlanState = new ExecutionPlanState(
294
294
  this.editorStore.applicationStore,
295
295
  this.editorStore.graphManagerState,
296
296
  );
297
297
  this.parametersState = new FunctionParametersState(this);
298
+ this.functionTestableEditorState = new FunctionTestableState(this);
298
299
  }
299
300
 
300
301
  override get label(): string {
@@ -30,7 +30,7 @@ import {
30
30
  } from '@finos/legend-shared';
31
31
  import { ProtocolValueBuilderState } from '../ProtocolValueBuilderState.js';
32
32
  import { INTERNAL__UnknownFunctionActivator_setContent } from '../../../../graph-modifier/DomainGraphModifierHelper.js';
33
- import { FUNCTION_ACTIVATOR_EXCLUDED_PATHS } from '../FunctionActivatorBuilderState.js';
33
+ import { FUNCTION_ACTIVATOR_EXCLUDED_PATHS } from '../ToDelete_FunctionActivatorBuilderState.js';
34
34
 
35
35
  export class INTERNAL__UnknownFunctionActivatorEdtiorState extends ElementEditorState {
36
36
  readonly activator: INTERNAL__UnknownFunctionActivator;
@@ -50,7 +50,7 @@ export class SnowflakeAppFunctionActivatorEdtiorState extends ElementEditorState
50
50
  updateConnection: action,
51
51
  updateAppType: action,
52
52
  validate: flow,
53
- deploy: flow,
53
+ deployToSandbox: flow,
54
54
  });
55
55
  }
56
56
 
@@ -106,7 +106,7 @@ export class SnowflakeAppFunctionActivatorEdtiorState extends ElementEditorState
106
106
  }
107
107
  }
108
108
 
109
- *deploy(): GeneratorFn<void> {
109
+ *deployToSandbox(): GeneratorFn<void> {
110
110
  this.deployState.inProgress();
111
111
  try {
112
112
  yield this.editorStore.graphManagerState.graphManager.publishFunctionActivatorToSandbox(