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

Do not show cryptic confirm dialog when editing group #9048

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 26 additions & 19 deletions src/Umbraco.Web.UI.Client/src/views/users/group.controller.js
Expand Up @@ -23,7 +23,9 @@
vm.openContentPicker = openContentPicker;
vm.openMediaPicker = openMediaPicker;
vm.openUserPicker = openUserPicker;
vm.removeSelectedItem = removeSelectedItem;
vm.removeSection = removeSection;
vm.removeAssignedPermissions = removeAssignedPermissions;
vm.removeUser = removeUser;
vm.clearStartNode = clearStartNode;
vm.save = save;
vm.openGranularPermissionsPicker = openGranularPermissionsPicker;
Expand Down Expand Up @@ -281,28 +283,33 @@

}

function removeSelectedItem(index, selection) {
if (selection && selection.length > 0) {
function removeSection(index) {
vm.userGroup.sections.splice(index, 1);
}

const dialog = {
view: "views/users/views/overlays/remove.html",
username: selection[index].username,
userGroupName: vm.userGroup.name.toLowerCase(),
submitButtonLabelKey: "defaultdialogs_yesRemove",
submitButtonStyle: "danger",
function removeAssignedPermissions(index) {
vm.userGroup.assignedPermissions.splice(index, 1);
}

submit: function () {
selection.splice(index, 1);
function removeUser(index) {
const dialog = {
view: "views/users/views/overlays/remove.html",
username: vm.userGroup.users[index].username,
userGroupName: vm.userGroup.name.toLowerCase(),
submitButtonLabelKey: "defaultdialogs_yesRemove",
submitButtonStyle: "danger",

overlayService.close();
},
close: function () {
overlayService.close();
}
};
submit: function () {
vm.userGroup.users.splice(index, 1);

overlayService.open(dialog);
}
overlayService.close();
},
close: function () {
overlayService.close();
}
};

overlayService.open(dialog);
}

function clearStartNode(type) {
Expand Down
6 changes: 3 additions & 3 deletions src/Umbraco.Web.UI.Client/src/views/users/group.html
Expand Up @@ -35,7 +35,7 @@
icon="section.icon"
name="section.name"
allow-remove="true"
on-remove="vm.removeSelectedItem($index, vm.userGroup.sections)">
on-remove="vm.removeSection($index)">
</umb-node-preview>

<button type="button"
Expand Down Expand Up @@ -115,7 +115,7 @@
name="node.name"
permissions="node.allowedPermissions"
allow-remove="true"
on-remove="vm.removeSelectedItem($index, vm.userGroup.assignedPermissions)"
on-remove="vm.removeAssignedPermissions($index)"
allow-edit="true"
on-edit="vm.setPermissionsForNode(node)">
</umb-node-preview>
Expand Down Expand Up @@ -143,7 +143,7 @@
name="user.name"
avatars="user.avatars"
allow-remove="true"
on-remove="vm.removeSelectedItem($index, vm.userGroup.users)">
on-remove="vm.removeUser($index)">
</umb-user-preview>

<button type="button"
Expand Down