Merge branch 'main' into v17/dev

This commit is contained in:
Andy Butland
2025-10-08 06:29:30 +02:00
6 changed files with 535 additions and 529 deletions

View File

@@ -417,17 +417,14 @@ SELECT 4 AS {keyAlias}, COUNT(id) AS {valueAlias} FROM {userTableName}
Sql<ISqlContext> sql;
try
{
sql = SqlContext.Sql()
.Select<UserGroupDto>(x => x.Id, x => x.Key)
.From<UserGroupDto>()
.InnerJoin<User2UserGroupDto>().On<UserGroupDto, User2UserGroupDto>((left, right) => left.Id == right.UserGroupId)
.WhereIn<User2UserGroupDto>(x => x.UserId, userIds);
List<UserGroupDto>? userGroups = Database.Fetch<UserGroupDto>(sql);
groupKeys = userGroups.Select(x => x.Key).ToList();
groupKeys = Database.FetchByGroups<UserGroupDto, int>(userIds, Constants.Sql.MaxParameterCount, ints =>
{
return SqlContext.Sql()
.Select<UserGroupDto>(x => x.Id, x => x.Key)
.From<UserGroupDto>()
.InnerJoin<User2UserGroupDto>().On<UserGroupDto, User2UserGroupDto>((left, right) => left.Id == right.UserGroupId)
.WhereIn<User2UserGroupDto>(x => x.UserId, ints);
}).Select(x => x.Key).ToList();
}
catch (DbException)
{
@@ -441,12 +438,13 @@ SELECT 4 AS {keyAlias}, COUNT(id) AS {valueAlias} FROM {userTableName}
// get users2groups
sql = SqlContext.Sql()
.Select<User2UserGroupDto>()
.From<User2UserGroupDto>()
.WhereIn<User2UserGroupDto>(x => x.UserId, userIds);
List<User2UserGroupDto>? user2Groups = Database.Fetch<User2UserGroupDto>(sql);
List<User2UserGroupDto>? user2Groups = Database.FetchByGroups<User2UserGroupDto, int>(userIds, Constants.Sql.MaxParameterCount, ints =>
{
return SqlContext.Sql()
.Select<User2UserGroupDto>()
.From<User2UserGroupDto>()
.WhereIn<User2UserGroupDto>(x => x.UserId, ints);
}).ToList();
if (groupIds.Any() is false)
{
@@ -454,7 +452,6 @@ SELECT 4 AS {keyAlias}, COUNT(id) AS {valueAlias} FROM {userTableName}
groupIds = user2Groups.Select(x => x.UserGroupId).Distinct().ToList();
}
// get groups
// We wrap this in a try-catch, as this might throw errors when you try to login before having migrated your database
Dictionary<int, UserGroupDto> groups;
@@ -493,13 +490,13 @@ SELECT 4 AS {keyAlias}, COUNT(id) AS {valueAlias} FROM {userTableName}
.ToDictionary(x => x.Key, x => x);
// get start nodes
sql = SqlContext.Sql()
.Select<UserStartNodeDto>()
.From<UserStartNodeDto>()
.WhereIn<UserStartNodeDto>(x => x.UserId, userIds);
List<UserStartNodeDto>? startNodes = Database.Fetch<UserStartNodeDto>(sql);
List<UserStartNodeDto>? startNodes = Database.FetchByGroups<UserStartNodeDto, int>(userIds, Constants.Sql.MaxParameterCount, ints =>
{
return SqlContext.Sql()
.Select<UserStartNodeDto>()
.From<UserStartNodeDto>()
.WhereIn<UserStartNodeDto>(x => x.UserId, ints);
}).ToList();
// get groups2languages

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
"build": "vite build"
},
"dependencies": {
"@umbraco-ui/uui": "^1.15.0",
"@umbraco-ui/uui-css": "^1.15.0"
"@umbraco-ui/uui": "^1.16.0-rc.0",
"@umbraco-ui/uui-css": "^1.16.0-rc.0"
}
}
}

View File

