Adds create container endpoint for creation folders for scripts, partialviews, partialviewmacros

This commit is contained in:
Emil Wangaa
2017-02-07 10:55:38 +01:00
parent 999de5ae1d
commit c36000c4dd
7 changed files with 88 additions and 12 deletions

View File

@@ -235,7 +235,7 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) {
$http.post(umbRequestHelper.getApiUrl(
"codeFileApiBaseUrl",
"PostCreateContainer",
{ type: type, parentId: parentId, name: name })),
{ type: type, parentId: parentId, name: encodeURIComponent(name) })),
'Failed to create a folder under parent id ' + parentId);
}

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function PartialViewMacrosCreateController($scope, codefileResource, $location, navigationService, formHelper, localizationService) {
function PartialViewMacrosCreateController($scope, codefileResource, $location, navigationService, formHelper, localizationService, appState) {
var vm = this;
var node = $scope.dialogOptions.currentNode;
@@ -45,13 +45,13 @@
function createFolder(form) {
if (formHelper.submitForm({scope: $scope, formCtrl: form, statusMessage: localizeCreateFolder})) {
codefileResource.createContainer("partialViewMacros", node.id, vm.folderName).then(function(path) {
codefileResource.createContainer("partialViewMacros", node.id, vm.folderName).then(function (saved) {
navigationService.hideMenu();
navigationService.syncTree({
tree: "partialViewMacros",
path: path,
path: saved.path,
forceReload: true,
activate: true
});

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function PartialViewsCreateController($scope, codefileResource, $location, navigationService, formHelper, localizationService) {
function PartialViewsCreateController($scope, codefileResource, $location, navigationService, formHelper, localizationService, appState) {
var vm = this;
var node = $scope.dialogOptions.currentNode;
@@ -45,13 +45,13 @@
function createFolder(form) {
if (formHelper.submitForm({scope: $scope, formCtrl: form, statusMessage: localizeCreateFolder})) {
codefileResource.createContainer("partialViews", node.id, vm.folderName).then(function(path) {
codefileResource.createContainer("partialViews", node.id, vm.folderName).then(function(saved) {
navigationService.hideMenu();
navigationService.syncTree({
tree: "partialViews",
path: path,
path: saved.path,
forceReload: true,
activate: true
});

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function ScriptsCreateController($scope, $location, navigationService, formHelper, codefileResource, localizationService) {
function ScriptsCreateController($scope, $location, navigationService, formHelper, codefileResource, localizationService, appState) {
var vm = this;
var node = $scope.dialogOptions.currentNode;
@@ -29,13 +29,13 @@
if (formHelper.submitForm({scope: $scope, formCtrl: form, statusMessage: localizeCreateFolder})) {
codefileResource.createContainer("scripts", node.id, vm.folderName).then(function(path) {
codefileResource.createContainer("scripts", node.id, vm.folderName).then(function (saved) {
navigationService.hideMenu();
navigationService.syncTree({
tree: "scripts",
path: path,
path: saved.path,
forceReload: true,
activate: true
});