web/admin: workaround for tenant certificate selection being cut off (#4820)
Signed-off-by: Jens Langhammer <jens@goauthentik.io> #4814
This commit is contained in:
parent
9042664fcf
commit
87fa50c492
|
@ -370,6 +370,37 @@ export class TenantForm extends ModelForm<Tenant, string> {
|
||||||
<ak-form-group>
|
<ak-form-group>
|
||||||
<span slot="header"> ${t`Other global settings`} </span>
|
<span slot="header"> ${t`Other global settings`} </span>
|
||||||
<div slot="body" class="pf-c-form">
|
<div slot="body" class="pf-c-form">
|
||||||
|
<ak-form-element-horizontal label=${t`Web Certificate`} name="webCertificate">
|
||||||
|
<ak-search-select
|
||||||
|
.fetchObjects=${async (
|
||||||
|
query?: string,
|
||||||
|
): Promise<CertificateKeyPair[]> => {
|
||||||
|
const args: CryptoCertificatekeypairsListRequest = {
|
||||||
|
ordering: "name",
|
||||||
|
hasKey: true,
|
||||||
|
includeDetails: false,
|
||||||
|
};
|
||||||
|
if (query !== undefined) {
|
||||||
|
args.search = query;
|
||||||
|
}
|
||||||
|
const certificates = await new CryptoApi(
|
||||||
|
DEFAULT_CONFIG,
|
||||||
|
).cryptoCertificatekeypairsList(args);
|
||||||
|
return certificates.results;
|
||||||
|
}}
|
||||||
|
.renderElement=${(item: CertificateKeyPair): string => {
|
||||||
|
return item.name;
|
||||||
|
}}
|
||||||
|
.value=${(item: CertificateKeyPair | undefined): string | undefined => {
|
||||||
|
return item?.pk;
|
||||||
|
}}
|
||||||
|
.selected=${(item: CertificateKeyPair): boolean => {
|
||||||
|
return item.pk === this.instance?.webCertificate;
|
||||||
|
}}
|
||||||
|
?blankable=${true}
|
||||||
|
>
|
||||||
|
</ak-search-select>
|
||||||
|
</ak-form-element-horizontal>
|
||||||
<ak-form-element-horizontal
|
<ak-form-element-horizontal
|
||||||
label=${t`Event retention`}
|
label=${t`Event retention`}
|
||||||
?required=${true}
|
?required=${true}
|
||||||
|
@ -404,37 +435,6 @@ export class TenantForm extends ModelForm<Tenant, string> {
|
||||||
${t`Set custom attributes using YAML or JSON. Any attributes set here will be inherited by users, if the request is handled by this tenant.`}
|
${t`Set custom attributes using YAML or JSON. Any attributes set here will be inherited by users, if the request is handled by this tenant.`}
|
||||||
</p>
|
</p>
|
||||||
</ak-form-element-horizontal>
|
</ak-form-element-horizontal>
|
||||||
<ak-form-element-horizontal label=${t`Web Certificate`} name="webCertificate">
|
|
||||||
<ak-search-select
|
|
||||||
.fetchObjects=${async (
|
|
||||||
query?: string,
|
|
||||||
): Promise<CertificateKeyPair[]> => {
|
|
||||||
const args: CryptoCertificatekeypairsListRequest = {
|
|
||||||
ordering: "name",
|
|
||||||
hasKey: true,
|
|
||||||
includeDetails: false,
|
|
||||||
};
|
|
||||||
if (query !== undefined) {
|
|
||||||
args.search = query;
|
|
||||||
}
|
|
||||||
const certificates = await new CryptoApi(
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
).cryptoCertificatekeypairsList(args);
|
|
||||||
return certificates.results;
|
|
||||||
}}
|
|
||||||
.renderElement=${(item: CertificateKeyPair): string => {
|
|
||||||
return item.name;
|
|
||||||
}}
|
|
||||||
.value=${(item: CertificateKeyPair | undefined): string | undefined => {
|
|
||||||
return item?.pk;
|
|
||||||
}}
|
|
||||||
.selected=${(item: CertificateKeyPair): boolean => {
|
|
||||||
return item.pk === this.instance?.webCertificate;
|
|
||||||
}}
|
|
||||||
?blankable=${true}
|
|
||||||
>
|
|
||||||
</ak-search-select>
|
|
||||||
</ak-form-element-horizontal>
|
|
||||||
</div>
|
</div>
|
||||||
</ak-form-group>
|
</ak-form-group>
|
||||||
</form>`;
|
</form>`;
|
||||||
|
|
|
@ -268,7 +268,10 @@ export class SearchSelect<T> extends AKElement {
|
||||||
@blur=${(ev: FocusEvent) => {
|
@blur=${(ev: FocusEvent) => {
|
||||||
// For Safari, we get the <ul> element itself here when clicking on one of
|
// For Safari, we get the <ul> element itself here when clicking on one of
|
||||||
// it's buttons, as the container has tabindex set
|
// it's buttons, as the container has tabindex set
|
||||||
if ((ev.relatedTarget as HTMLElement).id === this.dropdownUID) {
|
if (
|
||||||
|
ev.relatedTarget &&
|
||||||
|
(ev.relatedTarget as HTMLElement).id === this.dropdownUID
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check if we're losing focus to one of our dropdown items, and if such don't blur
|
// Check if we're losing focus to one of our dropdown items, and if such don't blur
|
||||||
|
|
Reference in New Issue