Compare commits

...

18 Commits

Author SHA1 Message Date
Sebastiaan Janssen d69f0fe9dd #3993 Move color picker fix to correct method and update backwards compatibility test 2019-01-10 15:35:48 +01:00
Kenn Jacobsen d2baf03119 Fix content picker dirty checking (#4003)
(cherry picked from commit d41dbce601)
2019-01-10 09:54:39 +01:00
Sebastiaan Janssen ff085c97ce Revert "Added eslintignore file"
This reverts commit 673735c2fe.
2019-01-09 14:57:17 +01:00
Sebastiaan Janssen ec60ba142a Fixes #3993 Recent changes in color picker has caused incompatibility with existing picker 2019-01-09 10:50:27 +01:00
Kenn Jacobsen a16e31c671 Safeguard the tags value converter against empty tags
(cherry picked from commit cc6c16894c)
2019-01-08 21:52:58 +01:00
Floris Robbemont d19a23eec6 Fix for wrong sorting overload in MediaService (#3948)
(cherry picked from commit 0852b20b31)
2019-01-08 21:50:58 +01:00
Sebastiaan Janssen 5b17072d55 Bump version to 7.13.1 2019-01-08 21:45:34 +01:00
Sebastiaan Janssen 51875539b9 Fixes #4000 - 7.13.0 Creating new node as an editor causes exception
(cherry picked from commit caf7a6a1ca)
2019-01-08 21:44:17 +01:00
Sebastiaan Janssen 030fd4d375 Git clone includes a directory to clone to now,
should fix Azure Gallery release.
Tightened up the variables and paths.

(cherry picked from commit e0a38a4d9b)
2019-01-08 21:44:07 +01:00
Sebastiaan Janssen 7658fba725 Fixes #3990 All images uploaded to media section have umbracoHeight / umbracoWidth of 200x200px
(cherry picked from commit 086157cff8)
2019-01-08 21:43:53 +01:00
Kenn Jacobsen 0150b97278 Show password change validation errors at the correct fields (#3918)
* Show password change validation errors at the correct password fields + remove the redundant "Could not reset password, errors: " message text

* Explicitly find the user instead of mapping it.
2018-12-31 14:02:59 +00:00
Kenn Jacobsen af2f531d31 Add missing localization of dialogs (#3844) 2018-12-31 13:37:58 +00:00
Sebastiaan Janssen 5e680e80e6 Deletes commented out code 2018-12-31 12:49:54 +00:00
Dave Woestenborghs ee8b4c5884 #3916 fix multiple enumerations of ienumerable...so usernames and avatars are displayed correctly 2018-12-31 12:49:54 +00:00
Dave Woestenborghs 0ce54847b0 #3916 mapping to a IEnumerable resulted in all items in the result list being the same. Now map items indiviually. Could be caused by this : https://stackoverflow.com/questions/17268362/automapper-for-a-list-scenario-only-seems-to-repeat-mapping-the-first-object-in 2018-12-31 12:49:54 +00:00
Callum Whyte b852c78861 Fixing spelling mistakes in helveticons CSS class names
The icon picker uses these class names as labels, kept the old class names for backwards compatibility
2018-12-31 12:47:04 +00:00
Kenn Jacobsen debbf87a04 Support image crop data set when overwriting files using the API 2018-12-31 12:43:06 +00:00
Brian Juul Andersen b2a1b11a5b Fixed minor grammatical error 2018-12-29 20:20:02 +00:00
29 changed files with 158 additions and 91 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ This document gives you a quick overview on how to get started, we will link to
## Guidelines for contributions we welcome
Not all changes are wanted, so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valueable time.
Not all changes are wanted, so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valuable time.
We have [documented what we consider small and large changes](CONTRIBUTION_GUIDELINES.md). Make sure to talk to us before making large changes.
+20 -20
View File
@@ -3,57 +3,57 @@
[string]$Directory
)
$workingDirectory = $Directory
CD $workingDirectory
CD "$($workingDirectory)"
# Clone repo
$fullGitUrl = "https://$env:GIT_URL/$env:GIT_REPOSITORYNAME.git"
git clone $fullGitUrl 2>&1 | % { $_.ToString() }
$fullGitUrl = "https://$($env:GIT_URL)/$($env:GIT_REPOSITORYNAME).git"
git clone $($fullGitUrl) $($env:GIT_REPOSITORYNAME) 2>&1 | % { $_.ToString() }
# Remove everything so that unzipping the release later will update everything
# Don't remove the readme file nor the git directory
Write-Host "Cleaning up git directory before adding new version"
Remove-Item -Recurse $workingDirectory\$env:GIT_REPOSITORYNAME\* -Exclude README.md,.git
Remove-Item -Recurse "$($workingDirectory)\$($env:GIT_REPOSITORYNAME)\*" -Exclude README.md,.git
# Find release zip
$zipsDir = "$workingDirectory\$env:BUILD_DEFINITIONNAME\zips"
$zipsDir = "$($workingDirectory)\$($env:BUILD_DEFINITIONNAME)\zips"
$pattern = "UmbracoCms.([0-9]{1,2}.[0-9]{1,3}.[0-9]{1,3}).zip"
Write-Host "Searching for Umbraco release files in $workingDirectory\$zipsDir for a file with pattern $pattern"
$file = (Get-ChildItem $zipsDir | Where-Object { $_.Name -match "$pattern" })
Write-Host "Searching for Umbraco release files in $($zipsDir) for a file with pattern $($pattern)"
$file = (Get-ChildItem "$($zipsDir)" | Where-Object { $_.Name -match "$($pattern)" })
if($file)
{
# Get release name
$version = [regex]::Match($file.Name, $pattern).captures.groups[1].value
$releaseName = "Umbraco $version"
Write-Host "Found $releaseName"
$version = [regex]::Match($($file.Name), $($pattern)).captures.groups[1].value
$releaseName = "Umbraco $($version)"
Write-Host "Found $($releaseName)"
# Unzip into repository to update release
Add-Type -AssemblyName System.IO.Compression.FileSystem
Write-Host "Unzipping $($file.FullName) to $workingDirectory\$env:GIT_REPOSITORYNAME"
[System.IO.Compression.ZipFile]::ExtractToDirectory("$($file.FullName)", "$workingDirectory\$env:GIT_REPOSITORYNAME")
Write-Host "Unzipping $($file.FullName) to $($workingDirectory)\$($env:GIT_REPOSITORYNAME)"
[System.IO.Compression.ZipFile]::ExtractToDirectory("$($file.FullName)", "$($workingDirectory)\$($env:GIT_REPOSITORYNAME)")
# Telling git who we are
git config --global user.email "coffee@umbraco.com" 2>&1 | % { $_.ToString() }
git config --global user.name "Umbraco HQ" 2>&1 | % { $_.ToString() }
# Commit
CD $env:GIT_REPOSITORYNAME
Write-Host "Committing Umbraco $version Release from Build Output"
CD "$($workingDirectory)\$($env:GIT_REPOSITORYNAME)"
Write-Host "Committing Umbraco $($version) Release from Build Output"
git add . 2>&1 | % { $_.ToString() }
git commit -m " Release $releaseName from Build Output" 2>&1 | % { $_.ToString() }
git commit -m " Release $($releaseName) from Build Output" 2>&1 | % { $_.ToString() }
# Tag the release
git tag -a "v$version" -m "v$version"
git tag -a "v$($version)" -m "v$($version)"
# Push release to master
$fullGitAuthUrl = "https://$($env:GIT_USERNAME):$GitHubPersonalAccessToken@$env:GIT_URL/$env:GIT_REPOSITORYNAME.git"
git push $fullGitAuthUrl 2>&1 | % { $_.ToString() }
$fullGitAuthUrl = "https://$($env:GIT_USERNAME):$($GitHubPersonalAccessToken)@$($env:GIT_URL)/$($env:GIT_REPOSITORYNAME).git"
git push $($fullGitAuthUrl) 2>&1 | % { $_.ToString() }
#Push tag to master
git push $fullGitAuthUrl --tags 2>&1 | % { $_.ToString() }
git push $($fullGitAuthUrl) --tags 2>&1 | % { $_.ToString() }
}
else
{
Write-Error "Umbraco release file not found, searched in $workingDirectory\$zipsDir for a file with pattern $pattern - cancelling"
Write-Error "Umbraco release file not found, searched in $($workingDirectory)\$($zipsDir) for a file with pattern $($pattern) - canceling"
}
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.13.0")]
[assembly: AssemblyInformationalVersion("7.13.0")]
[assembly: AssemblyFileVersion("7.13.1")]
[assembly: AssemblyInformationalVersion("7.13.1")]
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.13.0");
private static readonly Version Version = new Version("7.13.1");
/// <summary>
/// Gets the current version of Umbraco.
+11 -2
View File
@@ -1,4 +1,6 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
@@ -293,6 +295,12 @@ namespace Umbraco.Core.IO
{
var property = GetProperty(content, propertyTypeAlias);
var svalue = property.Value as string;
if (svalue != null && svalue.DetectIsJson())
{
// the property value is a JSON serialized image crop data set - grab the "src" property as the file source
var jObject = JsonConvert.DeserializeObject<JObject>(svalue);
svalue = jObject != null ? jObject.GetValueAsString("src") : svalue;
}
var oldpath = svalue == null ? null : GetRelativePath(svalue);
var filepath = StoreFile(content, property.PropertyType, filename, filestream, oldpath);
property.Value = GetUrl(filepath);
@@ -357,7 +365,8 @@ namespace Umbraco.Core.IO
{
var jpgInfo = ImageFile.FromStream(stream);
if (jpgInfo.Format != ImageFileFormat.Unknown
if (jpgInfo != null
&& jpgInfo.Format != ImageFileFormat.Unknown
&& jpgInfo.Properties.ContainsKey(ExifTag.PixelYDimension)
&& jpgInfo.Properties.ContainsKey(ExifTag.PixelXDimension))
{
+5 -4
View File
@@ -118,9 +118,9 @@ namespace Umbraco.Core.Media.Exif
/// <param name="encoding">The encoding to be used for text metadata when the source encoding is unknown.</param>
/// <returns>The <see cref="ImageFile"/> created from the file.</returns>
public static ImageFile FromStream(Stream stream, Encoding encoding)
{
{
// JPEG
if(JPEGDetector.IsOfType(stream))
if (JPEGDetector.IsOfType(stream))
{
return new JPEGFile(stream, encoding);
}
@@ -137,8 +137,9 @@ namespace Umbraco.Core.Media.Exif
return new SVGFile(stream);
}
throw new NotValidImageFileException ();
}
// We don't know
return null;
}
#endregion
}
}
@@ -7,8 +7,7 @@ namespace Umbraco.Core.Media.TypeDetector
public static bool IsOfType(Stream fileStream)
{
var header = GetFileHeader(fileStream);
return header[0] == 0xff && header[1] == 0xD8;
return header != null && header[0] == 0xff && header[1] == 0xD8;
}
}
}
@@ -7,9 +7,13 @@ namespace Umbraco.Core.Media.TypeDetector
public static byte[] GetFileHeader(Stream fileStream)
{
fileStream.Seek(0, SeekOrigin.Begin);
byte[] header = new byte[8];
var header = new byte[8];
fileStream.Seek(0, SeekOrigin.Begin);
// Invalid header
if (fileStream.Read(header, 0, header.Length) != header.Length)
return null;
return header;
}
}
@@ -7,17 +7,17 @@ namespace Umbraco.Core.Media.TypeDetector
{
public static bool IsOfType(Stream fileStream)
{
string tiffHeader = GetFileHeader(fileStream);
return tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00";
var tiffHeader = GetFileHeader(fileStream);
return tiffHeader != null && tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00";
}
public static string GetFileHeader(Stream fileStream)
{
var header = RasterizedTypeDetector.GetFileHeader(fileStream);
if (header == null)
return null;
string tiffHeader = Encoding.ASCII.GetString(header, 0, 4);
var tiffHeader = Encoding.ASCII.GetString(header, 0, 4);
return tiffHeader;
}
}
@@ -42,16 +42,22 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
{
var sourceAsString = source?.ToString();
if(sourceAsString.IsNullOrWhiteSpace())
{
return new string[0];
}
// if Json storage type deserialzie and return as string array
if (JsonStorageType(propertyType.DataTypeId))
{
var jArray = JsonConvert.DeserializeObject<JArray>(source.ToString());
var jArray = JsonConvert.DeserializeObject<JArray>(sourceAsString);
return jArray.ToObject<string[]>();
}
// Otherwise assume CSV storage type and return as string array
var csvTags =
source.ToString()
sourceAsString
.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries)
.ToArray();
return csvTags;
+1 -1
View File
@@ -509,7 +509,7 @@ namespace Umbraco.Core.Services
public IEnumerable<IMedia> GetPagedChildren(int id, long pageIndex, int pageSize, out long totalChildren,
string orderBy, Direction orderDirection, bool orderBySystemField, string filter)
{
return GetPagedChildren(id, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, true, filter, null);
return GetPagedChildren(id, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filter, null);
}
/// <summary>
@@ -17,12 +17,14 @@
-webkit-font-smoothing: antialiased;
*margin-right: .3em;
}
[class^="icon-"]:before,
[class*=" icon-"]:before {
text-decoration: inherit;
display: inline-block;
speak: none;
}
/*
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: 'icomoon';
@@ -38,7 +40,6 @@
i.large{
font-size: 32px;
}
i.medium{
font-size: 24px;
}
@@ -187,8 +188,6 @@ i.small{
.icon-umb-translation:before, .traytranslation:before {
content: "\e1fd";
}
.icon-tv:before {
content: "\e02e";
}
@@ -213,7 +212,8 @@ i.small{
.icon-train:before {
content: "\e035";
}
.icon-trafic:before {
.icon-trafic:before,
.icon-traffic:before {
content: "\e036";
}
.icon-traffic-alt:before {
@@ -255,6 +255,7 @@ i.small{
.icon-target:before {
content: "\e043";
}
.icon-temperature-alt:before,
.icon-temperatrure-alt:before {
content: "\e044";
}
@@ -267,6 +268,7 @@ i.small{
.icon-theater:before {
content: "\e047";
}
.icon-thief:before,
.icon-theif:before {
content: "\e048";
}
@@ -375,6 +377,7 @@ i.small{
.icon-shuffle:before {
content: "\e06b";
}
.icon-science:before,
.icon-sience:before {
content: "\e06c";
}
@@ -747,6 +750,7 @@ i.small{
.icon-pictures-alt-2:before {
content: "\e0e7";
}
.icon-panel-close:before,
.icon-pannel-close:before {
content: "\e0e8";
}
@@ -1627,6 +1631,7 @@ i.small{
.icon-alarm-clock:before {
content: "\e20c";
}
.icon-addressbook:before,
.icon-adressbook:before {
content: "\e20d";
}
@@ -3,7 +3,8 @@
$scope,
contentResource,
navigationService,
angularHelper) {
angularHelper,
localizationService) {
var vm = this;
var currentForm;
vm.notifyOptions = [];
@@ -11,7 +12,8 @@
vm.cancel = cancel;
vm.message = {
name: $scope.currentNode.name
};;
};
vm.labels = {};
function onInit() {
vm.loading = true;
contentResource.getNotifySettingsById($scope.currentNode.id).then(function (options) {
@@ -19,6 +21,9 @@
vm.loading = false;
vm.notifyOptions = options;
});
localizationService.localize("notifications_editNotifications", [$scope.currentNode.name]).then(function(value) {
vm.labels.headline = value;
});
}
function cancel() {
navigationService.hideMenu();
@@ -11,14 +11,17 @@
<div ng-show="success">
<div class="alert alert-success">
<strong>{{currentNode.name}}</strong> was copied to
<strong>{{currentNode.name}}</strong>
<localize key="actions_wasCopiedTo">was copied to</localize>
<strong>{{target.name}}</strong>
</div>
<button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
</div>
<p class="abstract" ng-hide="success">
Choose where to copy <strong>{{currentNode.name}}</strong> to in the tree structure below
<localize key="actions_chooseWhereToCopy">Choose where to copy</localize>
<strong>{{currentNode.name}}</strong>
<localize key="actions_toInTheTreeStructureBelow">to in the tree structure below</localize>
</p>
<div class="umb-loader-wrapper" ng-show="busy">
@@ -11,7 +11,9 @@
<div ng-show="success">
<div class="alert alert-success">
<strong>{{currentNode.name}}</strong> was moved underneath&nbsp;<strong>{{target.name}}</strong>
<strong>{{currentNode.name}}</strong>
<localize key="actions_wasMovedTo">was moved to</localize>
<strong>{{target.name}}</strong>
</div>
<button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
</div>
@@ -13,13 +13,13 @@
</div>
<div ng-show="vm.saveSuccces" ng-cloak>
<div class="alert alert-success">
<localize key="notify_notificationsSavedFor"></localize><strong> {{currentNode.name}}</strong>
<localize key="notifications_notificationsSavedFor"></localize> <strong>{{currentNode.name}}</strong>
</div>
<button class="btn btn-primary" ng-click="vm.cancel()"><localize key="general_ok">Ok</localize></button>
</div>
<div ng-hide="vm.saveSuccces || vm.saveError" ng-cloak>
<div class="block-form" ng-show="!vm.loading">
<localize key="notify_notifySet">Set your notification for</localize> <strong>{{ currentNode.name }}</strong>
<span ng-bind-html="vm.labels.headline"></span>
<umb-control-group>
<umb-permission ng-repeat="option in vm.notifyOptions"
name="option.name"
@@ -11,7 +11,9 @@
<div ng-show="success">
<div class="alert alert-success">
<strong>{{currentNode.name}}</strong> was moved underneath <strong>{{target.name}}</strong>
<strong>{{currentNode.name}}</strong>
<localize key="actions_wasMovedTo">was moved to</localize>
<strong>{{target.name}}</strong>
</div>
<button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
</div>
@@ -139,6 +139,11 @@ function ColorPickerController($scope) {
if (!$scope.model.value)
return;
// Backwards compatibility, the color used to be stored as a hex value only
if (typeof $scope.model.value === "string") {
$scope.model.value = { value: $scope.model.value, label: $scope.model.value };
}
// Complex color (value and label)?
if (!$scope.model.value.hasOwnProperty("value"))
return;
@@ -35,7 +35,6 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
return $scope.model.config.idType === "udi" ? i.udi : i.id;
});
$scope.model.value = trim(currIds.join(), ",");
angularHelper.getCurrentForm($scope).$setDirty();
//Validate!
if ($scope.model.config && $scope.model.config.minNumber && parseInt($scope.model.config.minNumber) > $scope.renderModel.length) {
@@ -84,7 +83,10 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
opacity: 0.7,
tolerance: "pointer",
scroll: true,
zIndex: 6000
zIndex: 6000,
update: function (e, ui) {
angularHelper.getCurrentForm($scope).$setDirty();
}
};
if ($scope.model.config) {
-3
View File
@@ -1,3 +0,0 @@
/Umbraco/**
/Umbraco_Client/**
+2 -3
View File
@@ -520,7 +520,6 @@
</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>
@@ -1039,9 +1038,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>7130</DevelopmentServerPort>
<DevelopmentServerPort>7131</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:7130</IISUrl>
<IISUrl>http://localhost:7131</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
@@ -32,8 +32,11 @@
<key alias="rename" version="7.3.0">Omdøb</key>
<key alias="restore" version="7.3.0">Gendan</key>
<key alias="SetPermissionsForThePage">Sæt rettigheder for siden %0%</key>
<key alias="chooseWhereToCopy">Vælg hvor du vil kopiere</key>
<key alias="chooseWhereToMove">Vælg hvortil du vil flytte</key>
<key alias="toInTheTreeStructureBelow">I træstrukturen nedenfor</key>
<key alias="toInTheTreeStructureBelow">til i træstrukturen nedenfor</key>
<key alias="wasMovedTo">blev flyttet til</key>
<key alias="wasCopiedTo">blev kopieret til</key>
<key alias="rights">Rettigheder</key>
<key alias="rollback">Fortryd ændringer</key>
<key alias="sendtopublish">Send til udgivelse</key>
@@ -830,7 +833,8 @@
<key alias="relateToOriginal">Relater det kopierede element til originalen</key>
</area>
<area alias="notifications">
<key alias="editNotifications">Rediger dine notificeringer for %0%</key>
<key alias="editNotifications"><![CDATA[Vælg dine notificeringer for <strong>%0%</strong>]]></key>
<key alias="notificationsSavedFor">Notificeringer er gemt for</key>
<key alias="mailBody">
<![CDATA[
Hej %0%
@@ -1004,6 +1008,7 @@ Mange hilsner fra Umbraco robotten
<area alias="rollback">
<key alias="headline">Vælg en version at sammenligne med den nuværende version</key>
<key alias="currentVersion">Nuværende version</key>
<key alias="diffHelp"><![CDATA[Her vises forskellene mellem den nuværende version og den valgte version<br /><del>Rød</del> tekst vil ikke blive vist i den valgte version. <ins>Grøn betyder tilføjet</ins>]]></key>
<key alias="documentRolledBack">Dokument tilbagerullet</key>
@@ -33,8 +33,11 @@
<key alias="rename" version="7.3.0">Rename</key>
<key alias="restore" version="7.3.0">Restore</key>
<key alias="SetPermissionsForThePage">Set permissions for the page %0%</key>
<key alias="chooseWhereToCopy">Choose where to copy</key>
<key alias="chooseWhereToMove">Choose where to move</key>
<key alias="toInTheTreeStructureBelow">In the tree structure below</key>
<key alias="toInTheTreeStructureBelow">to in the tree structure below</key>
<key alias="wasMovedTo">was moved to</key>
<key alias="wasCopiedTo">was copied to</key>
<key alias="rights">Permissions</key>
<key alias="rollback">Rollback</key>
<key alias="sendtopublish">Send To Publish</key>
@@ -1038,7 +1041,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="relateToOriginal">Relate copied items to original</key>
</area>
<area alias="notifications">
<key alias="editNotifications">Edit your notification for %0%</key>
<key alias="editNotifications"><![CDATA[Select your notification for <strong>%0%</strong>]]></key>
<key alias="notificationsSavedFor">Notification settings saved for</key>
<key alias="mailBody">
<![CDATA[
Hi %0%
@@ -1310,6 +1314,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="undoEditCrop">Undo edits</key>
</area>
<area alias="rollback">
<key alias="headline">Select a version to compare with the current version</key>
<key alias="currentVersion">Current version</key>
<key alias="diffHelp"><![CDATA[This shows the differences between the current version and the selected version<br /><del>Red</del> text will not be shown in the selected version. , <ins>green means added</ins>]]></key>
<key alias="documentRolledBack">Document has been rolled back</key>
@@ -33,8 +33,11 @@
<key alias="rename" version="7.3.0">Rename</key>
<key alias="restore" version="7.3.0">Restore</key>
<key alias="SetPermissionsForThePage">Set permissions for the page %0%</key>
<key alias="chooseWhereToCopy">Choose where to copy</key>
<key alias="chooseWhereToMove">Choose where to move</key>
<key alias="toInTheTreeStructureBelow">In the tree structure below</key>
<key alias="toInTheTreeStructureBelow">to in the tree structure below</key>
<key alias="wasMovedTo">was moved to</key>
<key alias="wasCopiedTo">was copied to</key>
<key alias="rights">Permissions</key>
<key alias="rollback">Rollback</key>
<key alias="sendtopublish">Send To Publish</key>
@@ -1037,7 +1040,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="relateToOriginal">Relate copied items to original</key>
</area>
<area alias="notifications">
<key alias="editNotifications">Edit your notification for %0%</key>
<key alias="editNotifications"><![CDATA[Select your notification for <strong>%0%</strong>]]></key>
<key alias="notificationsSavedFor">Notification settings saved for</key>
<key alias="mailBody">
<![CDATA[
Hi %0%
@@ -1309,6 +1313,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="undoEditCrop">Undo edits</key>
</area>
<area alias="rollback">
<key alias="headline">Select a version to compare with the current version</key>
<key alias="currentVersion">Current version</key>
<key alias="diffHelp"><![CDATA[This shows the differences between the current version and the selected version<br /><del>Red</del> text will not be shown in the selected version. , <ins>green means added</ins>]]></key>
<key alias="documentRolledBack">Document has been rolled back</key>
@@ -2220,8 +2225,4 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="itemCannotBeRestoredHelpText">There is no location where this item can be automatically restored. You can move the item manually using the tree below.</key>
<key alias="wasRestored">was restored under</key>
</area>
<area alias="notify">
<key alias="notifySet">Select your notifications for</key>
<key alias="notificationsSavedFor">Notification settings saved for </key>
</area>
</language>
@@ -55,7 +55,7 @@
</div>
<div runat="server" id="pl_buttons" class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
<a href="#" class="btn btn-link" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("general", "cancel")%></a>
<a href="#" class="btn btn-link" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("general", "close")%></a>
<asp:Button ID="Button1" runat="server" visible="false" CssClass="btn btn-primary" OnClick="doRollback_Click"></asp:Button>
</div>
</asp:Content>
+3 -1
View File
@@ -349,7 +349,9 @@ namespace Umbraco.Web.Editors
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);
// if your user type doesn't have access to the Settings section it would not get this property mapped
if(mapped.DocumentType != null)
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);
+5 -4
View File
@@ -27,7 +27,7 @@ namespace Umbraco.Web.Editors
long totalRecords;
var dateQuery = sinceDate.HasValue ? Query<IAuditItem>.Builder.Where(x => x.CreateDate >= sinceDate) : null;
var result = Services.AuditService.GetPagedItemsByEntity(id, pageNumber - 1, pageSize, out totalRecords, orderDirection, customFilter: dateQuery);
var mapped = Mapper.Map<IEnumerable<AuditLog>>(result);
var mapped = result.Select(item => Mapper.Map<AuditLog>(item));
var page = new PagedResult<AuditLog>(totalRecords, pageNumber, pageSize)
{
@@ -85,16 +85,17 @@ namespace Umbraco.Web.Editors
private IEnumerable<AuditLog> MapAvatarsAndNames(IEnumerable<AuditLog> items)
{
var userIds = items.Select(x => x.UserId).ToArray();
var mappedItems = items.ToList();
var userIds = mappedItems.Select(x => x.UserId).ToArray();
var users = Services.UserService.GetUsersById(userIds)
.ToDictionary(x => x.Id, x => x.GetUserAvatarUrls(ApplicationContext.ApplicationCache.RuntimeCache));
var userNames = Services.UserService.GetUsersById(userIds).ToDictionary(x => x.Id, x => x.Name);
foreach (var item in items)
foreach (var item in mappedItems)
{
item.UserAvatars = users[item.UserId];
item.UserName = userNames[item.UserId];
}
return items;
return mappedItems;
}
}
}
+23 -14
View File
@@ -100,7 +100,7 @@ namespace Umbraco.Web.Editors
{
var errors = string.Join(". ", resetResult.Errors);
_logger.Warn<PasswordChanger>(string.Format("Could not reset user password {0}", errors));
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not reset password, errors: " + errors, new[] { "resetPassword" }) });
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "resetPassword" }) });
}
return Attempt.Succeed(new PasswordChangedModel());
@@ -120,21 +120,30 @@ namespace Umbraco.Web.Editors
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Password cannot be changed without the old password", new[] { "oldPassword" }) });
}
if (passwordModel.OldPassword.IsNullOrWhiteSpace() == false)
//get the user
var backOfficeIdentityUser = await userMgr.FindByIdAsync(savingUser.Id);
if (backOfficeIdentityUser == null)
{
//if an old password is suplied try to change it
var changeResult = await userMgr.ChangePasswordAsync(savingUser.Id, passwordModel.OldPassword, passwordModel.NewPassword);
if (changeResult.Succeeded == false)
{
var errors = string.Join(". ", changeResult.Errors);
_logger.Warn<PasswordChanger>(string.Format("Could not change user password {0}", errors));
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, errors: " + errors, new[] { "oldPassword" }) });
}
return Attempt.Succeed(new PasswordChangedModel());
//this really shouldn't ever happen... but just in case
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Password could not be verified", new[] { "oldPassword" }) });
}
//We shouldn't really get here
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, invalid information supplied", new[] { "value" }) });
//is the old password correct?
var validateResult = await userMgr.CheckPasswordAsync(backOfficeIdentityUser, passwordModel.OldPassword);
if(validateResult == false)
{
//no, fail with an error message for "oldPassword"
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Incorrect password", new[] { "oldPassword" }) });
}
//can we change to the new password?
var changeResult = await userMgr.ChangePasswordAsync(savingUser.Id, passwordModel.OldPassword, passwordModel.NewPassword);
if (changeResult.Succeeded == false)
{
//no, fail with error messages for "password"
var errors = string.Join(". ", changeResult.Errors);
_logger.Warn<PasswordChanger>(string.Format("Could not change user password {0}", errors));
return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "password" }) });
}
return Attempt.Succeed(new PasswordChangedModel());
}
/// <summary>
@@ -116,6 +116,11 @@ namespace umbraco.presentation.dialogs
currentVersionTitle.Text = currentDoc.Text;
currentVersionMeta.Text = ui.Text("content", "createDate") + ": " + currentDoc.VersionDate.ToShortDateString() + " " + currentDoc.VersionDate.ToShortTimeString();
pp_selectVersion.Text = ui.Text("rollback", "headline");
pp_currentVersion.Text = ui.Text("rollback", "currentVersion");
pp_view.Text = ui.Text("rollback", "view");
pp_rollBackTo.Text = ui.Text("rollback", "rollbackTo");
if (!IsPostBack) {
allVersions.Items.Add(new ListItem(ui.Text("rollback", "selectVersion")+ "...", ""));