Skip to content

Commit 02dfb5a

Browse files
committed
Merge remote-tracking branch 'origin/v8/dev' into v8/feature/version-history-cleanup
# Conflicts: # src/Umbraco.Tests.AcceptanceTest/package.json # src/Umbraco.Web.UI/Umbraco/config/lang/en.xml # src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
2 parents b09619f + 2ec77a2 commit 02dfb5a

File tree

122 files changed

+3461
-400
lines changed

Some content is hidden

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

122 files changed

+3461
-400
lines changed

src/Umbraco.Core/Configuration/GlobalSettings.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,27 @@ public bool UseHttps
395395
}
396396
}
397397

398+
/// <summary>
399+
/// Returns true if TinyMCE scripting sanitization should be applied
400+
/// </summary>
401+
/// <remarks>
402+
/// The default value is false
403+
/// </remarks>
404+
public bool SanitizeTinyMce
405+
{
406+
get
407+
{
408+
try
409+
{
410+
return bool.Parse(ConfigurationManager.AppSettings[Constants.AppSettings.SanitizeTinyMce]);
411+
}
412+
catch
413+
{
414+
return false;
415+
}
416+
}
417+
}
418+
398419
/// <summary>
399420
/// An int value representing the time in milliseconds to lock the database for a write operation
400421
/// </summary>

src/Umbraco.Core/Configuration/IGlobalSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,10 @@ public interface IGlobalSettings
7777
/// Gets the write lock timeout.
7878
/// </summary>
7979
int SqlWriteLockTimeOut { get; }
80+
81+
/// <summary>
82+
/// Returns true if TinyMCE scripting sanitization should be applied
83+
/// </summary>
84+
bool SanitizeTinyMce { get; }
8085
}
8186
}

src/Umbraco.Core/Constants-AppSettings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static class AppSettings
109109
/// A true or false indicating whether umbraco should force a secure (https) connection to the backoffice.
110110
/// </summary>
111111
public const string UseHttps = "Umbraco.Core.UseHttps";
112-
112+
113113
/// <summary>
114114
/// A true/false value indicating whether the content dashboard should be visible for all user groups.
115115
/// </summary>
@@ -155,6 +155,11 @@ public static class Debug
155155
/// An int value representing the time in milliseconds to lock the database for a write operation
156156
/// </summary>
157157
public const string SqlWriteLockTimeOut = "Umbraco.Core.SqlWriteLockTimeOut";
158+
159+
/// <summary>
160+
/// Returns true if TinyMCE scripting sanitization should be applied
161+
/// </summary>
162+
public const string SanitizeTinyMce = "Umbraco.Web.SanitizeTinyMce";
158163
}
159164
}
160165
}

