-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11328 from umbraco/v9/feature/add-notifcation-for…
…-url-collision Add notifcation when publishing varying culture without domains configured
- Loading branch information
Showing
16 changed files
with
827 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/Umbraco.Tests.Common/Builders/ContentCultureInfosBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using Umbraco.Cms.Core.Models; | ||
using Umbraco.Cms.Tests.Common.Builders.Interfaces; | ||
|
||
namespace Umbraco.Cms.Tests.Common.Builders | ||
{ | ||
public class ContentCultureInfosBuilder : ChildBuilderBase<ContentCultureInfosCollectionBuilder, ContentCultureInfos>, | ||
IWithNameBuilder, | ||
IWithDateBuilder | ||
{ | ||
private string _name; | ||
private string _cultureIso; | ||
private DateTime? _date; | ||
public ContentCultureInfosBuilder(ContentCultureInfosCollectionBuilder parentBuilder) : base(parentBuilder) | ||
{ | ||
} | ||
|
||
public ContentCultureInfosBuilder WithCultureIso(string cultureIso) | ||
{ | ||
_cultureIso = cultureIso; | ||
return this; | ||
} | ||
|
||
public override ContentCultureInfos Build() | ||
{ | ||
var name = _name ?? Guid.NewGuid().ToString(); | ||
var cultureIso = _cultureIso ?? "en-us"; | ||
DateTime date = _date ?? DateTime.Now; | ||
|
||
return new ContentCultureInfos(cultureIso) { Name = name, Date = date }; | ||
} | ||
|
||
public string Name | ||
{ | ||
get => _name; | ||
set => _name = value; | ||
} | ||
|
||
public DateTime? Date | ||
{ | ||
get => _date; | ||
set => _date = value; | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Umbraco.Tests.Common/Builders/ContentCultureInfosCollectionBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Umbraco.Cms.Core.Models; | ||
using Umbraco.Cms.Tests.Common.Builders.Interfaces; | ||
|
||
namespace Umbraco.Cms.Tests.Common.Builders | ||
{ | ||
public class ContentCultureInfosCollectionBuilder : ChildBuilderBase<ContentBuilder, ContentCultureInfosCollection>, IBuildContentCultureInfosCollection | ||
{ | ||
private readonly List<ContentCultureInfosBuilder> _cultureInfosBuilders; | ||
public ContentCultureInfosCollectionBuilder(ContentBuilder parentBuilder) : base(parentBuilder) => _cultureInfosBuilders = new List<ContentCultureInfosBuilder>(); | ||
|
||
public ContentCultureInfosBuilder AddCultureInfos() | ||
{ | ||
var builder = new ContentCultureInfosBuilder(this); | ||
_cultureInfosBuilders.Add(builder); | ||
return builder; | ||
} | ||
|
||
public override ContentCultureInfosCollection Build() | ||
{ | ||
if (_cultureInfosBuilders.Count < 1) | ||
{ | ||
throw new InvalidOperationException("You must add at least one culture infos to the collection builder"); | ||
} | ||
var cultureInfosCollection = new ContentCultureInfosCollection(); | ||
|
||
foreach (ContentCultureInfosBuilder cultureInfosBuilder in _cultureInfosBuilders) | ||
{ | ||
cultureInfosCollection.Add(cultureInfosBuilder.Build()); | ||
} | ||
|
||
return cultureInfosCollection; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/Umbraco.Tests.Common/Builders/Interfaces/IBuildContentCultureInfosCollection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Umbraco.Cms.Tests.Common.Builders.Interfaces | ||
{ | ||
public interface IBuildContentCultureInfosCollection | ||
{ | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Umbraco.Tests.Common/Builders/Interfaces/IWithDateBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace Umbraco.Cms.Tests.Common.Builders.Interfaces | ||
{ | ||
public interface IWithDateBuilder | ||
{ | ||
DateTime? Date { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using NUnit.Framework; | ||
|
||
[assembly: SetCulture("en-US")] | ||
[assembly: SetUICulture("en-US")] |
Oops, something went wrong.