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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers
# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers

root = true

Expand Down
9 changes: 6 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Auto detect text files and perform LF normalization

# Windows developers can enable autocrlf to checkout in crlf and commit in lf
# git config --global core.autocrlf true
# Text files are checked out with LF on every OS, including Windows.

* text=auto
* text=auto eol=lf

.gitattributes text
.editorconfig text

*.cs text diff=csharp
*.cshtml text diff=html
Expand All @@ -16,6 +18,7 @@

*.xproj text
*.props text
*.targets text
*.filters text
*.vcxitems text

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ Settings are managed through the Kentico admin interface and retrieved programma

**Key Concept:** Whether settings are global or channel-specific is determined by which admin UI page you create. The same settings class can be used for both contexts.

### Admin UI

- Until you explicitly **create an override**, the form stays disabled and previews the values currently in effect — the developer defaults on the global page, or the global settings (falling back to developer defaults) on a channel page.
- A **Reset** page action removes an override with a destructive confirmation. On the global page it resets to the developer defaults; on a channel page it resets to the global settings, or the developer defaults when none exist.
- Creating or resetting an override refreshes the page immediately, and the global page lists any channels that have their own settings.

See the [Usage Guide](https://github.com/roeldeb/xperiencecommunity-projectsettings/blob/main/docs/Usage-Guide.md#admin-ui-features) for the full behavior.

## Requirements

### Library Version Matrix
Expand Down
30 changes: 23 additions & 7 deletions docs/Usage-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,34 @@ When you inject `IOptions<T>`, settings are resolved automatically based on the

### Admin UI Features

Both admin pages base their state purely on whether a settings **record** exists — not on
whether the stored values happen to match the developer defaults. This means the editable form
only appears once you have explicitly created an override, and the callouts always describe
which values are currently in effect. Creating or resetting an override reloads the page, so the
form and callouts update immediately without a manual browser refresh.

**Global Settings Page:**

- Shows warning when using developer defaults (no saved settings)
- "Create override" button to save initial settings
- Shows links to channels that have overrides
- When no global record exists, the form is **disabled** and previews the developer defaults. A
"Using developer defaults" callout with a **Create override** button lets you store an initial
record so the settings become editable.
- When a global record exists, a **Reset to developer defaults** page action deletes the record
(with a destructive confirmation dialog) so the system falls back to the developer defaults.
- Lists the channels that have their own settings (as links). When creating global settings, it
notes that those channels already override the global values and will not be affected.

**Channel Settings Page:**

- Shows warning when overriding global settings
- "Reset to default" button to remove channel-specific settings
- "Create override" button to create channel-specific settings
- Only supports Website channels
- When no channel record exists, the form is **disabled** and previews the effective values — the
global settings when they exist, otherwise the developer defaults. A **Create override** button
seeds a new channel record from those effective values, so creating an override does not change
the values already in effect.
- When a channel record exists, a **Reset** page action removes it (with a destructive
confirmation dialog). It is labeled **Reset to global settings** when global settings exist,
or **Reset to developer defaults** when they do not.
- An "Overriding global settings" callout links back to the global settings page when the channel
record overrides global values.
- Only supports Website channels.

## Key Types

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;

using CMS.Activities;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Core;
using CMS.Core;

using Kentico.Xperience.Admin.Base.Forms;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;

using CMS.ContentEngine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;

using CMS.ContentEngine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace DancingGoat.Commerce
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;

using DancingGoat.Models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

using DancingGoat.Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Commerce;
using CMS.Commerce;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Commerce;
using CMS.Commerce;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Commerce;
using CMS.Commerce;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Commerce;
using CMS.Commerce;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;

using CMS.Commerce;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace DancingGoat.Commerce;
namespace DancingGoat.Commerce;

public static class DancingGoatTaxRateConstants
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Commerce;
using CMS.Commerce;

namespace DancingGoat.Commerce;

Expand Down
2 changes: 1 addition & 1 deletion examples/DancingGoat/Commerce/PriceFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Globalization;
using System.Globalization;

using CMS;
using CMS.Commerce;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CMS.Commerce;
using CMS.Commerce;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;

using CMS.Commerce;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;

using CMS.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

using DancingGoat.Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Threading;
using System.Threading;
using System.Threading.Tasks;

using CMS.Commerce;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Threading;
using System.Threading;
using System.Threading.Tasks;

using CMS.DataEngine;
Expand Down
2 changes: 1 addition & 1 deletion examples/DancingGoat/Commerce/Services/OrderService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

using DancingGoat.Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Threading.Tasks;

using CMS.ContentEngine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace DancingGoat.Commerce
namespace DancingGoat.Commerce
{
/// <summary>
/// Represents the result of evaluating a coupon code within the current context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace DancingGoat.Commerce;
namespace DancingGoat.Commerce;

/// <summary>
/// Represents a coupon code and its current status in the shopping cart context.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace DancingGoat.Commerce;
namespace DancingGoat.Commerce;

public sealed class ShoppingCartDataItem
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace DancingGoat.Commerce;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Text.Json;
using System.Text.Json;

using CMS.Commerce;

Expand Down
2 changes: 1 addition & 1 deletion examples/DancingGoat/Components/ComponentIdentifiers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace DancingGoat
namespace DancingGoat
{
/// <summary>
/// Encapsulated identifiers of components.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DancingGoat.Components.FormSections.TitledSection;
using DancingGoat.Components.FormSections.TitledSection;

using Kentico.Forms.Web.Mvc;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Kentico.Forms.Web.Mvc;
using Kentico.Forms.Web.Mvc;
using Kentico.Xperience.Admin.Base.FormAnnotations;

namespace DancingGoat.Components.FormSections.TitledSection
Expand Down
Loading
Loading