Skip to content

Commit

Permalink
Create package form missing "Include all child nodes" label by… (umbr…
Browse files Browse the repository at this point in the history
  • Loading branch information
poornimanayar authored and nul800sebastiaan committed Oct 29, 2019
1 parent 227a0ec commit 6c13e4a
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

vm.labels = {};

vm.versionRegex = /^(\d+\.)(\d+\.)(\*|\d+)$/;
vm.versionRegex = /^(\d+\.)(\d+\.)(\*|\d+)$/;

function onInit() {

if (create) {
// Pre populate package with some values
packageResource.getEmpty().then(scaffold => {
Expand All @@ -53,8 +53,9 @@
vm.loading = false;
});

localizationService.localize("general_create").then(function (value) {
vm.labels.button = value;
localizationService.localizeMany(["general_create", "packager_includeAllChildNodes"]).then(function (values) {
vm.labels.button = values[0];
vm.labels.includeAllChildNodes = values[1];
});
} else {
// Load package
Expand All @@ -77,11 +78,11 @@

});


localizationService.localizeMany(["buttons_save", "packager_includeAllChildNodes"]).then(function (values) {
vm.labels.button = values[0];
vm.labels.includeAllChildNodes = values[1];
});

}
}

Expand Down Expand Up @@ -201,8 +202,8 @@
//don't add a browser history for this
$location.replace();
}
}, function(err){

}, function (err) {
formHelper.handleError(err);
vm.buttonState = "error";
});
Expand All @@ -215,14 +216,14 @@

function openContentPicker() {
const contentPicker = {
submit: function(model) {
if(model.selection && model.selection.length > 0) {
submit: function (model) {
if (model.selection && model.selection.length > 0) {
vm.package.contentNodeId = model.selection[0].id.toString();
vm.contentNodeDisplayModel = model.selection[0];
}
editorService.close();
},
close: function() {
close: function () {
editorService.close();
}
};
Expand All @@ -240,25 +241,25 @@
entityType: "file",
multiPicker: true,
isDialog: true,
select: function(node) {
select: function (node) {
node.selected = !node.selected;

const id = decodeURIComponent(node.id.replace(/\+/g, " "));
const index = selection.indexOf(id);

if(node.selected) {
if(index === -1) {
if (node.selected) {
if (index === -1) {
selection.push(id);
}
} else {
selection.splice(index, 1);
}
},
submit: function() {
submit: function () {
vm.package.files = selection;
editorService.close();
},
close: function() {
close: function () {
editorService.close();
}
};
Expand All @@ -283,12 +284,12 @@
}
},
filterCssClass: "not-allowed",
select: function(node) {
select: function (node) {
const id = decodeURIComponent(node.id.replace(/\+/g, " "));
vm.package.packageView = id;
editorService.close();
},
close: function() {
close: function () {
editorService.close();
}
};
Expand Down Expand Up @@ -384,7 +385,7 @@
}

function buildContributorsEditor(pkg) {

vm.contributorsEditor = {
alias: "contributors",
editor: "Umbraco.MultipleTextstring",
Expand Down

0 comments on commit 6c13e4a

Please sign in to comment.