web: switch to eslint

This commit is contained in:
Jens Langhammer
2020-12-01 09:15:41 +01:00
parent a312ad2ad1
commit 0231bcf685
25 changed files with 1010 additions and 151 deletions

View File

@ -12,7 +12,7 @@ export abstract class Table<T> extends LitElement {
data?: PBResponse<T>;
@property()
page: number = 1;
page = 1;
static get styles() {
return [COMMON_STYLES];
@ -51,12 +51,12 @@ export abstract class Table<T> extends LitElement {
return;
}
return this.data.results.map((item) => {
const fullRow = [`<tr role="row">`].concat(
const fullRow = ["<tr role=\"row\">"].concat(
this.row(item).map((col) => {
return `<td role="cell">${col}</td>`;
})
);
fullRow.push(`</tr>`);
fullRow.push("</tr>");
return html(<any>fullRow);
});
}
@ -71,8 +71,8 @@ export abstract class Table<T> extends LitElement {
<slot name="create-button"></slot>
<button
@click=${() => {
this.fetch();
}}
this.fetch();
}}
class="pf-c-button pf-m-primary"
>
Refresh
@ -88,8 +88,8 @@ export abstract class Table<T> extends LitElement {
<thead>
<tr role="row">
${this.columns().map(
(col) => html`<th role="columnheader" scope="col">${col}</th>`
)}
(col) => html`<th role="columnheader" scope="col">${col}</th>`
)}
</tr>
</thead>
<tbody role="rowgroup">

View File

@ -13,7 +13,7 @@ export class TablePagination extends LitElement {
previousHandler() {
if (!this.table?.data?.pagination.previous) {
console.debug(`passbook/tables: no previous`);
console.debug("passbook/tables: no previous");
return;
}
this.table.page = this.table?.data?.pagination.previous;
@ -21,7 +21,7 @@ export class TablePagination extends LitElement {
nextHandler() {
if (!this.table?.data?.pagination.next) {
console.debug(`passbook/tables: no next`);
console.debug("passbook/tables: no next");
return;
}
this.table.page = this.table?.data?.pagination.next;
@ -44,8 +44,8 @@ export class TablePagination extends LitElement {
<button
class="pf-c-button pf-m-plain"
@click=${() => {
this.previousHandler();
}}
this.previousHandler();
}}
disabled="${this.table?.data?.pagination.previous ? "true" : "false"}"
aria-label="{% trans 'Go to previous page' %}"
>
@ -56,8 +56,8 @@ export class TablePagination extends LitElement {
<button
class="pf-c-button pf-m-plain"
@click=${() => {
this.nextHandler();
}}
this.nextHandler();
}}
disabled="${this.table?.data?.pagination.next ? "true" : "false"}"
aria-label="{% trans 'Go to next page' %}"
>