Skip to content

Commit 9d2bec4

Browse files
hmorerasclaude
andauthored
style(ui): portlet search boxes, import dialogs and content compare fixes (#35341)
## What does this PR do? Addresses several UI inconsistencies across recently migrated portlets. ## Changes - **Search boxes (categories, tags, locales, plugins):** Enforced consistent `w-80` (320px) width on all search inputs; simplified placeholder text to `Search` across all four portlets - **Tags import dialog:** Removed redundant `", such as...."` text from the instructions copy, ending the sentence with a period - **Categories import dialog:** Unified the `p-fileupload` dropzone template to match the tags/plugins pattern (icon, layout, `#content`-only approach); added `shrink-0` to the icon container to prevent oval distortion when dialog space is constrained; put Import Type radio buttons on the same row (`gap-3`) to reduce vertical overflow - **Content compare:** Fixed the Previous version `p-select` dropdown not showing a selected value on first load by binding `[ngModel]="data.compare"` and adding `dataKey="inode"` for reliable object matching ## Closes Closes #35274 --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4494b5f commit 9d2bec4

5 files changed

Lines changed: 72 additions & 59 deletions

File tree

core-web/libs/portlets/dot-categories/src/lib/dot-categories-import/dot-categories-import.component.html

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -14,81 +14,85 @@
1414
<div class="flex-1 min-h-0">
1515
<p-fileupload
1616
#fileUpload
17-
[customUpload]="true"
18-
accept=".csv"
17+
mode="advanced"
18+
chooseIcon="pi pi-upload"
1919
[showUploadButton]="false"
2020
[showCancelButton]="false"
21+
[multiple]="false"
22+
[auto]="false"
23+
[customUpload]="true"
24+
accept=".csv"
25+
styleClass="w-full h-full"
2126
(onSelect)="onFileSelect($event)"
2227
(onClear)="onFileClear()"
2328
[pt]="{
24-
header: { class: 'hidden' },
29+
header: { style: { padding: '0', border: '0' } },
2530
root: { class: 'h-full flex flex-col' },
2631
content: { class: 'flex-1 min-h-0' }
2732
}"
28-
class="h-full"
2933
data-testid="category-import-file">
30-
<ng-template #empty>
31-
<div class="flex flex-col items-center justify-center h-full py-8">
34+
<ng-template #header />
35+
<ng-template #content>
36+
<div
37+
class="group w-full rounded-xl bg-surface-100 border border-surface-200 p-8 flex flex-col items-center justify-center text-center gap-4 h-full cursor-pointer overflow-hidden"
38+
(click)="fileUpload.choose()">
3239
<div
33-
class="rounded-full w-28 h-28 flex items-center justify-center mb-5 bg-primary-50">
34-
<i class="pi pi-download text-primary text-5xl"></i>
40+
class="w-24 h-24 shrink-0 rounded-full bg-primary-100 text-primary flex items-center justify-center transition-colors group-hover:bg-primary-200">
41+
<i class="pi pi-upload !text-4xl" aria-hidden="true"></i>
3542
</div>
36-
<p class="text-xl font-bold mb-2">
37-
{{ 'categories.import.drag-drop' | dm }}
38-
</p>
39-
<p class="text-sm text-color-secondary">
40-
{{ 'categories.import.csv-only' | dm }}
43+
44+
<p class="text-2xl font-semibold text-color">
45+
{{ 'categories.import.dropzone.prefix' | dm }}
46+
<span class="text-primary hover:underline">
47+
{{ 'categories.import.choose-file' | dm }}
48+
</span>
49+
{{ 'categories.import.dropzone.suffix' | dm }}
4150
</p>
42-
<p class="text-sm text-color-secondary flex items-center gap-1">
43-
{{ 'categories.import.flat-only' | dm }}
51+
52+
<div class="flex items-center gap-2 text-base text-color-secondary">
53+
<span>{{ 'categories.import.csv-only' | dm }}</span>
54+
</div>
55+
56+
<div class="flex items-center gap-2 text-base text-color-secondary">
57+
<span>{{ 'categories.import.flat-only' | dm }}</span>
4458
<i
45-
class="pi pi-info-circle cursor-pointer"
59+
class="pi pi-info-circle"
4660
[pTooltip]="'categories.import.flat-only.tooltip' | dm"
47-
tooltipPosition="top"
61+
tooltipPosition="right"
4862
[attr.aria-label]="'categories.import.flat-only.tooltip' | dm"
4963
data-testid="category-import-flat-only-icon"></i>
50-
</p>
51-
</div>
52-
</ng-template>
53-
<ng-template #content let-files>
54-
@if ($selectedFile(); as file) {
55-
<div class="flex items-center gap-2 py-3 px-4">
56-
<i class="pi pi-file text-2xl text-color-secondary"></i>
57-
<span class="flex-1 truncate">{{ file.name }}</span>
58-
<p-button
59-
icon="pi pi-times"
60-
[rounded]="true"
61-
[text]="true"
62-
severity="danger"
63-
(onClick)="onFileClear()"
64-
[attr.aria-label]="'categories.import.remove-file' | dm"
65-
data-testid="category-import-remove-file" />
6664
</div>
67-
}
65+
66+
@if ($selectedFile(); as file) {
67+
<span class="text-sm font-medium text-color">{{ file.name }}</span>
68+
}
69+
</div>
6870
</ng-template>
6971
</p-fileupload>
7072
</div>
7173

