Add store-scoped contact attribute management to Grand.Web.Store#710
Merged
Conversation
Store owners can create, edit and delete their own contact attributes. Global/shared attributes are visible in read-only preview mode (values visible, no add/edit/delete). Access to attributes from other stores is blocked at the controller level. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ontactAttribute views - Add ContactAttributeStoreProfile (Grand.Web.Store) to map ContactAttribute → ContactAttributeStoreModel via Grand.Mapping infrastructure - Add ContactAttributeStoreModel inheriting ContactAttributeModel with IsReadOnly property - Controller Edit GET now uses MapTo<ContactAttribute, ContactAttributeStoreModel>() instead of non-existent ToModel(model) overload - Controller Edit POST returns ContactAttributeStoreModel on validation failure (drops ViewBag.IsReadOnly) - Update Edit.cshtml, CreateOrUpdate.cshtml, TabInfo.cshtml, TabValues.cshtml to @model ContactAttributeStoreModel and Model.IsReadOnly - Add Grand.Web.Store.Models.Messages using to _ViewImports.cshtml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…wBag.Title ternary - Add admin.catalog.attributes.contactattributes.globalreadonly to DefaultLanguage.xml - Simplify ViewBag.Title in Edit.cshtml (both ternary branches were identical) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch Create GET/POST to use ContactAttributeStoreModel so partial views render correctly - Update Create.cshtml to @model ContactAttributeStoreModel - Add ContactAttributeStoreValidator that reuses ContactAttributeValidator rules via FluentValidation Include + IValidator<in T> contravariance Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
KrzysztofPajak
added a commit
that referenced
this pull request
Jul 4, 2026
….Store (#722) * Add store-scoped customer & address attribute management to Grand.Web.Store Store owners can create, edit and delete their own customer attributes and address attributes. Global attributes are visible in read-only preview mode; attributes limited to other stores are hidden and access is blocked at the controller level. - CustomerAttribute and AddressAttribute implement IStoreLinkEntity (LimitedToStores + Stores) - GetAllCustomerAttributes(storeId) / GetAllAddressAttributes(storeId) service overloads with per-store cache keys - Storefront handlers and validators filter attributes by current store; GetAttributeWarnings(attrs, storeId) parser overloads so required attributes of other stores do not block registration/checkout - Admin: Stores selector on customer/address attribute forms - Grand.Web.Store: CustomerAttributeController + AddressAttributeController with views following the ContactAttribute pattern (PR #710); Stores field hidden and auto-set to the staff store - New translation resources (limitedtostores, globalreadonly) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Address Copilot review feedback on PR #722 - RegisterValidator/CustomerInfoValidator: always scope attribute validation to the current store instead of the per-store-identity storeId, which is empty when RegisterCustomersPerStore is disabled - Store CustomerAttribute/AddressAttribute Edit POST: repopulate Locales when redisplaying the form after a validation failure - Store ValueDelete endpoints: return a structured DataSourceResult error instead of throwing (500) when the value id is not found Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Store owners can create, edit and delete their own contact attributes. Global/shared attributes are visible in read-only preview mode (values visible, no add/edit/delete). Access to attributes from other stores is blocked at the controller level.
Resolves #issueNumber
Type: feature|bugfix|
Issue
Description of the issue this PR is solving, why it's happening, and how to reproduce it.
Solution
Summarize your solution to the problem. Please include short description.
Breaking changes
If you have a breaking changes, list them here, otherwise list none.
Testing