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 }} - + + + + + +