Sort domains (Culture and Hostnames) (#13797)
* Add sort order to IDomain, UmbracoDomain and DomainDto * Add migration to create domain sort order column * Add Sort method to domain service * Set sort order when persisting new domain and order results * Add multiple and block style support to umb-button-group * Allow sorting domains in back-office, improve UI and rewrite PostSaveLanguageAndDomains for correctly sorting domains * Ensure routing and cache keeps the domain sort order * Update test to assert correct domain order * Move migration to target 11.3 and cleanup plan * Fix formatting/styling and make SelectDomains private Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> --------- Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
This commit is contained in:
@@ -298,15 +298,15 @@ internal class PublishedSnapshotService : IPublishedSnapshotService
|
||||
continue; // anomaly
|
||||
}
|
||||
|
||||
if (domain.LanguageIsoCode.IsNullOrWhiteSpace())
|
||||
var culture = domain.LanguageIsoCode;
|
||||
if (string.IsNullOrWhiteSpace(culture))
|
||||
{
|
||||
continue; // anomaly
|
||||
}
|
||||
|
||||
var culture = domain.LanguageIsoCode;
|
||||
_domainStore.SetLocked(
|
||||
domain.Id,
|
||||
new Domain(domain.Id, domain.DomainName, domain.RootContentId.Value, culture, domain.IsWildcard));
|
||||
new Domain(domain.Id, domain.DomainName, domain.RootContentId.Value, culture, domain.IsWildcard, domain.SortOrder));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -832,7 +832,7 @@ internal class PublishedSnapshotService : IPublishedSnapshotService
|
||||
{
|
||||
foreach (Domain domain in domains
|
||||
.Where(x => x.RootContentId.HasValue && x.LanguageIsoCode.IsNullOrWhiteSpace() == false)
|
||||
.Select(x => new Domain(x.Id, x.DomainName, x.RootContentId!.Value, x.LanguageIsoCode!, x.IsWildcard)))
|
||||
.Select(x => new Domain(x.Id, x.DomainName, x.RootContentId!.Value, x.LanguageIsoCode!, x.IsWildcard, x.SortOrder)))
|
||||
{
|
||||
_domainStore.SetLocked(domain.Id, domain);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user