Adds create container endpoint for creation folders for scripts, partialviews, partialviewmacros
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user