@finos/legend-application-studio 28.13.2 → 28.13.3

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 (92) 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 +2 -2
  11. package/lib/components/editor/ActivityBar.js.map +1 -1
  12. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +1 -1
  13. package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
  14. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +46 -95
  15. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  16. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js +3 -3
  18. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js.map +1 -1
  19. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts +22 -0
  20. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts.map +1 -0
  21. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js +231 -0
  22. package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js.map +1 -0
  23. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  24. package/lib/components/editor/side-bar/Explorer.js +1 -25
  25. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  26. package/lib/index.css +1 -1
  27. package/lib/package.json +1 -1
  28. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorPromoteState.d.ts → FunctionActivatorState.d.ts} +9 -9
  29. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -0
  30. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorPromoteState.js → FunctionActivatorState.js} +24 -24
  31. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -0
  32. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +6 -5
  33. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  34. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +6 -5
  35. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorBuilderState.d.ts → ToDelete_FunctionActivatorBuilderState.d.ts} +1 -1
  37. package/lib/stores/editor/editor-state/element-editor-state/ToDelete_FunctionActivatorBuilderState.d.ts.map +1 -0
  38. package/lib/stores/editor/editor-state/element-editor-state/{FunctionActivatorBuilderState.js → ToDelete_FunctionActivatorBuilderState.js} +1 -1
  39. package/lib/stores/editor/editor-state/element-editor-state/ToDelete_FunctionActivatorBuilderState.js.map +1 -0
  40. package/lib/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js +1 -1
  41. package/lib/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.js.map +1 -1
  42. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts +1 -1
  43. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts.map +1 -1
  44. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js +2 -2
  45. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js.map +1 -1
  46. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +81 -0
  47. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -0
  48. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +286 -0
  49. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -0
  50. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  51. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +1 -1
  52. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  53. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +3 -17
  54. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  55. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +8 -69
  56. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  57. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +26 -3
  58. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
  59. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +72 -1
  60. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
  61. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts +3 -1
  62. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts.map +1 -1
  63. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js +7 -1
  64. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js.map +1 -1
  65. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.d.ts +3 -2
  66. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.d.ts.map +1 -1
  67. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.js +3 -0
  68. package/lib/stores/graph-modifier/Testable_GraphModifierHelper.js.map +1 -1
  69. package/package.json +4 -4
  70. package/src/__lib__/LegendStudioApplicationNavigationContext.ts +1 -0
  71. package/src/application/LegendStudioApplicationConfig.ts +7 -12
  72. package/src/components/editor/ActivityBar.tsx +3 -2
  73. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +59 -276
  74. package/src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx +3 -10
  75. package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx +748 -0
  76. package/src/components/editor/side-bar/Explorer.tsx +0 -59
  77. package/src/stores/editor/editor-state/element-editor-state/{FunctionActivatorPromoteState.ts → FunctionActivatorState.ts} +23 -23
  78. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +7 -6
  79. package/src/stores/editor/editor-state/element-editor-state/function-activator/INTERNAL__UnknownFunctionActivatorEditorState.ts +1 -1
  80. package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts +2 -2
  81. package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +414 -0
  82. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -4
  83. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +16 -96
  84. package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +105 -3
  85. package/src/stores/graph-modifier/DomainGraphModifierHelper.ts +23 -2
  86. package/src/stores/graph-modifier/Testable_GraphModifierHelper.ts +9 -1
  87. package/tsconfig.json +4 -2
  88. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.d.ts.map +0 -1
  89. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.js.map +0 -1
  90. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.d.ts.map +0 -1
  91. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.js.map +0 -1
  92. /package/src/stores/editor/editor-state/element-editor-state/{FunctionActivatorBuilderState.ts → ToDelete_FunctionActivatorBuilderState.ts} +0 -0
