web: clear out selecteds list after an API event to ensure a fresh copy of the policies-to-delete list

This commit is contained in:
Ken Sternberg 2024-01-10 11:19:07 -08:00
parent 8831e1d946
commit e32e8f3cfa
1 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import "@goauthentik/admin/policies/PolicyBindingForm";
import "@goauthentik/admin/policies/PolicyWizard"; import "@goauthentik/admin/policies/PolicyWizard";
import "@goauthentik/admin/users/UserForm"; import "@goauthentik/admin/users/UserForm";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { EVENT_REFRESH } from "@goauthentik/common/constants";
import { uiConfig } from "@goauthentik/common/ui/config"; import { uiConfig } from "@goauthentik/common/ui/config";
import "@goauthentik/components/ak-status-label"; import "@goauthentik/components/ak-status-label";
import { PFSize } from "@goauthentik/elements/Spinner"; import { PFSize } from "@goauthentik/elements/Spinner";
@ -30,6 +31,13 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
checkbox = true; checkbox = true;
constructor() {
super();
this.addEventListener(EVENT_REFRESH, () => {
this.selectedElements = [];
});
}
async apiEndpoint(page: number): Promise<PaginatedResponse<PolicyBinding>> { async apiEndpoint(page: number): Promise<PaginatedResponse<PolicyBinding>> {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsList({ return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsList({
target: this.target || "", target: this.target || "",
@ -186,7 +194,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
</button> </button>
</ak-forms-modal> </ak-forms-modal>
</div> </div>
</ak-empty-state>`, </ak-empty-state>`
); );
} }