Merge branch 'dev-v7' into temp7-269-xss-stylesheets

# Conflicts resolved:
#	src/Umbraco.Core/StringExtensions.cs
This commit is contained in:
elitsa
2018-12-10 10:57:30 +01:00
19 changed files with 7228 additions and 6127 deletions
+2 -1
View File
@@ -13,4 +13,5 @@ indent_size = 4
# Trim trailing whitespace, limited support.
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
trim_trailing_whitespace = true
trim_trailing_whitespace = true
csharp_prefer_braces = false : none
-1
View File
@@ -82,7 +82,6 @@ You can get in touch with [the PR team](#the-pr-team) in multiple ways, we love
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"](https://our.umbraco.com/forum/contributing-to-umbraco-cms/) forum, the team monitors that one closely
- We're also [active in the Gitter chatroom](https://gitter.im/umbraco/Umbraco-CMS)
## Code of Conduct
+1
View File
@@ -90,6 +90,7 @@ src/Umbraco.Web.UI.Client/[Bb]uild/*
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
src/Umbraco.Web.UI.Client/vwd.webinfo
tools/NDepend/
src/Umbraco.Web.UI/App_Plugins/*
+2 -2
View File
@@ -53,7 +53,7 @@ namespace Umbraco.Core
.Reverse()
.ToArray();
return nodeIds;
}
}
/// <summary>
/// Removes new lines and tabs
@@ -190,7 +190,7 @@ namespace Umbraco.Core
return new string(outputArray);
}
private static readonly char[] CleanForXssChars = "*?(){}[];:%<>/\\|&'+\"".ToCharArray();
private static readonly char[] CleanForXssChars = "*?(){}[];:%<>/\\|&'\"".ToCharArray();
/// <summary>
/// Cleans string to aid in preventing xss attacks.
+7154 -6096
View File
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -11,10 +11,10 @@
"cssnano": "^3.7.6",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "5.0.0",
"gulp-connect": "5.6.1",
"gulp-eslint": "^5.0.0",
"gulp-imagemin": "^4.1.0",
"gulp-less": "^3.5.0",
"gulp-less": "^4.0.1",
"gulp-ngdocs": "^0.3.0",
"gulp-open": "^2.1.0",
"gulp-postcss": "^6.2.0",
@@ -24,12 +24,14 @@
"gulp-wrap": "^0.13.0",
"gulp-wrap-js": "^0.4.1",
"jasmine-core": "2.5.2",
"karma": "^1.7.0",
"karma": "^3.1.3",
"karma-jasmine": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.4",
"less": "^2.7.3",
"less": "^3.9.0",
"lodash": "^4.17.5",
"merge-stream": "^1.0.1",
"run-sequence": "^2.2.1"
"run-sequence": "^2.2.1",
"marked": "^0.5.2",
"event-stream": "3.3.4"
}
}
@@ -253,9 +253,9 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
}
}
// If we have a scheduled publish or unpublish date change the default button to
// If we have a scheduled publish date change the default button to
// "save" and update the label to "save and schedule
if(args.content.releaseDate || args.content.removeDate) {
if(args.content.releaseDate) {
// if save button is alread the default don't change it just update the label
if (buttons.defaultButton && buttons.defaultButton.letter === "A") {
@@ -88,13 +88,7 @@
<div class="flex justify-center items-center">
<umb-button type="button"
button-style="success"
label="Get started"
action="getStarted()">
</umb-button>
<umb-button ng-if="!avatarFile.uploaded"
type="button"
button-style="link"
label="Skip"
label="Done"
action="getStarted()">
</umb-button>
</div>
@@ -30,15 +30,21 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio
var recycleBin = treeService.getDescendantNode(rootNode, -20);
if (recycleBin) {
recycleBin.hasChildren = true;
//reload the recycle bin if it's already expanded so the deleted item is shown
if (recycleBin.expanded) {
treeService.loadNodeChildren({ node: recycleBin, section: "content" });
}
}
}
//if the current edited item is the same one as we're deleting, we need to navigate elsewhere
if (editorState.current && editorState.current.id == $scope.currentNode.id) {
//If the deleted item lived at the root then just redirect back to the root, otherwise redirect to the item's parent
var location = "/content";
if ($scope.currentNode.parentId.toString() !== "-1")
if ($scope.currentNode.parentId.toString() === "-20")
location = "/content/content/recyclebin";
else if ($scope.currentNode.parentId.toString() !== "-1")
location = "/content/content/edit/" + $scope.currentNode.parentId;
$location.path(location);
@@ -30,6 +30,10 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
var recycleBin = treeService.getDescendantNode(rootNode, -21);
if (recycleBin) {
recycleBin.hasChildren = true;
//reload the recycle bin if it's already expanded so the deleted item is shown
if (recycleBin.expanded) {
treeService.loadNodeChildren({ node: recycleBin, section: "media" });
}
}
}
@@ -37,8 +41,10 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
if (editorState.current && editorState.current.id == $scope.currentNode.id) {
//If the deleted item lived at the root then just redirect back to the root, otherwise redirect to the item's parent
var location = "/media";
if ($scope.currentNode.parentId.toString() !== "-1")
var location = "/media";
if ($scope.currentNode.parentId.toString() === "-21")
location = "/media/media/recyclebin";
else if ($scope.currentNode.parentId.toString() !== "-1")
location = "/media/media/edit/" + $scope.currentNode.parentId;
$location.path(location);
+3
View File
@@ -0,0 +1,3 @@
/Umbraco/**
/Umbraco_Client/**
+1
View File
@@ -520,6 +520,7 @@
</Content>
<Content Include="Umbraco\Install\Views\Web.config" />
<Content Include="App_Plugins\ModelsBuilder\package.manifest" />
<Content Include=".eslintignore" />
<None Include="Config\404handlers.Release.config">
<DependentUpon>404handlers.config</DependentUpon>
</None>
@@ -32,6 +32,7 @@
<notifications>
<!-- the email that should be used as from mail when umbraco sends a notification -->
<!-- you can add a display name to the email like thist: <email>Your display name here &lt;your@email.here&gt;</email> -->
<email>your@email.here</email>
</notifications>
@@ -48,6 +48,7 @@
</errors>
<notifications>
<!-- the email that should be used as from mail when umbraco sends a notification -->
<!-- you can add a display name to the email like this: <email>Your display name here &lt;your@email.here&gt;</email> -->
<email>your@email.here</email>
</notifications>
@@ -1079,8 +1079,10 @@ Mange hilsner fra Umbraco robotten
<key alias="dictionaryItemSaved">Ordbogsnøgle gemt</key>
<key alias="editContentPublishedHeader">Indhold publiceret</key>
<key alias="editContentPublishedText">og nu synligt for besøgende</key>
<key alias="editContentPublishedWithExpireDateText">og nu synligt for besøgende indtil %0% kl. %1%</key>
<key alias="editContentSavedHeader">Indhold gemt</key>
<key alias="editContentSavedText">Husk at publicere for at gøre det synligt for besøgende</key>
<key alias="editContentSavedWithReleaseDateText">Ændringerne bliver publiceret den %0% kl. %1%</key>
<key alias="editContentSendToPublish">Send til Godkendelse</key>
<key alias="editContentSendToPublishText">Rettelser er blevet sendt til godkendelse</key>
<key alias="editMediaSaved">Medie gemt</key>
@@ -1562,7 +1564,7 @@ Mange hilsner fra Umbraco robotten
<key alias="userInvited">er blevet inviteret</key>
<key alias="userInvitedSuccessHelp">En invitation er blevet sendt til den nye bruger med oplysninger om, hvordan man logger ind i Umbraco.</key>
<key alias="userinviteWelcomeMessage">Hej og velkommen til Umbraco! På bare 1 minut vil du være klar til at komme i gang, vi skal bare have dig til at oprette en adgangskode og tilføje et billede til din avatar.</key>
<key alias="userinviteAvatarMessage">Upload et billede for at gøre det nemt for andre brugere at genkende dig.</key>
<key alias="userinviteAvatarMessage">Hvis du uploader et billede af dig selv, gør du det nemt for andre brugere at genkende dig. Klik på cirklen ovenfor for at uploade et billede.</key>
<key alias="writer">Forfatter</key>
<key alias="translator">Oversætter</key>
<key alias="change">Skift</key>
@@ -1397,8 +1397,10 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="editContentPublishedFailedByParent">Publishing failed because the parent page isn't published</key>
<key alias="editContentPublishedHeader">Content published</key>
<key alias="editContentPublishedText">and visible on the website</key>
<key alias="editContentPublishedWithExpireDateText">and visible on the website until %0% at %1%</key>
<key alias="editContentSavedHeader">Content saved</key>
<key alias="editContentSavedText">Remember to publish to make changes visible</key>
<key alias="editContentSavedWithReleaseDateText">Changes will be published on %0% at %1%</key>
<key alias="editContentSendToPublish">Sent For Approval</key>
<key alias="editContentSendToPublishText">Changes have been sent for approval</key>
<key alias="editMediaSaved">Media saved</key>
@@ -1940,7 +1942,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="userInvitedSuccessHelp">An invitation has been sent to the new user with details about how to log in to Umbraco.</key>
<key alias="userinviteWelcomeMessage">Hello there and welcome to Umbraco! In just 1 minute youll be good to go, we just need you to setup a password and add a picture for your avatar.</key>
<key alias="userinviteExpiredMessage">Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it.</key>
<key alias="userinviteAvatarMessage">Upload a picture to make it easy for other users to recognize you.</key>
<key alias="userinviteAvatarMessage">Uploading a photo of yourself will make it easy for other users to recognize you. Click the circle above to upload your photo.</key>
<key alias="writer">Writer</key>
<key alias="translator">Translator</key>
<key alias="change">Change</key>
@@ -1396,8 +1396,10 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="editContentPublishedFailedByParent">Publishing failed because the parent page isn't published</key>
<key alias="editContentPublishedHeader">Content published</key>
<key alias="editContentPublishedText">and visible on the website</key>
<key alias="editContentPublishedWithExpireDateText">and visible on the website until %0% at %1%</key>
<key alias="editContentSavedHeader">Content saved</key>
<key alias="editContentSavedText">Remember to publish to make changes visible</key>
<key alias="editContentSavedWithReleaseDateText">Changes will be published on %0% at %1%</key>
<key alias="editContentSendToPublish">Sent For Approval</key>
<key alias="editContentSendToPublishText">Changes have been sent for approval</key>
<key alias="editMediaSaved">Media saved</key>
@@ -1934,7 +1936,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="userInvitedSuccessHelp">An invitation has been sent to the new user with details about how to log in to Umbraco.</key>
<key alias="userinviteWelcomeMessage">Hello there and welcome to Umbraco! In just 1 minute youll be good to go, we just need you to setup a password and add a picture for your avatar.</key>
<key alias="userinviteExpiredMessage">Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it.</key>
<key alias="userinviteAvatarMessage">Upload a picture to make it easy for other users to recognize you.</key>
<key alias="userinviteAvatarMessage">Uploading a photo of yourself will make it easy for other users to recognize you. Click the circle above to upload your photo.</key>
<key alias="writer">Writer</key>
<key alias="translator">Translator</key>
<key alias="change">Change</key>
+15 -6
View File
@@ -347,6 +347,9 @@ namespace Umbraco.Web.Editors
var emptyContent = Services.ContentService.CreateContent("", parentId, contentType.Alias, UmbracoUser.Id);
var mapped = AutoMapperExtensions.MapWithUmbracoContext<IContent, ContentItemDisplay>(emptyContent, UmbracoContext);
// translate the content type name if applicable
mapped.ContentTypeName = Services.TextService.UmbracoDictionaryTranslate(mapped.ContentTypeName);
mapped.DocumentType.Name = Services.TextService.UmbracoDictionaryTranslate(mapped.DocumentType.Name);
//remove this tab if it exists: umbContainerView
var containerTab = mapped.Tabs.FirstOrDefault(x => x.Alias == Constants.Conventions.PropertyGroups.ListViewGroupName);
@@ -696,7 +699,10 @@ namespace Umbraco.Web.Editors
{
display.AddSuccessNotification(
Services.TextService.Localize("speechBubbles/editContentSavedHeader"),
Services.TextService.Localize("speechBubbles/editContentSavedText"));
contentItem.ReleaseDate.HasValue
? Services.TextService.Localize("speechBubbles/editContentSavedWithReleaseDateText", new [] { contentItem.ReleaseDate.Value.ToLongDateString(), contentItem.ReleaseDate.Value.ToShortTimeString() })
: Services.TextService.Localize("speechBubbles/editContentSavedText")
);
}
else
{
@@ -718,7 +724,7 @@ namespace Umbraco.Web.Editors
break;
case ContentSaveAction.Publish:
case ContentSaveAction.PublishNew:
ShowMessageForPublishStatus(publishStatus.Result, display);
ShowMessageForPublishStatus(publishStatus.Result, display, contentItem.ExpireDate);
break;
}
@@ -759,7 +765,7 @@ namespace Umbraco.Web.Editors
if (publishResult.Success == false)
{
var notificationModel = new SimpleNotificationModel();
ShowMessageForPublishStatus(publishResult.Result, notificationModel);
ShowMessageForPublishStatus(publishResult.Result, notificationModel, foundContent.ExpireDate);
return Request.CreateValidationErrorResponse(notificationModel);
}
@@ -1040,15 +1046,18 @@ namespace Umbraco.Web.Editors
return toMove;
}
private void ShowMessageForPublishStatus(PublishStatus status, INotificationModel display)
private void ShowMessageForPublishStatus(PublishStatus status, INotificationModel display, DateTime? expireDate)
{
switch (status.StatusType)
{
case PublishStatusType.Success:
case PublishStatusType.SuccessAlreadyPublished:
case PublishStatusType.SuccessAlreadyPublished:
display.AddSuccessNotification(
Services.TextService.Localize("speechBubbles/editContentPublishedHeader"),
Services.TextService.Localize("speechBubbles/editContentPublishedText"));
expireDate.HasValue
? Services.TextService.Localize("speechBubbles/editContentPublishedWithExpireDateText", new [] { expireDate.Value.ToLongDateString(), expireDate.Value.ToShortTimeString() })
: Services.TextService.Localize("speechBubbles/editContentPublishedText")
);
break;
case PublishStatusType.FailedPathNotPublished:
display.AddWarningNotification(
+13
View File
@@ -63,6 +63,19 @@
<PropertyGroup Condition="Exists('$(VSWherePath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
<WebPublishingTasks>$(VSWherePath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(VSWherePath)\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
<WebPublishingTasks>$(VSWherePath)\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
</PropertyGroup>
<!-- Temporary addition for the VS2019 preview - can be removed when VS2019 final is released, then v16 above will be used -->
<PropertyGroup Condition="Exists('$(ProgramFiles32)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
<WebPublishingTasks>$(ProgramFiles32)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
</PropertyGroup>
<!--
****************************************************