@@ -48,13 +48,10 @@ import {
48
48
  PanelContent,
49
49
  PanelDnDEntry,
50
50
  Dialog,
51
- ModalHeader,
52
51
  ModalBody,
53
52
  ModalFooter,
54
- ModalTitle,
55
53
  CaretDownIcon,
56
54
  DropdownMenu,
57
- LaunchIcon,
58
55
  BlankPanelContent,
59
56
  MenuContent,
60
57
  MenuContentItem,
@@ -100,9 +97,6 @@ import {
100
97
  stub_RawVariableExpression,
101
98
  getFunctionNameWithPath,
102
99
  getFunctionSignature,
103
- generateFunctionPrettyName,
104
- extractAnnotatedElementDocumentation,
105
- getClassProperty,
106
100
  RawExecutionResult,
107
101
  extractExecutionResultValues,
108
102
  RawLambda,
@@ -149,14 +143,13 @@ import {
149
143
  } from '@finos/legend-query-builder';
150
144
  import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
151
145
  import { graph_renameElement } from '../../../../stores/graph-modifier/GraphModifierHelper.js';
152
- import { ProtocolValueBuilder } from '../ProtocolValueBuilder.js';
153
- import type { ProtocolValueBuilderState } from '../../../../stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js';
154
146
  import {
155
147
  CODE_EDITOR_LANGUAGE,
156
148
  CodeEditor,
157
149
  } from '@finos/legend-lego/code-editor';
158
150
  import { PanelGroupItemExperimentalBadge } from '../../panel-group/PanelGroup.js';
159
- import type { FunctionActivatorPromoteState } from '../../../../stores/editor/editor-state/element-editor-state/FunctionActivatorPromoteState.js';
151
+ import type { FunctionActivatorState } from '../../../../stores/editor/editor-state/element-editor-state/FunctionActivatorState.js';
152
+ import { FunctionTestableEditor } from './testable/FunctionTestableEditor.js';
160
153
 
161
154
  enum FUNCTION_PARAMETER_TYPE {
162
155
  CLASS = 'CLASS',
@@ -164,7 +157,7 @@ enum FUNCTION_PARAMETER_TYPE {
164
157
  PRIMITIVE = 'PRIMITIVE',
165
158
  }
166
159
 
167
- export enum FUNCTION_PROMOTE_TYPE {
160
+ export enum FUNCTION_ACTIVATE_TYPE {
168
161
  SNOWFLAKE_NATIVE_APP = 'Snowflake Native App',
169
162
  REST_SERVICE = 'REST Service',
170
163
  SERVICE_JAR = 'Service JAR',
@@ -680,7 +673,7 @@ const ReturnTypeEditor = observer(
680
673
  const FunctionPromoteEditor = observer(
681
674
  (props: {
682
675
  functionElement: ConcreteFunctionDefinition;
683
- activatorPromoteState: FunctionActivatorPromoteState;
676
+ activatorPromoteState: FunctionActivatorState;
684
677
  }) => {
685
678
  const { functionElement, activatorPromoteState } = props;
686
679
  const applicationStore = useApplicationStore();
@@ -692,13 +685,13 @@ const FunctionPromoteEditor = observer(
692
685
  : undefined;
693
686
  let validationMessage = '';
694
687
  const closeModal = (): void => {
695
- activatorPromoteState.closeFunctionPromoteModal();
696
- activatorPromoteState.setPromoteType(undefined);
688
+ activatorPromoteState.closeFunctionActivateModal();
689
+ activatorPromoteState.setAcitvateType(undefined);
697
690
  };
698
691
  const promoteFunction = (): void => {
699
- flowResult(activatorPromoteState.promote(functionElement))
692
+ flowResult(activatorPromoteState.activate(functionElement))
700
693
  .then(() => {
701
- activatorPromoteState.closeFunctionPromoteModal();
694
+ activatorPromoteState.closeFunctionActivateModal();
702
695
  })
703
696
  .catch(applicationStore.alertUnhandledError);
704
697
  };
@@ -709,7 +702,7 @@ const FunctionPromoteEditor = observer(
709
702
  };
710
703
  const validateFunctionActivator = (type: string): boolean => {
711
704
  switch (type) {
712
- case FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP: {
705
+ case FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP: {
713
706
  const availableConnections =
714
707
  activatorPromoteState.functionEditorState.editorStore.graphManagerState.usableConnections.filter(
715
708
  (connection) =>
@@ -731,77 +724,77 @@ const FunctionPromoteEditor = observer(
731
724
  };
732
725
  const renderFunctionPromoteTypes = (type: string): React.ReactNode => {
733
726
  switch (type) {
734
- case FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP:
727
+ case FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP:
735
728
  return (
736
729
  <BaseCard
737
- key={FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP}
730
+ key={FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP}
738
731
  cardMedia={
739
732
  <Snowflake_BrandIcon className="function-promote-editor__type-icon" />
740
733
  }
741
734
  cardName={type}
742
735
  cardContent="Deploy the function as a UDTF(user-defined table function) in snowflake"
743
736
  isActive={
744
- activatorPromoteState.promoteType ===
745
- FUNCTION_PROMOTE_TYPE.SNOWFLAKE_NATIVE_APP
737
+ activatorPromoteState.activateType ===
738
+ FUNCTION_ACTIVATE_TYPE.SNOWFLAKE_NATIVE_APP
746
739
  }
747
740
  onClick={() => {
748
- activatorPromoteState.setPromoteType(type);
741
+ activatorPromoteState.setAcitvateType(type);
749
742
  }}
750
743
  />
751
744
  );
752
- case FUNCTION_PROMOTE_TYPE.REST_SERVICE:
745
+ case FUNCTION_ACTIVATE_TYPE.REST_SERVICE:
753
746
  return (
754
747
  <BaseCard
755
- key={FUNCTION_PROMOTE_TYPE.REST_SERVICE}
748
+ key={FUNCTION_ACTIVATE_TYPE.REST_SERVICE}
756
749
  cardMedia={<div className="coming-soon-label">Coming Soon</div>}
757
750
  cardName={type}
758
751
  cardContent="Create a HostedService that will be deployed to a server environment and executed with a pattern"
759
752
  isDisable={true}
760
753
  isActive={
761
- activatorPromoteState.promoteType ===
762
- FUNCTION_PROMOTE_TYPE.REST_SERVICE
754
+ activatorPromoteState.activateType ===
755
+ FUNCTION_ACTIVATE_TYPE.REST_SERVICE
763
756
  }
764
757
  />
765
758
  );
766
- case FUNCTION_PROMOTE_TYPE.SERVICE_JAR:
759
+ case FUNCTION_ACTIVATE_TYPE.SERVICE_JAR:
767
760
  return (
768
761
  <BaseCard
769
- key={FUNCTION_PROMOTE_TYPE.SERVICE_JAR}
762
+ key={FUNCTION_ACTIVATE_TYPE.SERVICE_JAR}
770
763
  cardMedia={<div className="coming-soon-label">Coming Soon</div>}
771
764
  cardName={type}
772
765
  cardContent="Deploy the function in the definition of a Store persistence"
773
766
  isDisable={true}
774
767
  isActive={
775
- activatorPromoteState.promoteType ===
776
- FUNCTION_PROMOTE_TYPE.SERVICE_JAR
768
+ activatorPromoteState.activateType ===
769
+ FUNCTION_ACTIVATE_TYPE.SERVICE_JAR
777
770
  }
778
771
  />
779
772
  );
780
- case FUNCTION_PROMOTE_TYPE.REFINER:
773
+ case FUNCTION_ACTIVATE_TYPE.REFINER:
781
774
  return (
782
775
  <BaseCard
783
- key={FUNCTION_PROMOTE_TYPE.REFINER}
776
+ key={FUNCTION_ACTIVATE_TYPE.REFINER}
784
777
  cardMedia={<div className="coming-soon-label">Coming Soon</div>}
785
778
  cardName={type}
786
779
  cardContent="Use the service in a refiner context"
787
780
  isDisable={true}
788
781
  isActive={
789
- activatorPromoteState.promoteType ===
790
- FUNCTION_PROMOTE_TYPE.REFINER
782
+ activatorPromoteState.activateType ===
783
+ FUNCTION_ACTIVATE_TYPE.REFINER
791
784
  }
792
785
  />
793
786
  );
794
- case FUNCTION_PROMOTE_TYPE.BIG_QUERY_NATIVE_APP:
787
+ case FUNCTION_ACTIVATE_TYPE.BIG_QUERY_NATIVE_APP:
795
788
  return (
796
789
  <BaseCard
797
- key={FUNCTION_PROMOTE_TYPE.BIG_QUERY_NATIVE_APP}
790
+ key={FUNCTION_ACTIVATE_TYPE.BIG_QUERY_NATIVE_APP}
798
791
  cardMedia={<div className="coming-soon-label">Coming Soon</div>}
799
792
  cardName={type}
800
793
  cardContent="Deploy the function as a UDTF(user-defined table function) in BigQuery"
801
794
  isDisable={true}
802
795
  isActive={
803
- activatorPromoteState.promoteType ===
804
- FUNCTION_PROMOTE_TYPE.BIG_QUERY_NATIVE_APP
796
+ activatorPromoteState.activateType ===
797
+ FUNCTION_ACTIVATE_TYPE.BIG_QUERY_NATIVE_APP
805
798
  }
806
799
  />
807
800
  );
@@ -812,7 +805,7 @@ const FunctionPromoteEditor = observer(
812
805
 
813
806
  return (
814
807
  <Dialog
815
- open={activatorPromoteState.isPromotingFunction}
808
+ open={activatorPromoteState.isActivatingFunction}
816
809
  onClose={closeModal}
817
810
  classes={{ container: 'search-modal__container' }}
818
811
  PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
@@ -823,7 +816,7 @@ const FunctionPromoteEditor = observer(
823
816
  Select any one of the following activator types to continue
824
817
  </div>
825
818
  <div className="function-promote-editor__content__activator-types">
826
- {Object.values(FUNCTION_PROMOTE_TYPE).map((type) =>
819
+ {Object.values(FUNCTION_ACTIVATE_TYPE).map((type) =>
827
820
  renderFunctionPromoteTypes(type),
828
821
  )}
829
822
  </div>
@@ -850,18 +843,18 @@ const FunctionPromoteEditor = observer(
850
843
  <ModalFooterButton
851
844
  className=" function-promote-editor__action-btn function-promote-editor__action-btn--primitive"
852
845
  disabled={
853
- !activatorPromoteState.promoteType ||
854
- !validateFunctionActivator(activatorPromoteState.promoteType)
846
+ !activatorPromoteState.activateType ||
847
+ !validateFunctionActivator(activatorPromoteState.activateType)
855
848
  }
856
849
  title={
857
- activatorPromoteState.promoteType &&
858
- validateFunctionActivator(activatorPromoteState.promoteType)
850
+ activatorPromoteState.activateType &&
851
+ validateFunctionActivator(activatorPromoteState.activateType)
859
852
  ? ''
860
853
  : validationMessage
861
854
  }
862
855
  onClick={promoteFunction}
863
856
  >
864
- Promote
857
+ Activate
865
858
  </ModalFooterButton>
866
859
  </ModalFooter>
867
860
  </Modal>
@@ -1060,91 +1053,6 @@ const FunctionDefinitionEditor = observer(
1060
1053
  },
1061
1054
  );
1062
1055
 
1063
- const FunctionActivatorContentBuilder = observer(
1064
- (props: {
1065
- functionEditorState: FunctionEditorState;
1066
- valueBuilderState: ProtocolValueBuilderState;
1067
- }) => {
1068
- const { functionEditorState, valueBuilderState } = props;
1069
- const builderState = functionEditorState.activatorBuilderState;
1070
-
1071
- // name
1072
- const nameInputRef = useRef<HTMLInputElement>(null);
1073
- const nameValidationErrorMessage =
1074
- builderState.activatorName.length === 0
1075
- ? 'Element name cannot be empty'
1076
- : builderState.isDuplicated
1077
- ? `Element of the same path already existed`
1078
- : undefined;
1079
- useEffect(() => {
1080
- nameInputRef.current?.focus();
1081
- nameInputRef.current?.select();
1082
- }, [valueBuilderState]);
1083
-
1084
- // function
1085
- const functionFieldProperty = returnUndefOnError(() =>
1086
- getClassProperty(valueBuilderState.type, 'function'),
1087
- );
1088
- const functionFieldDocumentation = functionFieldProperty
1089
- ? extractAnnotatedElementDocumentation(functionFieldProperty)
1090
- : undefined;
1091
-
1092
- return (
1093
- <>
1094
- <div className="panel__content__form">
1095
- <div className="panel__content__form__section">
1096
- <div className="panel__content__form__section__header__label">
1097
- Name
1098
- </div>
1099
- <div className="input-group">
1100
- <input
1101
- className="panel__content__form__section__input"
1102
- spellCheck={false}
1103
- ref={nameInputRef}
1104
- value={builderState.activatorName}
1105
- onChange={(event) =>
1106
- builderState.setActivatorName(event.target.value)
1107
- }
1108
- />
1109
- {nameValidationErrorMessage && (
1110
- <div className="input-group__error-message">
1111
- {nameValidationErrorMessage}
1112
- </div>
1113
- )}
1114
- </div>
1115
- </div>
1116
- <div className="panel__content__form__section">
1117
- <div className="panel__content__form__section__header__label">
1118
- Function
1119
- </div>
1120
- {functionFieldDocumentation && (
1121
- <div className="panel__content__form__section__header__prompt">
1122
- {functionFieldDocumentation}
1123
- </div>
1124
- )}
1125
- <input
1126
- className="panel__content__form__section__input"
1127
- spellCheck={false}
1128
- disabled={true}
1129
- value={generateFunctionPrettyName(
1130
- functionEditorState.functionElement,
1131
- {
1132
- fullPath: true,
1133
- spacing: false,
1134
- },
1135
- )}
1136
- />
1137
- </div>
1138
- <div className="panel__content__form__section">
1139
- <div className="panel__content__form__section__divider"></div>
1140
- </div>
1141
- </div>
1142
- <ProtocolValueBuilder builderState={valueBuilderState} />
1143
- </>
1144
- );
1145
- },
1146
- );
1147
-
1148
1056
  export const FunctionEditor = observer(() => {
1149
1057
  const editorStore = useEditorStore();
1150
1058
  const applicationStore = useApplicationStore();
@@ -1245,12 +1153,6 @@ export const FunctionEditor = observer(() => {
1245
1153
  (): void =>
1246
1154
  functionEditorState.setSelectedTab(tab);
1247
1155
 
1248
- const activate = (): void => {
1249
- flowResult(functionEditorState.activatorBuilderState.activate()).catch(
1250
- applicationStore.alertUnhandledError,
1251
- );
1252
- };
1253
-
1254
1156
  const runFunc = applicationStore.guardUnhandledError(() =>
1255
1157
  flowResult(functionEditorState.handleRunFunc()),
1256
1158
  );
@@ -1368,10 +1270,15 @@ export const FunctionEditor = observer(() => {
1368
1270
  }
1369
1271
  });
1370
1272
 
1371
- const openFunctionPromoteModal = (): void => {
1372
- functionEditorState.activatorPromoteState.showFunctionPromoteModal();
1273
+ const openFunctionActivateModal = (): void => {
1274
+ functionEditorState.activatorPromoteState.showFunctionActivateModal();
1373
1275
  };
1374
-
1276
+ // tabs
1277
+ const functionTabs = Object.values(FUNCTION_EDITOR_TAB).filter(
1278
+ (val) =>
1279
+ val !== FUNCTION_EDITOR_TAB.TEST_SUITES ||
1280
+ editorStore.applicationStore.config.options.NonProductionFeatureFlag,
1281
+ );
1375
1282
  return (
1376
1283
  <div
1377
1284
  data-testid={LEGEND_STUDIO_TEST_ID.FUNCTION_EDITOR}
@@ -1393,7 +1300,7 @@ export const FunctionEditor = observer(() => {
1393
1300
  </div>
1394
1301
  <div className="panel__header function-editor__tabs__header">
1395
1302
  <div className="function-editor__tabs">
1396
- {Object.values(FUNCTION_EDITOR_TAB).map((tab) => (
1303
+ {functionTabs.map((tab) => (
1397
1304
  <div
1398
1305
  key={tab}
1399
1306
  onClick={changeTab(tab)}
@@ -1481,147 +1388,16 @@ export const FunctionEditor = observer(() => {
1481
1388
  <div className="btn__dropdown-combo btn__dropdown-combo--primary">
1482
1389
  <button
1483
1390
  className="btn__dropdown-combo__label"
1484
- onClick={openFunctionPromoteModal}
1485
- title="Promote function"
1391
+ onClick={openFunctionActivateModal}
1392
+ title="Activate function"
1486
1393
  tabIndex={-1}
1487
1394
  >
1488
1395
  <RocketIcon className="btn__dropdown-combo__label__icon" />
1489
- <div className="btn__dropdown-combo__label__title">Promote</div>
1396
+ <div className="btn__dropdown-combo__label__title">
1397
+ Activate
1398
+ </div>
1490
1399
  </button>
1491
1400
  </div>
1492
- {editorStore.applicationStore.config.options
1493
- .TEMPORARY__enableFunctionActivatorSupport && (
1494
- <>
1495
- <DropdownMenu
1496
- className="btn__dropdown-combo"
1497
- disabled={
1498
- !editorStore.graphState.functionActivatorConfigurations
1499
- .length
1500
- }
1501
- content={
1502
- <MenuContent>
1503
- {editorStore.graphState.functionActivatorConfigurations.map(
1504
- (config) => (
1505
- <MenuContentItem
1506
- key={config.uuid}
1507
- className="function-editor__activator__selector__option"
1508
- onClick={() =>
1509
- functionEditorState.activatorBuilderState.setCurrentActivatorConfiguration(
1510
- config,
1511
- )
1512
- }
1513
- title={config.description}
1514
- >
1515
- <div className="function-editor__activator__selector__option__name">
1516
- {config.name}
1517
- </div>
1518
- <div className="function-editor__activator__selector__option__description">
1519
- {config.description}
1520
- </div>
1521
- </MenuContentItem>
1522
- ),
1523
- )}
1524
- </MenuContent>
1525
- }
1526
- menuProps={{
1527
- anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
1528
- transformOrigin: { vertical: 'top', horizontal: 'right' },
1529
- }}
1530
- >
1531
- <div className="btn__dropdown-combo__label">
1532
- <div className="btn__dropdown-combo__label__icon">
1533
- <LaunchIcon />
1534
- </div>
1535
- <div className="btn__dropdown-combo__label__title">
1536
- Activate
1537
- </div>
1538
- </div>
1539
- <div className="btn__dropdown-combo__dropdown-btn">
1540
- <CaretDownIcon />
1541
- </div>
1542
- </DropdownMenu>
1543
- {functionEditorState.activatorBuilderState
1544
- .currentActivatorConfiguration && (
1545
- <Dialog
1546
- open={Boolean(
1547
- functionEditorState.activatorBuilderState
1548
- .currentActivatorConfiguration,
1549
- )}
1550
- onClose={() =>
1551
- functionEditorState.activatorBuilderState.setCurrentActivatorConfiguration(
1552
- undefined,
1553
- )
1554
- }
1555
- classes={{
1556
- root: 'editor-modal__root-container',
1557
- container: 'editor-modal__container',
1558
- paper: 'editor-modal__content',
1559
- }}
1560
- // NOTE: this is a safer way compared to using <form> as it will not trigger click event
1561
- // on nested button
1562
- // See https://stackoverflow.com/questions/11353105/why-browser-trigger-a-click-event-instead-of-a-submit-in-a-form
1563
- // See https://stackoverflow.com/questions/3350247/how-to-prevent-form-from-being-submitted
1564
- // See https://gomakethings.com/how-to-prevent-buttons-from-causing-a-form-to-submit-with-html/
1565
- onKeyDown={(event) => {
1566
- if (event.code === 'Enter' && !event.shiftKey) {
1567
- event.preventDefault();
1568
- activate();
1569
- }
1570
- }}
1571
- >
1572
- <Modal darkMode={true} className="editor-modal">
1573
- <ModalHeader>
1574
- <ModalTitle
1575
- title={`Function Activator: ${functionEditorState.activatorBuilderState.currentActivatorConfiguration.name}`}
1576
- />
1577
- </ModalHeader>
1578
- <ModalBody>
1579
- <div className="function-editor__activator-builder">
1580
- {functionEditorState.activatorBuilderState
1581
- .functionActivatorProtocolValueBuilderState && (
1582
- <FunctionActivatorContentBuilder
1583
- functionEditorState={functionEditorState}
1584
- valueBuilderState={
1585
- functionEditorState.activatorBuilderState
1586
- .functionActivatorProtocolValueBuilderState
1587
- }
1588
- />
1589
- )}
1590
- {!functionEditorState.activatorBuilderState
1591
- .functionActivatorProtocolValueBuilderState && (
1592
- <BlankPanelContent>
1593
- No activator chosen
1594
- </BlankPanelContent>
1595
- )}
1596
- </div>
1597
- </ModalBody>
1598
- <ModalFooter>
1599
- <button
1600
- className="btn btn--dark function-editor__activator__btn"
1601
- type="submit"
1602
- disabled={
1603
- !functionEditorState.activatorBuilderState.isValid
1604
- }
1605
- onClick={activate}
1606
- >
1607
- Activate
1608
- </button>
1609
- <button
1610
- className="btn btn--dark"
1611
- onClick={() =>
1612
- functionEditorState.activatorBuilderState.setCurrentActivatorConfiguration(
1613
- undefined,
1614
- )
1615
- }
1616
- >
1617
- Close
1618
- </button>
1619
- </ModalFooter>
1620
- </Modal>
1621
- </Dialog>
1622
- )}
1623
- </>
1624
- )}
1625
1401
  <button
1626
1402
  className="panel__header__action"
1627
1403
  disabled={
@@ -1684,6 +1460,13 @@ export const FunctionEditor = observer(() => {
1684
1460
  ))}
1685
1461
  </div>
1686
1462
  )}
1463
+ {selectedTab === FUNCTION_EDITOR_TAB.TEST_SUITES && (
1464
+ <FunctionTestableEditor
1465
+ functionTestableState={
1466
+ functionEditorState.functionTestableEditorState
1467
+ }
1468
+ />
1469
+ )}
1687
1470
  <ExecutionPlanViewer
1688
1471
  executionPlanState={functionEditorState.executionPlanState}
1689
1472
  />
@@ -1699,7 +1482,7 @@ export const FunctionEditor = observer(() => {
1699
1482
  />
1700
1483
  )}
1701
1484
  </PanelContent>
1702
- {functionEditorState.activatorPromoteState.isPromotingFunction && (
1485
+ {functionEditorState.activatorPromoteState.isActivatingFunction && (
1703
1486
  <FunctionPromoteEditor
1704
1487
  functionElement={functionElement}
1705
1488
  activatorPromoteState={functionEditorState.activatorPromoteState}
@@ -27,7 +27,6 @@ import {
27
27
  CustomSelectorInput,
28
28
  createFilter,
29
29
  type SelectComponent,
30
- QuestionCircleIcon,
31
30
  } from '@finos/legend-art';
32
31
  import {
33
32
  type PackageableConnection,
@@ -130,7 +129,7 @@ export const SnowflakeAppFunctionActivatorEditor = observer(() => {
130
129
  );
131
130
  };
132
131
  const deploy = (): void => {
133
- flowResult(editorState.deploy()).catch(
132
+ flowResult(editorState.deployToSandbox()).catch(
134
133
  applicationStore.alertUnhandledError,
135
134
  );
136
135
  };
@@ -152,25 +151,19 @@ export const SnowflakeAppFunctionActivatorEditor = observer(() => {
152
151
  </div>
153
152
  <div className="snowflake-app-function-activator-editor__header__actions">
154
153
  <button
155
- className="snowflake-app-function-activator-editor__header__actions__action"
154
+ className="snowflake-app-function-activator-editor__header__actions__action snowflake-app-function-activator-editor__header__actions__action--primary"
156
155
  onClick={validate}
157
156
  disabled={editorState.validateState.isInProgress}
158
157
  tabIndex={-1}
159
158
  title="Click Validate to verify your activator before deployment"
160
159
  >
161
160
  Validate
162
- <QuestionCircleIcon
163
- title="Click Validate to verify your activator before deployment"
164
- className={
165
- 'snowflake-app-function-activator-editor__header__actions__action__icon'
166
- }
167
- />
168
161
  </button>
169
162
  <button
170
163
  className="snowflake-app-function-activator-editor__header__actions__action snowflake-app-function-activator-editor__header__actions__action--primary"
171
164
  onClick={deploy}
172
165
  disabled={editorState.deployState.isInProgress}
173
- title="Publish to sandbox"
166
+ title="Deploy to sandbox"
174
167
  tabIndex={-1}
175
168
  >
176
169
  Deploy