Skip to content

Commit

Permalink
fix: unable to edit admin group (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland authored Nov 17, 2023
1 parent ed451b1 commit 0f0030a
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 436 deletions.
5 changes: 3 additions & 2 deletions js/src/admin/extendEditGroupModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ export default function extendEditGroupModal() {
});

extend(EditGroupModal.prototype, 'fields', function (items) {
const isAdmin = this.group.id() === Group.ADMINISTRATOR_ID;
items.add(
'2fa',
<div className="Form-group">
{this.group.id() === Group.ADMINISTRATOR_ID ? (
{isAdmin ? (
<p>
{app.translator.trans('ianm-twofactor.admin.edit_group.admin_2fa_help', {
adminName: this.group.nameSingular(),
Expand All @@ -25,7 +26,7 @@ export default function extendEditGroupModal() {
{app.translator.trans('ianm-twofactor.admin.edit_group.2fa_label')}
</Switch>
)}
<p className="helpText">{app.translator.trans('ianm-twofactor.admin.edit_group.2fa_help')}</p>
{!isAdmin && <p className="helpText">{app.translator.trans('ianm-twofactor.admin.edit_group.2fa_help')}</p>}
</div>,
10
);
Expand Down
Loading

0 comments on commit 0f0030a

Please sign in to comment.