Skip to content

Commit 8219d1d

Browse files
authored
Merge branch 'v15/dev' into v15/bugfix/18000
2 parents 11e2614 + c448190 commit 8219d1d

File tree

47 files changed

+277
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+277
-156
lines changed

src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentControllerBase.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,18 @@ protected CreateDocumentControllerBase(IAuthorizationService authorizationServic
1818

1919
protected async Task<IActionResult> HandleRequest(CreateDocumentRequestModel requestModel, Func<Task<IActionResult>> authorizedHandler)
2020
{
21-
// TODO This have temporarily been uncommented, to support the client sends values from all cultures, even when the user do not have access to the languages.
22-
// The values are ignored in the ContentEditingService
21+
// We intentionally don't pass in cultures here.
22+
// This is to support the client sending values for all cultures even if the user doesn't have access to the language.
23+
// Values for unauthorized languages are later ignored in the ContentEditingService.
24+
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
25+
User,
26+
ContentPermissionResource.WithKeys(ActionNew.ActionLetter, requestModel.Parent?.Id),
27+
AuthorizationPolicies.ContentPermissionByResource);
2328

24-
// IEnumerable<string> cultures = requestModel.Variants
25-
// .Where(v => v.Culture is not null)
26-
// .Select(v => v.Culture!);
27-
// AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
28-
// User,
29-
// ContentPermissionResource.WithKeys(ActionNew.ActionLetter, requestModel.Parent?.Id, cultures),
30-
// AuthorizationPolicies.ContentPermissionByResource);
31-
//
32-
// if (!authorizationResult.Succeeded)
33-
// {
34-
// return Forbidden();
35-
// }
29+
if (authorizationResult.Succeeded is false)
30+
{
31+
return Forbidden();
32+
}
3633

3734
return await authorizedHandler();
3835
}

src/Umbraco.Web.UI.Client/src/packages/property-editors/toggle/Umbraco.TrueFalse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ManifestPropertyEditorSchema } from '@umbraco-cms/backoffice/prope
22

