web/admin: only show non-backchannel providers in application provider select (#9658)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2024-05-09 18:10:07 +02:00
committed by GitHub
parent 85594a119c
commit 2edc651582
6 changed files with 31 additions and 9 deletions

View File

@ -18,7 +18,7 @@ export interface SummarizedSyncStatus {
}
@customElement("ak-admin-status-chart-sync")
export class LDAPSyncStatusChart extends AKChart<SummarizedSyncStatus[]> {
export class SyncStatusChart extends AKChart<SummarizedSyncStatus[]> {
getChartType(): string {
return "doughnut";
}
@ -102,6 +102,19 @@ export class LDAPSyncStatusChart extends AKChart<SummarizedSyncStatus[]> {
},
msg("Google Workspace Provider"),
),
await this.fetchStatus(
() => {
return new ProvidersApi(DEFAULT_CONFIG).providersMicrosoftEntraList();
},
(element) => {
return new ProvidersApi(
DEFAULT_CONFIG,
).providersMicrosoftEntraSyncStatusRetrieve({
id: element.pk,
});
},
msg("Microsoft Entra Provider"),
),
await this.fetchStatus(
() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapList();

View File

@ -21,7 +21,7 @@ export class ProviderSelectModal extends TableModal<Provider> {
}
@property({ type: Boolean })
backchannelOnly = false;
backchannel?: boolean;
@property()
confirm!: (selectedItems: Provider[]) => Promise<unknown>;
@ -34,7 +34,7 @@ export class ProviderSelectModal extends TableModal<Provider> {
page: page,
pageSize: (await uiConfig()).pagination.perPage,
search: this.search || "",
backchannelOnly: this.backchannelOnly,
backchannel: this.backchannel,
});
}

View File

@ -64,7 +64,7 @@ export class AkBackchannelProvidersInput extends AKElement {
return html`
<ak-form-element-horizontal label=${this.label} name=${this.name}>
<div class="pf-c-input-group">
<ak-provider-select-table ?backchannelOnly=${true} .confirm=${this.confirm}>
<ak-provider-select-table ?backchannel=${true} .confirm=${this.confirm}>
<button slot="trigger" class="pf-c-button pf-m-control" type="button">
${this.tooltip ? this.tooltip : nothing}
<i class="fas fa-plus" aria-hidden="true"></i>

View File

@ -15,6 +15,7 @@ const doGroupBy = (items: Provider[]) => groupBy(items, (item) => item.verboseNa
async function fetch(query?: string) {
const args: ProvidersAllListRequest = {
ordering: "name",
backchannel: false,
};
if (query !== undefined) {
args.search = query;