Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web/admin: show user internal service account as disabled #9464

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions web/src/admin/users/UserForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ export class UserForm extends ModelForm<User, number> {
"Service accounts should be used for machine-to-machine authentication or other automations.",
)}`,
},
{
label: "Internal Service account",
value: UserTypeEnum.InternalServiceAccount,
disabled: true,
description: html`${msg(
"Internal Service accounts are created and managed by authentik and cannot be created manually.",
)}`,
},
]}
.value=${this.instance?.type}
>
Expand Down
5 changes: 5 additions & 0 deletions web/src/elements/forms/Radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface RadioOption<T> {
description?: TemplateResult;
default?: boolean;
value: T;
disabled?: boolean;
}

@customElement("ak-radio")
Expand Down Expand Up @@ -77,6 +78,9 @@ export class Radio<T> extends CustomEmitterElement(AKElement) {
// This is a controlled input. Stop the native event from escaping or affecting the
// value. We'll do that ourselves.
ev.stopPropagation();
if (option.disabled) {
return;
}
this.value = option.value;
this.dispatchCustomEvent("change", { value: option.value });
this.dispatchCustomEvent("input", { value: option.value });
Expand All @@ -93,6 +97,7 @@ export class Radio<T> extends CustomEmitterElement(AKElement) {
name="${this.name}"
id=${elId}
.checked=${option.value === this.value}
.disabled=${option.disabled}
/>
<label class="pf-c-radio__label" for=${elId}>${option.label}</label>
${option.description
Expand Down
Loading