33
export const manifest: ManifestPropertyEditorSchema = {
44
type: 'propertyEditorSchema',
5-
name: 'Date/Time',
5+
name: 'True/False',
66
alias: 'Umbraco.TrueFalse',
77
meta: {
88
defaultPropertyEditorUiAlias: 'Umb.PropertyEditorUi.Toggle',

tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Umbraco.Tests.AcceptanceTest/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"smokeTestSqlite": "npx playwright test DefaultConfig --grep \"@smoke\" --grep-invert \"Users\""
1414
},
1515
"devDependencies": {
16-
"@playwright/test": "^1.43",
16+
"@playwright/test": "^1.50",
1717
"@types/node": "^20.9.0",
1818
"prompt": "^1.2.0",
1919
"tslib": "^2.4.0",
2020
"typescript": "^4.8.3"
2121
},
2222
"dependencies": {
23-
"@umbraco/json-models-builders": "^2.0.26",
24-
"@umbraco/playwright-testhelpers": "^15.0.7",
23+
"@umbraco/json-models-builders": "^2.0.27",
24+
"@umbraco/playwright-testhelpers": "^15.0.13",
2525
"camelize": "^1.0.0",
2626
"dotenv": "^16.3.1",
2727
"node-fetch": "^2.6.7"

tests/Umbraco.Tests.AcceptanceTest/tests/ApiTesting/User/User.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test.describe('User Tests', () => {
1919

2020
test('can create a user', async ({umbracoApi}) => {
2121
// Act
22-
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, userGroupId);
22+
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, [userGroupId]);
2323

2424
// Assert
2525
expect(await umbracoApi.user.doesExist(userId)).toBeTruthy();
@@ -28,7 +28,7 @@ test.describe('User Tests', () => {
2828
test('can update a user', async ({umbracoApi}) => {
2929
// Arrange
3030
const anotherUserGroup = await umbracoApi.userGroup.getByName("Translators");
31-
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, userGroupId);
31+
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, [userGroupId]);
3232
const userData = await umbracoApi.user.get(userId);
3333
const newUserGroupData = [
3434
userGroupId,
@@ -48,7 +48,7 @@ test.describe('User Tests', () => {
4848

4949
test('can delete a user', async ({umbracoApi}) => {
5050
// Arrange
51-
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, userGroupId);
51+
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, [userGroupId]);
5252
expect(await umbracoApi.user.doesExist(userId)).toBeTruthy();
5353

5454
// Act

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ test('can create child node', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) =
3333
await umbracoUi.content.clickActionsMenuForContent(contentName);
3434
await umbracoUi.content.clickCreateButton();
3535
await umbracoUi.content.chooseDocumentType(childDocumentTypeName);
36-
// This wait is needed
37-
await umbracoUi.waitForTimeout(500);
3836
await umbracoUi.content.enterContentName(childContentName);
3937
await umbracoUi.content.clickSaveButton();
4038

@@ -74,7 +72,6 @@ test('can create child node in child node', async ({umbracoApi, umbracoUi}) => {
7472
await umbracoUi.content.clickCreateButton();
7573
await umbracoUi.content.chooseDocumentType(childOfChildDocumentTypeName);
7674
// This wait is needed
77-
await umbracoUi.waitForTimeout(500);
7875
await umbracoUi.content.enterContentName(childOfChildContentName);
7976
await umbracoUi.content.clickSaveButton();
8077

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ test('can see correct information when published', async ({umbracoApi, umbracoUi
3434

3535
// Assert
3636
await umbracoUi.content.isSuccessNotificationVisible();
37-
await umbracoUi.waitForTimeout(2000);
3837
const contentData = await umbracoApi.document.getByName(contentName);
3938
await umbracoUi.content.doesIdHaveText(contentData.id);
4039
const expectedCreatedDate = new Date(contentData.variants[0].createDate).toLocaleString("en-US", {
@@ -134,8 +133,6 @@ test('cannot change to a template that is not allowed in the document type', asy
134133
await umbracoUi.content.clickEditTemplateByName(firstTemplateName);
135134

136135
// Assert
137-
// This wait is needed to make sure the template name is visible when the modal is opened
138-
await umbracoUi.waitForTimeout(1000);
139136
await umbracoUi.content.isTemplateNameDisabled(secondTemplateName);
140137

141138
// Clean

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => {
1111
});
1212

1313
test.afterEach(async ({umbracoApi}) => {
14-
await umbracoApi.document.ensureNameNotExists(contentName);
14+
await umbracoApi.document.ensureNameNotExists(contentName);
1515
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
1616
});
1717

@@ -29,7 +29,7 @@ test('can create content with allowed child node enabled', async ({umbracoApi, u
2929
await umbracoUi.content.chooseDocumentType(documentTypeName);
3030
await umbracoUi.content.enterContentName(contentName);
3131
await umbracoUi.content.clickSaveButton();
32-
32+
3333
// Assert
3434
await umbracoUi.content.isSuccessNotificationVisible();
3535
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
@@ -71,8 +71,6 @@ test('can create multiple child nodes with different document types', async ({um
7171
await umbracoUi.content.clickActionsMenuForContent(contentName);
7272
await umbracoUi.content.clickCreateButton();
7373
await umbracoUi.content.chooseDocumentType(secondChildDocumentTypeName);
74-
// This wait is needed
75-
await umbracoUi.waitForTimeout(500);
7674
await umbracoUi.content.enterContentName(secondChildContentName);
7775
await umbracoUi.content.clickSaveButton();
7876

@@ -95,4 +93,4 @@ test('can create multiple child nodes with different document types', async ({um
9593
await umbracoApi.document.ensureNameNotExists(secondChildContentName);
9694
await umbracoApi.documentType.ensureNameNotExists(firstChildDocumentTypeName);
9795
await umbracoApi.documentType.ensureNameNotExists(secondChildDocumentTypeName);
98-
});
96+
});

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ test('can create child content in a collection', async ({umbracoApi, umbracoUi})
5353
await umbracoUi.content.clickActionsMenuForContent(contentName);
5454
await umbracoUi.content.clickCreateButton();
5555
await umbracoUi.content.chooseDocumentType(childDocumentTypeName);
56-
// This wait is needed
57-
await umbracoUi.waitForTimeout(500);
5856
await umbracoUi.content.enterContentName(firstChildContentName);
5957
await umbracoUi.content.clickSaveButton();
6058

@@ -63,11 +61,9 @@ test('can create child content in a collection', async ({umbracoApi, umbracoUi})
6361
expect(childData.length).toBe(expectedNames.length);
6462
expect(childData[0].variants[0].name).toBe(firstChildContentName);
6563
// verify that the child content displays in collection list after reloading tree
66-
await umbracoUi.waitForTimeout(1000);
6764
await umbracoUi.content.clickActionsMenuForContent(contentName);
6865
await umbracoUi.content.clickReloadButton();
6966
await umbracoUi.content.goToContentWithName(contentName);
70-
await umbracoUi.waitForTimeout(500);
7167
await umbracoUi.content.doesDocumentTableColumnNameValuesMatch(expectedNames);
7268

7369
// Clean
@@ -89,8 +85,6 @@ test('can create multiple child nodes in a collection', async ({umbracoApi, umbr
8985
await umbracoUi.content.clickActionsMenuForContent(contentName);
9086
await umbracoUi.content.clickCreateButton();
9187
await umbracoUi.content.chooseDocumentType(childDocumentTypeName);
92-
// This wait is needed
93-
await umbracoUi.waitForTimeout(500);
9488
await umbracoUi.content.enterContentName(secondChildContentName);
9589
await umbracoUi.content.clickSaveButton();
9690

@@ -100,11 +94,9 @@ test('can create multiple child nodes in a collection', async ({umbracoApi, umbr
10094
expect(childData[0].variants[0].name).toBe(firstChildContentName);
10195
expect(childData[1].variants[0].name).toBe(secondChildContentName);
10296
// verify that the child content displays in collection list after reloading tree
103-
await umbracoUi.waitForTimeout(1000);
10497
await umbracoUi.content.clickActionsMenuForContent(contentName);
10598
await umbracoUi.content.clickReloadButton();
10699
await umbracoUi.content.goToContentWithName(contentName);
107-
await umbracoUi.waitForTimeout(500);
108100
await umbracoUi.content.doesDocumentTableColumnNameValuesMatch(expectedNames);
109101

110102
// Clean

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageCropper.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ test('can publish content with the image cropper data type', {tag: '@smoke'}, as
7575
test('can create content with the custom image cropper data type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
7676
// Arrange
7777
const customDataTypeName = 'CustomImageCropper';
78-
const cropValue = ['TestCropLabel', 100, 50];
79-
const customDataTypeId = await umbracoApi.dataType.createImageCropperDataTypeWithOneCrop(customDataTypeName, cropValue[0], cropValue[1], cropValue[2]);
78+
const cropAlias = 'TestCropLabel';
79+
const cropWidth = 100;
80+
const cropHeight = 50;
81+
const customDataTypeId = await umbracoApi.dataType.createImageCropperDataTypeWithOneCrop(customDataTypeName, AliasHelper.toAlias(cropAlias), cropWidth, cropHeight);
8082
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId);
8183
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
8284
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
@@ -93,9 +95,9 @@ test('can create content with the custom image cropper data type', {tag: '@smoke
9395
expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName));
9496
expect(contentData.values[0].value.src).toContain(AliasHelper.toAlias(imageFileName));
9597
expect(contentData.values[0].value.focalPoint).toEqual(defaultFocalPoint);
96-
expect(contentData.values[0].value.crops[0].alias).toEqual(AliasHelper.toAlias(cropValue[0]));
97-
expect(contentData.values[0].value.crops[0].width).toEqual(cropValue[1]);
98-
expect(contentData.values[0].value.crops[0].height).toEqual(cropValue[2]);
98+
expect(contentData.values[0].value.crops[0].alias).toEqual(AliasHelper.toAlias(cropAlias));
99+
expect(contentData.values[0].value.crops[0].width).toEqual(cropWidth);
100+
expect(contentData.values[0].value.crops[0].height).toEqual(cropHeight);
99101

100102
// Clean
101103
await umbracoApi.dataType.ensureNameNotExists(customDataTypeName);

0 commit comments

Comments
 (0)