From 0fd30ce9290abd02f4ddc524ebf7ff9626fd1b84 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Fri, 9 Nov 2018 09:01:52 -0700 Subject: [PATCH] SHIBUI-701 integrated with schema endpoint for retrieving --- .../provider/effect/collection.effect.ts | 24 ++++++++++++++++++- .../model/file-system.provider.form.ts | 10 ++++---- .../widget/select/select.component.html | 11 ++++++++- .../widget/select/select.component.ts | 16 +++++++++++++ .../provider/metadata-provider.schema.json | 19 +++------------ 5 files changed, 57 insertions(+), 23 deletions(-) diff --git a/ui/src/app/metadata/provider/effect/collection.effect.ts b/ui/src/app/metadata/provider/effect/collection.effect.ts index 73ce52ea5..5ac47c647 100644 --- a/ui/src/app/metadata/provider/effect/collection.effect.ts +++ b/ui/src/app/metadata/provider/effect/collection.effect.ts @@ -37,6 +37,9 @@ import { ClearProvider, ResetChanges } from '../action/entity.action'; import { ShowContentionAction } from '../../../contention/action/contention.action'; import { ContentionService } from '../../../contention/service/contention.service'; import { MetadataProvider } from '../../domain/model'; +import { AddNotification } from '../../../notification/action/notification.action'; +import { Notification, NotificationType } from '../../../notification/model/notification'; +import { WizardActionTypes, SetDisabled } from '../../../wizard/action/wizard.action'; /* istanbul ignore next */ @@ -96,11 +99,30 @@ export class CollectionEffects { .save(provider) .pipe( map(p => new AddProviderSuccess(p)), - catchError((e) => of(new AddProviderFail(e))) + catchError((e) => of(new AddProviderFail(e.error))) ) ) ); + @Effect() + createProviderFailDispatchNotification$ = this.actions$.pipe( + ofType(ProviderCollectionActionTypes.ADD_PROVIDER_FAIL), + map(action => action.payload), + map(error => new AddNotification( + new Notification( + NotificationType.Danger, + `${error.errorCode}: ${ error.errorMessage }`, + 8000 + ) + )) + ); + @Effect() + createProviderFailEnableForm$ = this.actions$.pipe( + ofType(ProviderCollectionActionTypes.ADD_PROVIDER_FAIL), + map(action => action.payload), + map(error => new SetDisabled(false)) + ); + @Effect({ dispatch: false }) createProviderSuccessRedirect$ = this.actions$.pipe( ofType(ProviderCollectionActionTypes.ADD_PROVIDER_SUCCESS), diff --git a/ui/src/app/metadata/provider/model/file-system.provider.form.ts b/ui/src/app/metadata/provider/model/file-system.provider.form.ts index e84e79aa4..ea4713106 100644 --- a/ui/src/app/metadata/provider/model/file-system.provider.form.ts +++ b/ui/src/app/metadata/provider/model/file-system.provider.form.ts @@ -4,8 +4,8 @@ import { BaseMetadataProviderEditor } from './base.provider.form'; export const FileSystemMetadataProviderWizard: Wizard = { ...BaseMetadataProviderEditor, - label: 'FileSystemMetadataProvider', - type: 'FileSystemMetadataResolver', + label: 'FilesystemMetadataProvider', + type: 'FilesystemMetadataResolver', getValidators(namesList: string[] = [], xmlIdList: string[] = []): any { const validators = BaseMetadataProviderEditor.getValidators(namesList); validators['/xmlId'] = (value, property, form) => { @@ -25,7 +25,7 @@ export const FileSystemMetadataProviderWizard: Wizard{{ schema.placeholder }} {{ schema.title }} - + + + + + +