From 26828df2376a8989ac829e94a6c530cd9704f076 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 2 Jul 2018 15:15:23 -0700 Subject: [PATCH] SHIBUI-579 Added metadata filters --- ui/src/app/schema-form/registry.ts | 12 ++--- ui/src/app/schema-form/schema-form.module.ts | 6 ++- .../widget/array/array.component.html | 23 ++++++++ .../widget/array/array.component.ts | 9 ++++ .../widget/check/checkbox.component.html | 53 +++++++++++++------ .../widget/select/select.component.html | 4 +- .../widget/textarea/textarea.component.html | 21 ++++++++ .../widget/textarea/textarea.component.ts | 9 ++++ .../filebacked-http-filters.schema.json | 15 +++--- 9 files changed, 121 insertions(+), 31 deletions(-) create mode 100644 ui/src/app/schema-form/widget/array/array.component.html create mode 100644 ui/src/app/schema-form/widget/array/array.component.ts create mode 100644 ui/src/app/schema-form/widget/textarea/textarea.component.html create mode 100644 ui/src/app/schema-form/widget/textarea/textarea.component.ts diff --git a/ui/src/app/schema-form/registry.ts b/ui/src/app/schema-form/registry.ts index 904377313..d197dcf2c 100644 --- a/ui/src/app/schema-form/registry.ts +++ b/ui/src/app/schema-form/registry.ts @@ -4,18 +4,17 @@ import { CustomStringComponent } from './widget/text/string.component'; import { WidgetRegistry } from 'ngx-schema-form'; -import { ArrayWidget } from 'ngx-schema-form'; import { ButtonWidget } from 'ngx-schema-form'; -import { CheckboxWidget } from 'ngx-schema-form'; import { FileWidget } from 'ngx-schema-form'; import { IntegerWidget } from 'ngx-schema-form'; import { ObjectWidget } from 'ngx-schema-form'; import { RadioWidget } from 'ngx-schema-form'; import { RangeWidget } from 'ngx-schema-form'; -import { TextAreaWidget } from 'ngx-schema-form'; import { CustomSelectComponent } from './widget/select/select.component'; import { DatalistComponent } from './widget/datalist/datalist.component'; import { CustomCheckboxComponent } from './widget/check/checkbox.component'; +import { CustomTextAreaComponent } from './widget/textarea/textarea.component'; +import { CustomArrayComponent } from './widget/array/array.component'; export class CustomWidgetRegistry extends WidgetRegistry { @@ -35,24 +34,25 @@ export class CustomWidgetRegistry extends WidgetRegistry { this.register('time', CustomStringComponent); this.register('boolean-radio', BooleanRadioComponent); + this.register('fieldset', FieldsetComponent); + this.register('array', CustomArrayComponent); this.register('select', CustomSelectComponent); this.register('boolean', CustomCheckboxComponent); this.register('checkbox', CustomCheckboxComponent); + this.register('textarea', CustomTextAreaComponent); + this.register('datalist', DatalistComponent); /* NGX-Form */ - this.register('array', ArrayWidget); this.register('object', ObjectWidget); this.register('integer', IntegerWidget); this.register('number', IntegerWidget); this.register('range', RangeWidget); - this.register('textarea', TextAreaWidget); - this.register('file', FileWidget); this.register('radio', RadioWidget); diff --git a/ui/src/app/schema-form/schema-form.module.ts b/ui/src/app/schema-form/schema-form.module.ts index 89dc8ffc3..d51ae2269 100644 --- a/ui/src/app/schema-form/schema-form.module.ts +++ b/ui/src/app/schema-form/schema-form.module.ts @@ -12,6 +12,8 @@ import { SharedModule } from '../shared/shared.module'; import { CustomSelectComponent } from './widget/select/select.component'; import { DatalistComponent } from './widget/datalist/datalist.component'; import { CustomCheckboxComponent } from './widget/check/checkbox.component'; +import { CustomTextAreaComponent } from './widget/textarea/textarea.component'; +import { CustomArrayComponent } from './widget/array/array.component'; export const COMPONENTS = [ BooleanRadioComponent, @@ -19,7 +21,9 @@ export const COMPONENTS = [ CustomStringComponent, CustomSelectComponent, DatalistComponent, - CustomCheckboxComponent + CustomCheckboxComponent, + CustomTextAreaComponent, + CustomArrayComponent ]; @NgModule({ diff --git a/ui/src/app/schema-form/widget/array/array.component.html b/ui/src/app/schema-form/widget/array/array.component.html new file mode 100644 index 000000000..577c084f9 --- /dev/null +++ b/ui/src/app/schema-form/widget/array/array.component.html @@ -0,0 +1,23 @@ +
+
+ +   + +
+
+
+ +
+ +
+
+
+ {{schema.description}} +
\ No newline at end of file diff --git a/ui/src/app/schema-form/widget/array/array.component.ts b/ui/src/app/schema-form/widget/array/array.component.ts new file mode 100644 index 000000000..52987cda7 --- /dev/null +++ b/ui/src/app/schema-form/widget/array/array.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +import { ArrayWidget } from 'ngx-schema-form'; + +@Component({ + selector: 'array-component', + templateUrl: `./array.component.html` +}) +export class CustomArrayComponent extends ArrayWidget {} diff --git a/ui/src/app/schema-form/widget/check/checkbox.component.html b/ui/src/app/schema-form/widget/check/checkbox.component.html index 7ce7eba62..4c2745660 100644 --- a/ui/src/app/schema-form/widget/check/checkbox.component.html +++ b/ui/src/app/schema-form/widget/check/checkbox.component.html @@ -1,18 +1,27 @@
- -
- -
- + +
+
+ + + +
+
+ {{ schema.description }} + +
+
+
+
-
\ No newline at end of file + + \ No newline at end of file diff --git a/ui/src/app/schema-form/widget/select/select.component.html b/ui/src/app/schema-form/widget/select/select.component.html index 831a7e852..7b4bf8173 100644 --- a/ui/src/app/schema-form/widget/select/select.component.html +++ b/ui/src/app/schema-form/widget/select/select.component.html @@ -1,7 +1,7 @@
-
\ No newline at end of file diff --git a/ui/src/app/schema-form/widget/textarea/textarea.component.ts b/ui/src/app/schema-form/widget/textarea/textarea.component.ts new file mode 100644 index 000000000..6586d7d1f --- /dev/null +++ b/ui/src/app/schema-form/widget/textarea/textarea.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +import { TextAreaWidget } from 'ngx-schema-form'; + +@Component({ + selector: 'textarea-component', + templateUrl: `./textarea.component.html` +}) +export class CustomTextAreaComponent extends TextAreaWidget {} diff --git a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json index 2b3d32846..884b8b89e 100644 --- a/ui/src/assets/schema/provider/filebacked-http-filters.schema.json +++ b/ui/src/assets/schema/provider/filebacked-http-filters.schema.json @@ -15,7 +15,7 @@ "properties": { "maxValidityInterval": { "title": "Max Validity Interval", - "description": "", + "description": "Max Validity Interval", "type": "number" } } @@ -29,14 +29,15 @@ "properties": { "requireSignedRoot": { "title": "Require Signed Root", - "description": "", + "description": "Require Signed Root", "type": "boolean", "default": true }, "certificateFile": { "title": "Certificate File", - "description": "", - "type": "string" + "description": "Certificate File", + "type": "string", + "widget": "textarea" } } }, @@ -49,7 +50,7 @@ "properties": { "retainedRoles": { "title": "Retained Roles", - "description": "", + "description": "Retained Roles", "type": "array", "items": { "widget": { @@ -74,13 +75,13 @@ }, "removeRolelessEntityDescriptors": { "title": "Remove Roleless Entity Descriptors?", - "description": "", + "description": "Remove Roleless Entity Descriptors?", "type": "boolean", "default": true }, "removeEmptyEntitiesDescriptors": { "title": "Remove Empty Entities Descriptors?", - "description": "", + "description": "Remove Empty Entities Descriptors?", "type": "boolean", "default": true }