Merge pull request #4853 from umbraco/temp8-js-error-unpublishing
Fixes javascript error when trying to unpublish an invariant item
This commit is contained in:
443
src/Umbraco.Web.UI.Client/package-lock.json
generated
443
src/Umbraco.Web.UI.Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -301,6 +301,19 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
|
||||
return allProps;
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.services.contentEditingHelper#buildCompositeVariantId
|
||||
* @methodOf umbraco.services.contentEditingHelper
|
||||
* @function
|
||||
*
|
||||
* @description
|
||||
* Returns a id for the variant that is unique between all variants on the content
|
||||
*/
|
||||
buildCompositeVariantId: function (variant) {
|
||||
return (variant.language ? variant.language.culture : "invariant") + "_" + (variant.segment ? variant.segment : "");
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function PublishController($scope, localizationService) {
|
||||
function PublishController($scope, localizationService, contentEditingHelper) {
|
||||
|
||||
var vm = this;
|
||||
vm.loading = true;
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
variant.compositeId = variant.language.culture + "_" + (variant.segment ? variant.segment : "");
|
||||
variant.compositeId = contentEditingHelper.buildCompositeVariantId(variant);
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
|
||||
//check for pristine variants
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function SaveContentController($scope, localizationService) {
|
||||
function SaveContentController($scope, localizationService, contentEditingHelper) {
|
||||
|
||||
var vm = this;
|
||||
vm.loading = true;
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
variant.compositeId = variant.language.culture + "_" + (variant.segment ? variant.segment : "");
|
||||
variant.compositeId = contentEditingHelper.buildCompositeVariantId(variant);
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
|
||||
//check for pristine variants
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function ScheduleContentController($scope, $timeout, localizationService, dateHelper, userService) {
|
||||
function ScheduleContentController($scope, $timeout, localizationService, dateHelper, userService, contentEditingHelper) {
|
||||
|
||||
var vm = this;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
variant.compositeId = variant.language.culture + "_" + (variant.segment ? variant.segment : "");
|
||||
variant.compositeId = contentEditingHelper.buildCompositeVariantId(variant);
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
|
||||
//check for pristine variants
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function SendToPublishController($scope, localizationService) {
|
||||
function SendToPublishController($scope, localizationService, contentEditingHelper) {
|
||||
|
||||
var vm = this;
|
||||
vm.loading = true;
|
||||
@@ -25,7 +25,7 @@
|
||||
if (vm.variants.length !== 0) {
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
variant.compositeId = variant.language.culture + "_" + (variant.segment ? variant.segment : "");
|
||||
variant.compositeId = contentEditingHelper.buildCompositeVariantId(variant);
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function UnpublishController($scope, localizationService) {
|
||||
function UnpublishController($scope, localizationService, contentEditingHelper) {
|
||||
|
||||
var vm = this;
|
||||
var autoSelectedVariants = [];
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
variant.compositeId = variant.language.culture + "_" + (variant.segment ? variant.segment : "");
|
||||
variant.compositeId = contentEditingHelper.buildCompositeVariantId(variant);
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
});
|
||||
$scope.model.disableSubmitButton = !firstSelected; //disable submit button if there is none selected
|
||||
|
||||
// if a mandatory variant is selected we want to selet all other variants
|
||||
// if a mandatory variant is selected we want to select all other variants
|
||||
// and disable selection for the others
|
||||
if(selectedVariant.save && selectedVariant.language.isMandatory) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user