@finos/legend-application-studio 28.18.42 → 28.18.44

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 (22) hide show
  1. package/lib/components/editor/editor-group/function-activator/ActivatorFormComponents.d.ts +23 -0
  2. package/lib/components/editor/editor-group/function-activator/ActivatorFormComponents.d.ts.map +1 -0
  3. package/lib/components/editor/editor-group/function-activator/ActivatorFormComponents.js +34 -0
  4. package/lib/components/editor/editor-group/function-activator/ActivatorFormComponents.js.map +1 -0
  5. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.d.ts.map +1 -1
  6. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.js +76 -108
  7. package/lib/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.js.map +1 -1
  8. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js +4 -13
  10. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js.map +1 -1
  11. package/lib/index.css +1 -1
  12. package/lib/package.json +1 -1
  13. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.d.ts +8 -3
  14. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.d.ts.map +1 -1
  15. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.js +15 -10
  16. package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.js.map +1 -1
  17. package/package.json +6 -6
  18. package/src/components/editor/editor-group/function-activator/ActivatorFormComponents.tsx +97 -0
  19. package/src/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.tsx +347 -482
  20. package/src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx +7 -42
  21. package/src/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.ts +18 -11
  22. package/tsconfig.json +1 -0
@@ -34,7 +34,6 @@ import {
34
34
  generateFunctionPrettyName,
35
35
  RelationalDatabaseConnection,
36
36
  DatabaseType,
37
- DeploymentOwner,
38
37
  SnowflakePermissionScheme,
39
38
  } from '@finos/legend-graph';
40
39
  import { observer } from 'mobx-react-lite';
@@ -42,12 +41,12 @@ import { useApplicationStore } from '@finos/legend-application';
42
41
  import { useEditorStore } from '../../EditorStoreProvider.js';
43
42
  import { SnowflakeAppFunctionActivatorEdtiorState } from '../../../../stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js';
44
43
  import { flowResult } from 'mobx';
45
- import { useRef, useState } from 'react';
44
+ import { useRef } from 'react';
46
45
  import {
47
46
  type RelationalDatabaseConnectionOption,
48
47
  buildRelationalDatabaseConnectionOption,
49
48
  } from '../connection-editor/RelationalDatabaseConnectionEditor.js';
50
- import { activator_setDeploymentOwner } from '../../../../stores/graph-modifier/DSL_FunctionActivator_GraphModifierHelper.js';
49
+ import { ActivatorOwnershipForm } from './ActivatorFormComponents.js';
51
50
 
