Skip to content

Commit 8b8dc15

Browse files
committed
Adding a fixed prefix to all future signs, and removing the provider property
1 parent 0845c3e commit 8b8dc15

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/Umbraco.Cms.Api.Management/Services/Signs/HasScheduleSignProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Api.Management.Services.Signs;
1010
/// </summary>
1111
internal class HasScheduleSignProvider : ISignProvider
1212
{
13-
private const string Alias = "ScheduledForPublish";
13+
private const string Alias = ISignProvider.Prefix + "ScheduledForPublish";
1414

1515
private readonly IContentService _contentService;
1616

@@ -29,7 +29,7 @@ public Task PopulateTreeSignsAsync<TItem>(TItem[] treeItemViewModels, IEnumerabl
2929
IEnumerable<Guid> contentKeysScheduledForPublishing = _contentService.GetScheduledContentKeys(treeItemViewModels.Select(x => x.Id));
3030
foreach (Guid key in contentKeysScheduledForPublishing)
3131
{
32-
treeItemViewModels.First(x => x.Id == key).AddSign(Core.Constants.System.UmbracoSignProvider, Alias);
32+
treeItemViewModels.First(x => x.Id == key).AddSign(Alias);
3333
}
3434

3535
return Task.CompletedTask;

src/Umbraco.Cms.Api.Management/Services/Signs/ISignProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ namespace Umbraco.Cms.Api.Management.Services.Signs;
88
/// </summary>
99
public interface ISignProvider
1010
{
11+
/// <summary>
12+
/// Prefix of each sign alias.
13+
/// </summary>
14+
const string Prefix = "Umb.";
15+
1116
/// <summary>
1217
/// Gets a value indicating whether this provider can provide tree signs for the specified item type.
1318
/// </summary>

src/Umbraco.Cms.Api.Management/ViewModels/SignModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ namespace Umbraco.Cms.Api.Management.ViewModels;
22

33
public class SignModel
44
{
5-
public required string Provider { get; set; }
6-
75
public required string Alias { get; set; }
86
}

src/Umbraco.Cms.Api.Management/ViewModels/Tree/EntityTreeItemResponseModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class EntityTreeItemResponseModel : TreeItemPresentationModel
1010

1111
public IEnumerable<SignModel> Signs => _signs.AsEnumerable();
1212

13-
public void AddSign(string provider, string alias) => _signs.Add(new SignModel { Provider = provider, Alias = alias });
13+
public void AddSign(string alias) => _signs.Add(new SignModel { Alias = alias });
1414

15-
public void RemoveSign(string provider, string alias) => _signs.RemoveAll(x => x.Provider == provider && x.Alias == alias);
15+
public void RemoveSign(string alias) => _signs.RemoveAll(x => x.Alias == alias);
1616
}

0 commit comments

Comments
 (0)