fix dialog

This commit is contained in:
sua yoo 2024-05-07 14:30:54 -07:00
parent e1ef894275
commit ebb9dc826a
No known key found for this signature in database
GPG Key ID: 5AD1B4C02D4F0567

View File

@ -2,6 +2,7 @@ import { localized, msg, str } from "@lit/localize";
import type { SlInput } from "@shoelace-style/shoelace";
import { type TemplateResult } from "lit";
import { customElement, property } from "lit/decorators.js";
import { when } from "lit/directives/when.js";
import type { CurrentUser, UserOrg } from "@/types/user";
import LiteElement, { html } from "@/utils/LiteElement";
@ -38,17 +39,14 @@ export class OrgsList extends LiteElement {
}
private renderOrgQuotas() {
if (!this.currOrg) {
return html``;
}
return html`
<btrix-dialog
.label=${msg(str`Quotas for: ${this.currOrg.name}`)}
.label=${msg(str`Quotas for: ${this.currOrg?.name || ""}`)}
.open=${!!this.currOrg}
@sl-request-close=${() => (this.currOrg = null)}
>
${Object.entries(this.currOrg.quotas!).map(([key, value]) => {
${when(this.currOrg?.quotas, (quotas) =>
Object.entries(quotas).map(([key, value]) => {
let label;
switch (key) {
case "maxConcurrentCrawls":
@ -80,7 +78,8 @@ export class OrgsList extends LiteElement {
type="number"
@sl-input="${this.onUpdateQuota}"
></sl-input>`;
})}
}),
)}
<div slot="footer" class="flex justify-end">
<sl-button
size="small"