From d80f0dbee9e690eef2251f25d26a28e449c2c1e8 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 6 Nov 2018 13:59:15 -0700 Subject: [PATCH] SHIBUI-704 Adding dynamic http provider type --- ui/src/app/metadata/provider/model/index.ts | 7 +++++-- ui/src/app/wizard/model/wizard.ts | 7 ++++++- ui/src/app/wizard/reducer/index.ts | 1 - .../assets/schema/provider/metadata-provider.schema.json | 6 ++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ui/src/app/metadata/provider/model/index.ts b/ui/src/app/metadata/provider/model/index.ts index cfb64a08d..adba253bc 100644 --- a/ui/src/app/metadata/provider/model/index.ts +++ b/ui/src/app/metadata/provider/model/index.ts @@ -1,12 +1,15 @@ import { FileBackedHttpMetadataProviderWizard } from './file-backed-http.provider.form'; import { FileBackedHttpMetadataProviderEditor } from './file-backed-http.provider.form'; +import { DynamicHttpMetadataProviderWizard, DynamicHttpMetadataProviderEditor } from './dynamic-http.provider.form'; export const MetadataProviderWizardTypes = [ - FileBackedHttpMetadataProviderWizard + FileBackedHttpMetadataProviderWizard, + DynamicHttpMetadataProviderWizard ]; export const MetadataProviderEditorTypes = [ - FileBackedHttpMetadataProviderEditor + FileBackedHttpMetadataProviderEditor, + DynamicHttpMetadataProviderEditor ]; export * from './file-backed-http.provider.form'; diff --git a/ui/src/app/wizard/model/wizard.ts b/ui/src/app/wizard/model/wizard.ts index 35ae220c6..33186ddeb 100644 --- a/ui/src/app/wizard/model/wizard.ts +++ b/ui/src/app/wizard/model/wizard.ts @@ -19,10 +19,15 @@ export interface WizardStep { export interface WizardFieldset { type: string; class?: string[]; - fields: string[]; + fields: (string | WizardFieldsubset)[]; } export interface WizardValue { key: string; value: any; } + +export interface WizardFieldsubset { + parent: string; + children: string[]; +} diff --git a/ui/src/app/wizard/reducer/index.ts b/ui/src/app/wizard/reducer/index.ts index 56054616c..30f00b18d 100644 --- a/ui/src/app/wizard/reducer/index.ts +++ b/ui/src/app/wizard/reducer/index.ts @@ -69,7 +69,6 @@ export const getSplitSchema = (schema: any, step: WizardStep) => { if (schema.definitions) { s.definitions = schema.definitions; } - if (required && required.length) { s.required = required; } diff --git a/ui/src/assets/schema/provider/metadata-provider.schema.json b/ui/src/assets/schema/provider/metadata-provider.schema.json index 6cd17323f..cf856b52f 100644 --- a/ui/src/assets/schema/provider/metadata-provider.schema.json +++ b/ui/src/assets/schema/provider/metadata-provider.schema.json @@ -28,6 +28,12 @@ "FileBackedHttpMetadataResolver" ], "description": "value.file-backed-http-metadata-provider" + }, + { + "enum": [ + "DynamicHttpMetadataResolver" + ], + "description": "value.dynamic-http-metadata-provider" } ] }