From d0d1b2675dd93a104a46df842ea4e219db5ef499 Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Thu, 21 Nov 2013 11:24:46 +0100 Subject: [PATCH] Some changes to related links to make sure peoples front end code will still work --- .../Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs | 7 +++++-- .../relatedlinks/relatedlinks.controller.js | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs index a3ad8f47eb..0861c1df51 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Deployment.Internal; using System.Dynamic; using System.Linq; using System.Text; @@ -54,10 +55,12 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven //create the links in the format the new prop editor expects it to be var link = new ExpandoObject() as IDictionary; - link.Add("caption", title); - link.Add("link", type.Equals("internal") ? null : lnk); + link.Add("title", title); + link.Add("link", lnk); link.Add("newWindow", newwindow); + link.Add("type", type.Equals("internal") ? "internal" : "external"); link.Add("internal", type.Equals("internal") ? lnk : null); + link.Add("edit", false); link.Add("isInternal", type.Equals("internal")); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 294f9a84b6..e5e1fa3a14 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -56,17 +56,21 @@ this.newWindow = $scope.newNewWindow; this.edit = false; this.isInternal = false; + this.type = "external"; + this.title = $scope.newCaption; }; $scope.model.value.push(newExtLink); } else { var newIntLink = new function() { this.caption = $scope.newCaption; - this.link = $scope.newLink; + this.link = $scope.newInternal; this.newWindow = $scope.newNewWindow; this.internal = $scope.newInternal; this.edit = false; this.isInternal = true; this.iternalName = $scope.newInternalName; + this.type = "internal"; + this.title = $scope.newCaption; }; $scope.model.value.push(newIntLink); }