- * codefileResource.deleteByPath('partialView', 'Grid%2fEditors%2fBase.cshtml')
+ * codefileResource.deleteByPath('partialViews', 'Grid%2fEditors%2fBase.cshtml')
* .then(function() {
* alert('its gone!');
* });
*
*
- * @param {type} the type of script (partialView, partialViewMacro, script)
+ * @param {type} the type of script (partialViews, partialViewMacros, scripts)
* @param {virtualpath} the virtual path of the script
* @returns {Promise} resourcePromise object.
*
@@ -145,7 +145,7 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) {
"codeFileApiBaseUrl",
"Delete",
[{ type: type }, { virtualPath: virtualpath}])),
- "Failed to delete item " + id);
+ "Failed to delete item: " + virtualpath);
},
/**
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js
index 0649277c54..6c83f69f84 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js
@@ -19,14 +19,14 @@ function memberTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
_.each(filterContentTypes, function (item) {
query += "filterContentTypes=" + item + "&";
});
- // if filterContentTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
+ // if filterContentTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterContentTypes.length === 0) {
query += "filterContentTypes=&";
}
_.each(filterPropertyTypes, function (item) {
query += "filterPropertyTypes=" + item + "&";
});
- // if filterPropertyTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
+ // if filterPropertyTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterPropertyTypes.length === 0) {
query += "filterPropertyTypes=&";
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js
index c759169752..86137888fa 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js
@@ -204,7 +204,7 @@ angular.module('umbraco.services')
//when it's successful, return the user data
setCurrentUser(data);
- var result = { user: data, authenticated: true, lastUserId: lastUserId };
+ var result = { user: data, authenticated: true, lastUserId: lastUserId, loginType: "credentials" };
//broadcast a global event
eventsService.emit("app.authenticated", result);
@@ -232,7 +232,7 @@ angular.module('umbraco.services')
authResource.getCurrentUser()
.then(function (data) {
- var result = { user: data, authenticated: true, lastUserId: lastUserId };
+ var result = { user: data, authenticated: true, lastUserId: lastUserId, loginType: "implicit" };
//TODO: This is a mega backwards compatibility hack... These variables SHOULD NOT exist in the server variables
// since they are not supposed to be dynamic but I accidentally added them there in 7.1.5 IIRC so some people might
diff --git a/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js b/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
index 74eb872aa2..1504abf7c1 100644
--- a/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
@@ -8,7 +8,7 @@
* The main application controller
*
*/
-function MainController($scope, $rootScope, $location, $routeParams, $timeout, $http, $log, appState, treeService, notificationsService, userService, navigationService, historyService, updateChecker, assetsService, eventsService, umbRequestHelper, tmhDynamicLocale) {
+function MainController($scope, $rootScope, $location, $routeParams, $timeout, $http, $log, appState, treeService, notificationsService, userService, navigationService, historyService, updateChecker, assetsService, eventsService, umbRequestHelper, tmhDynamicLocale, localStorageService) {
//the null is important because we do an explicit bool check on this in the view
//the avatar is by default the umbraco logo
@@ -81,6 +81,14 @@ function MainController($scope, $rootScope, $location, $routeParams, $timeout, $
$location.path("/").search("");
historyService.removeAll();
treeService.clearCache();
+
+ //if the user changed, clearout local storage too - could contain sensitive data
+ localStorageService.clearAll();
+ }
+
+ //if this is a new login (i.e. the user entered credentials), then clear out local storage - could contain sensitive data
+ if (data.loginType === "credentials") {
+ localStorageService.clearAll();
}
//Load locale file
diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js
index 3233974cee..3300c47ab9 100644
--- a/src/Umbraco.Web.UI.Client/src/init.js
+++ b/src/Umbraco.Web.UI.Client/src/init.js
@@ -13,11 +13,7 @@ app.run(['userService', '$log', '$rootScope', '$location', 'navigationService',
/** Listens for authentication and checks if our required assets are loaded, if/once they are we'll broadcast a ready event */
eventsService.on("app.authenticated", function(evt, data) {
-
- //Removes all stored LocalStorage browser items - that may contain sensitive data
- //So if a machine or computer is shared and a new user logs in, we clear out the previous persons localStorage items
- localStorageService.clearAll();
-
+
assetsService._loadInitAssets().then(function() {
appState.setGlobalState("isReady", true);
diff --git a/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js
index 061ca7eb2c..c0cd0c8598 100644
--- a/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js
@@ -1,10 +1,10 @@
/**
* @ngdoc controller
- * @name Umbraco.Editors.DocumentType.DeleteController
+ * @name Umbraco.Editors.MemberTypes.DeleteController
* @function
*
* @description
- * The controller for deleting content
+ * The controller for deleting member types
*/
function MemberTypesDeleteController($scope, memberTypeResource, treeService, navigationService) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.controller.js
new file mode 100644
index 0000000000..9789467827
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.controller.js
@@ -0,0 +1,34 @@
+/**
+ * @ngdoc controller
+ * @name Umbraco.Editors.PartialViewMacros.DeleteController
+ * @function
+ *
+ * @description
+ * The controller for deleting partial view macros
+ */
+function PartialViewMacrosDeleteController($scope, codefileResource, treeService, navigationService) {
+
+ $scope.performDelete = function() {
+
+ //mark it for deletion (used in the UI)
+ $scope.currentNode.loading = true;
+
+ var virtualPath = $scope.currentNode.parentId + $scope.currentNode.name;
+
+ codefileResource.deleteByPath('partialViewMacros', virtualPath)
+ .then(function() {
+ $scope.currentNode.loading = false;
+ //get the root node before we remove it
+ var rootNode = treeService.getTreeRoot($scope.currentNode);
+ //TODO: Need to sync tree, etc...
+ treeService.removeNode($scope.currentNode);
+ navigationService.hideMenu();
+ });
+ };
+
+ $scope.cancel = function() {
+ navigationService.hideDialog();
+ };
+}
+
+angular.module("umbraco").controller("Umbraco.Editors.PartialViewMacros.DeleteController", PartialViewMacrosDeleteController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.html
new file mode 100644
index 0000000000..6b66a48821
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.html
@@ -0,0 +1,12 @@
+
+
+
+