diff --git a/build/UmbracoVersion.txt b/build/UmbracoVersion.txt index 36ca25b17a..0353e6fdb1 100644 --- a/build/UmbracoVersion.txt +++ b/build/UmbracoVersion.txt @@ -1,2 +1,3 @@ # Usage: on line 2 put the release version, on line 3 put the version comment (example: beta) -7.4.0 \ No newline at end of file +7.4.0 +beta \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 658e8498e9..f170c325c8 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration /// Gets the version comment (like beta or RC). /// /// The version comment. - public static string CurrentComment { get { return ""; } } + public static string CurrentComment { get { return "beta"; } } // Get the version of the umbraco.dll by looking at a class in that dll // Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx diff --git a/src/Umbraco.Core/Models/Rdbms/UmbracoDeployChecksumDto.cs b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployChecksumDto.cs new file mode 100644 index 0000000000..06d904ee88 --- /dev/null +++ b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployChecksumDto.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.DatabaseAnnotations; +using Umbraco.Core.Persistence.DatabaseModelDefinitions; + +namespace Umbraco.Core.Models.Rdbms +{ + [TableName("umbracoDeployChecksum")] + [PrimaryKey("id")] + [ExplicitColumns] + internal class UmbracoDeployChecksumDto + { + [Column("id")] + [PrimaryKeyColumn(Name = "PK_umbracoDeployChecksum")] + public int Id { get; set; } + + [Column("entityType")] + [Length(32)] + [NullSetting(NullSetting = NullSettings.NotNull)] + [Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoDeployChecksum", ForColumns = "entityType,entityGuid,entityPath")] + public string EntityType { get; set; } + + [Column("entityGuid")] + [NullSetting(NullSetting = NullSettings.Null)] + public Guid EntityGuid { get; set; } + + [Column("entityPath")] + [Length(256)] + [NullSetting(NullSetting = NullSettings.Null)] + public string EntityPath { get; set; } + + [Column("localChecksum")] + [NullSetting(NullSetting = NullSettings.NotNull)] + [Length(32)] + public string LocalChecksum { get; set; } + + [Column("compositeChecksum")] + [NullSetting(NullSetting = NullSettings.Null)] + [Length(32)] + public string CompositeChecksum { get; set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Models/Rdbms/UmbracoDeployDependencyDto.cs b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployDependencyDto.cs new file mode 100644 index 0000000000..765a32c929 --- /dev/null +++ b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployDependencyDto.cs @@ -0,0 +1,26 @@ +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.DatabaseAnnotations; + +namespace Umbraco.Core.Models.Rdbms +{ + [TableName("umbracoDeployDependency")] + [ExplicitColumns] + internal class UmbracoDeployDependencyDto + { + [Column("sourceId")] + [PrimaryKeyColumn(AutoIncrement = false, Clustered = true, Name = "PK_umbracoDeployDependency", OnColumns = "sourceId, targetId")] + [ForeignKey(typeof(UmbracoDeployChecksumDto), Name = "FK_umbracoDeployDependency_umbracoDeployChecksum_id1")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public int SourceId { get; set; } + + [Column("targetId")] + [ForeignKey(typeof(UmbracoDeployChecksumDto), Name = "FK_umbracoDeployDependency_umbracoDeployChecksum_id2")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public int TargetId { get; set; } + + [Column("mode")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public int Mode { get; set; } + + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index 2a688811d7..5e07a617d4 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -187,7 +187,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial private void CreateCmsPropertyTypeData() { - _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = -90, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); + _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = 1043, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs index 9ffce4b8de..0ae044d1ee 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs @@ -82,7 +82,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial {42, typeof (AccessRuleDto)}, {43, typeof(CacheInstructionDto)}, {44, typeof (ExternalLoginDto)}, - {45, typeof (MigrationDto)} + {45, typeof (MigrationDto)}, + {46, typeof (UmbracoDeployChecksumDto)}, + {47, typeof (UmbracoDeployDependencyDto)} }; #endregion diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs index 04d6598d4b..9af6d46fbb 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs @@ -119,6 +119,12 @@ namespace Umbraco.Core.Persistence.Migrations.Initial return new Version(7, 2, 5); } + //if the error is for umbracoDeployChecksum it must be the previous version to 7.4 since that is when it is added + if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.InvariantEquals("umbracoDeployChecksum")))) + { + return new Version(7, 3, 4); + } + return UmbracoVersion.Current; } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs new file mode 100644 index 0000000000..a39cea2ee0 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs @@ -0,0 +1,48 @@ +using System.Linq; +using Umbraco.Core.Configuration; +using Umbraco.Core.Logging; +using Umbraco.Core.Persistence.SqlSyntax; + +namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero +{ + [Migration("7.4.0", 5, GlobalSettings.UmbracoMigrationName)] + public class AddUmbracoDeployTables : MigrationBase + { + public AddUmbracoDeployTables(ISqlSyntaxProvider sqlSyntax, ILogger logger) + : base(sqlSyntax, logger) + { } + + public override void Up() + { + //Don't exeucte if the table is already there + var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray(); + if (tables.InvariantContains("umbracoDeployChecksum")) return; + + Create.Table("umbracoDeployChecksum") + .WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoDeployChecksum") + .WithColumn("entityType").AsString(32).NotNullable() + .WithColumn("entityGuid").AsGuid().Nullable() + .WithColumn("entityPath").AsString(256).Nullable() + .WithColumn("localChecksum").AsString(32).NotNullable() + .WithColumn("compositeChecksum").AsString(32).Nullable(); + + Create.Table("umbracoDeployDependency") + .WithColumn("sourceId").AsInt32().NotNullable().ForeignKey("FK_umbracoDeployDependency_umbracoDeployChecksum_id1", "umbracoDeployChecksum", "id") + .WithColumn("targetId").AsInt32().NotNullable().ForeignKey("FK_umbracoDeployDependency_umbracoDeployChecksum_id2", "umbracoDeployChecksum", "id") + .WithColumn("mode").AsInt32().NotNullable(); + + Create.PrimaryKey("PK_umbracoDeployDependency").OnTable("umbracoDeployDependency").Columns(new[] {"sourceId", "targetId"}); + + Create.Index("IX_umbracoDeployChecksum").OnTable("umbracoDeployChecksum") + .OnColumn("entityType") + .Ascending() + .OnColumn("entityGuid") + .Ascending() + .OnColumn("entityPath") + .Unique(); + } + + public override void Down() + { } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs index 84877fa4de..20200a3230 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer /// alias, so we need to ensure that these are initially consistent on /// all environments (based on the alias). /// - [Migration("7.4.0", 2, GlobalSettings.UmbracoMigrationName)] + [Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)] public class EnsureContentTypeUniqueIdsAreConsistent : MigrationBase { public EnsureContentTypeUniqueIdsAreConsistent(ISqlSyntaxProvider sqlSyntax, ILogger logger) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs index 59882a25ec..5d5900308a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero { - [Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)] + [Migration("7.4.0", 4, GlobalSettings.UmbracoMigrationName)] public class RemoveParentIdPropertyTypeGroupColumn : MigrationBase { public RemoveParentIdPropertyTypeGroupColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger) diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index ede498dcfa..97e8a8988e 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -394,6 +394,8 @@ + + @@ -410,6 +412,7 @@ + diff --git a/src/Umbraco.Tests/Persistence/BaseTableByTableTest.cs b/src/Umbraco.Tests/Persistence/BaseTableByTableTest.cs index 5aa2649caf..e9b58ffcae 100644 --- a/src/Umbraco.Tests/Persistence/BaseTableByTableTest.cs +++ b/src/Umbraco.Tests/Persistence/BaseTableByTableTest.cs @@ -580,6 +580,31 @@ namespace Umbraco.Tests.Persistence } } + [Test] + public void Can_Create_umbracoDeployDependency_Table() + { + + using (Transaction transaction = Database.GetTransaction()) + { + DatabaseSchemaHelper.CreateTable(); + DatabaseSchemaHelper.CreateTable(); + + //transaction.Complete(); + } + } + + [Test] + public void Can_Create_umbracoDeployChecksum_Table() + { + + using (Transaction transaction = Database.GetTransaction()) + { + DatabaseSchemaHelper.CreateTable(); + + //transaction.Complete(); + } + } + [Test] public void Can_Create_umbracoUser_Table() { diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js index fc8ca74a2d..621e1aac9e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js @@ -110,7 +110,6 @@ ]; if ($routeParams.create) { - vm.page.loading = true; //we are creating so get an empty data type item @@ -124,7 +123,6 @@ }); } else { - vm.page.loading = true; contentTypeResource.getById($routeParams.id).then(function (dt) { @@ -141,7 +139,6 @@ /* ---------- SAVE ---------- */ function save() { - var deferred = $q.defer(); vm.page.saveButtonState = "busy"; @@ -206,18 +203,15 @@ }); }); } - vm.page.saveButtonState = "error"; deferred.reject(err); }); - return deferred.promise; } function init(contentType) { - //get available composite types contentTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) { contentType.availableCompositeContentTypes = result; @@ -237,8 +231,6 @@ }); } - - // sort properties after sort order angular.forEach(contentType.groups, function (group) { group.properties = $filter('orderBy')(group.properties, 'sortOrder'); @@ -250,17 +242,16 @@ contentType.allowedTemplates = contentTypeHelper.insertTemplatePlaceholder(contentType.allowedTemplates); } - + // convert icons for content type + convertLegacyIcons(contentType); //set a shared state editorState.set(contentType); vm.contentType = contentType; - } function convertLegacyIcons(contentType) { - // make array to store contentType icon var contentTypeArray = []; @@ -272,11 +263,9 @@ // set icon back on contentType contentType.icon = contentTypeArray[0].icon; - } function getDataTypeDetails(property) { - if (property.propertyState !== "init") { dataTypeResource.getById(property.dataTypeId) @@ -287,18 +276,14 @@ } } - /** Syncs the content type to it's tree node - this occurs on first load and after saving */ function syncTreeNode(dt, path, initialLoad) { - navigationService.syncTree({ tree: "documenttypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) { vm.currentNode = syncArgs.node; }); - } } angular.module("umbraco").controller("Umbraco.Editors.DocumentTypes.EditController", DocumentTypesEditController); - })(); diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js index 51bdb249bc..28f7cf59f5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js @@ -10,7 +10,6 @@ "use strict"; function MediaTypesEditController($scope, $routeParams, mediaTypeResource, dataTypeResource, editorState, contentEditingHelper, formHelper, navigationService, iconHelper, contentTypeHelper, notificationsService, $filter, $q, localizationService) { - var vm = this; vm.save = save; @@ -96,22 +95,20 @@ ]; if ($routeParams.create) { - vm.page.loading = true; //we are creating so get an empty data type item mediaTypeResource.getScaffold($routeParams.id) - .then(function (dt) { - init(dt); + .then(function(dt) { + init(dt); - vm.page.loading = false; - }); + vm.page.loading = false; + }); } else { - vm.page.loading = true; - mediaTypeResource.getById($routeParams.id).then(function (dt) { + mediaTypeResource.getById($routeParams.id).then(function(dt) { init(dt); syncTreeNode(vm.contentType, dt.path, true); @@ -120,11 +117,9 @@ }); } - /* ---------- SAVE ---------- */ function save() { - var deferred = $q.defer(); vm.page.saveButtonState = "busy"; @@ -165,16 +160,13 @@ }); return deferred.promise; - } function init(contentType) { - //get available composite types mediaTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) { contentType.availableCompositeContentTypes = result; - - // convert icons for composite content types + // convert legacy icons iconHelper.formatContentTypeIcons(contentType.availableCompositeContentTypes); }); @@ -189,24 +181,22 @@ }); } - - // convert legacy icons - convertLegacyIcons(contentType); - + // sort properties after sort order angular.forEach(contentType.groups, function (group) { group.properties = $filter('orderBy')(group.properties, 'sortOrder'); }); + // convert icons for content type + convertLegacyIcons(contentType); + //set a shared state editorState.set(contentType); vm.contentType = contentType; - } function convertLegacyIcons(contentType) { - // make array to store contentType icon var contentTypeArray = []; @@ -218,33 +208,27 @@ // set icon back on contentType contentType.icon = contentTypeArray[0].icon; - } function getDataTypeDetails(property) { - if (property.propertyState !== "init") { dataTypeResource.getById(property.dataTypeId) - .then(function (dataType) { - property.dataTypeIcon = dataType.icon; - property.dataTypeName = dataType.name; - }); + .then(function(dataType) { + property.dataTypeIcon = dataType.icon; + property.dataTypeName = dataType.name; + }); } } /** Syncs the content type to it's tree node - this occurs on first load and after saving */ function syncTreeNode(dt, path, initialLoad) { - - navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) { + navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function(syncArgs) { vm.currentNode = syncArgs.node; }); - } - } angular.module("umbraco").controller("Umbraco.Editors.MediaTypes.EditController", MediaTypesEditController); - })(); diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index a8bb6da508..3595ff54d1 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -140,8 +140,8 @@ - - + +