From 9db0033672fff20577a12fa12180c0735fe5bc86 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 19 May 2022 15:39:42 +0200 Subject: [PATCH] format using prettier --- src/Umbraco.Web.UI.Client/src/api/fetcher.ts | 4 +- .../src/auth/login/umb-login.element.ts | 4 +- .../umb-backoffice-header.element.ts | 69 +++++++++++-------- .../src/installer/installer-user.element.ts | 4 +- .../src/mocks/browser.ts | 2 +- .../src/mocks/handlers.ts | 45 ++++++------ 6 files changed, 70 insertions(+), 58 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/api/fetcher.ts b/src/Umbraco.Web.UI.Client/src/api/fetcher.ts index 81701702f8..5f4e8c0d0b 100644 --- a/src/Umbraco.Web.UI.Client/src/api/fetcher.ts +++ b/src/Umbraco.Web.UI.Client/src/api/fetcher.ts @@ -5,7 +5,7 @@ import { paths } from '../../schemas/generated-schema'; const fetcher = Fetcher.for(); fetcher.configure({ - baseUrl: '/umbraco/backoffice' + baseUrl: '/umbraco/backoffice', }); export const getInitStatus = fetcher.path('/init').method('get').create(); @@ -14,4 +14,4 @@ export const postUserLogin = fetcher.path('/user/login').method('post').create() export const postUserLogout = fetcher.path('/user/logout').method('post').create(); export const getUserSections = fetcher.path('/user/sections').method('get').create(); export const getInstall = fetcher.path('/install').method('get').create(); -export const postInstall = fetcher.path('/install').method('post').create(); \ No newline at end of file +export const postInstall = fetcher.path('/install').method('post').create(); diff --git a/src/Umbraco.Web.UI.Client/src/auth/login/umb-login.element.ts b/src/Umbraco.Web.UI.Client/src/auth/login/umb-login.element.ts index a4e19e0bc7..daae56fee8 100644 --- a/src/Umbraco.Web.UI.Client/src/auth/login/umb-login.element.ts +++ b/src/Umbraco.Web.UI.Client/src/auth/login/umb-login.element.ts @@ -48,7 +48,9 @@ export class UmbLogin extends LitElement { await postUserLogin({ username, password, persist }); this._loggingIn = false; // TODO: Change to redirect when router has been added. - this.dispatchEvent(new CustomEvent('login', { bubbles: true, composed: true, detail: { username, password, persist } })); + this.dispatchEvent( + new CustomEvent('login', { bubbles: true, composed: true, detail: { username, password, persist } }) + ); } catch (error) { console.log(error); this._loggingIn = false; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/umb-backoffice-header.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/umb-backoffice-header.element.ts index 8ffd6072d2..b53e4b5eef 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/umb-backoffice-header.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/umb-backoffice-header.element.ts @@ -80,28 +80,28 @@ export class UmbBackofficeHeader extends LitElement { { type: 'section', alias: 'Umb.Section.Content', - name: 'Content' + name: 'Content', }, { type: 'section', alias: 'Umb.Section.Media', - name: 'Media' + name: 'Media', }, { type: 'section', alias: 'Umb.Section.Members', - name: 'Members' + name: 'Members', }, { type: 'section', alias: 'Umb.Section.Settings', - name: 'Settings' + name: 'Settings', }, { type: 'section', alias: 'Umb.Section.Packages', - name: 'Packages' - } + name: 'Packages', + }, ]; @state() @@ -148,29 +148,36 @@ export class UmbBackofficeHeader extends LitElement { const { data } = await getUserSections({}); this._availableSections = data.sections; - this._visibleSections = this._sections.filter(section => this._availableSections.includes(section.alias)).map(section => section.name); + this._visibleSections = this._sections + .filter((section) => this._availableSections.includes(section.alias)) + .map((section) => section.name); this._activeSection = this._visibleSections?.[0]; } private _renderExtraSections() { - return when(this._extraSections.length > 0, () => html` - - - - - + return when( + this._extraSections.length > 0, + () => html` + + + + + - - - - `); + + + + ` + ); } render() { @@ -182,12 +189,14 @@ export class UmbBackofficeHeader extends LitElement {
- ${this._visibleSections.map((section) => html` - - `)} + ${this._visibleSections.map( + (section) => html` + + ` + )} ${this._renderExtraSections()}
diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts b/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts index d045d35a40..5a6f90ff5e 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts +++ b/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts @@ -55,8 +55,8 @@ export class UmbInstallerUser extends LitElement { connectionString: '', databaseProviderMetadataId: '1', integratedAuth: false, - providerName: 'SQLite' - } + providerName: 'SQLite', + }, }); // TODO: Change to redirect when router has been added. diff --git a/src/Umbraco.Web.UI.Client/src/mocks/browser.ts b/src/Umbraco.Web.UI.Client/src/mocks/browser.ts index 4726ecc864..750e031c2b 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/browser.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/browser.ts @@ -1,4 +1,4 @@ import { setupWorker } from 'msw'; import { handlers } from './handlers'; -export const worker = setupWorker(...handlers); \ No newline at end of file +export const worker = setupWorker(...handlers); diff --git a/src/Umbraco.Web.UI.Client/src/mocks/handlers.ts b/src/Umbraco.Web.UI.Client/src/mocks/handlers.ts index 412fa3b6d6..8010c62749 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/handlers.ts @@ -9,7 +9,7 @@ export const handlers = [ ctx.status(200), ctx.json({ installed: import.meta.env.VITE_UMBRACO_INSTALL_STATUS !== 'false', - } as components['schemas']['InitResponse']), + } as components['schemas']['InitResponse']) ); }), @@ -18,8 +18,8 @@ export const handlers = [ // Respond with a 200 status code ctx.status(200), ctx.json({ - version: '13.0.0' - } as components['schemas']['VersionResponse']), + version: '13.0.0', + } as components['schemas']['VersionResponse']) ); }), @@ -58,8 +58,8 @@ export const handlers = [ ctx.status(200), ctx.json({ username: 'admin', - role: 'administrator' - } as components['schemas']['UserResponse']), + role: 'administrator', + } as components['schemas']['UserResponse']) ); }), @@ -67,8 +67,8 @@ export const handlers = [ return res( ctx.status(200), ctx.json({ - sections: ['Umb.Section.Content', 'Umb.Section.Media', 'Umb.Section.Settings'] - } as components['schemas']['AllowedSectionsResponse']), + sections: ['Umb.Section.Content', 'Umb.Section.Media', 'Umb.Section.Settings'], + } as components['schemas']['AllowedSectionsResponse']) ); }), @@ -87,26 +87,27 @@ export const handlers = [ consentLevels: [ { level: 'Minimal', - description: 'We will only send an anonymized site ID to let us know that the site exists.' + description: 'We will only send an anonymized site ID to let us know that the site exists.', }, { level: 'Basic', - description: 'We will send an anonymized site ID, umbraco version, and packages installed' + description: 'We will send an anonymized site ID, umbraco version, and packages installed', }, { level: 'Detailed', - description: 'We will send:\n
- Anonymized site ID, umbraco version, and packages installed.\n
- Number of: Root nodes, Content nodes, Macros, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, and Property Editors in use.\n
- System information: Webserver, server OS, server framework, server OS language, and database provider.\n
- Configuration settings: Modelsbuilder mode, if custom Umbraco path exists, ASP environment, and if you are in debug mode.\n
\n
We might change what we send on the Detailed level in the future. If so, it will be listed above.\n
By choosing \'Detailed\' you agree to current and future anonymized information being collected.
' - } + description: + "We will send:\n
- Anonymized site ID, umbraco version, and packages installed.\n
- Number of: Root nodes, Content nodes, Macros, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, and Property Editors in use.\n
- System information: Webserver, server OS, server framework, server OS language, and database provider.\n
- Configuration settings: Modelsbuilder mode, if custom Umbraco path exists, ASP environment, and if you are in debug mode.\n
\n
We might change what we send on the Detailed level in the future. If so, it will be listed above.\n
By choosing 'Detailed' you agree to current and future anonymized information being collected.
", + }, ], quickInstallSettings: { displayName: 'SQLite', defaultDatabaseName: 'Umbraco', - } + }, }, view: 'user', name: 'User', description: '', - serverOrder: 20 + serverOrder: 20, }, { model: { @@ -123,7 +124,7 @@ export const handlers = [ serverPlaceholder: null, requiresCredentials: false, supportsIntegratedAuthentication: false, - requiresConnectionTest: false + requiresConnectionTest: false, }, { id: '2', @@ -137,7 +138,7 @@ export const handlers = [ serverPlaceholder: '(local)\\SQLEXPRESS', requiresCredentials: true, supportsIntegratedAuthentication: true, - requiresConnectionTest: true + requiresConnectionTest: true, }, { id: '42c0eafd-1650-4bdb-8cf6-d226e8941698', @@ -151,23 +152,23 @@ export const handlers = [ serverPlaceholder: null, requiresCredentials: false, supportsIntegratedAuthentication: false, - requiresConnectionTest: true - } - ] + requiresConnectionTest: true, + }, + ], }, view: 'database', name: 'Database', description: '', - serverOrder: 10 + serverOrder: 10, }, { name: 'UmbracoVersion', view: '', model: null, description: 'Installation is complete! Get ready to be redirected to your new CMS.', - serverOrder: 50 - } - ] + serverOrder: 50, + }, + ], } as components['schemas']['UmbracoInstaller']) ); }),