web: fix linting issues

This commit is contained in:
Jens Langhammer 2021-02-04 10:22:14 +01:00
parent 9ca9e67ffa
commit 7e2a471903
3 changed files with 10 additions and 13 deletions

View File

@ -1,7 +1,7 @@
import { html, TemplateResult } from "lit-html";
export const SLUG_REGEX = "[-a-zA-Z0-9_]+";
export const ID_REGEX = "\d+";
export const ID_REGEX = "\\d+";
export class Route {
url: RegExp;

View File

@ -6,6 +6,7 @@ import { TablePage } from "../../elements/table/TablePage";
import "../../elements/buttons/ModalButton";
import "../../elements/buttons/SpinnerButton";
import "../../elements/buttons/Dropdown";
import { TableColumn } from "../../elements/table/Table";
@customElement("ak-provider-list")
@ -58,13 +59,13 @@ export class ProviderListPage extends TablePage<Provider> {
html`
<ak-modal-button href="${Provider.adminUrl(`${item.pk}/update/`)}">
<ak-spinner-button slot="trigger" class="pf-m-secondary">
Edit
${gettext("Edit")}
</ak-spinner-button>
<div slot="modal"></div>
</ak-modal-button>&nbsp;
<ak-modal-button href="${Provider.adminUrl(`${item.pk}/delete/`)}">
<ak-spinner-button slot="trigger" class="pf-m-danger">
Delete
${gettext("Delete")}
</ak-spinner-button>
<div slot="modal"></div>
</ak-modal-button>
@ -81,7 +82,7 @@ export class ProviderListPage extends TablePage<Provider> {
</button>
<ul class="pf-c-dropdown__menu" hidden>
<li>
<ak-modal-button href="${Provider.adminUrl(`/create/?type=OAuth2Provider`)}">
<ak-modal-button href="${Provider.adminUrl("/create/?type=OAuth2Provider")}">
<button slot="trigger" class="pf-c-dropdown__menu-item">${gettext("OAuth2/OpenID Provider")}<br>
<small>
${gettext("OAuth2 Provider for generic OAuth and OpenID Connect Applications.")}
@ -91,7 +92,7 @@ export class ProviderListPage extends TablePage<Provider> {
</ak-modal-button>
</li>
<li>
<ak-modal-button href="${Provider.adminUrl(`/create/?type=ProxyProvider`)}">
<ak-modal-button href="${Provider.adminUrl("/create/?type=ProxyProvider")}">
<button slot="trigger" class="pf-c-dropdown__menu-item">${gettext("Proxy Provider")}<br>
<small>
${gettext("Protect applications that don't support any of the other Protocols by using a Reverse-Proxy.")}
@ -101,7 +102,7 @@ export class ProviderListPage extends TablePage<Provider> {
</ak-modal-button>
</li>
<li>
<ak-modal-button href="${Provider.adminUrl(`/create/?type=SAMLProvider`)}">
<ak-modal-button href="${Provider.adminUrl("/create/?type=SAMLProvider")}">
<button slot="trigger" class="pf-c-dropdown__menu-item">${gettext("SAML Provider")}<br>
<small>
${gettext("SAML 2.0 Endpoint for applications which support SAML.")}
@ -111,7 +112,7 @@ export class ProviderListPage extends TablePage<Provider> {
</ak-modal-button>
</li>
<li>
<ak-modal-button href="${Provider.adminUrl(`/create/saml/from-metadata`)}/">
<ak-modal-button href="${Provider.adminUrl("/create/saml/from-metadata/")}">
<button slot="trigger" class="pf-c-dropdown__menu-item">${gettext("SAML Provider from Metadata")}<br>
<small>
${gettext("Create a SAML Provider by importing its Metadata.")}

View File

@ -1,12 +1,8 @@
import { gettext } from "django";
import { customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { customElement, LitElement, property } from "lit-element";
import { Provider } from "../../api/Providers";
import { PBResponse } from "../../api/Client";
import { TablePage } from "../../elements/table/TablePage";
import "../../elements/buttons/ModalButton";
import "../../elements/buttons/SpinnerButton";
import { TableColumn } from "../../elements/table/Table";
@customElement("ak-provider-view")
export class ProviderViewPage extends LitElement {
@ -15,7 +11,7 @@ export class ProviderViewPage extends LitElement {
this.providerID = value.id;
}
@property()
@property({type: Number})
set providerID(value: number) {
Provider.get(value).then((app) => (this.provider = app));
}