feat(categories): migrate Categories portlet from Dojo to Angular#35146
feat(categories): migrate Categories portlet from Dojo to Angular#35146
Conversation
Replace the legacy categories portlet in dotcms-ui with a new standalone portlet library following the dot-tags canonical pattern. Includes API service, SignalStore with breadcrumb navigation, CRUD dialog, and full test coverage (52 tests). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Show only 4 fields: name (required), variable (readonly, auto-generated from name in camelCase), key, and keywords (textarea) - Variable field is always visible and auto-generates on create mode - Remove sortOrder, active, description fields from the dialog Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Angular Router query params (?inode=xxx) as source of truth for category navigation. Breadcrumbs are rebuilt from the API parentList field on each load. Row click now navigates to children while a dedicated edit icon button opens the edit dialog. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…te form Remove childrenCount guard so users can navigate into any category to create children. Add parentName to store state and URL query params so the create dialog shows an info hint indicating the parent category. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the children API returns an empty list, keep the existing breadcrumbs from the store instead of wiping them out. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The API parentList may not include the current parent when navigating deeper. Append the current parent from query params when the last parentList item does not match the current parentInode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop Router/ActivatedRoute query param sync and parentList API param. Breadcrumbs are now built purely from navigation steps in the store: navigateToChildren pushes, navigateToBreadcrumb truncates. This avoids issues with the API parentList not matching the full navigation depth. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a row-level popup menu with ellipsis icon containing edit, permissions, and delete actions. Edit opens the existing edit dialog, delete confirms and removes a single category, permissions opens an empty placeholder dialog. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace per-row p-menu with a single shared menu appended to body. Menu items are set imperatively on button click before toggling, avoiding the change detection issue where template-bound items were recreated on every cycle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use group/group-hover Tailwind pattern to show the ellipsis button only when hovering the row, matching the content-drive portlet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add CSS grid layout to the list component host so toolbar, breadcrumb, and table fill the available height. Enable scrollable flex mode on the table so it scrolls within its container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Passing null to DialogService.open causes NG0919. Created a minimal DotCategoriesPermissionsComponent as a placeholder. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The separate file import caused a runtime circular dependency error. Define the placeholder component in the same file as the list component to avoid the import resolution issue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add CSV export and import capabilities to the categories service, store, and list component. Export triggers a blob download; import uses a dialog with file upload and merge/replace mode selection. The Add button is now a PrimeNG SplitButton with Import as a dropdown option. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hide FileUpload header via PT, use large download icon in bg-primary-50 circle, bold drag-drop text, and info-circle icon on CSV subtitle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @hmoreras's task in 2m 42s —— View job PR Review — feat(categories): migrate Categories portlet from Dojo to Angular
Issues Found1. Dead code:
|
… order editing - Add 32 i18n keys for all category UI labels (toolbar, table, empty state, dialogs, toasts) - Replace right-click p-menu with p-contextMenu so it opens at cursor position - Add row hover state and pointer cursor matching other portlets (content-drive pattern) - Add breadcrumb cursor-pointer via PrimeNG passthrough API - Add empty state matching tags portlet (full-height, centered icon + message) - Add p-inputNumber per row for inline sort order editing (save on blur/Enter) - Optimistic sort order update avoids table reload/flickering; reverts on error - Show success toast after sort order save via MessageService at shell level - Fix toast: move MessageService provider + p-toast to shell component so it's visible - Fix children count lost after sort update: use optimistic patch instead of _sort response - Add updateSortOrder() to DotCategoriesService (PUT /api/v1/categories/_sort) - Center-align Children, Sort Order and Actions columns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
This PR migrates the Categories portlet from the legacy Dojo/Java-server implementation to a modern Angular portlet using PrimeNG and NgRx Signals. It is extracted from the broader PrimeNG migration branch (
dot-categories) and rebased on top ofmain.Closes #34731
What changed
libs/portlets/dot-categories/replacing the old implementation inapps/dotcms-ui/src/app/portlets/dot-categories/libs/data-access/src/lib/dot-categories/and registered in the shared data-access indexDynamicDialogConfig.data)DotMessagePipeChecklist