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:
|
|
@copilot Grand.Web.Store - maybe it's better to prepare 2 tabs, one with landing pages for the current store and second tab for global landing pages, it's easier to see with pages contains to your store. But I think you need to change filtering service |
- Controller: replace single List POST with StorePagesList + GlobalPagesList POST actions - StorePagesList: pages exclusively limited to this store (LimitedToStores && Stores.Count == 1) - GlobalPagesList: global (no-store) or multistore pages (!LimitedToStores || Stores.Count > 1) - List.cshtml: two-tab layout using admin-tabstrip with separate Kendo grids per tab - DefaultLanguage.xml: add admin.content.pages.list.storepages and admin.content.pages.list.globalpages Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/5f8af9bf-18a7-4d55-b50b-0f6aa8fdf36f Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in commit
Both tabs share the same name-filter search bar and have identical columns (SystemName, Title, IncludeInMenu, Published, DisplayOrder). No change was needed in 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:
|
|
@copilot pagination does not work well, second page show the same result as first page |
…lobalPagesList The controller was returning all records with serverPaging: true declared in the Kendo grid, causing every page to show the same items (no slicing was applied). Fix: compute Total from the full filtered list, then slice with Skip/Take before returning Data. Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/1e4e597f-a4f8-4d36-8f4d-80401dcfcbec Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Fixed in commit 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 Grand.Web.Admin - on list of landing pages - pagination does not exists, the bar is hidden |
Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/22793ceb-63fd-4100-a7d2-24dc020da864 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Fixed in commit |
There was a problem hiding this comment.
Pull request overview
Adds Store-area CRUD management for CMS Pages (Topics), aligns list paging behavior across Store/Admin, and hardens SEO slug validation against null stored settings.
Changes:
- Introduces
Grand.Web.StorePage CRUD (controller + views), including a two-tab list (“Store Pages” / “Global Pages”) and a Copy workflow. - Fixes Kendo grid pagination in both Store and Admin Page lists by returning the correct
Skip/Takeslice plus total count. - Makes
SeNameService.ValidateSeNamenull-safe forSeoSettings.ReservedEntityUrlSlugsand adds a regression test.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Web/Grand.Web.Store/Controllers/PageController.cs | New Store-area Page CRUD endpoints (list, create/edit/delete, copy) and server-side paging for grids |
| src/Web/Grand.Web.Store/Areas/Store/Views/Page/Partials/CreateOrUpdate.TabSeo.cshtml | New SEO tab UI for Page create/edit |
| src/Web/Grand.Web.Store/Areas/Store/Views/Page/Partials/CreateOrUpdate.TabInfo.cshtml | New Info tab UI for Page create/edit |
| src/Web/Grand.Web.Store/Areas/Store/Views/Page/Partials/CreateOrUpdate.cshtml | Tabstrip wrapper partial for Page create/edit |
| src/Web/Grand.Web.Store/Areas/Store/Views/Page/List.cshtml | Two-tab list view with two grids and paging configuration |
| src/Web/Grand.Web.Store/Areas/Store/Views/Page/Edit.cshtml | Store-area edit view including Copy button/form |
| src/Web/Grand.Web.Store/Areas/Store/Views/Page/Create.cshtml | Store-area create view |
| src/Web/Grand.Web.Store/Areas/Store/Views/_ViewImports.cshtml | Adds Pages models namespace for Store views |
| src/Web/Grand.Web.Admin/Controllers/PageController.cs | Fixes Admin paging by returning paged slice + total |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Page/List.cshtml | Restores standard pageable config and uses AdminAreaSettings page size settings |
| src/Tests/Grand.Business.Common.Tests/Services/Seo/SeNameServiceTests.cs | Adds regression test for null reserved slugs |
| src/Business/Grand.Business.Common/Services/Seo/SeNameService.cs | Null-safe reserved-slug check to prevent ArgumentNullException |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Upgraded the Scryber.Core NuGet package from version 9.3.1 to 9.5.0 in Directory.Packages.props to include the latest features and fixes.
Changed the permission attribute on the Copy action in PageController from Create to Edit, so only users with Edit permission can access this action.
….com/grandnode/grandnode2 into copilot/implement-page-management-ui
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot Grad.Web.Store - list of landing pages - column Title should be wider, Grad.Web.Admin - list of landing pages, add new column Title |
Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/0ced35ab-aeaa-446a-a438-a81fee1e33f2 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in commit
|
|
@copilot Grand.Web.Admin, list of landing pages - add new columns "Include in the menu" and Visible, remove Password protected |
…dmin page list Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/46f4585c-a48d-4ba3-8191-7bf99554e8db Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in commit |
PageController.csinGrand.Web.Store/Controllers/Grand.Web.Store/Areas/Store/Views/Page/@using Grand.Web.AdminShared.Models.Pagesto_ViewImports.cshtmlDefaultLanguage.xmlArgumentNullExceptionon Copy: null-safeseoSettings.ReservedEntityUrlSlugs; add regression testGrand.Web.Store: applySkip((page-1)*pageSize).Take(pageSize)so each page returns its correct sliceGrand.Web.Admincontroller: same Skip/Take fix applied toPageController.ListGrand.Web.AdminPage list: injectAdminAreaSettings, addpageSize, restore standardpageableconfig withpageSizesGrand.Web.Storelist: remove fixed width from Title column so it fills available horizontal spaceGrand.Web.Adminlist: add missing Title column after SystemNameGrand.Web.Adminlist: replace IsPasswordProtected with IncludeInMenu and Published (Visible) columns