web: bump prettier from 2.8.8 to 3.0.0 in /web (#6329)

* web: bump prettier from 2.8.8 to 3.0.0 in /web

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* update formatting and config

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
dependabot[bot] 2023-07-21 18:19:19 +02:00 committed by GitHub
parent e604e70395
commit 03f3ad89df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 247 additions and 202 deletions

View File

@ -15,6 +15,7 @@
"trailingComma": "all", "trailingComma": "all",
"useTabs": false, "useTabs": false,
"vueIndentScriptAndStyle": false, "vueIndentScriptAndStyle": false,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": ["^(@?)lit(.*)$", "\\.css$", "^@goauthentik/api$", "^[./]"], "importOrder": ["^(@?)lit(.*)$", "\\.css$", "^@goauthentik/api$", "^[./]"],
"importOrderSeparation": true, "importOrderSeparation": true,
"importOrderSortSpecifiers": true, "importOrderSortSpecifiers": true,

42
web/package-lock.json generated
View File

@ -78,7 +78,7 @@
"eslint-plugin-storybook": "^0.6.13", "eslint-plugin-storybook": "^0.6.13",
"lit-analyzer": "^1.2.1", "lit-analyzer": "^1.2.1",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^2.8.8", "prettier": "^3.0.0",
"pyright": "^1.1.318", "pyright": "^1.1.318",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
@ -6985,6 +6985,21 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/@storybook/cli/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@storybook/cli/node_modules/semver": { "node_modules/@storybook/cli/node_modules/semver": {
"version": "7.5.4", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
@ -7116,6 +7131,21 @@
"url": "https://opencollective.com/storybook" "url": "https://opencollective.com/storybook"
} }
}, },
"node_modules/@storybook/codemod/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@storybook/components": { "node_modules/@storybook/components": {
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/@storybook/components/-/components-7.1.0.tgz", "resolved": "https://registry.npmjs.org/@storybook/components/-/components-7.1.0.tgz",
@ -18288,15 +18318,15 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.8", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin/prettier.cjs"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=14"
}, },
"funding": { "funding": {
"url": "https://github.com/prettier/prettier?sponsor=1" "url": "https://github.com/prettier/prettier?sponsor=1"

View File

@ -95,7 +95,7 @@
"eslint-plugin-storybook": "^0.6.13", "eslint-plugin-storybook": "^0.6.13",
"lit-analyzer": "^1.2.1", "lit-analyzer": "^1.2.1",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^2.8.8", "prettier": "^3.0.0",
"pyright": "^1.1.318", "pyright": "^1.1.318",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",

View File

@ -92,8 +92,10 @@ export class RecentEventsCard extends Table<Event> {
} }
renderEmpty(): TemplateResult { renderEmpty(): TemplateResult {
return super.renderEmpty(html`<ak-empty-state header=${msg("No Events found.")}> return super.renderEmpty(
<div slot="body">${msg("No matching events could be found.")}</div> html`<ak-empty-state header=${msg("No Events found.")}>
</ak-empty-state>`); <div slot="body">${msg("No matching events could be found.")}</div>
</ak-empty-state>`,
);
} }
} }

View File

