Merge branch 'temp8' into temp8-contentAndType

This commit is contained in:
Stephan
2019-02-07 08:40:46 +01:00
18 changed files with 106 additions and 65 deletions

View File

@@ -126,6 +126,7 @@ namespace Umbraco.Core.Migrations.Upgrade
To<UpdateMemberGroupPickerData>("{8A027815-D5CD-4872-8B88-9A51AB5986A6}"); // from 7.14.0
To<ConvertRelatedLinksToMultiUrlPicker>("{ED28B66A-E248-4D94-8CDB-9BDF574023F0}");
To<UpdatePickerIntegerValuesToUdi>("{38C809D5-6C34-426B-9BEA-EFD39162595C}");
To<RenameUmbracoDomainsTable>("{6017F044-8E70-4E10-B2A3-336949692ADD}");
//FINAL

View File

@@ -0,0 +1,12 @@
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
public class RenameUmbracoDomainsTable : MigrationBase
{
public RenameUmbracoDomainsTable(IMigrationContext context) : base(context) { }
public override void Migrate()
{
Rename.Table("umbracoDomains").To(Constants.DatabaseSchema.Tables.Domain).Do();
}
}
}

View File

@@ -87,8 +87,20 @@ namespace Umbraco.Core.Models.PublishedContent
{
lock (_publishedDataTypesLocker)
{
var dataTypes = _dataTypeService.GetAll(ids);
_publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType);
if (_publishedDataTypes == null)
{
var dataTypes = _dataTypeService.GetAll();
_publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType);
}
else
{
foreach (var id in ids)
_publishedDataTypes.Remove(id);
var dataTypes = _dataTypeService.GetAll(ids);
foreach (var dataType in dataTypes)
_publishedDataTypes[dataType.Id] = CreatePublishedDataType(dataType);
}
}
}

View File

@@ -40,7 +40,7 @@ namespace Umbraco.Core
public const string RelationType = /*TableNamePrefix*/ "umbraco" + "RelationType";
public const string Relation = /*TableNamePrefix*/ "umbraco" + "Relation";
public const string Domain = /*TableNamePrefix*/ "umbraco" + "Domains";
public const string Domain = /*TableNamePrefix*/ "umbraco" + "Domain";
public const string Language = /*TableNamePrefix*/ "umbraco" + "Language";
public const string DictionaryEntry = /*TableNamePrefix*/ "cms" + "Dictionary";
public const string DictionaryValue = /*TableNamePrefix*/ "cms" + "LanguageText";

View File