src/Umbraco.Tests.AcceptanceTest/cypress.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
"password": "<insert password in cypress.env.json>"
88
},
99
"supportFile": "cypress/support/index.ts",
10-
"videoUploadOnPasses" : false
10+
"videoUploadOnPasses" : false,
11+
"retries": {
12+
"runMode": 5,
13+
"openMode": 1
14+
}
1115
}

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,8 @@ context('Content', () => {
766766
// Click macro
767767
cy.get(':nth-child(4) > .umb-card-grid-item > :nth-child(1)').click();
768768
// Select the macro
769-
cy.get('.umb-card-grid-item').contains(macroName).click();
769+
cy.get(`.umb-card-grid-item[title='${macroName}']`).click('bottom');
770+
770771

771772
// Save and publish
772773
cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click();

src/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import {
33
AliasHelper,
44
ApprovedColorPickerDataTypeBuilder,
5+
TextBoxDataTypeBuilder,
56
} from 'umbraco-cypress-testhelpers';
67

78
context('DataTypes', () => {
@@ -62,6 +63,48 @@ context('DataTypes', () => {
6263
cy.umbracoEnsureTemplateNameNotExists(name);
6364
});
6465

66+
it('Tests Textbox Maxlength', () => {
67+
cy.deleteAllContent();
68+
const name = 'Textbox Maxlength Test';
69+
const alias = AliasHelper.toAlias(name);
70+
71+
cy.umbracoEnsureDocumentTypeNameNotExists(name);
72+
cy.umbracoEnsureDataTypeNameNotExists(name);
73+
74+
const textBoxDataType = new TextBoxDataTypeBuilder()
75+
.withName(name)
76+
.withMaxChars(10)
77+
.build()
78+
79+
cy.umbracoCreateDocTypeWithContent(name, alias, textBoxDataType);
80+
81+
// Act
82+
// Enter content
83+
// Assert no helptext with (max-2) chars & can save
84+
cy.umbracoRefreshContentTree();
85+
cy.umbracoTreeItem("content", [name]).click();
86+
cy.get('input[name="textbox"]').type('12345678');
87+
cy.get('localize[key="textbox_characters_left"]').should('not.exist');
88+
cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click();
89+
cy.umbracoSuccessNotification().should('be.visible');
90+
cy.get('.property-error').should('not.be.visible');
91+
92+
// Add char and assert helptext appears - no publish to save time & has been asserted above & below
93+
cy.get('input[name="textbox"]').type('9');
94+
cy.get('localize[key="textbox_characters_left"]').contains('characters left').should('exist');
95+
cy.get('.property-error').should('not.be.visible');
96+
97+
// Add char and assert errortext appears and can't save
98+
cy.get('input[name="textbox"]').type('10'); // 1 char over max
99+
cy.get('localize[key="textbox_characters_exceed"]').contains('too many').should('exist');
100+
cy.umbracoButtonByLabelKey('buttons_saveAndPublish').click();
101+
cy.get('.property-error').should('be.visible');
102+
103+
// Clean
104+
cy.umbracoEnsureDataTypeNameNotExists(name);
105+
cy.umbracoEnsureDocumentTypeNameNotExists(name);
106+
})
107+
65108
// it('Tests Checkbox List', () => {
66109
// const name = 'CheckBox List';
67110
// const alias = AliasHelper.toAlias(name);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/// <reference types="Cypress" />
2+
context('Languages', () => {
3+
4+
beforeEach(() => {
5+
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'), false);
6+
});
7+
8+
it('Deletes language', () => {
9+
// Setup
10+
const language1 = 'da';
11+
const language2 = 'en-GB';
12+
cy.umbracoEnsureLanguageNotExists(language1);
13+
cy.umbracoEnsureLanguageNotExists(language2);
14+
cy.umbracoCreateLanguage(language1, true, '1');
15+
cy.umbracoCreateLanguage(language2, true, '1');
16+
cy.umbracoSection('settings');
17+
18+
// Enter language tree and select the language we just created
19+
cy.umbracoTreeItem('settings', ['Languages']).click();
20+
21+
// Assert there are 3 languages
22+
cy.get('tbody > tr').should('have.length', 3);
23+
24+
// Delete the Danish language
25+
cy.get('tr').contains('Danish').parents('tr').within(() => {
26+
cy.get('umb-button[label-key="general_delete"]').click()
27+
});
28+
cy.umbracoButtonByLabelKey('contentTypeEditor_yesDelete').click();
29+
30+
// Assert there is only 2 language
31+
cy.get('tbody > tr').should('have.length', 3);
32+
33+
// Cleanup
34+
cy.umbracoEnsureLanguageNotExists(language1);
35+
cy.umbracoEnsureLanguageNotExists(language2);
36+
});
37+
38+
});

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Members/memberGroups.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
context('User Groups', () => {
1+
context('Member Groups', () => {
22

33
beforeEach(() => {
44
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/documentTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ context('Document Types', () => {
3535
cy.get('#datatype-search').type('Textstring');
3636

3737
// Choose first item
38-
cy.get('ul.umb-card-grid li [title="Textstring"]').closest("li").click();
38+
cy.get('ul.umb-card-grid [title="Textstring"]').closest("li").click();
3939

4040
// Save property
4141
cy.get('.btn-success').last().click();

src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/mediaTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ context('Media Types', () => {
3434
cy.get('#datatype-search').type('Textstring');
3535

3636
// Choose first item
37-
cy.get('ul.umb-card-grid li [title="Textstring"]').closest("li").click();
37+
cy.get('ul.umb-card-grid [title="Textstring"]').closest("li").click();
3838

3939
// Save property
4040
cy.get('.btn-success').last().click();

0 commit comments

Comments
 (0)