web: Table parity (#427)

* core: fix application API always being sorted by name

* web: add sorting to tables

* web: add search to TablePage

* core: add search to applications API

* core: add MetaNameSerializer

* *: fix signature for non-modal serializers

* providers/*: implement MetaNameSerializer

* web: implement full app list page, use as default in sidebar

* web: fix linting errors

* admin: remove old application list

* web: fix default sorting for application list

* web: fix spacing for search element in toolbar
This commit is contained in:
Jens L
2020-12-24 09:56:05 +01:00
committed by GitHub
parent c3e9168b46
commit 79da2bf698
26 changed files with 355 additions and 244 deletions

View File

@ -1,19 +1,34 @@
import { html, TemplateResult } from "lit-html";
import { ifDefined } from "lit-html/directives/if-defined";
import { Table } from "./Table";
import "./TableSearch";
export abstract class TablePage<T> extends Table<T> {
abstract pageTitle(): string;
abstract pageDescription(): string;
abstract pageDescription(): string | undefined;
abstract pageIcon(): string;
abstract searchEnabled(): boolean;
renderSearch(): TemplateResult {
if (!this.searchEnabled()) {
return super.renderSearch();
}
return html`<ak-table-search value=${ifDefined(this.search)} .onSearch=${(value: string) => {
this.search = value;
this.fetch();
}}>
</ak-table-search>`;
}
render(): TemplateResult {
const description = this.pageDescription();
return html`<section class="pf-c-page__main-section pf-m-light">
<div class="pf-c-content">
<h1>
<i class="${this.pageIcon()}"></i>
${this.pageTitle()}
</h1>
<p>${this.pageDescription()}</p>
${description ? html`<p>${description}</p>` : html``}
</div>
</section>
<section class="pf-c-page__main-section pf-m-no-padding-mobile">