Ivan Galakhov 4 лет назад
Родитель
Сommit
63a09a430d

+ 3 - 0
dashboard/src/components/form-refactor/PorterForm.tsx

@@ -23,6 +23,7 @@ import ArrayInput from "./field-components/ArrayInput";
 import Select from "./field-components/Select";
 import Select from "./field-components/Select";
 import ServiceIPList from "./field-components/ServiceIPList";
 import ServiceIPList from "./field-components/ServiceIPList";
 import ResourceList from "./field-components/ResourceList";
 import ResourceList from "./field-components/ResourceList";
+import VeleroForm from "../forms/VeleroForm";
 
 
 interface Props {
 interface Props {
   leftTabOptions?: TabOption[];
   leftTabOptions?: TabOption[];
@@ -67,6 +68,8 @@ const PorterForm: React.FC<Props> = (props) => {
         return <ServiceIPList {...(bundledProps as ServiceIPListField)} />;
         return <ServiceIPList {...(bundledProps as ServiceIPListField)} />;
       case "resource-list":
       case "resource-list":
         return <ResourceList {...(bundledProps as ResourceListField)} />;
         return <ResourceList {...(bundledProps as ResourceListField)} />;
+      case "velero-create-backup":
+        return <VeleroForm />;
     }
     }
     return <p>Not Implemented: {(field as any).type}</p>;
     return <p>Not Implemented: {(field as any).type}</p>;
   };
   };

+ 2 - 1
dashboard/src/components/form-refactor/PorterFormContextProvider.tsx

@@ -259,7 +259,8 @@ export const PorterFormContextProvider: React.FC<Props> = (props) => {
             field.type == "heading" ||
             field.type == "heading" ||
             field.type == "subtitle" ||
             field.type == "subtitle" ||
             field.type == "resource-list" ||
             field.type == "resource-list" ||
-            field.type == "service-ip-list"
+            field.type == "service-ip-list" ||
+            field.type == "velero-create-backup"
           )
           )
             return;
             return;
           if (field.required) {
           if (field.required) {

+ 6 - 1
dashboard/src/components/form-refactor/types.ts

@@ -35,6 +35,10 @@ export interface ResourceListField extends GenericField {
   value: any[];
   value: any[];
 }
 }
 
 
+export interface VeleroBackupField extends GenericField {
+  type: "velero-create-backup";
+}
+
 export interface InputField extends GenericInputField {
 export interface InputField extends GenericInputField {
   type: "input";
   type: "input";
   label?: string;
   label?: string;
@@ -87,7 +91,8 @@ export interface SelectField extends GenericInputField {
 }
 }
 
 
 export type FormField = HeadingField|SubtitleField|InputField|CheckboxField
 export type FormField = HeadingField|SubtitleField|InputField|CheckboxField
-  |KeyValueArrayField|ArrayInputField|SelectField|ServiceIPListField|ResourceListField;
+  |KeyValueArrayField|ArrayInputField|SelectField|ServiceIPListField|ResourceListField
+  |VeleroBackupField;
 
 
 export interface ShowIfAnd {
 export interface ShowIfAnd {
   and: ShowIf[];
   and: ShowIf[];