+ * contentTypeResource.move({ parentId: 1244, id: 123 })
+ * .then(function() {
+ * alert("node was moved");
+ * }, function(err){
+ * alert("node didnt move:" + err.data.Message);
+ * });
+ *
+ * @param {Object} args arguments object
+ * @param {Int} args.idd the ID of the node to move
+ * @param {Int} args.parentId the ID of the parent node to move to
+ * @returns {Promise} resourcePromise object.
+ *
+ */
+ move: function (args) {
+ if (!args) {
+ throw "args cannot be null";
+ }
+ if (!args.parentId) {
+ throw "args.parentId cannot be null";
+ }
+ if (!args.id) {
+ throw "args.id cannot be null";
+ }
return umbRequestHelper.resourcePromise(
- $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostCreateFolder", { parentId: parentId, name: name })),
+ $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostMove"),
+ {
+ parentId: args.parentId,
+ id: args.id
+ }),
+ 'Failed to move content');
+ },
+
+ createContainer: function(parentId, name) {
+
+ return umbRequestHelper.resourcePromise(
+ $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostCreateContainer", { parentId: parentId, name: name })),
'Failed to create a folder under parent id ' + parentId);
}
-
+
};
}
angular.module('umbraco.resources').factory('contentTypeResource', contentTypeResource);
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/datatype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/datatype.resource.js
index a1263a6126..678e8547d5 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/datatype.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/datatype.resource.js
@@ -181,13 +181,13 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
* @returns {Promise} resourcePromise object containing the data type scaffold.
*
*/
- getScaffold: function () {
+ getScaffold: function (parentId) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"dataTypeApiBaseUrl",
- "GetEmpty")),
+ "GetEmpty", { parentId: parentId })),
"Failed to retrieve data for empty datatype");
},
/**
@@ -220,6 +220,17 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
"Failed to delete item " + id);
},
+ deleteContainerById: function (id) {
+
+ return umbRequestHelper.resourcePromise(
+ $http.post(
+ umbRequestHelper.getApiUrl(
+ "dataTypeApiBaseUrl",
+ "DeleteContainer",
+ [{ id: id }])),
+ 'Failed to delete content type contaier');
+ },
+
/**
@@ -303,6 +314,60 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("dataTypeApiBaseUrl", "PostSave"), saveModel),
"Failed to save data for data type id " + dataType.id);
+ },
+
+ /**
+ * @ngdoc method
+ * @name umbraco.resources.dataTypeResource#move
+ * @methodOf umbraco.resources.dataTypeResource
+ *
+ * @description
+ * Moves a node underneath a new parentId
+ *
+ * ##usage
+ *
+ * dataTypeResource.move({ parentId: 1244, id: 123 })
+ * .then(function() {
+ * alert("node was moved");
+ * }, function(err){
+ * alert("node didnt move:" + err.data.Message);
+ * });
+ *
+ * @param {Object} args arguments object
+ * @param {Int} args.idd the ID of the node to move
+ * @param {Int} args.parentId the ID of the parent node to move to
+ * @returns {Promise} resourcePromise object.
+ *
+ */
+ move: function (args) {
+ if (!args) {
+ throw "args cannot be null";
+ }
+ if (!args.parentId) {
+ throw "args.parentId cannot be null";
+ }
+ if (!args.id) {
+ throw "args.id cannot be null";
+ }
+
+ return umbRequestHelper.resourcePromise(
+ $http.post(umbRequestHelper.getApiUrl("dataTypeApiBaseUrl", "PostMove"),
+ {
+ parentId: args.parentId,
+ id: args.id
+ }),
+ 'Failed to move content');
+ },
+
+ createContainer: function (parentId, name) {
+
+ return umbRequestHelper.resourcePromise(
+ $http.post(
+ umbRequestHelper.getApiUrl(
+ "dataTypeApiBaseUrl",
+ "PostCreateContainer",
+ { parentId: parentId, name: name })),
+ 'Failed to create a folder under parent id ' + parentId);
}
};
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js
index 93e7fefa2b..dcdcb7de88 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js
@@ -79,6 +79,17 @@ function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
'Failed to retrieve content type');
},
+ deleteContainerById: function (id) {
+
+ return umbRequestHelper.resourcePromise(
+ $http.post(
+ umbRequestHelper.getApiUrl(
+ "mediaTypeApiBaseUrl",
+ "DeleteContainer",
+ [{ id: id }])),
+ 'Failed to delete content type contaier');
+ },
+
save: function (contentType) {
var saveModel = umbDataFormatter.formatContentTypePostData(contentType);
@@ -88,13 +99,56 @@ function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
'Failed to save data for content type id ' + contentType.id);
},
- createFolder: function(parentId, name) {
+ /**
+ * @ngdoc method
+ * @name umbraco.resources.mediaTypeResource#move
+ * @methodOf umbraco.resources.mediaTypeResource
+ *
+ * @description
+ * Moves a node underneath a new parentId
+ *
+ * ##usage
+ *
+ * mediaTypeResource.move({ parentId: 1244, id: 123 })
+ * .then(function() {
+ * alert("node was moved");
+ * }, function(err){
+ * alert("node didnt move:" + err.data.Message);
+ * });
+ *
+ * @param {Object} args arguments object
+ * @param {Int} args.idd the ID of the node to move
+ * @param {Int} args.parentId the ID of the parent node to move to
+ * @returns {Promise} resourcePromise object.
+ *
+ */
+ move: function (args) {
+ if (!args) {
+ throw "args cannot be null";
+ }
+ if (!args.parentId) {
+ throw "args.parentId cannot be null";
+ }
+ if (!args.id) {
+ throw "args.id cannot be null";
+ }
+
+ return umbRequestHelper.resourcePromise(
+ $http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostMove"),
+ {
+ parentId: args.parentId,
+ id: args.id
+ }),
+ 'Failed to move content');
+ },
+
+ createContainer: function(parentId, name) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
- "PostCreateFolder",
+ "PostCreateContainer",
{ parentId: parentId, name: name })),
'Failed to create a folder under parent id ' + parentId);
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
index 11c62f1aec..7bc069ef44 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
@@ -108,7 +108,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
* @param {String} source The URL to load into the iframe
*/
loadLegacyIFrame: function (source) {
- $location.path("/" + appState.getSectionState("currentSection") + "/framed/" + encodeURIComponent(source));
+ $location.path("/" + appState.getSectionState("currentSection").toLowerCase() + "/framed/" + encodeURIComponent(source));
},
/**
@@ -132,7 +132,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
appState.setSectionState("currentSection", sectionAlias);
this.showTree(sectionAlias);
- $location.path(sectionAlias);
+ $location.path(sectionAlias.toLowerCase());
},
/**
@@ -250,10 +250,10 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
appState.setMenuState("currentNode", args.node);
//not legacy, lets just set the route value and clear the query string if there is one.
- $location.path(n.routePath).search("");
+ $location.path(n.routePath.toLowerCase()).search("");
}
else if (args.element.section) {
- $location.path(args.element.section).search("");
+ $location.path(args.element.section.toLowerCase()).search("");
}
service.hideNavigation();
@@ -446,7 +446,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
if (action.metaData && action.metaData["actionRoute"] && angular.isString(action.metaData["actionRoute"])) {
//first check if the menu item simply navigates to a route
var parts = action.metaData["actionRoute"].split("?");
- $location.path(parts[0]).search(parts.length > 1 ? parts[1] : "");
+ $location.path(parts[0].toLowerCase()).search(parts.length > 1 ? parts[1] : "");
this.hideNavigation();
return;
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js
index 8d94a66793..4371c0d7a7 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js
@@ -537,7 +537,7 @@ function umbDataFormatter() {
/** formats the display model used to display the data type to the model used to save the data type */
formatDataTypePostData: function(displayModel, preValues, action) {
var saveModel = {
- parentId: -1,
+ parentId: displayModel.parentId,
id: displayModel.id,
name: displayModel.name,
selectedEditor: displayModel.selectedEditor,
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/move.html b/src/Umbraco.Web.UI.Client/src/views/content/move.html
index 96e76d4dc4..b64511ec22 100644
--- a/src/Umbraco.Web.UI.Client/src/views/content/move.html
+++ b/src/Umbraco.Web.UI.Client/src/views/content/move.html
@@ -3,7 +3,7 @@
- Choose where to move {{currentNode.name}} to in the tree structure below + Choose where to move {{currentNode.name}} to in the tree structure below
-
+ All property types & property data + using this data type will be deleted permanently, please confirm you want to delete these as well. +
+ ++ Select the folder to move {{currentNode.name}} to in the tree structure below +
+ +{{error.data.message}}
+