7274
<!-- Import Type -->
73-
<div class="flex flex-col gap-3 mt-4">
75+
<div class="flex flex-col gap-2 mt-4">
7476
<span class="font-semibold">{{ 'categories.import.type' | dm }}</span>
75-
<div class="flex items-center gap-2">
76-
<p-radioButton
77-
name="importType"
78-
value="merge"
79-
[(ngModel)]="importType"
80-
inputId="import-type-merge"
81-
data-testid="category-import-type-merge" />
82-
<label for="import-type-merge">{{ 'categories.import.type.merge' | dm }}</label>
83-
</div>
84-
<div class="flex items-center gap-2">
85-
<p-radioButton
86-
name="importType"
87-
value="replace"
88-
[(ngModel)]="importType"
89-
inputId="import-type-replace"
90-
data-testid="category-import-type-replace" />
91-
<label for="import-type-replace">{{ 'categories.import.type.replace' | dm }}</label>
77+
<div class="flex items-center gap-3">
78+
<div class="flex items-center gap-2">
79+
<p-radioButton
80+
name="importType"
81+
value="merge"
82+
[(ngModel)]="importType"
83+
inputId="import-type-merge"
84+
data-testid="category-import-type-merge" />
85+
<label for="import-type-merge">{{ 'categories.import.type.merge' | dm }}</label>
86+
</div>
87+
<div class="flex items-center gap-2">
88+
<p-radioButton
89+
name="importType"
90+
value="replace"
91+
[(ngModel)]="importType"
92+
inputId="import-type-replace"
93+
data-testid="category-import-type-replace" />
94+
<label for="import-type-replace">{{ 'categories.import.type.replace' | dm }}</label>
95+
</div>
9296
</div>
9397
</div>
9498

core-web/libs/portlets/dot-plugins/src/lib/dot-plugins-list/dot-plugins-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
}
2121
<p-toolbar class="gap-1 px-3 justify-start border-x-0! border-t-0! flex-shrink-0">
2222
<div class="flex w-full items-center gap-4 py-3">
23-
<p-iconfield iconPosition="left" class="flex-1 max-w-xs">
23+
<p-iconfield iconPosition="left">
2424
<p-inputicon class="pi pi-search" />
2525
<input
2626
#searchInput
2727
pInputText
2828
type="text"
2929
autocomplete="off"
30-
class="w-full"
30+
class="w-80"
3131
[placeholder]="'plugins.search' | dm"
3232
(input)="filterTable(searchInput.value)"
3333
data-testid="plugins-search-input" />

