dotCMS / dotCMS/core

[Task] dot-tags: replace hand-rolled empty state with DotEmptyContainerComponent

Open Beginner friendly
#36,111 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale Team : Modernization
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-tags would drift.
  • Discoverability: new portlets that look at dot-tags as the canonical CRUD reference (per libs/portlets/CLAUDE.md) copy the wrong empty-state pattern. The recent dot-publishing-queue (#36040) copied this exact hand-rolled markup before being migrated to the standard.
  • A11y / responsive parity: DotEmptyContainerComponent ships with the correct max-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}:

  1. Import DotEmptyContainerComponent + PrincipalConfiguration from @dotcms/ui.
  2. Build a PrincipalConfiguration on the component (resolved via DotMessageService.get(...)) for the empty state:
    • icon: 'pi-tags'
    • title: 'tags.empty.state.title'
    • subtitle: 'tags.empty.state.description'
  3. Replace the hand-rolled <div> block inside <ng-template pTemplate="emptymessage"> with <dot-empty-container [configuration]="emptyConfig" [hideContactUsLink]="true" />.
  4. Drop the inline classes / icon wrapper.
  5. Update the existing spec assertions (tags-empty-state testid → assert dot-empty-container renders 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-import if 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.