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

View file

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

View file

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