[Task] dot-tags: replace hand-rolled empty state with DotEmptyContainerComponent
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Context
libs/portlets/dot-tags/src/lib/dot-tags-list/dot-tags-list.component.html (lines ~106-126) renders its empty state with hand-rolled markup (icon + title + subtitle inside a <td colspan=3>):
<div class="mx-auto flex max-w-100 flex-col items-center gap-4" data-testid="tags-empty-state">
<div class="flex size-20 items-center justify-center rounded-full">
<i class="pi pi-tags text-6xl! text-surface-500" aria-hidden="true"></i>
</div>
<div class="flex flex-col text-center">
<h3 class="m-0 text-lg font-medium text-gray-800">
{{ 'tags.empty.state.title' | dm }}
</h3>
<p class="m-0 text-base leading-6 text-color">
{{ 'tags.empty.state.description' | dm }}
</p>
</div>
</div>
The canonical empty-state primitive DotEmptyContainerComponent (in libs/ui/src/lib/components/dot-empty-container/) is used everywhere else (dot-query-tool, dot-analytics, dot-velocity-playground, dot-experiments, dot-es-search, …). dot-tags is one of the last portlets still rolling its own.
Why this matters
- Consistency: when dotCMS updates the empty-state look, every portlet that uses the standard component picks it up;
dot-tagswould drift. - Discoverability: new portlets that look at
dot-tagsas the canonical CRUD reference (perlibs/portlets/CLAUDE.md) copy the wrong empty-state pattern. The recentdot-publishing-queue(#36040) copied this exact hand-rolled markup before being migrated to the standard. - A11y / responsive parity:
DotEmptyContainerComponentships with the correctmax-w, heading levels, and centering; hand-rolled copies tend to diverge.
Scope
Update libs/portlets/dot-tags/src/lib/dot-tags-list/dot-tags-list.component.{ts,html,spec.ts}:
- Import
DotEmptyContainerComponent+PrincipalConfigurationfrom@dotcms/ui. - Build a
PrincipalConfigurationon the component (resolved viaDotMessageService.get(...)) for the empty state:icon: 'pi-tags'title: 'tags.empty.state.title'subtitle: 'tags.empty.state.description'
- Replace the hand-rolled
<div>block inside<ng-template pTemplate="emptymessage">with<dot-empty-container [configuration]="emptyConfig" [hideContactUsLink]="true" />. - Drop the inline classes / icon wrapper.
- Update the existing spec assertions (
tags-empty-statetestid → assertdot-empty-containerrenders with the expected configuration).
Definition of done
- Empty state visually matches the dotCMS empty-state look (large icon + bold title + lighter subtitle, no contact-us link).
data-testid="tags-empty-state"preserved on the wrapper for backwards-compatible spec selectors.- Existing tests pass (
yarn nx test portlets-dot-tags-portlet). - Optional: same migration for
dot-tags-importif it has its own empty state.
References
- Standard component:
libs/ui/src/lib/components/dot-empty-container/dot-empty-container.component.ts - Usage examples:
libs/portlets/dot-query-tool/,libs/portlets/dot-velocity-playground/ - Related migration: dotCMS/core#36040 (publishing-queue swapped to the standard in the same PR)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with libs/portlets/dot-tags/src/lib/dot-tags-list/dot-tags-list.component.{ts,html,spec.ts}, then compare the DotEmptyContainerComponent API and usage examples in dot-query-tool or dot-velocity-playground. Update the empty-state configuration and spec assertions, preserve the tags-empty-state selector, and run yarn nx test portlets-dot-tags-portlet.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100