@ -121,23 +121,22 @@ export class BoundStagesList extends Table<FlowStageBinding> {
} }
renderEmpty(): TemplateResult { renderEmpty(): TemplateResult {
return super.renderEmpty(html`<ak-empty-state return super.renderEmpty(
header=${msg("No Stages bound")} html`<ak-empty-state header=${msg("No Stages bound")} icon="pf-icon-module">
icon="pf-icon-module" <div slot="body">${msg("No stages are currently bound to this flow.")}</div>
> <div slot="primary">
<div slot="body">${msg("No stages are currently bound to this flow.")}</div> <ak-forms-modal>
<div slot="primary"> <span slot="submit"> ${msg("Create")} </span>
<ak-forms-modal> <span slot="header"> ${msg("Create Stage binding")} </span>
<span slot="submit"> ${msg("Create")} </span> <ak-stage-binding-form slot="form" targetPk=${ifDefined(this.target)}>
<span slot="header"> ${msg("Create Stage binding")} </span> </ak-stage-binding-form>
<ak-stage-binding-form slot="form" targetPk=${ifDefined(this.target)}> <button slot="trigger" class="pf-c-button pf-m-primary">
</ak-stage-binding-form> ${msg("Bind stage")}
<button slot="trigger" class="pf-c-button pf-m-primary"> </button>
${msg("Bind stage")} </ak-forms-modal>
</button> </div>
</ak-forms-modal> </ak-empty-state>`,
</div> );
</ak-empty-state>`);
} }
renderToolbar(): TemplateResult { renderToolbar(): TemplateResult {

View File

@ -40,16 +40,14 @@ export class FlowViewPage extends AKElement {
flow!: Flow; flow!: Flow;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [PFBase, PFPage, PFDescriptionList, PFButton, PFCard, PFContent, PFGrid].concat( return [PFBase, PFPage, PFDescriptionList, PFButton, PFCard, PFContent, PFGrid].concat(css`
css` img.pf-icon {
img.pf-icon { max-height: 24px;
max-height: 24px; }
} ak-tabs {
ak-tabs { height: 100%;
height: 100%; }
} `);
`,
);
} }
render(): TemplateResult { render(): TemplateResult {

View File

@ -170,27 +170,26 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
} }
renderEmpty(): TemplateResult { renderEmpty(): TemplateResult {
return super.renderEmpty(html`<ak-empty-state return super.renderEmpty(
header=${msg("No Policies bound.")} html`<ak-empty-state header=${msg("No Policies bound.")} icon="pf-icon-module">
icon="pf-icon-module" <div slot="body">${msg("No policies are currently bound to this object.")}</div>
> <div slot="primary">
<div slot="body">${msg("No policies are currently bound to this object.")}</div> <ak-forms-modal size=${PFSize.Medium}>
<div slot="primary"> <span slot="submit"> ${msg("Create")} </span>
<ak-forms-modal size=${PFSize.Medium}> <span slot="header"> ${msg("Create Binding")} </span>
<span slot="submit"> ${msg("Create")} </span> <ak-policy-binding-form
<span slot="header"> ${msg("Create Binding")} </span> slot="form"
<ak-policy-binding-form targetPk=${ifDefined(this.target)}
slot="form" ?policyOnly=${this.policyOnly}
targetPk=${ifDefined(this.target)} >
?policyOnly=${this.policyOnly} </ak-policy-binding-form>
> <button slot="trigger" class="pf-c-button pf-m-primary">
</ak-policy-binding-form> ${msg("Create Binding")}
<button slot="trigger" class="pf-c-button pf-m-primary"> </button>
${msg("Create Binding")} </ak-forms-modal>
</button> </div>
</ak-forms-modal> </ak-empty-state>`,
</div> );
</ak-empty-state>`);
} }
renderToolbar(): TemplateResult { renderToolbar(): TemplateResult {

View File

@ -191,9 +191,8 @@ export class LDAPProviderViewPage extends AKElement {
class="pf-c-form-control" class="pf-c-form-control"
readonly readonly
type="text" type="text"
value=${`cn=${ value=${`cn=${this.me?.user
this.me?.user.username .username},ou=users,${this.provider?.baseDn?.toLowerCase()}`}
},ou=users,${this.provider?.baseDn?.toLowerCase()}`}
/> />
</div> </div>
<div class="pf-c-form__group"> <div class="pf-c-form__group">

View File

@ -120,58 +120,62 @@ export class SAMLProviderViewPage extends AKElement {
renderRelatedObjects(): TemplateResult { renderRelatedObjects(): TemplateResult {
const relatedObjects = []; const relatedObjects = [];
if (this.provider?.assignedApplicationName) { if (this.provider?.assignedApplicationName) {
relatedObjects.push(html`<div class="pf-c-description-list__group"> relatedObjects.push(
<dt class="pf-c-description-list__term"> html`<div class="pf-c-description-list__group">
<span class="pf-c-description-list__text">${msg("Metadata")}</span> <dt class="pf-c-description-list__term">
</dt> <span class="pf-c-description-list__text">${msg("Metadata")}</span>
<dd class="pf-c-description-list__description"> </dt>
<div class="pf-c-description-list__text"> <dd class="pf-c-description-list__description">
<a <div class="pf-c-description-list__text">
class="pf-c-button pf-m-primary" <a
target="_blank" class="pf-c-button pf-m-primary"
href=${ifDefined(this.provider?.urlDownloadMetadata)} target="_blank"
> href=${ifDefined(this.provider?.urlDownloadMetadata)}
${msg("Download")} >
</a> ${msg("Download")}
<ak-action-button </a>
class="pf-m-secondary" <ak-action-button
.apiRequest=${() => { class="pf-m-secondary"
if (!navigator.clipboard) { .apiRequest=${() => {
return Promise.resolve( if (!navigator.clipboard) {
showMessage({ return Promise.resolve(
level: MessageLevel.info, showMessage({
message: this.provider?.urlDownloadMetadata || "", level: MessageLevel.info,
}), message: this.provider?.urlDownloadMetadata || "",
}),
);
}
return navigator.clipboard.writeText(
this.provider?.urlDownloadMetadata || "",
); );
} }}
return navigator.clipboard.writeText( >
this.provider?.urlDownloadMetadata || "", ${msg("Copy download URL")}
); </ak-action-button>
}} </div>
> </dd>
${msg("Copy download URL")} </div>`,
</ak-action-button> );
</div>
</dd>
</div>`);
} }
if (this.signer) { if (this.signer) {
relatedObjects.push(html`<div class="pf-c-description-list__group"> relatedObjects.push(
<dt class="pf-c-description-list__term"> html`<div class="pf-c-description-list__group">
<span class="pf-c-description-list__text" <dt class="pf-c-description-list__term">
>${msg("Download signing certificate")}</span <span class="pf-c-description-list__text"
> >${msg("Download signing certificate")}</span
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
<a
class="pf-c-button pf-m-primary"
href=${this.signer.certificateDownloadUrl}
>${msg("Download")}</a
> >
</div> </dt>
</dd> <dd class="pf-c-description-list__description">
</div>`); <div class="pf-c-description-list__text">
<a
class="pf-c-button pf-m-primary"
href=${this.signer.certificateDownloadUrl}
>${msg("Download")}</a
>
</div>
</dd>
</div>`,
);
} }
return html` <div class="pf-c-card pf-l-grid__item pf-m-12-col"> return html` <div class="pf-c-card pf-l-grid__item pf-m-12-col">
<div class="pf-c-card__title">${msg("Related objects")}</div> <div class="pf-c-card__title">${msg("Related objects")}</div>

View File

@ -27,20 +27,21 @@ const metadata: Meta<AKActionButton> = {
export default metadata; export default metadata;
const container = (testItem: TemplateResult) => html` <div style="background: #fff; padding: 2em"> const container = (testItem: TemplateResult) =>
<style> html` <div style="background: #fff; padding: 2em">
li { <style>
display: block; li {
} display: block;
p { }
margin-top: 1em; p {
} margin-top: 1em;
</style> }
<ak-message-container></ak-message-container> </style>
${testItem} <ak-message-container></ak-message-container>
<p>Messages received from the button:</p> ${testItem}
<ul id="action-button-message-pad" style="margin-top: 1em"></ul> <p>Messages received from the button:</p>
</div>`; <ul id="action-button-message-pad" style="margin-top: 1em"></ul>
</div>`;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const displayMessage = (result: any) => { const displayMessage = (result: any) => {
@ -81,7 +82,9 @@ export const ButtonWithError = () => {
}, 3000); }, 3000);
}); });
return container(html` <ak-action-button class="pf-m-secondary" .apiRequest=${run} return container(
>3 Seconds</ak-action-button html` <ak-action-button class="pf-m-secondary" .apiRequest=${run}
>`); >3 Seconds</ak-action-button
>`,
);
}; };

View File

@ -21,25 +21,26 @@ function makeid(length: number) {
// We want the display to be rich and comprehensive. The next two functions provide // We want the display to be rich and comprehensive. The next two functions provide
// a styled wrapper for the return messages, and a styled wrapper for each message. // a styled wrapper for the return messages, and a styled wrapper for each message.
const container = (testItem: TemplateResult) => html` <div style="background: #fff; padding: 2em"> const container = (testItem: TemplateResult) =>
<style> html` <div style="background: #fff; padding: 2em">
li { <style>
display: block; li {
} display: block;
p { }
display: block; p {
margin-top: 1em; display: block;
} margin-top: 1em;
p + p { }
margin-top: 0.2em; p + p {
padding-left: 2.5rem; margin-top: 0.2em;
} padding-left: 2.5rem;
</style> }
<ak-message-container></ak-message-container> </style>
${testItem} <ak-message-container></ak-message-container>
<p>Messages received from the button:</p> ${testItem}
<ul id="action-button-message-pad" style="margin-top: 1em"></ul> <p>Messages received from the button:</p>
</div>`; <ul id="action-button-message-pad" style="margin-top: 1em"></ul>
</div>`;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const displayMessage = (result: any) => { const displayMessage = (result: any) => {

View File

@ -33,7 +33,12 @@ export const FONT_COLOUR_DARK_MODE = "#fafafa";
export const FONT_COLOUR_LIGHT_MODE = "#151515"; export const FONT_COLOUR_LIGHT_MODE = "#151515";
export class RGBAColor { export class RGBAColor {
constructor(public r: number, public g: number, public b: number, public a: number = 1) {} constructor(
public r: number,
public g: number,
public b: number,
public a: number = 1,
) {}
toString(): string { toString(): string {
return `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`; return `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`;
} }

View File

@ -97,8 +97,10 @@ export class ObjectChangelog extends Table<Event> {
} }
renderEmpty(): TemplateResult { renderEmpty(): TemplateResult {
return super.renderEmpty(html`<ak-empty-state header=${msg("No Events found.")}> return super.renderEmpty(
<div slot="body">${msg("No matching events could be found.")}</div> html`<ak-empty-state header=${msg("No Events found.")}>
</ak-empty-state>`); <div slot="body">${msg("No matching events could be found.")}</div>
</ak-empty-state>`,
);
} }
} }

View File

@ -71,8 +71,10 @@ export class UserEvents extends Table<Event> {
} }
renderEmpty(): TemplateResult { renderEmpty(): TemplateResult {
return super.renderEmpty(html`<ak-empty-state header=${msg("No Events found.")}> return super.renderEmpty(
<div slot="body">${msg("No matching events could be found.")}</div> html`<ak-empty-state header=${msg("No Events found.")}>
</ak-empty-state>`); <div slot="body">${msg("No matching events could be found.")}</div>
</ak-empty-state>`,
);
} }
} }

View File

@ -22,7 +22,10 @@ import { ResponseError, ValidationError, ValidationErrorFromJSON } from "@goauth
export class PreventFormSubmit { export class PreventFormSubmit {
// Stub class which can be returned by form elements to prevent the form from submitting // Stub class which can be returned by form elements to prevent the form from submitting
constructor(public message: string, public element?: HorizontalFormElement) {} constructor(
public message: string,
public element?: HorizontalFormElement,
) {}
} }
export class APIError extends Error { export class APIError extends Error {

View File

@ -28,31 +28,29 @@ export class NotificationDrawer extends AKElement {
unread = 0; unread = 0;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [PFBase, PFButton, PFNotificationDrawer, PFContent, PFDropdown].concat( return [PFBase, PFButton, PFNotificationDrawer, PFContent, PFDropdown].concat(css`
css` .pf-c-drawer__body {
.pf-c-drawer__body { height: 100%;
height: 100%; }
} .pf-c-notification-drawer__body {
.pf-c-notification-drawer__body { flex-grow: 1;
flex-grow: 1; }
} .pf-c-notification-drawer__header {
.pf-c-notification-drawer__header { height: 114px;
height: 114px; align-items: center;
align-items: center; }
} .pf-c-notification-drawer__header-action,
.pf-c-notification-drawer__header-action, .pf-c-notification-drawer__header-action-close,
.pf-c-notification-drawer__header-action-close, .pf-c-notification-drawer__header-action-close > .pf-c-button.pf-m-plain {
.pf-c-notification-drawer__header-action-close > .pf-c-button.pf-m-plain { height: 100%;
height: 100%; }
} .pf-c-notification-drawer__list-item-description {
.pf-c-notification-drawer__list-item-description { white-space: pre-wrap;
white-space: pre-wrap; }
} .pf-c-notification-drawer__footer {
.pf-c-notification-drawer__footer { margin: 1rem;
margin: 1rem; }
} `);
`,
);
} }
firstUpdated(): void { firstUpdated(): void {

View File

@ -44,24 +44,22 @@ export class IdentificationStage extends BaseStage<
form?: HTMLFormElement; form?: HTMLFormElement;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [PFBase, PFAlert, PFLogin, PFForm, PFFormControl, PFTitle, PFButton].concat( return [PFBase, PFAlert, PFLogin, PFForm, PFFormControl, PFTitle, PFButton].concat(css`
css` /* login page's icons */
/* login page's icons */ .pf-c-login__main-footer-links-item button {
.pf-c-login__main-footer-links-item button { background-color: transparent;
background-color: transparent; border: 0;
border: 0; display: flex;
display: flex; align-items: stretch;
align-items: stretch; }
} .pf-c-login__main-footer-links-item img {
.pf-c-login__main-footer-links-item img { fill: var(--pf-c-login__main-footer-links-item-link-svg--Fill);
fill: var(--pf-c-login__main-footer-links-item-link-svg--Fill); width: 100px;
width: 100px; max-width: var(--pf-c-login__main-footer-links-item-link-svg--Width);
max-width: var(--pf-c-login__main-footer-links-item-link-svg--Width); height: 100%;
height: 100%; max-height: var(--pf-c-login__main-footer-links-item-link-svg--Height);
max-height: var(--pf-c-login__main-footer-links-item-link-svg--Height); }
} `);
`,
);
} }
firstUpdated(): void { firstUpdated(): void {

View File

@ -200,12 +200,13 @@ ${prompt.initialValue}</textarea
? LOCALES ? LOCALES
: LOCALES.filter((locale) => locale.code !== "debug"); : LOCALES.filter((locale) => locale.code !== "debug");
const options = locales.map( const options = locales.map(
(locale) => html`<option (locale) =>
value=${locale.code} html`<option
?selected=${locale.code === prompt.initialValue} value=${locale.code}
> ?selected=${locale.code === prompt.initialValue}
${locale.code.toUpperCase()} - ${locale.label()} >
</option> `, ${locale.code.toUpperCase()} - ${locale.label()}
</option> `,
); );
return html`<select class="pf-c-form-control" name="${prompt.fieldKey}"> return html`<select class="pf-c-form-control" name="${prompt.fieldKey}">