@@ -94,7 +94,7 @@ test('can update property value nested in a block grid area with an RTE with a b
await umbracoUi.content.clickSelectBlockElementWithName(areaElementTypeName);
await umbracoUi.content.clickAddBlockGridElementWithName(richTextEditorElementTypeName);
await umbracoUi.content.clickExactLinkWithName(richTextEditorElementTypeName);
await umbracoUi.content.clickInsertBlockButton();
await umbracoUi.content.clickTipTapToolbarIconWithTitle('Insert Block');
await umbracoUi.content.clickExactLinkWithName(blockListElementTypeName, true);
await umbracoUi.content.clickAddBlockGridElementWithName(textStringElementTypeName);
await umbracoUi.content.clickExactLinkWithName(textStringElementTypeName);

View File

@@ -63,6 +63,7 @@ test('can publish content with the image cropper data type', {tag: '@smoke'}, as
await umbracoUi.content.clickSaveAndPublishButton();
// Assert
await umbracoUi.content.waitForContentToBePublished();
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
const contentData = await umbracoApi.document.getByName(contentName);

View File

@@ -587,11 +587,17 @@ public partial class ContentEditingServiceTests
var createResult = await ContentEditingService.CreateAsync(createModel, Constants.Security.SuperUserKey);
Assert.IsTrue(createResult.Success);
Assert.NotNull(createResult.Result.Content);
var firstUpdateDateEn = createResult.Result.Content!.GetUpdateDate("en-US")!;
var firstUpdateDateDa = createResult.Result.Content!.GetUpdateDate("da-DK")!;
// Retrieve the actual stored content to ensure the database truncation of times isn't interfering with the test
var createdContent = await ContentEditingService.GetAsync(createResult.Result.Content.Key);
Assert.NotNull(createdContent);
var firstUpdateDateEn = createdContent.GetUpdateDate("en-US");
Assert.IsNotNull(firstUpdateDateEn);
var firstUpdateDateDa = createdContent.GetUpdateDate("da-DK");
Assert.IsNotNull(firstUpdateDateDa);
Thread.Sleep(100);
await Task.Delay(100);
var updateModel = new ContentUpdateModel
{
@@ -610,15 +616,13 @@ public partial class ContentEditingServiceTests
// re-get and re-test
VerifyUpdate(await ContentEditingService.GetAsync(updateResult.Result.Content!.Key));
return;
void VerifyUpdate(IContent? updatedContent)
{
Assert.IsNotNull(updatedContent);
Assert.AreEqual(firstUpdateDateDa?.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond), updatedContent.GetUpdateDate("da-DK")?.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond));
var lastUpdateDateEn = updatedContent.GetUpdateDate("en-US")
?? throw new InvalidOperationException("Expected a publish date for EN");
Assert.Greater(lastUpdateDateEn.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond), firstUpdateDateEn?.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond));
Assert.AreEqual(firstUpdateDateDa, updatedContent.GetUpdateDate("da-DK"));
Assert.Less(firstUpdateDateEn, updatedContent.GetUpdateDate("en-US"));
}
}
@@ -626,10 +630,16 @@ public partial class ContentEditingServiceTests
public async Task Updating_Single_Variant_Property_Does_Not_Change_Update_Dates_Of_Other_Variants()
{
var content = await CreateCultureVariantContent();
var firstUpdateDateEn = content.GetUpdateDate("en-US")
?? throw new InvalidOperationException("Expected an update date for EN");
var firstUpdateDateDa = content.GetUpdateDate("da-DK")
?? throw new InvalidOperationException("Expected an update date for DA");
// Retrieve the actual stored content to ensure the database truncation of times isn't interfering with the test
var createdContent = await ContentEditingService.GetAsync(content.Key);
Assert.NotNull(createdContent);
var firstUpdateDateEn = createdContent.GetUpdateDate("en-US");
Assert.IsNotNull(firstUpdateDateEn);
var firstUpdateDateDa = createdContent.GetUpdateDate("da-DK");
Assert.IsNotNull(firstUpdateDateDa);
await Task.Delay(100);
var updateModel = new ContentUpdateModel
{
@@ -667,15 +677,13 @@ public partial class ContentEditingServiceTests
// re-get and re-test
VerifyUpdate(await ContentEditingService.GetAsync(content.Key));
return;
void VerifyUpdate(IContent? updatedContent)
{
Assert.IsNotNull(updatedContent);
Assert.AreEqual(firstUpdateDateEn.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond), updatedContent.GetUpdateDate("en-US")?.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond));
var lastUpdateDateDa = updatedContent.GetUpdateDate("da-DK")
?? throw new InvalidOperationException("Expected an update date for DA");
Assert.Greater(lastUpdateDateDa.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond), firstUpdateDateDa.TruncateTo(DateTimeExtensions.DateTruncate.Millisecond));
Assert.AreEqual(firstUpdateDateEn, updatedContent.GetUpdateDate("en-US"));
Assert.Less(firstUpdateDateDa, updatedContent.GetUpdateDate("da-DK"));
}
}
}