diff --git a/src/Umbraco.Web.UI.Client/src/routes.js b/src/Umbraco.Web.UI.Client/src/routes.js index c2d3ea2df8..ecb011e3f0 100644 --- a/src/Umbraco.Web.UI.Client/src/routes.js +++ b/src/Umbraco.Web.UI.Client/src/routes.js @@ -164,6 +164,13 @@ app.config(function ($routeProvider) { return; } + //special case for the users section + var usersPages = ["user", "group"]; + if ($routeParams.section.toLowerCase() === "users" && $routeParams.tree.toLowerCase() === "users" && usersPages.indexOf($routeParams.method.toLowerCase()) === -1) { + $scope.templateUrl = "views/users/overview.html"; + return; + } + // Here we need to figure out if this route is for a user's package tree and if so then we need // to change it's convention view path to: // /App_Plugins/{mypackage}/backoffice/{treetype}/{method}.html diff --git a/src/Umbraco.Web.UI.Client/src/views/users/group.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/group.controller.js index 54096d413b..a9d9f5d4e4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/group.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/group.controller.js @@ -100,7 +100,7 @@ } function goToPage(ancestor) { - $location.path(ancestor.path).search("subview", ancestor.subView); + $location.path(ancestor.path); } function openSectionPicker() { @@ -292,8 +292,7 @@ vm.breadcrumbs = [ { "name": vm.labels.groups, - "path": "/users/users/overview", - "subView": "groups" + "path": "/users/users/groups" }, { "name": vm.userGroup.name diff --git a/src/Umbraco.Web.UI.Client/src/views/users/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/overview.controller.js index 80e2322f6b..2268bb93b8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/overview.controller.js @@ -1,17 +1,11 @@ (function () { "use strict"; - function UsersOverviewController($scope, $location, localizationService) { + function UsersOverviewController($scope, $location, $routeParams, localizationService) { var vm = this; - var usersUri = $location.search().subview; - if (!usersUri) { - $location.search("subview", "users"); - //exit after this, we don't want to initialize anything further since this - //is going to change the route - return; - } - + let usersUri = $routeParams.method; + //note on the below, we dont assign a view unless it's the right route since if we did that it will load in that controller //for the view which is unecessary and will cause extra overhead/requests to occur vm.page = {}; @@ -30,7 +24,7 @@ var labels = ["sections_users", "general_groups"]; - localizationService.localizeMany(labels).then(function(data){ + localizationService.localizeMany(labels).then(function (data) { vm.page.labels.users = data[0]; vm.page.labels.groups = data[1]; @@ -38,8 +32,8 @@ { "name": vm.page.labels.users, "icon": "icon-user", - "action": function() { - $location.search("subview", "users") + "action": function () { + $location.path("/users/users/users").search("create", null); }, "view": !usersUri || usersUri === "users" ? "views/users/views/users/users.html" : null, "active": !usersUri || usersUri === "users", @@ -49,7 +43,7 @@ "name": vm.page.labels.groups, "icon": "icon-users", "action": function () { - $location.search("subview", "groups") + $location.path("/users/users/groups").search("create", null); }, "view": usersUri === "groups" ? "views/users/views/groups/groups.html" : null, "active": usersUri === "groups", @@ -60,11 +54,11 @@ } function setPageName() { - localizationService.localize("user_userManagement").then(function(data){ + localizationService.localize("user_userManagement").then(function (data) { vm.page.name = data; }) } - + onInit(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js index dc4512a549..d5636c5b3f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js @@ -205,7 +205,7 @@ } function goToPage(ancestor) { - $location.path(ancestor.path).search("subview", ancestor.subView); + $location.path(ancestor.path); } function openUserGroupPicker() { @@ -458,8 +458,7 @@ vm.breadcrumbs = [ { "name": vm.labels.users, - "path": "/users/users/overview", - "subView": "users" + "path": "/users/users/users" }, { "name": vm.user.name diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js index 2b531b7ef2..92ed10267d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js @@ -558,7 +558,7 @@ } function goToUser(userId) { - $location.path('users/users/user/' + userId); + $location.path('users/users/user/' + userId).search("create", null).search("invite", null); } // helpers diff --git a/src/Umbraco.Web/Trees/UserTreeController.cs b/src/Umbraco.Web/Trees/UserTreeController.cs index 91078b2be8..7da0b689af 100644 --- a/src/Umbraco.Web/Trees/UserTreeController.cs +++ b/src/Umbraco.Web/Trees/UserTreeController.cs @@ -21,7 +21,7 @@ namespace Umbraco.Web.Trees var root = base.CreateRootNode(queryStrings); //this will load in a custom UI instead of the dashboard for the root node - root.RoutePath = string.Format("{0}/{1}/{2}", Constants.Applications.Users, Constants.Trees.Users, "overview"); + root.RoutePath = $"{Constants.Applications.Users}/{Constants.Trees.Users}/users"; root.Icon = "icon-users"; root.HasChildren = false;