Skip to content

Commit

Permalink
web: change "delete" verb to "remove" for one-to-many relationships
Browse files Browse the repository at this point in the history
Two changes here

- make a new property on the BulkDeleteForm view so an external user can set the button label
  dynamically, with the original "Delete" as default.
- Add the property to the RelatedGroupsList view, with the word "Remove," as requested by Tana.
  • Loading branch information
kensternberg-authentik committed Feb 15, 2024
1 parent 07b6356 commit c8fc065
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/src/admin/groups/RelatedGroupList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class RelatedGroupList extends Table<Group> {
actionSubtext=${msg(
str`Are you sure you want to remove user ${this.targetUser?.username} from the following groups?`,
)}
buttonLabel=${msg("Remove")}
.objects=${this.selectedElements}
.delete=${(item: Group) => {
if (!this.targetUser) return;
Expand Down
5 changes: 4 additions & 1 deletion web/src/elements/forms/DeleteBulkForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export class DeleteBulkForm<T> extends ModalButton {
@property()
actionSubtext?: string;

@property()
buttonLabel = msg("Delete");

@property({ attribute: false })
metadata: (item: T) => BulkDeleteMetadata = (item: T) => {
const rec = item as Record<string, unknown>;
Expand Down Expand Up @@ -222,7 +225,7 @@ export class DeleteBulkForm<T> extends ModalButton {
}}
class="pf-m-danger"
>
${msg("Delete")} </ak-spinner-button
${this.buttonLabel} </ak-spinner-button
>&nbsp;
<ak-spinner-button
.callAction=${async () => {
Expand Down

0 comments on commit c8fc065

Please sign in to comment.