Explorar el Código

Setup execution payload from refactored execution options

Daniel Vincze hace 1 año
padre
commit
d1c2d65a35
Se han modificado 2 ficheros con 4 adiciones y 10 borrados
  1. 3 3
      src/components/smart/WizardPage/WizardPage.tsx
  2. 1 7
      src/sources/WizardSource.ts

+ 3 - 3
src/components/smart/WizardPage/WizardPage.tsx

@@ -26,7 +26,7 @@ import { WizardNetworksChangeObject } from "@src/components/modules/WizardModule
 import WizardPageContent from "@src/components/modules/WizardModule/WizardPageContent";
 import Modal from "@src/components/ui/Modal";
 import endpointStore from "@src/stores/EndpointStore";
-import { executeOptionsWithExecuteNow, deploymentFields, providerTypes, wizardPages } from "@src/constants";
+import { executeOptionsWithExecuteNow, deploymentFields, providerTypes, wizardPages, executionOptions } from "@src/constants";
 import instanceStore from "@src/stores/InstanceStore";
 import minionPoolStore from "@src/stores/MinionPoolStore";
 import networkStore from "@src/stores/NetworkStore";
@@ -793,7 +793,7 @@ class WizardPage extends React.Component<Props, State> {
   }
 
   executeCreatedTransfer(transfer: TransferItem) {
-    const options = wizardStore.data.destOptions;
+    const options = wizardStore.data.executeOptions;
     let executeNow = true;
     if (options && options.execute_now != null) {
       executeNow = options.execute_now;
@@ -802,7 +802,7 @@ class WizardPage extends React.Component<Props, State> {
       return;
     }
 
-    const executeNowOptions = executeOptionsWithExecuteNow.map(field => {
+    const executeNowOptions = executionOptions.map(field => {
       const value = wizardStore.data.executeOptions?.[field.name];
       if (value != null) {
         return { name: field.name, value };

+ 1 - 7
src/sources/WizardSource.ts

@@ -24,7 +24,7 @@ import type { InstanceScript } from "@src/@types/Instance";
 import DefaultOptionsSchemaParser from "@src/plugins/default/OptionsSchemaPlugin";
 import { ActionItem } from "@src/@types/MainItem";
 import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/modules/WizardModule/WizardOptions";
-import { deploymentFields, executionOptions } from "@src/constants";
+import { deploymentFields } from "@src/constants";
 
 class WizardSource {
   async create(opts: {
@@ -106,12 +106,6 @@ class WizardSource {
       );
     }
 
-    executionOptions.forEach(option => {
-      if (data.executeOptions && data.executeOptions[option.name] !== undefined) {
-        payload[option.name] = data.executeOptions[option.name];
-      }
-    });
-
     deploymentFields.forEach(option => {
       if (data.executeOptions && data.executeOptions[option.name] !== undefined) {
         payload[option.name] = data.executeOptions[option.name];