feat: Pages (Topics) CRUD management in Grand.Web.Store#693
Conversation
- Add PageController with CRUD operations, filtering by store, and automatic storeId assignment on create/edit - Add List, Create, Edit views with Partials (TabInfo, TabSeo) - Add Grand.Web.AdminShared.Models.Pages namespace to _ViewImports.cshtml" Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/e126ff73-2407-4da7-ae12-fd982e28a981 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
- Remove unused NoAccessToPageMessage constant - Simplify redundant LimitedToStores condition in Edit GET - Remove unnecessary ModelState check in Delete action Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/e126ff73-2407-4da7-ae12-fd982e28a981 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
|
@copilot Grand.Web.Store - If the topic is multistore or without set as a store, Add new button on the form EDIT with the name Copy, and add action copy current topic to the new one for the current store (but only if this topic name does not exists in the current store) |
When a topic is multistore (LimitedToStores + multiple stores) or has no store restriction, a "Copy" button is shown on the Edit page. Clicking it creates a store-specific copy (all fields + locales preserved) for the current store, guarded by a duplicate SystemName check. Redirects to the new page's Edit view on success. Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/623ad074-c18a-43f8-9a53-00b7f6df747c Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in commit Copy button behaviour:
The button uses the HTML5 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot please add new translation to default language EN |
|
@copilot After click Copy I've got error |
- admin.common.copy: Copy - admin.content.pages.copy.duplicatesystemname: duplicate SystemName error - admin.content.pages.permissions: multistore warning - Update PageController to use translation resource instead of hardcoded string Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/e594e525-bd03-400b-9b1f-f634b62e6301 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in commit
The hardcoded error string in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The property can be null when loaded from MongoDB in older installations. Use null-conditional operator to avoid ArgumentNullException when Copy (or any page insert) is triggered. Also adds a regression test for the null-settings case. Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/e444e392-5111-4a1b-a6a1-297c8f3f5c98 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Fixed in commit
The fix is a one-character null-conditional in // before
var reserved2 = seoSettings.ReservedEntityUrlSlugs.Contains(tempSeName, ...);
// after
var reserved2 = seoSettings.ReservedEntityUrlSlugs?.Contains(tempSeName, ...) ?? false;A regression test covering the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
PageController.csinGrand.Web.Store/Controllers/Grand.Web.Store/Areas/Store/Views/Page/@using Grand.Web.AdminShared.Models.Pagesto_ViewImports.cshtmlDefaultLanguage.xmladmin.common.copy→ "Copy"admin.content.pages.copy.duplicatesystemname→ duplicate SystemName error messageadmin.content.pages.permissions→ multistore warning messageArgumentNullExceptionon Copy: null-safeseoSettings.ReservedEntityUrlSlugsinSeNameService.ValidateSeName; add regression test