From 40beff7cf3785e2d1672e9cf96dc77f1d40ad0a1 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 5 Jul 2022 18:55:48 +0200 Subject: [PATCH] show notification when data type is saved --- .../src/backoffice/editors/editor-data-type.element.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/editors/editor-data-type.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/editors/editor-data-type.element.ts index 0673b12b88..212b5b32f1 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/editors/editor-data-type.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/editors/editor-data-type.element.ts @@ -6,6 +6,7 @@ import { IRoute, IRoutingInfo, RouterSlot } from 'router-slot'; import { map, Subscription } from 'rxjs'; import { UmbContextConsumerMixin } from '../../core/context'; import { UmbExtensionManifestEditorView, UmbExtensionRegistry } from '../../core/extension'; +import { UmbNotificationService } from '../../core/services/notification.service'; import { UmbDataTypeStore } from '../../core/stores/data-type.store'; import { DataTypeEntity } from '../../mocks/data/data-type.data'; @@ -64,6 +65,7 @@ export class UmbEditorDataTypeElement extends UmbContextConsumerMixin(LitElement private _dataTypeSubscription?: Subscription; private _extensionRegistry?: UmbExtensionRegistry; private _editorViewsSubscription?: Subscription; + private _notificationService?: UmbNotificationService; private _routerFolder = ''; @@ -80,6 +82,10 @@ export class UmbEditorDataTypeElement extends UmbContextConsumerMixin(LitElement this._useEditorViews(); }); + this.consumeContext('umbNotificationService', (service: UmbNotificationService) => { + this._notificationService = service; + }); + // TODO: temp solution to handle property editor UI change this.addEventListener('change', this._handleChange); } @@ -176,6 +182,7 @@ export class UmbEditorDataTypeElement extends UmbContextConsumerMixin(LitElement try { this._saveButtonState = 'waiting'; await this._dataTypeStore.save([this._dataType]); + this._notificationService?.peek('Data Type saved'); this._saveButtonState = 'success'; } catch (error) { this._saveButtonState = 'failed';