Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Umbraco.Core/Configuration/Models/ContentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ @keyframes umbraco-preview-badge--effect {{
internal const bool StaticDisableUnpublishWhenReferenced = false;
internal const bool StaticAllowEditInvariantFromNonDefault = false;
internal const bool StaticShowDomainWarnings = true;
internal const bool StaticShowUnroutableContentWarnings = true;

/// <summary>
/// Gets or sets a value for the content notification settings.
Expand Down Expand Up @@ -285,4 +286,10 @@ @keyframes umbraco-preview-badge--effect {{
/// </summary>
[DefaultValue(StaticShowDomainWarnings)]
public bool ShowDomainWarnings { get; set; } = StaticShowDomainWarnings;

/// <summary>
/// Gets or sets a value indicating whether to show unroutable content warnings.
/// </summary>
[DefaultValue(StaticShowUnroutableContentWarnings)]
public bool ShowUnroutableContentWarnings { get; set; } = StaticShowUnroutableContentWarnings;
}
5 changes: 5 additions & 0 deletions src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,11 @@
SimpleNotificationModel globalNotifications,
string[]? successfulCultures)
{
if (_contentSettings.ShowUnroutableContentWarnings is false)
{
return;
}

Check warning on line 1285 in src/Umbraco.Web.BackOffice/Controllers/ContentController.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v13/dev)

❌ New issue: Complex Method

AddPublishRoutableErrorNotifications has a cyclomatic complexity of 9, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
IContent? content = publishStatus.FirstOrDefault()?.Content;
if (content is null)
{
Expand Down
Loading