core-web/libs/portlets/edit-ema/ui/src/lib/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
@if ($showActions()) {
2121
<div class="dot-content-compare-table__controls">
2222
<p-select
23+
[ngModel]="data.compare"
2324
(onChange)="changeVersion.emit($event.value)"
2425
[options]="data.versions"
26+
dataKey="inode"
2527
data-testid="versions-dropdown"
2628
appendTo="body">
2729
<ng-template let-selected pTemplate="selectedItem">

core-web/libs/portlets/edit-ema/ui/src/lib/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ describe('DotContentCompareTableComponent', () => {
343343
const dropdown: Select = de.query(By.css('p-select')).componentInstance;
344344
expect(dropdown.options).toEqual(dotContentCompareTableDataMock.versions);
345345
});
346+
it('should show data.compare as the initially selected version in the dropdown', () => {
347+
const dropdown: Select = de.query(By.css('p-select')).componentInstance;
348+
expect(dropdown.value).toEqual(dotContentCompareTableDataMock.compare);
349+
});
346350
it('should show selectButton', () => {
347351
const select: SelectButton = de.query(
348352
By.css('[data-testId="show-diff"]')

dotCMS/src/main/webapp/WEB-INF/messages/Language.properties

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5855,7 +5855,7 @@ locales.variables=Variables
58555855
locales.edit.locale=Edit Locale
58565856
locales.add.locale=Add Locale
58575857
locales.menu=Menu
5858-
locales.search.placeholder=Search locales...
5858+
locales.search.placeholder=Search
58595859
locales.edit=Edit Locale
58605860
locales.push.publish=Push Publish
58615861
locales.delete=Delete
@@ -6619,7 +6619,7 @@ usage.dashboard.lastUpdated=Last Updated
66196619
usage.dashboard.cacheInfo=Data is cached and refreshed every 5 minutes
66206620
66216621
## Tags Portlet
6622-
tags.search.placeholder=Search tags...
6622+
tags.search.placeholder=Search
66236623
tags.export=Export
66246624
tags.export.all=Export All
66256625
tags.import=Import
@@ -6639,7 +6639,7 @@ tags.save=Save
66396639
tags.update=Update
66406640
tags.done=Done
66416641
tags.import.header=Import Tags
6642-
tags.import.instructions=Please upload the correspondent file you want to upload, such as....
6642+
tags.import.instructions=Please upload the correspondent file you want to upload.
66436643
tags.import.column.tag-name=Tag Name
66446644
tags.import.column.tag-name.description=The name of the tag (required)
66456645
tags.import.column.host-id=Host ID
@@ -6666,7 +6666,7 @@ plugins.load=Load
66666666
plugins.upload=Upload
66676667
plugins.refresh=Refresh
66686668
plugins.refresh-table=Refresh Table
6669-
plugins.search=Search plugins...
6669+
plugins.search=Search
66706670
plugins.show-undeployed=Show undeployed
66716671
plugins.extra-packages=Exported Packages
66726672
plugins.table.name=Name
@@ -6750,14 +6750,17 @@ categories.import.flat-only.tooltip=To import into nested categories, navigate t
67506750
categories.import.success={0} categories imported successfully.
67516751
categories.import.partial-success={0} categories imported. {1} failed.
67526752
categories.import.drag-drop=Drag & drop a CSV file or click to browse
6753+
categories.import.dropzone.prefix=Drag & drop files or
6754+
categories.import.choose-file=Choose CSV File
6755+
categories.import.dropzone.suffix=to upload
67536756
categories.import.remove-file=Remove file
67546757
categories.import.type=Import Type
67556758
categories.import.type.merge=Merge
67566759
categories.import.type.replace=Replace
67576760
categories.permissions=Permissions
67586761
categories.permissions.placeholder=Permissions for this category will be managed here.
67596762
categories.save=Save
6760-
categories.search.placeholder=Search categories...
6763+
categories.search.placeholder=Search
67616764
categories.table.header.children=Children
67626765
categories.table.header.key=Key
67636766
categories.table.header.name=Name

0 commit comments

Comments
 (0)