Skip to content

Commit e19eb66

Browse files
authored
V16-RC: Login screen cannot load public manifests (#19453)
* chore: disable notifications for global manifest loads * fix: registers required contexts to load public manifests * fix: specifically for localizations, load with the same cultures and weights as the backoffice itself does * fix: set weight to +100 to make sure custom localization extensions are loaded first * fix: remove 'welcome' fallback to avoid a flash of unlocalized content (FO"U"C) * fix: starting <li> tag
1 parent c3f62f1 commit e19eb66

File tree

12 files changed

+135
-112
lines changed

12 files changed

+135
-112
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
'In order to improve Umbraco and add new functionality based on as relevant information as possible, we would like to collect system- and usage information from your installation.<br>Aggregate data will be shared on a regular basis as well as learnings from these metrics.<br>Hopefully, you will help us collect some valuable data.<br><br>We <strong>WILL NOT</strong> collect any personal data such as content, code, user information, and all data will be fully anonymized.',
1717
basicLevelDescription: 'We will send an anonymized site ID, Umbraco version, and packages installed',
1818
detailedLevelDescription:
19-
'We will send: <ul>li>Anonymized site ID, Umbraco version, and packages installed.</li><li>Number of: Root nodes, Content nodes, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, Backoffice external login providers, and Property Editors in use.</li><li>System information: Webserver, server OS, server framework, server OS language, and database provider.</li><li>Configuration settings: ModelsBuilder mode, if custom Umbraco path exists, ASP environment, whether the delivery API is enabled, and allows public access, and if you are in debug mode.</li></ul><em>We might change what we send on the Detailed level in the future. If so, it will be listed above.<br>By choosing "Detailed" you agree to current and future anonymized information being collected.</em>',
19+
'We will send: <ul><li>Anonymized site ID, Umbraco version, and packages installed.</li><li>Number of: Root nodes, Content nodes, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, Backoffice external login providers, and Property Editors in use.</li><li>System information: Webserver, server OS, server framework, server OS language, and database provider.</li><li>Configuration settings: ModelsBuilder mode, if custom Umbraco path exists, ASP environment, whether the delivery API is enabled, and allows public access, and if you are in debug mode.</li></ul><em>We might change what we send on the Detailed level in the future. If so, it will be listed above.<br>By choosing "Detailed" you agree to current and future anonymized information being collected.</em>',
2020
minimalLevelDescription: 'We will only send an anonymized site ID to let us know that the site exists.',
2121
},
2222
blockEditor: {

src/Umbraco.Web.UI.Client/src/libs/extension-api/controller/server-extension-registrator.controller.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export class UmbServerExtensionRegistrator extends UmbControllerBase {
3434
* @remark Users must have the BACKOFFICE_ACCESS permission to access this method.
3535
*/
3636
public async registerPrivateExtensions() {
37-
const { data: packages } = await tryExecute(this, ManifestService.getManifestManifestPrivate());
37+
const { data: packages } = await tryExecute(this, ManifestService.getManifestManifestPrivate(), {
38+
disableNotifications: true,
39+
});
3840
if (packages) {
3941
await this.#loadServerPackages(packages);
4042
}
@@ -46,7 +48,9 @@ export class UmbServerExtensionRegistrator extends UmbControllerBase {
4648
* @remark Any user can access this method without any permissions.
4749
*/
4850
public async registerPublicExtensions() {
49-
const { data: packages } = await tryExecute(this, ManifestService.getManifestManifestPublic());
51+
const { data: packages } = await tryExecute(this, ManifestService.getManifestManifestPublic(), {
52+
disableNotifications: true,
53+
});
5054
if (packages) {
5155
await this.#loadServerPackages(packages);
5256
}

src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const manifests: Array<ManifestLocalization> = [
44
{
55
type: 'localization',
66
alias: 'Umb.Localization.AR',
7-
weight: -100,
7+
weight: 100,
88
name: 'Arabic Backoffice UI Localization',
99
meta: {
1010
culture: 'ar',
@@ -14,7 +14,7 @@ export const manifests: Array<ManifestLocalization> = [
1414
{
1515
type: 'localization',
1616
alias: 'Umb.Localization.BS',
17-
weight: -100,
17+
weight: 100,
1818
name: 'Bosnian Backoffice UI Localization',
1919
meta: {
2020
culture: 'bs',
@@ -24,7 +24,7 @@ export const manifests: Array<ManifestLocalization> = [
2424
{
2525
type: 'localization',
2626
alias: 'Umb.Localization.CS',
27-
weight: -100,
27+
weight: 100,
2828
name: 'Czech Backoffice UI Localization',
2929
meta: {
3030
culture: 'cs',
@@ -34,7 +34,7 @@ export const manifests: Array<ManifestLocalization> = [
3434
{
3535
type: 'localization',
3636
alias: 'Umb.Localization.CY',
37-
weight: -100,
37+
weight: 100,
3838
name: 'Welsh Backoffice UI Localization',
3939
meta: {
4040
culture: 'cy',
@@ -44,7 +44,7 @@ export const manifests: Array<ManifestLocalization> = [
4444
{
4545
type: 'localization',
4646
alias: 'Umb.Localization.DA',
47-
weight: -100,
47+
weight: 100,
4848
name: 'Danish Backoffice UI Localization',
4949
meta: {
5050
culture: 'da',
@@ -54,7 +54,7 @@ export const manifests: Array<ManifestLocalization> = [
5454
{
5555
type: 'localization',
5656
alias: 'Umb.Localization.DE',
57-
weight: -100,
57+
weight: 100,
5858
name: 'German Backoffice UI Localization',
5959
meta: {
6060
culture: 'de',
@@ -64,7 +64,7 @@ export const manifests: Array<ManifestLocalization> = [
6464
{
6565
type: 'localization',
6666
alias: 'Umb.Localization.EN',
67-
weight: -100,
67+
weight: 100,
6868
name: 'English (United Kingdom) Backoffice UI Localization',
6969
meta: {
7070
culture: 'en',
@@ -74,7 +74,7 @@ export const manifests: Array<ManifestLocalization> = [
7474
{
7575
type: 'localization',
7676
alias: 'Umb.Localization.EN_US',
77-
weight: -100,
77+
weight: 100,
7878
name: 'English (United States) Backoffice UI Localization',
7979
meta: {
8080
culture: 'en-US',
@@ -84,7 +84,7 @@ export const manifests: Array<ManifestLocalization> = [
8484
{
8585
type: 'localization',
8686
alias: 'Umb.Localization.ES',
87-
weight: -100,
87+
weight: 100,
8888
name: 'Spanish Backoffice UI Localization',
8989
meta: {
9090
culture: 'es',
@@ -94,7 +94,7 @@ export const manifests: Array<ManifestLocalization> = [
9494
{
9595
type: 'localization',
9696
alias: 'Umb.Localization.FR',
97-
weight: -100,
97+
weight: 100,
9898
name: 'French Backoffice UI Localization',
9999
meta: {
100100
culture: 'fr',
@@ -104,7 +104,7 @@ export const manifests: Array<ManifestLocalization> = [
104104
{
105105
type: 'localization',
106106
alias: 'Umb.Localization.HE',
107-
weight: -100,
107+
weight: 100,
108108
name: 'Hebrew Backoffice UI Localization',
109109
meta: {
110110
culture: 'he',
@@ -114,7 +114,7 @@ export const manifests: Array<ManifestLocalization> = [
114114
{
115115
type: 'localization',
116116
alias: 'Umb.Localization.HR',
117-
weight: -100,
117+
weight: 100,
118118
name: 'Croatian Backoffice UI Localization',
119119
meta: {
120120
culture: 'hr',
@@ -124,7 +124,7 @@ export const manifests: Array<ManifestLocalization> = [
124124
{
125125
type: 'localization',
126126
alias: 'Umb.Localization.IT',
127-
weight: -100,
127+
weight: 100,
128128
name: 'Italian Backoffice UI Localization',
129129
meta: {
130130
culture: 'it',
@@ -134,7 +134,7 @@ export const manifests: Array<ManifestLocalization> = [
134134
{
135135
type: 'localization',
136136
alias: 'Umb.Localization.JA',
137-
weight: -100,
137+
weight: 100,
138138
name: 'Japanese Backoffice UI Localization',
139139
meta: {
140140
culture: 'ja',
@@ -144,7 +144,7 @@ export const manifests: Array<ManifestLocalization> = [
144144
{
145145
type: 'localization',
146146
alias: 'Umb.Localization.KO',
147-
weight: -100,
147+
weight: 100,
148148
name: 'Korean Backoffice UI Localization',
149149
meta: {
150150
culture: 'ko',
@@ -154,7 +154,7 @@ export const manifests: Array<ManifestLocalization> = [
154154
{
155155
type: 'localization',
156156
alias: 'Umb.Localization.NB',
157-
weight: -100,
157+
weight: 100,
158158
name: 'Norwegian Backoffice UI Localization',
159159
meta: {
160160
culture: 'nb',
@@ -164,7 +164,7 @@ export const manifests: Array<ManifestLocalization> = [
164164
{
165165
type: 'localization',
166166
alias: 'Umb.Localization.NL',
167-
weight: -100,
167+
weight: 100,
168168
name: 'Dutch Backoffice UI Localization',
169169
meta: {
170170
culture: 'nl',
@@ -174,7 +174,7 @@ export const manifests: Array<ManifestLocalization> = [
174174
{
175175
type: 'localization',
176176
alias: 'Umb.Localization.PL',
177-
weight: -100,
177+
weight: 100,
178178
name: 'Polish Backoffice UI Localization',
179179
meta: {
180180
culture: 'pl',
@@ -184,7 +184,7 @@ export const manifests: Array<ManifestLocalization> = [
184184
{
185185
type: 'localization',
186186
alias: 'Umb.Localization.PT',
187-
weight: -100,
187+
weight: 100,
188188
name: 'Portuguese Backoffice UI Localization',
189189
meta: {
190190
culture: 'pt',
@@ -194,7 +194,7 @@ export const manifests: Array<ManifestLocalization> = [
194194
{
195195
type: 'localization',
196196
alias: 'Umb.Localization.PT_BR',
197-
weight: -100,
197+
weight: 100,
198198
name: 'Portuguese (Brazil) Backoffice UI Localization',
199199
meta: {
200200
culture: 'pt-BR',
@@ -204,7 +204,7 @@ export const manifests: Array<ManifestLocalization> = [
204204
{
205205
type: 'localization',
206206
alias: 'Umb.Localization.RO',
207-
weight: -100,
207+
weight: 100,
208208
name: 'Romanian Backoffice UI Localization',
209209
meta: {
210210
culture: 'ro',
@@ -214,7 +214,7 @@ export const manifests: Array<ManifestLocalization> = [
214214
{
215215
type: 'localization',
216216
alias: 'Umb.Localization.RU',
217-
weight: -100,
217+
weight: 100,
218218
name: 'Russian Backoffice UI Localization',
219219
meta: {
220220
culture: 'ru',
@@ -224,7 +224,7 @@ export const manifests: Array<ManifestLocalization> = [
224224
{
225225
type: 'localization',
226226
alias: 'Umb.Localization.SV',
227-
weight: -100,
227+
weight: 100,
228228
name: 'Swedish Backoffice UI Localization',
229229
meta: {
230230
culture: 'sv',
@@ -234,7 +234,7 @@ export const manifests: Array<ManifestLocalization> = [
234234
{
235235
type: 'localization',
236236
alias: 'Umb.Localization.TR',
237-
weight: -100,
237+
weight: 100,
238238
name: 'Turkish Backoffice UI Localization',
239239
meta: {
240240
culture: 'tr',
@@ -244,7 +244,7 @@ export const manifests: Array<ManifestLocalization> = [
244244
{
245245
type: 'localization',
246246
alias: 'Umb.Localization.UK',
247-
weight: -100,
247+
weight: 100,
248248
name: 'Ukrainian Backoffice UI Localization',
249249
meta: {
250250
culture: 'uk',
@@ -254,7 +254,7 @@ export const manifests: Array<ManifestLocalization> = [
254254
{
255255
type: 'localization',
256256
alias: 'Umb.Localization.ZH',
257-
weight: -100,
257+
weight: 100,
258258
name: 'Chinese Backoffice UI Localization',
259259
meta: {
260260
culture: 'zh',
@@ -264,7 +264,7 @@ export const manifests: Array<ManifestLocalization> = [
264264
{
265265
type: 'localization',
266266
alias: 'Umb.Localization.ZH_TW',
267-
weight: -100,
267+
weight: 100,
268268
name: 'Chinese (Taiwan) Backoffice UI Localization',
269269
meta: {
270270
culture: 'zh-TW',

src/Umbraco.Web.UI.Login/src/components/pages/login.page.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default class UmbLoginPageElement extends UmbLitElement {
127127
return html`
128128
<header id="header">
129129
<h1 id="greeting">
130-
<umb-localize .key=${this.#greetingLocalizationKey}>Welcome</umb-localize>
130+
<umb-localize .key=${this.#greetingLocalizationKey}></umb-localize>
131131
</h1>
132132
<slot name="subheadline"></slot>
133133
</header>

src/Umbraco.Web.UI.Login/src/controllers/slim-backoffice-initializer.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import type { UmbElement } from '@umbraco-cms/backoffice/element-api';
77
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
88
import { UUIIconRegistryEssential } from '@umbraco-cms/backoffice/external/uui';
9+
import { UmbServerConnection, UmbServerContext } from '@umbraco-cms/backoffice/server';
910

1011
// We import what we need from the Backoffice app.
1112
// In the future the login screen app will be a part of the Backoffice app, and we will not need to import these.
@@ -16,19 +17,33 @@ import '@umbraco-cms/backoffice/localization';
1617
* It is responsible for initializing the backoffice and only the extensions that is needed to run the login screen.
1718
*/
1819
export class UmbSlimBackofficeController extends UmbControllerBase {
19-
#uuiIconRegistry = new UUIIconRegistryEssential();
20-
2120
constructor(host: UmbElement) {
2221
super(host);
22+
23+
// Get the server URL and backoffice path from the host.
24+
const serverUrl = window.location.origin;
25+
const serverConnection = new UmbServerConnection(host, serverUrl);
26+
27+
// Create the server context for the slim backoffice.
28+
// This is needed by the UmbServerExtensionRegistrator to register the extensions.
29+
new UmbServerContext(this, {
30+
backofficePath: '/umbraco',
31+
serverUrl,
32+
serverConnection: serverConnection,
33+
});
34+
2335
new UmbBundleExtensionInitializer(host, umbExtensionsRegistry);
2436
new UmbAppEntryPointExtensionInitializer(host, umbExtensionsRegistry);
25-
new UmbServerExtensionRegistrator(host, umbExtensionsRegistry).registerPublicExtensions().catch(() => {
26-
// We don't care about errors here, as this is just a fallback for the login screen.
27-
// If the extensions are not registered, the login screen will still work, but some features may not be available.
37+
38+
// Register the public extensions for the slim backoffice.
39+
new UmbServerExtensionRegistrator(this, umbExtensionsRegistry).registerPublicExtensions().catch((error) => {
40+
console.error(`Failed to register public extensions for the slim backoffice.`, error);
2841
});
2942

30-
this.#uuiIconRegistry.attach(host);
43+
// Attach the UUIIconRegistry to the host so that it can be used in the login screen.
44+
new UUIIconRegistryEssential().attach(host);
3145

46+
// Add the essential styles to the host so that it can be used in the login screen.
3247
host.classList.add('uui-text');
3348
host.classList.add('uui-font');
3449
}

0 commit comments

Comments
 (0)