From 2cdcacb9a8e3edd9e4543c0554862a7a4da397f5 Mon Sep 17 00:00:00 2001
From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Date: Fri, 31 Jan 2025 21:26:19 +0100
Subject: [PATCH] V15/feature/notification-whitespace (#18190)
* feat: adds `white-space: pre-line` to all notification messages
* chore: remove invalid values
---
.../layouts/default/notification-layout-default.element.ts | 6 ++++--
.../src/packages/core/notification/notification.context.ts | 1 -
.../core/temporary-file/temporary-file-manager.class.ts | 3 +--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/notification/layouts/default/notification-layout-default.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/notification/layouts/default/notification-layout-default.element.ts
index 85a36bdec0..84b9bb5c11 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/core/notification/layouts/default/notification-layout-default.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/core/notification/layouts/default/notification-layout-default.element.ts
@@ -6,7 +6,6 @@ import {
ifDefined,
nothing,
css,
- styleMap,
} from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import type { UmbNotificationDefaultData, UmbNotificationHandler } from '@umbraco-cms/backoffice/notification';
@@ -24,7 +23,7 @@ export class UmbNotificationLayoutDefaultElement extends LitElement {
override render() {
return html`
- ${this.data.message}
+ ${this.data.message}
${this.#renderStructuredList(this.data.structuredList)}
`;
@@ -56,6 +55,9 @@ export class UmbNotificationLayoutDefaultElement extends LitElement {
static override styles = [
UmbTextStyles,
css`
+ #message {
+ white-space: pre-line;
+ }
.structured-list ul {
margin: 0;
}
diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/notification/notification.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/notification/notification.context.ts
index 790da2268d..5bdbf98670 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/core/notification/notification.context.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/core/notification/notification.context.ts
@@ -12,7 +12,6 @@ export interface UmbNotificationDefaultData {
message: string;
headline?: string;
structuredList?: Record>;
- whitespace?: 'normal' | 'pre-line' | 'pre-wrap' | 'nowrap' | 'pre';
}
/**
diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/temporary-file/temporary-file-manager.class.ts b/src/Umbraco.Web.UI.Client/src/packages/core/temporary-file/temporary-file-manager.class.ts
index 52b14b48c3..2af1555268 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/core/temporary-file/temporary-file-manager.class.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/core/temporary-file/temporary-file-manager.class.ts
@@ -89,10 +89,9 @@ export class UmbTemporaryFileManager<
headline: 'Upload',
message: `
${this.#localization.term('media_invalidFileSize')}: ${item.file.name} (${formatBytes(item.file.size)}).
-
+
${this.#localization.term('media_maxFileSize')} ${formatBytes(maxFileSize)}.
`,
- whitespace: 'pre-line',
},
});
return false;