Skip to content
Open
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
9 changes: 8 additions & 1 deletion framework/core/js/src/admin/components/PermissionGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Button from '../../common/components/Button';
import ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril';
import Icon from '../../common/components/Icon';
import extractText from '../../common/utils/extractText';

export interface PermissionConfig {
permission?: string;
Expand Down Expand Up @@ -63,7 +64,13 @@ export default class PermissionGrid<CustomAttrs extends IPermissionGridAttrs = I
icon="fas fa-times"
className="Button Button--text PermissionGrid-removeScope"
aria-label={app.translator.trans('core.admin.permissions.remove_scope_label', { scope: scope.label })}
onclick={scope.onremove}
onclick={() => {
const message = extractText(app.translator.trans('core.admin.permissions.remove_scope_confirmation', { scope: scope.label }));

if (confirm(message)) {
scope.onremove?.();
}
}}
/>
)}
</th>
Expand Down
1 change: 1 addition & 0 deletions framework/core/locale/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ core:
post_without_throttle_label: Reply multiple times without waiting
read_heading: Read
remove_scope_label: Remove scope of {scope}
remove_scope_confirmation: Are you sure you want to remove the {scope} scope?
rename_discussions_label: Rename discussions
reply_to_discussions_label: Reply to discussions
search_users_label: => core.ref.search_users
Expand Down
Loading