@@ -33,10 +33,10 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override IEnumerable<IDomain> PerformGetAll(params int[] ids)
{
var sql = GetBaseQuery(false).Where("umbracoDomains.id > 0");
var sql = GetBaseQuery(false).Where("umbracoDomain.id > 0");
if (ids.Any())
{
sql.Where("umbracoDomains.id in (@ids)", new { ids = ids });
sql.Where("umbracoDomain.id in (@ids)", new { ids = ids });
}
return Database.Fetch<DomainDto>(sql).Select(ConvertFromDto);
@@ -56,7 +56,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
}
else
{
sql.Select("umbracoDomains.*, umbracoLanguage.languageISOCode")
sql.Select("umbracoDomain.*, umbracoLanguage.languageISOCode")
.From<DomainDto>()
.LeftJoin<LanguageDto>()
.On<DomainDto, LanguageDto>(dto => dto.DefaultLanguage, dto => dto.Id);
@@ -67,14 +67,14 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override string GetBaseWhereClause()
{
return "umbracoDomains.id = @id";
return "umbracoDomain.id = @id";
}
protected override IEnumerable<string> GetDeleteClauses()
{
var list = new List<string>
{
"DELETE FROM umbracoDomains WHERE id = @id"
"DELETE FROM umbracoDomain WHERE id = @id"
};
return list;
}
@@ -86,7 +86,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override void PersistNewItem(IDomain entity)
{
var exists = Database.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoDomains WHERE domainName = @domainName", new { domainName = entity.DomainName });
var exists = Database.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoDomain WHERE domainName = @domainName", new { domainName = entity.DomainName });
if (exists > 0) throw new DuplicateNameException(string.Format("The domain name {0} is already assigned", entity.DomainName));
if (entity.RootContentId.HasValue)
@@ -122,7 +122,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
((UmbracoDomain)entity).UpdatingEntity();
var exists = Database.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoDomains WHERE domainName = @domainName AND umbracoDomains.id <> @id",
var exists = Database.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoDomain WHERE domainName = @domainName AND umbracoDomain.id <> @id",
new { domainName = entity.DomainName, id = entity.Id });
//ensure there is no other domain with the same name on another entity
if (exists > 0) throw new DuplicateNameException(string.Format("The domain name {0} is already assigned", entity.DomainName));

View File

@@ -385,6 +385,7 @@
<Compile Include="Migrations\Upgrade\V_8_0_0\PropertyEditorsMigration.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\RefactorMacroColumns.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\RefactorVariantsModel.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\RenameUmbracoDomainsTable.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\SuperZero.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\TablesForScheduledPublishing.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\TagsMigration.cs" />

View File

@@ -1,5 +1,6 @@
using Examine;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
@@ -41,7 +42,7 @@ namespace Umbraco.Examine
var urlValue = c.GetUrlSegment(_urlSegmentProviders); //Always add invariant urlName
var values = new Dictionary<string, IEnumerable<object>>
{
{"icon", c.ContentType.Icon.Yield()},
{"icon", c.ContentType.Icon?.Yield() ?? Enumerable.Empty<string>()},
{UmbracoExamineIndex.PublishedFieldName, new object[] {c.Published ? "y" : "n"}}, //Always add invariant published value
{"id", new object[] {c.Id}},
{UmbracoExamineIndex.NodeKeyFieldName, new object[] {c.Key}},
@@ -51,12 +52,12 @@ namespace Umbraco.Examine
{"sortOrder", new object[] {c.SortOrder}},
{"createDate", new object[] {c.CreateDate}}, //Always add invariant createDate
{"updateDate", new object[] {c.UpdateDate}}, //Always add invariant updateDate
{"nodeName", PublishedValuesOnly //Always add invariant nodeName
? c.PublishName.Yield()
: c.Name.Yield()},
{"urlName", urlValue.Yield()}, //Always add invariant urlName
{"path", c.Path.Yield()},
{"nodeType", new object[] {c.ContentType.Id}},
{"nodeName", (PublishedValuesOnly //Always add invariant nodeName
? c.PublishName?.Yield()
: c?.Name.Yield()) ?? Enumerable.Empty<string>()},
{"urlName", urlValue?.Yield() ?? Enumerable.Empty<string>()}, //Always add invariant urlName
{"path", c.Path?.Yield() ?? Enumerable.Empty<string>()},
{"nodeType", c.ContentType.Id.ToString().Yield() ?? Enumerable.Empty<string>()},
{"creatorName", (c.GetCreatorProfile(_userService)?.Name ?? "??").Yield() },
{"writerName",(c.GetWriterProfile(_userService)?.Name ?? "??").Yield() },
{"writerID", new object[] {c.WriterId}},
@@ -72,14 +73,14 @@ namespace Umbraco.Examine
{
var variantUrl = c.GetUrlSegment(_urlSegmentProviders, culture);
var lowerCulture = culture.ToLowerInvariant();
values[$"urlName_{lowerCulture}"] = variantUrl.Yield();
values[$"nodeName_{lowerCulture}"] = PublishedValuesOnly
? c.GetPublishName(culture).Yield()
: c.GetCultureName(culture).Yield();
values[$"urlName_{lowerCulture}"] = variantUrl?.Yield() ?? Enumerable.Empty<string>();
values[$"nodeName_{lowerCulture}"] = (PublishedValuesOnly
? c.GetPublishName(culture)?.Yield()
: c.GetCultureName(culture)?.Yield()) ?? Enumerable.Empty<string>();
values[$"{UmbracoExamineIndex.PublishedFieldName}_{lowerCulture}"] = (c.IsCulturePublished(culture) ? "y" : "n").Yield<object>();
values[$"updateDate_{lowerCulture}"] = PublishedValuesOnly
? c.GetPublishDate(culture).Yield<object>()
: c.GetUpdateDate(culture).Yield<object>();
values[$"updateDate_{lowerCulture}"] = (PublishedValuesOnly
? c.GetPublishDate(culture)
: c.GetUpdateDate(culture))?.Yield<object>() ?? Enumerable.Empty<object>();
}
}

View File

@@ -1,5 +1,6 @@
using Examine;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
@@ -30,7 +31,7 @@ namespace Umbraco.Examine
var urlValue = m.GetUrlSegment(_urlSegmentProviders);
var values = new Dictionary<string, IEnumerable<object>>
{
{"icon", m.ContentType.Icon.Yield()},
{"icon", m.ContentType.Icon?.Yield() ?? Enumerable.Empty<string>()},
{"id", new object[] {m.Id}},
{UmbracoExamineIndex.NodeKeyFieldName, new object[] {m.Key}},
{"parentID", new object[] {m.Level > 1 ? m.ParentId : -1}},
@@ -39,11 +40,11 @@ namespace Umbraco.Examine
{"sortOrder", new object[] {m.SortOrder}},
{"createDate", new object[] {m.CreateDate}},
{"updateDate", new object[] {m.UpdateDate}},
{"nodeName", m.Name.Yield()},
{"urlName", urlValue.Yield()},
{"path", m.Path.Yield()},
{"nodeType", new object[] {m.ContentType.Id}},
{"creatorName", m.GetCreatorProfile(_userService).Name.Yield()}
{"nodeName", m.Name?.Yield() ?? Enumerable.Empty<string>()},
{"urlName", urlValue?.Yield() ?? Enumerable.Empty<string>()},
{"path", m.Path?.Yield() ?? Enumerable.Empty<string>()},
{"nodeType", m.ContentType.Id.ToString().Yield() },
{"creatorName", (m.GetCreatorProfile(_userService)?.Name ?? "??").Yield()}
};
foreach (var property in m.Properties)

View File

@@ -1,5 +1,6 @@
using Examine;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
@@ -21,7 +22,7 @@ namespace Umbraco.Examine
{
var values = new Dictionary<string, IEnumerable<object>>
{
{"icon", m.ContentType.Icon.Yield()},
{"icon", m.ContentType.Icon?.Yield() ?? Enumerable.Empty<string>()},
{"id", new object[] {m.Id}},
{UmbracoExamineIndex.NodeKeyFieldName, new object[] {m.Key}},
{"parentID", new object[] {m.Level > 1 ? m.ParentId : -1}},
@@ -30,11 +31,11 @@ namespace Umbraco.Examine
{"sortOrder", new object[] {m.SortOrder}},
{"createDate", new object[] {m.CreateDate}},
{"updateDate", new object[] {m.UpdateDate}},
{"nodeName", m.Name.Yield()},
{"path", m.Path.Yield()},
{"nodeType", new object[] {m.ContentType.Id}},
{"loginName", m.Username.Yield()},
{"email", m.Email.Yield()},
{"nodeName", m.Name?.Yield() ?? Enumerable.Empty<string>()},
{"path", m.Path?.Yield() ?? Enumerable.Empty<string>()},
{"nodeType", m.ContentType.Id.ToString().Yield() },
{"loginName", m.Username?.Yield() ?? Enumerable.Empty<string>()},
{"email", m.Email?.Yield() ?? Enumerable.Empty<string>()},
};
foreach (var property in m.Properties)

View File

@@ -3,15 +3,21 @@
var config = require('../config');
var gulp = require('gulp');
var karmaServer = require('karma').Server;
var runSequence = require('run-sequence');
/**************************
* Build tests
**************************/
// Karma test
gulp.task('test:unit', function() {
gulp.task('runTests', function(cb) {
runSequence(["js"], "test:unit", cb);
});
gulp.task('test:unit', function () {
new karmaServer({
configFile: __dirname + "/test/config/karma.conf.js",
configFile: __dirname + "/../../test/config/karma.conf.js",
keepalive: true
})
.start();
@@ -19,7 +25,7 @@ gulp.task('test:unit', function() {
gulp.task('test:e2e', function() {
new karmaServer({
configFile: __dirname + "/test/config/e2e.js",
configFile: __dirname + "/../../test/config/e2e.js",
keepalive: true
})
.start();

View File

@@ -105,11 +105,6 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
return;
}
if (scope.userDialog) {
closeUserDialog();
}
navigationService.hideSearch();
navigationService.showTree(section.alias);

View File

@@ -310,12 +310,13 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
//need to determine which items we already have loaded
var renderModelIds = _.map($scope.renderModel, function (d) {
return $scope.model.config.idType === "udi" ? d.udi : d.id;
return ($scope.model.config.idType === "udi" ? d.udi : d.id).toString();
});
//get the ids that no longer exist
var toRemove = _.difference(renderModelIds, valueIds);
//remove the ones that no longer exist
for (var j = 0; j < toRemove.length; j++) {
var index = renderModelIds.indexOf(toRemove[j]);

View File

@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.RTEController",
function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper, editorService, macroService, editorState) {
function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper) {
// TODO: A lot of the code below should be shared between the grid rte and the normal rte
@@ -13,7 +13,7 @@ angular.module("umbraco")
var n = d.getTime();
$scope.textAreaHtmlId = $scope.model.alias + "_" + n + "_rte";
var editorConfig = $scope.model.config.editor;
var editorConfig = $scope.model.config ? $scope.model.config.editor : null;
if (!editorConfig || angular.isString(editorConfig)) {
editorConfig = tinyMceService.defaultPrevalues();
}

View File

@@ -1,12 +1,20 @@
var app = angular.module('umbraco', [
'umbraco.filters',
'umbraco.directives',
'umbraco.resources',
'umbraco.services',
'umbraco.filters',
'umbraco.directives',
'umbraco.resources',
'umbraco.services',
'umbraco.mocks',
'umbraco.interceptors',
'ngRoute',
'ngAnimate',
'ngCookies',
'LocalStorageModule'
'ngSanitize',
//'ngMessages',
'tmh.dynamicLocale',
//'ngFileUpload',
//'LocalStorageModule',
//'chart.js'
]);

View File

@@ -24,17 +24,19 @@ module.exports = function (config) {
'node_modules/moment/min/moment-with-locales.js',
'lib/umbraco/Extensions.js',
'node_modules/lazyload-js/lazyload.min.js',
'node_modules/angular-dynamic-locale/dist/tmhDynamicLocale.min.js',
//app bootstrap and loader
'test/config/app.unit.js',
//application files
'src/common/directives/*.js',
'src/common/filters/*.js',
'src/common/services/*.js',
'src/common/interceptors/*.js',
'src/common/resources/*.js',
'src/views/**/*.controller.js',
'../Umbraco.Web.UI/Umbraco/js/*.controllers.js',
'../Umbraco.Web.UI/Umbraco/js/*.directives.js',
'../Umbraco.Web.UI/Umbraco/js/*.filters.js',
'../Umbraco.Web.UI/Umbraco/js/*.services.js',
'../Umbraco.Web.UI/Umbraco/js/*.interceptors.js',
'../Umbraco.Web.UI/Umbraco/js/*.security.js',
'../Umbraco.Web.UI/Umbraco/js/*.resources.js',
//mocked data and routing
'src/common/mocks/umbraco.servervariables.js',

View File

@@ -14,7 +14,7 @@ describe('Drop down controller tests', function () {
it('should define the default properties on construction', function () {
controllerFactory('Umbraco.PropertyEditors.DropdownController', {
controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', {
$scope: scope,
$routeParams: routeParams
});
@@ -32,7 +32,7 @@ describe('Drop down controller tests', function () {
}
};
controllerFactory('Umbraco.PropertyEditors.DropdownController', {
controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', {
$scope: scope,
$routeParams: routeParams
});
@@ -57,7 +57,7 @@ describe('Drop down controller tests', function () {
};
var test = function() {
controllerFactory('Umbraco.PropertyEditors.DropdownController', {
controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', {
$scope: scope,
$routeParams: routeParams
});
@@ -76,7 +76,7 @@ describe('Drop down controller tests', function () {
};
var test = function () {
controllerFactory('Umbraco.PropertyEditors.DropdownController', {
controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', {
$scope: scope,
$routeParams: routeParams
});
@@ -87,4 +87,4 @@ describe('Drop down controller tests', function () {
});
});
});
});

View File

@@ -106,7 +106,7 @@
path, eg http://mysite.com/umbraco. NOT just "mysite.com" or "mysite.com/umbraco" or "http://mysite.com".
-->
<web.routing
trySkipIisCustomErrors="false"
trySkipIisCustomErrors="true"
internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false" validateAlternativeTemplates="false" disableFindContentByIdPath="false"
umbracoApplicationUrl="">
</web.routing>

View File

@@ -106,7 +106,7 @@
path, eg http://mysite.com/umbraco. NOT just "mysite.com" or "mysite.com/umbraco" or "http://mysite.com".
-->
<web.routing
trySkipIisCustomErrors="false"
trySkipIisCustomErrors="true"
internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false" validateAlternativeTemplates="false" disableFindContentByIdPath="false"
umbracoApplicationUrl="">
</web.routing>