-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…29388) ### Proposed Changes * Display an empty category message component when no categories are available. ### Screenshots <img width="1337" alt="image" src="https://github.com/user-attachments/assets/787e8ea6-6865-4096-b198-55618b692ff0"> <img width="1321" alt="image" src="https://github.com/user-attachments/assets/bf570c3f-847a-4f79-8760-9b97c1d1681e">
- Loading branch information
Showing
16 changed files
with
168 additions
and
83 deletions.
There are no files selected for viewing
95 changes: 50 additions & 45 deletions
95
...mponents/dot-category-field-category-list/dot-category-field-category-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,54 @@ | ||
<div class="w-full category-list__header">Root</div> | ||
<div | ||
[ngClass]="{ 'no-overflow-x-yet': $emptyColumns().length }" | ||
class="flex-1 category-list__category-list"> | ||
@for (column of $categories(); let index = $index; track index) { | ||
<!--dynamic columns--> | ||
<div #categoryColumn class="category-list__category-column" data-testId="category-column"> | ||
@for (item of column; track item.key) { | ||
<div | ||
data-testId="category-item" | ||
class="flex align-content-center align-items-center category-list__item" | ||
[ngClass]="{ 'category-list__item--selected': item.clicked }" | ||
(click)="rowClicked.emit({ index, item })"> | ||
<p-checkbox | ||
[(ngModel)]="itemsSelected" | ||
[value]="item.key" | ||
(onChange)="itemChecked.emit({ selected: $event.checked, item })" /> | ||
@if ($categories().length) { | ||
<div class="w-full category-list__header">Root</div> | ||
<div | ||
[ngClass]="{ 'no-overflow-x-yet': $emptyColumns().length }" | ||
class="flex-1 category-list__category-list"> | ||
@for (column of $categories(); let index = $index; track index) { | ||
<!--dynamic columns--> | ||
<div | ||
#categoryColumn | ||
class="category-list__category-column" | ||
data-testId="category-column"> | ||
@for (item of column; track item.key) { | ||
<div | ||
data-testId="category-item" | ||
class="flex align-content-center align-items-center category-list__item" | ||
[ngClass]="{ 'category-list__item--selected': item.clicked }" | ||
(click)="rowClicked.emit({ index, item })"> | ||
<p-checkbox | ||
[(ngModel)]="itemsSelected" | ||
[value]="item.key" | ||
(onChange)="itemChecked.emit({ selected: $event.checked, item })" /> | ||
|
||
<label | ||
data-testId="category-item-label" | ||
class="flex flex-grow-1 category-list__item-label" | ||
[class.cursor-pointer]="item.hasChildren" | ||
[for]="item.key"> | ||
{{ item.value }} | ||
</label> | ||
<label | ||
data-testId="category-item-label" | ||
class="flex flex-grow-1 category-list__item-label" | ||
[class.cursor-pointer]="item.hasChildren" | ||
[for]="item.key"> | ||
{{ item.value }} | ||
</label> | ||
|
||
@if (item.hasChildren) { | ||
<i | ||
data-testId="category-item-with-child" | ||
class="pi pi-chevron-right category-list__item-icon"></i> | ||
} | ||
</div> | ||
} | ||
</div> | ||
} @empty { | ||
@if (!$isLoading()) { | ||
No categories | ||
@if (item.hasChildren) { | ||
<i | ||
data-testId="category-item-with-child" | ||
class="pi pi-chevron-right category-list__item-icon"></i> | ||
} | ||
</div> | ||
} | ||
</div> | ||
} | ||
} | ||
|
||
<!--Fake empty columns--> | ||
@for (_ of $emptyColumns(); track $index) { | ||
<div class="flex-grow-1 category-list__category-column" data-testId="category-column-empty"> | ||
@if ($isLoading() && 0 === $index) { | ||
<dot-category-field-list-skeleton /> | ||
} | ||
</div> | ||
} | ||
</div> | ||
<!--Fake empty columns--> | ||
@for (_ of $emptyColumns(); track $index) { | ||
<div | ||
class="flex-grow-1 category-list__category-column" | ||
data-testId="category-column-empty"> | ||
@if ($isLoading() && 0 === $index) { | ||
<dot-category-field-list-skeleton /> | ||
} | ||
</div> | ||
} | ||
</div> | ||
} @else { | ||
<dot-empty-container [configuration]="emptyState" [hideContactUsLink]="true" /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.