root: fix formatting

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-08-06 00:11:24 +02:00
parent 8044818a4d
commit 2d5094fdf7
11 changed files with 99 additions and 61 deletions

View File

@ -12,7 +12,12 @@ import PFContent from "@patternfly/patternfly/components/Content/content.css";
import AKGlobal from "../authentik.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFButton from "@patternfly/patternfly/components/Button/button.css";
import { EVENT_API_DRAWER_TOGGLE, EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_SIDEBAR_TOGGLE, TITLE_DEFAULT } from "../constants";
import {
EVENT_API_DRAWER_TOGGLE,
EVENT_NOTIFICATION_DRAWER_TOGGLE,
EVENT_SIDEBAR_TOGGLE,
TITLE_DEFAULT,
} from "../constants";
import { DEFAULT_CONFIG, tenant } from "../api/Config";
import { EventsApi } from "../../api/dist";
@ -154,7 +159,6 @@ export class PageHeader extends LitElement {
}}
>
<i class="fas fa-bell"></i>
</button>
`;
</button> `;
}
}

View File

@ -5,7 +5,6 @@ import { MessageLevel } from "../messages/Message";
@customElement("ak-action-button")
export class ActionButton extends SpinnerButton {
@property({ attribute: false })
// eslint-disable-next-line @typescript-eslint/no-explicit-any
apiRequest: () => Promise<any> = () => {

View File

@ -16,7 +16,6 @@ import { ERROR_CLASS, PRIMARY_CLASS, PROGRESS_CLASS, SUCCESS_CLASS } from "../..
@customElement("ak-spinner-button")
export class SpinnerButton extends LitElement {
@property({ type: Boolean })
isRunning = false;

View File

@ -1,5 +1,13 @@
import { Middleware, ResponseContext } from "authentik-api";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFNotificationDrawer from "@patternfly/patternfly/components/NotificationDrawer/notification-drawer.css";
import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css";
@ -16,7 +24,6 @@ export interface RequestInfo {
}
export class APIMiddleware implements Middleware {
post?(context: ResponseContext): Promise<Response | void> {
const request: RequestInfo = {
method: (context.init.method || "GET").toUpperCase(),
@ -32,31 +39,37 @@ export class APIMiddleware implements Middleware {
);
return Promise.resolve(context.response);
}
}
@customElement("ak-api-drawer")
export class APIDrawer extends LitElement {
@property({attribute: false})
@property({ attribute: false })
requests: RequestInfo[] = [];
static get styles(): CSSResult[] {
return [PFBase, PFNotificationDrawer, PFButton, PFContent, PFDropdown, AKGlobal, css`
.pf-c-notification-drawer__header {
height: 114px;
align-items: center;
}
.pf-c-notification-drawer__header-action,
.pf-c-notification-drawer__header-action-close,
.pf-c-notification-drawer__header-action-close > .pf-c-button.pf-m-plain {
height: 100%;
}
.pf-c-notification-drawer__list-item-description {
white-space: pre-wrap;
font-family: monospace;
}
`];
return [
PFBase,
PFNotificationDrawer,
PFButton,
PFContent,
PFDropdown,
AKGlobal,
css`
.pf-c-notification-drawer__header {
height: 114px;
align-items: center;
}
.pf-c-notification-drawer__header-action,
.pf-c-notification-drawer__header-action-close,
.pf-c-notification-drawer__header-action-close > .pf-c-button.pf-m-plain {
height: 100%;
}
.pf-c-notification-drawer__list-item-description {
white-space: pre-wrap;
font-family: monospace;
}
`,
];
}
constructor() {
@ -73,9 +86,13 @@ export class APIDrawer extends LitElement {
renderItem(item: RequestInfo): TemplateResult {
return html`<li class="pf-c-notification-drawer__list-item pf-m-read">
<div class="pf-c-notification-drawer__list-item-header">
<h2 class="pf-c-notification-drawer__list-item-header-title">${item.method}: ${item.status}</h2>
<h2 class="pf-c-notification-drawer__list-item-header-title">
${item.method}: ${item.status}
</h2>
</div>
<a class="pf-c-notification-drawer__list-item-description" href=${item.path}>${item.path}</a>
<a class="pf-c-notification-drawer__list-item-description" href=${item.path}
>${item.path}</a
>
</li>`;
}