Redirect away from page under the settings section when the page is deleted. Affects DataTypes, DocTypes, Macros, MediaTypes, Membertypes, PartialViewMacro,PartialViews, Scripts, Stylesheet & Templates

This commit is contained in:
David Sheiles
2019-02-28 13:33:45 +11:00
parent 746573d28b
commit 45dfef78bd
11 changed files with 100 additions and 19 deletions
+21 -7
View File
@@ -5210,12 +5210,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -5230,17 +5232,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -5357,7 +5362,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@@ -5369,6 +5375,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -5383,6 +5390,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -5390,12 +5398,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@@ -5414,6 +5424,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -5494,7 +5505,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -5506,6 +5518,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -5627,6 +5640,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -6,7 +6,7 @@
* @description
* The controller for deleting content
*/
function DataTypeDeleteController($scope, dataTypeResource, treeService, navigationService) {
function DataTypeDeleteController($scope, $location, dataTypeResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -23,6 +23,12 @@ function DataTypeDeleteController($scope, dataTypeResource, treeService, navigat
navigationService.hideMenu();
});
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted DataType is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
};
$scope.performContainerDelete = function () {
@@ -6,8 +6,8 @@
* @description
* The controller for deleting content
*/
function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeResource, treeService, navigationService) {
function DocumentTypesDeleteController($scope, $location, dataTypeResource, contentTypeResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
//mark it for deletion (used in the UI)
@@ -20,7 +20,13 @@ function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeReso
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted doctype is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section );
}
});
};
@@ -38,6 +44,7 @@ function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeReso
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
});
};
@@ -6,7 +6,7 @@
* @description
* The controller for deleting macro items
*/
function MacrosDeleteController($scope, $location, macroResource, navigationService, treeService) {
function MacrosDeleteController($scope, $location, macroResource, navigationService, treeService, appState) {
var vm = this;
vm.name = $scope.currentNode.name;
@@ -18,6 +18,14 @@ function MacrosDeleteController($scope, $location, macroResource, navigationServ
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted Macro is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
});
}
@@ -6,7 +6,7 @@
* @description
* The controller for the media type delete dialog
*/
function MediaTypesDeleteController($scope, dataTypeResource, mediaTypeResource, treeService, navigationService) {
function MediaTypesDeleteController($scope, $location, dataTypeResource, mediaTypeResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -21,6 +21,12 @@ function MediaTypesDeleteController($scope, dataTypeResource, mediaTypeResource,
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted MediaType is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
});
};
@@ -6,7 +6,7 @@
* @description
* The controller for deleting member types
*/
function MemberTypesDeleteController($scope, memberTypeResource, treeService, navigationService) {
function MemberTypesDeleteController($scope, $location, memberTypeResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -21,6 +21,12 @@ function MemberTypesDeleteController($scope, memberTypeResource, treeService, na
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted MemberType is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
});
};
@@ -6,7 +6,7 @@
* @description
* The controller for deleting partial view macros
*/
function PartialViewMacrosDeleteController($scope, codefileResource, treeService, navigationService) {
function PartialViewMacrosDeleteController($scope, $location, codefileResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -21,6 +21,12 @@ function PartialViewMacrosDeleteController($scope, codefileResource, treeService
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted PartialViewMacro is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
});
};
@@ -6,7 +6,7 @@
* @description
* The controller for deleting partial views
*/
function PartialViewsDeleteController($scope, codefileResource, treeService, navigationService) {
function PartialViewsDeleteController($scope, $location, codefileResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -24,6 +24,13 @@ function PartialViewsDeleteController($scope, codefileResource, treeService, nav
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted PartialView is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
}, function (err) {
$scope.currentNode.loading = false;
$scope.error = err;
@@ -6,7 +6,7 @@
* @description
* The controller for deleting scripts
*/
function ScriptsDeleteController($scope, codefileResource, treeService, navigationService) {
function ScriptsDeleteController($scope, $location, codefileResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -21,6 +21,13 @@ function ScriptsDeleteController($scope, codefileResource, treeService, navigati
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted Script is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
});
};
@@ -6,7 +6,7 @@
* @description
* The controller for deleting stylesheets
*/
function StyleSheetsDeleteController($scope, codefileResource, treeService, navigationService) {
function StyleSheetsDeleteController($scope, $location, codefileResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -18,6 +18,12 @@ function StyleSheetsDeleteController($scope, codefileResource, treeService, navi
$scope.currentNode.loading = false;
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted StyleSheet is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
});
};
@@ -6,7 +6,7 @@
* @description
* The controller for the template delete dialog
*/
function TemplatesDeleteController($scope, templateResource , treeService, navigationService) {
function TemplatesDeleteController($scope, $location, templateResource, treeService, navigationService, appState) {
$scope.performDelete = function() {
@@ -25,6 +25,14 @@ function TemplatesDeleteController($scope, templateResource , treeService, navig
// TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
if ("/" + $scope.currentNode.routePath.toLowerCase() === $location.path().toLowerCase()) {
//The deleted Template is open, so redirect
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
}, function (err) {
$scope.currentNode.loading = false;
$scope.error = err;