Skip to content

Commit a8f58d8

Browse files
Simplify descriptions, labels and notification messages for publishing (#19267)
Co-authored-by: Niels Lyngsø <[email protected]>
1 parent 3a39728 commit a8f58d8

File tree

8 files changed

+35
-84
lines changed

8 files changed

+35
-84
lines changed

src/Umbraco.Web.UI.Client/src/assets/lang/en.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default {
159159
saveAndPublish: 'Save and publish',
160160
saveToPublish: 'Save and send for approval',
161161
saveListView: 'Save list view',
162-
schedulePublish: 'Schedule',
162+
schedulePublish: 'Schedule publish',
163163
saveAndPreview: 'Save and preview',
164164
showPageDisabled: "Preview is disabled because there's no template assigned",
165165
styleChoose: 'Choose style',
@@ -271,7 +271,7 @@ export default {
271271
publishedPendingChanges: 'Published (pending changes)',
272272
publishStatus: 'Publication Status',
273273
publishDescendantsHelp:
274-
'Publish <strong>%0%</strong> and all content items underneath and thereby making their content publicly available.',
274+
'Publish <strong>%0%</strong> and all items underneath and thereby making their content publicly available.',
275275
publishDescendantsWithVariantsHelp:
276276
'Publish variants and variants of same type underneath and thereby making their content publicly available.',
277277
noVariantsToProcess: 'There are no available variants',
@@ -319,7 +319,7 @@ export default {
319319
addTextBox: 'Add another text box',
320320
removeTextBox: 'Remove this text box',
321321
contentRoot: 'Content root',
322-
includeUnpublished: 'Include unpublished content items.',
322+
includeUnpublished: 'Include unpublished items.',
323323
isSensitiveValue:
324324
'This value is hidden. If you need access to view this value please contact your website administrator.',
325325
isSensitiveValue_short: 'This value is hidden.',
@@ -348,6 +348,8 @@ export default {
348348
variantUnpublishNotAllowed: 'Unpublish is not allowed',
349349
selectAllVariants: 'Select all variants',
350350
saveModalTitle: 'Save',
351+
saveAndPublishModalTitle: 'Save and publish',
352+
publishModalTitle: 'Publish',
351353
},
352354
blueprints: {
353355
createBlueprintFrom: "Create a new Document Blueprint from '%0%'",
@@ -475,10 +477,11 @@ export default {
475477
discardChanges: 'Discard changes',
476478
unsavedChanges: 'Discard unsaved changes',
477479
unsavedChangesWarning: 'Are you sure you want to navigate away from this page? You have unsaved changes',
478-
confirmListViewPublish: 'Publishing will make the selected items visible on the site.',
479-
confirmListViewUnpublish: 'Unpublishing will remove the selected items and all their descendants from the site.',
480-
confirmPublish: 'Publishing will make this page and all its published descendants visible on the site.',
481-
confirmUnpublish: 'Unpublishing will remove this page and all its descendants from the site.',
480+
confirmListViewPublish: 'Publishing will make the selected items publicly available.',
481+
confirmListViewUnpublish:
482+
'Unpublishing will make the selected items and all their descendants publicly unavailable.',
483+
confirmPublish: 'Publishing will make this content and all its published descendants publicly available.',
484+
confirmUnpublish: 'Unpublishing will make this content publicly unavailable.',
482485
doctypeChangeWarning: 'You have unsaved changes. Making changes to the Document Type will discard the changes.',
483486
},
484487
bulk: {
@@ -911,7 +914,7 @@ export default {
911914
retrieve: 'Retrieve',
912915
retry: 'Retry',
913916
rights: 'Permissions',
914-
scheduledPublishing: 'Scheduled Publishing',
917+
scheduledPublishing: 'Schedule publish',
915918
umbracoInfo: 'Umbraco info',
916919
search: 'Search',
917920
searchNoResult: 'Sorry, we can not find what you are looking for.',

src/Umbraco.Web.UI.Client/src/packages/documents/documents/modals/save-modal/document-save-modal.element.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ export class UmbDocumentSaveModalElement extends UmbModalBaseElement<
5757

5858
override render() {
5959
return html`<uui-dialog-layout headline=${this.localize.term('content_saveModalTitle')}>
60-
<p id="subtitle">
61-
<umb-localize key="content_variantsToSave">Choose which variants to be saved.</umb-localize>
62-
</p>
63-
6460
<umb-document-variant-language-picker
6561
.selectionManager=${this.#selectionManager}
6662
.variantLanguageOptions=${this._options}
@@ -69,7 +65,7 @@ export class UmbDocumentSaveModalElement extends UmbModalBaseElement<
6965
<div slot="actions">
7066
<uui-button label=${this.localize.term('general_close')} @click=${this.#close}></uui-button>
7167
<uui-button
72-
label="${this.localize.term('buttons_saveAndClose')}"
68+
label="${this.localize.term('buttons_save')}"
7369
look="primary"
7470
color="positive"
7571
@click=${this.#submit}></uui-button>

src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/publish/modal/document-publish-modal.element.ts

+12-15
Original file line numberDiff line numberDiff line change
@@ -101,26 +101,23 @@ export class UmbDocumentPublishModalElement extends UmbModalBaseElement<
101101
}
102102

103103
override render() {
104-
return html`<uui-dialog-layout headline=${this.localize.term('content_readyToPublish')}>
104+
const headline = this.data?.headline ?? this.localize.term('content_publishModalTitle');
105+
106+
return html`<uui-dialog-layout headline=${headline}>
107+
<p>
108+
<umb-localize key="prompt_confirmPublish"></umb-localize>
109+
</p>
110+
105111
${when(
106112
!this._isInvariant,
107113
() =>
108-
html` <p id="subtitle">
109-
<umb-localize key="content_variantsToPublish">Which variants would you like to publish?</umb-localize>
110-
</p>
111-
<umb-document-variant-language-picker
112-
.selectionManager=${this.#selectionManager}
113-
.variantLanguageOptions=${this._options}
114-
.requiredFilter=${isNotPublishedMandatory}
115-
.pickableFilter=${this.#pickableFilter}></umb-document-variant-language-picker>`,
114+
html` <umb-document-variant-language-picker
115+
.selectionManager=${this.#selectionManager}
116+
.variantLanguageOptions=${this._options}
117+
.requiredFilter=${isNotPublishedMandatory}
118+
.pickableFilter=${this.#pickableFilter}></umb-document-variant-language-picker>`,
116119
)}
117120
118-
<p>
119-
<umb-localize key="prompt_confirmPublish">
120-
Publishing will make this page and all its published descendants visible on the site.
121-
</umb-localize>
122-
</p>
123-
124121
<div slot="actions">
125122
<uui-button label=${this.localize.term('general_close')} @click=${this.#close}></uui-button>
126123
<uui-button

src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/publish/modal/document-publish-modal.token.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const UMB_DOCUMENT_PUBLISH_MODAL_ALIAS = 'Umb.Modal.DocumentPublish';
55

66
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
77
export interface UmbDocumentPublishModalData extends UmbDocumentVariantPickerData {
8+
headline?: string;
89
confirmLabel?: string;
910
}
1011

src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.element.ts

-14
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,6 @@ export class UmbDocumentScheduleModalElement extends UmbModalBaseElement<
160160

161161
override render() {
162162
return html`<uui-dialog-layout headline=${this.localize.term('general_scheduledPublishing')}>
163-
<p id="subtitle">
164-
${when(
165-
this._options.length > 1,
166-
() => html`
167-
<umb-localize key="content_languagesToSchedule">Which languages would you like to schedule?</umb-localize>
168-
`,
169-
() => html`
170-
<umb-localize key="content_schedulePublishHelp">
171-
Select the date and time to publish and/or unpublish the content item.
172-
</umb-localize>
173-
`,
174-
)}
175-
</p>
176-
177163
${this.#renderOptions()}
178164
179165
<div slot="actions">

src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/unpublish/entity-action/unpublish.action.ts

+5-22
Original file line numberDiff line numberDiff line change
@@ -105,28 +105,11 @@ export class UmbUnpublishDocumentEntityAction extends UmbEntityActionBase<never>
105105
}
106106

107107
if (!error) {
108-
// If the content is invariant, we need to show a different notification
109-
const isInvariant = options.length === 1 && options[0].culture === null;
110-
111-
if (isInvariant) {
112-
notificationContext?.peek('positive', {
113-
data: {
114-
headline: localize.term('speechBubbles_editContentUnpublishedHeader'),
115-
message: localize.term('speechBubbles_editContentUnpublishedText'),
116-
},
117-
});
118-
} else {
119-
const documentVariants = documentData.variants.filter((variant) => result.selection.includes(variant.culture!));
120-
notificationContext?.peek('positive', {
121-
data: {
122-
headline: localize.term('speechBubbles_editContentUnpublishedHeader'),
123-
message: localize.term(
124-
'speechBubbles_editVariantUnpublishedText',
125-
localize.list(documentVariants.map((v) => v.culture ?? v.name)),
126-
),
127-
},
128-
});
129-
}
108+
notificationContext?.peek('positive', {
109+
data: {
110+
message: localize.term('speechBubbles_editContentUnpublishedHeader'),
111+
},
112+
});
130113

131114
const actionEventContext = await this.getContext(UMB_ACTION_EVENT_CONTEXT);
132115
const event = new UmbRequestReloadStructureForEntityEvent({

src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/unpublish/modal/document-unpublish-modal.element.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,19 @@ export class UmbDocumentUnpublishModalElement extends UmbModalBaseElement<
150150

151151
override render() {
152152
return html`<uui-dialog-layout headline=${this.localize.term('content_unpublish')}>
153+
<p>
154+
<umb-localize key="prompt_confirmUnpublish"></umb-localize>
155+
</p>
153156
${when(
154157
!this._isInvariant,
155158
() => html`
156-
<p id="subtitle">
157-
<umb-localize key="content_languagesToUnpublish">
158-
Select the languages to unpublish. Unpublishing a mandatory language will unpublish all languages.
159-
</umb-localize>
160-
</p>
161159
<umb-document-variant-language-picker
162160
.selectionManager=${this._selectionManager}
163161
.variantLanguageOptions=${this._options}
164162
.requiredFilter=${this._hasInvalidSelection ? this._requiredFilter : undefined}
165163
.pickableFilter=${this.#pickableFilter}></umb-document-variant-language-picker>
166164
`,
167165
)}
168-
169-
<p>
170-
<umb-localize key="prompt_confirmUnpublish">
171-
Unpublishing will remove this page and all its descendants from the site.
172-
</umb-localize>
173-
</p>
174-
175166
${this._referencesConfig
176167
? html`<umb-confirm-action-modal-entity-references
177168
.config=${this._referencesConfig}

src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/workspace-context/document-publishing.workspace-context.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ export class UmbDocumentPublishingWorkspaceContext extends UmbContextBase {
249249
if (!error) {
250250
notificationContext?.peek('positive', {
251251
data: {
252-
headline: localize.term('publish_publishAll', primaryVariantName),
253252
message: localize.term('publish_nodePublishAll', primaryVariantName),
254253
},
255254
});
@@ -308,6 +307,7 @@ export class UmbDocumentPublishingWorkspaceContext extends UmbContextBase {
308307
// If there are multiple variants, we will open the modal to let the user pick which variants to publish.
309308
const result = await umbOpenModal(this, UMB_DOCUMENT_PUBLISH_MODAL, {
310309
data: {
310+
headline: this.#localize.term('content_saveAndPublishModalTitle'),
311311
options,
312312
pickableFilter: this.#publishableVariantsFilter,
313313
},
@@ -364,15 +364,9 @@ export class UmbDocumentPublishingWorkspaceContext extends UmbContextBase {
364364
);
365365

366366
if (!error) {
367-
const variants = saveData.variants.filter((v) => variantIds.some((id) => id.culture === v.culture));
368367
this.#notificationContext?.peek('positive', {
369368
data: {
370-
headline: this.#localize.term('speechBubbles_editContentPublishedHeader'),
371-
message: this.#localize.term(
372-
'speechBubbles_editVariantPublishedText',
373-
// TODO: use correct variant names instead of variant strings [MR]
374-
this.#localize.list(variants.map((v) => UmbVariantId.Create(v).toString() ?? v.name)),
375-
),
369+
message: this.#localize.term('speechBubbles_editContentPublishedHeader'),
376370
},
377371
});
378372

0 commit comments

Comments
 (0)