52
51
  export const SnowflakeAppFunctionActivatorEditor = observer(() => {
53
52
  const editorStore = useEditorStore();
@@ -57,7 +56,7 @@ export const SnowflakeAppFunctionActivatorEditor = observer(() => {
57
56
  );
58
57
  const isReadOnly = editorState.isReadOnly;
59
58
  const activator = editorState.activator;
60
- const ownership = activator.ownership;
59
+
61
60
  const connectionSelectorRef = useRef<SelectComponent>(null);
62
61
  const connectionFilterOption = createFilter({
63
62
  ignoreCase: true,
@@ -140,17 +139,6 @@ export const SnowflakeAppFunctionActivatorEditor = observer(() => {
140
139
  );
141
140
  };
142
141
 
143
- //Ownership
144
- const [ownerInputValue, setOwner] = useState<string>(activator.ownership.id);
145
- const updateDeploymentIdentifier: React.ChangeEventHandler<
146
- HTMLInputElement
147
- > = (event) => {
148
- if (!isReadOnly) {
149
- setOwner(event.target.value);
150
- activator_setDeploymentOwner(ownership, event.target.value);
151
- }
152
- };
153
-
154
142
  return (
155
143
  <div className="snowflake-app-function-activator-editor">
156
144
  <Panel>
@@ -330,33 +318,10 @@ export const SnowflakeAppFunctionActivatorEditor = observer(() => {
330
318
  </div>
331
319
  </PanelForm>
332
320
  <PanelForm>
333
- <div>
334
- <div className="panel__content__form__section">
335
- <div className="panel__content__form__section__header__label">
336
- Ownership
337
- </div>
338
- <div className="panel__content__form__section__header__prompt">
339
- The ownership model you want to use to control your snowflake
340
- app.
341
- </div>
342
- </div>
343
- {ownership instanceof DeploymentOwner && (
344
- <div className="panel__content__form__section">
345
- <div>
346
- <div className="panel__content__form__section__header__label">
347
- Deployment Identifier :
348
- </div>
349
- <input
350
- className="panel__content__form__section__input"
351
- spellCheck={false}
352
- disabled={isReadOnly}
353
- value={ownerInputValue}
354
- onChange={updateDeploymentIdentifier}
355
- />
356
- </div>
357
- </div>
358
- )}
359
- </div>
321
+ <ActivatorOwnershipForm
322
+ activator={activator}
323
+ isReadOnly={isReadOnly}
324
+ />
360
325
  </PanelForm>
361
326
  </PanelContent>
362
327
  </Panel>
@@ -28,14 +28,14 @@ import {
28
28
  guaranteeType,
29
29
  type PlainObject,
30
30
  } from '@finos/legend-shared';
31
- import { makeObservable, action, flow, computed } from 'mobx';
31
+ import { makeObservable, action, flow, computed, observable } from 'mobx';
32
32
  import type { EditorStore } from '../../../EditorStore.js';
33
33
  import { ElementEditorState } from '../ElementEditorState.js';
34
34
  import { activator_setOwnership } from '../../../../graph-modifier/DSL_FunctionActivator_GraphModifierHelper.js';
35
35
  import { User } from '@finos/legend-server-sdlc';
36
36
 
37
37
  //Ownership
38
- enum HostedServiceOwnershipType {
38
+ export enum HostedServiceOwnershipType {
39
39
  DEPLOYMENT_OWNERSHIP = 'deploymentOwnership',
40
40
  USERLIST_OWNERSHIP = 'userListOwnership',
41
41
  }
@@ -48,12 +48,14 @@ export const OWNERSHIP_OPTIONS = [
48
48
  label: DeploymentOwnershipLabel,
49
49
  value: HostedServiceOwnershipType.DEPLOYMENT_OWNERSHIP,
50
50
  },
51
- {
52
- label: UserlistOwnershipLabel,
53
- value: HostedServiceOwnershipType.USERLIST_OWNERSHIP,
54
- },
55
51
  ];
56
52
 
53
+ export enum ACTIVATOR_EDITOR_TAB {
54
+ DEFINITION = 'DEFINITION',
55
+ TAGGED_VALUES = 'TAGGED_VALUES',
56
+ STEREOTYPES = 'STEREOTYPES',
57
+ }
58
+
57
59
  export type HostedServiceOwnerOption = {
58
60
  label: string;
59
61
  value: string;
@@ -63,6 +65,8 @@ export class HostedServiceFunctionActivatorEditorState extends ElementEditorStat
63
65
  readonly validateState = ActionState.create();
64
66
  readonly deployState = ActionState.create();
65
67
 
68
+ selectedTab: ACTIVATOR_EDITOR_TAB;
69
+
66
70
  constructor(editorStore: EditorStore, element: HostedService) {
67
71
  super(editorStore, element);
68
72
 
@@ -74,11 +78,18 @@ export class HostedServiceFunctionActivatorEditorState extends ElementEditorStat
74
78
  setSelectedOwnership: action,
75
79
  selectedOwnership: computed,
76
80
  storeModel: action,
77
- generateLineage: action,
78
81
  validate: flow,
79
82
  deployToSandbox: flow,
80
83
  searchUsers: flow,
84
+ selectedTab: observable,
85
+ setSelectedTab: action,
81
86
  });
87
+
88
+ this.selectedTab = ACTIVATOR_EDITOR_TAB.DEFINITION;
89
+ }
90
+
91
+ setSelectedTab(tab: ACTIVATOR_EDITOR_TAB): void {
92
+ this.selectedTab = tab;
82
93
  }
83
94
 
84
95
  get activator(): HostedService {
@@ -103,10 +114,6 @@ export class HostedServiceFunctionActivatorEditorState extends ElementEditorStat
103
114
  this.activator.storeModel = val;
104
115
  }
105
116
 
106
- generateLineage(val: boolean): void {
107
- this.activator.generateLineage = val;
108
- }
109
-
110
117
  get selectedOwnership(): HostedServiceOwnerOption | undefined {
111
118
  const ownership = this.activator.ownership;
112
119
  if (ownership instanceof DeploymentOwner) {
package/tsconfig.json CHANGED
@@ -254,6 +254,7 @@
254
254
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.tsx",
255
255
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx",
256
256
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.tsx",
257
+ "./src/components/editor/editor-group/function-activator/ActivatorFormComponents.tsx",
257
258
  "./src/components/editor/editor-group/function-activator/FunctionEditor.tsx",
258
259
  "./src/components/editor/editor-group/function-activator/HostedServiceFunctionActivatorEditor.tsx",
259
260
  "./src/components/editor/editor-group/function-activator/INTERNAL__UnknownFunctionActivatorEdtior.tsx",