Skip to content

Commit 003dc2d

Browse files
authored
chore(edit-content): remove type column and display thumbnail in title column (dotCMS#32170)
### Proposed Changes This pull request includes a variety of changes to improve the styling, layout, and user experience of the `dot-edit-content-relationship-field` component and its related elements. Key updates include adjustments to table and paginator styles, improvements to the HTML structure for better responsiveness, and updates to localization messages. ### Styling and Layout Improvements: * Adjusted the `scrollHeight` of the table to `36rem` for better content visibility (`dot-select-existing-content.component.html`, `dot-select-existing-content.component.scss`). [[1]](diffhunk://#diff-ba794904cc95635d9efca07b7e2bfeb948b5b0bb0c8e1e97c777c615398ba011L30-R30) [[2]](diffhunk://#diff-778cca685214b49b5445efc5613609b68214a24052f4ed77408caeb0c9e6ffb2L7-R7) * Added styles for paginator buttons and current page display to ensure consistent height and width (`dot-select-existing-content.component.scss`). * Introduced new utility classes (`min-w-12rem`, `min-w-8rem`) for consistent column width across the table (`dot-edit-content-relationship-field.component.scss`). ### HTML Structure Enhancements: * Updated table header and cell structure to dynamically adjust column widths based on content presence (`dot-edit-content-relationship-field.component.html`). [[1]](diffhunk://#diff-f396a55538f81f083a55fe6a0a7d94cff418103cb29da292746fe029264f433dL22-R30) [[2]](diffhunk://#diff-f396a55538f81f083a55fe6a0a7d94cff418103cb29da292746fe029264f433dL65-R73) * Removed unnecessary thumbnail border logic and simplified the thumbnail container structure (`dot-select-existing-content.component.html`). ### Localization Updates: * Changed the title and placeholder for the search dialog to improve clarity and usability (`Language.properties`). * Updated the placeholder text in the search input field to match the new localization key (`search.component.html`). ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Screenshots | Expected | Current | |--------|--------| | ![Image](https://github.com/user-attachments/assets/4a95300c-880c-4ade-a047-64141043c55b) | ![Image](https://github.com/user-attachments/assets/68e72326-48e7-4e67-a685-ed5e7af53940) |
1 parent 7f78140 commit 003dc2d

File tree

8 files changed

+41
-25
lines changed

8 files changed

+41
-25
lines changed

core-web/libs/dotcms-scss/angular/dotcms-theme/components/_table.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,7 @@ $dot-table-cell-height: 1.25rem;
186186
max-height: 3rem;
187187
overflow: hidden;
188188
position: relative;
189-
border-radius: $border-radius-md;
190189
padding: $spacing-0;
191-
border-color: $color-palette-gray-300;
192-
border-style: solid;
193-
border-width: 0px;
194190
}
195191

196192
.p-row-toggler,
@@ -254,7 +250,6 @@ $dot-table-cell-height: 1.25rem;
254250
}
255251

256252
&:not(.p-highlight):hover {
257-
background: inherit;
258253
color: $text-color-hover;
259254
transition: background-color ease-in $basic-speed;
260255
cursor: default;

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/components/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="flex items-center justify-center gap-2">
1+
<div class="flex items-center justify-center mb-2">
22
<span class="p-dialog-title">
33
{{ 'dot.file.relationship.dialog.search.title' | dm }}
44
</span>

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/components/search/search.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
type="text"
66
class="w-26rem h-auto"
77
(keydown.enter)="doSearch()"
8-
[placeholder]="'dot.file.relationship.dialog.search.title' | dm"
8+
[placeholder]="'dot.file.relationship.dialog.search.placeholder' | dm"
99
formControlName="query" />
1010
<p-button
1111
(onClick)="popover.toggle($event, formElement)"

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
currentPageReportTemplate="{first} - {last} of {totalRecords}"
2828
[showPageLinks]="false"
2929
[showFirstLastIcon]="false"
30-
scrollHeight="34rem"
30+
scrollHeight="36rem"
3131
styleClass="dotTable p-datatable-existing-content w-full">
3232
<ng-template pTemplate="header" styleClass="relative" let-columns>
3333
<tr>
@@ -41,10 +41,7 @@
4141
<p-tableHeaderCheckbox />
4242
}
4343
</th>
44-
<th scope="col" class="column-thumbnail">
45-
{{ 'dot.file.relationship.dialog.table.type' | dm }}
46-
</th>
47-
<th scope="col" class="max-w-11rem" [pSortableColumn]="'title'">
44+
<th scope="col" [colSpan]="2" class="max-w-11rem" [pSortableColumn]="'title'">
4845
<span class="capitalize">
4946
{{ 'dot.file.relationship.dialog.table.title' | dm }}
5047
</span>
@@ -94,7 +91,7 @@
9491
}
9592
</td>
9693
<td class="column-thumbnail">
97-
<div class="container-thumbnail" [class.border-1]="item.hasTitleImage">
94+
<div class="container-thumbnail">
9895
<dot-contentlet-thumbnail
9996
[iconSize]="'30px'"
10097
[contentlet]="item"

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
p-table {
55
.dotTable.p-datatable.p-datatable-existing-content {
66
.p-datatable-wrapper {
7-
height: 34rem;
7+
height: 36rem;
88
}
99
.p-datatable-header {
1010
background-color: $white;
@@ -31,6 +31,18 @@
3131
max-width: 4.5rem;
3232
min-width: 4.5rem;
3333
}
34+
35+
.p-paginator .p-paginator-current {
36+
height: 2rem;
37+
min-height: 2rem;
38+
}
39+
.p-paginator .p-paginator-prev,
40+
.p-paginator .p-paginator-next {
41+
height: 2rem;
42+
min-height: 2rem;
43+
width: 2rem;
44+
min-width: 2rem;
45+
}
3446
}
3547
}
3648
}

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@let data = store.data();
55
@let hitText = attributes.hitText;
66
@let isDisabled = $isDisabled();
7+
@let isEmpty = data.length === 0;
78

89
<p-table
910
[value]="data"
@@ -19,14 +20,14 @@
1920
<p-menu #menu [model]="$menuItems()" [popup]="true" appendTo="body" />
2021

2122
<tr class="relationship-field__table_header">
22-
<th scope="col" class="w-3rem"></th>
23-
<th scope="col" class="max-w-12rem" style="min-width: 13rem">
23+
<th scope="col" class="min-w-3rem"></th>
24+
<th scope="col" [class.min-w-12rem]="!isEmpty">
2425
{{ 'dot.file.relationship.field.table.title' | dm }}
2526
</th>
26-
<th style="min-width: 8rem">
27+
<th scope="col" [class.min-w-8rem]="!isEmpty">
2728
{{ 'dot.file.relationship.field.table.language' | dm }}
2829
</th>
29-
<th style="min-width: 8rem">
30+
<th scope="col" [class.min-w-8rem]="!isEmpty">
3031
{{ 'dot.file.relationship.field.table.status' | dm }}
3132
</th>
3233
<th scope="col" class="w-1rem" alignFrozen="right" pFrozenColumn [frozen]="true">
@@ -61,16 +62,13 @@
6162
<span class="pi pi-bars text-gray-500 cursor-not-allowed"></span>
6263
}
6364
</td>
64-
<td
65-
class="max-w-12rem"
66-
style="min-width: 13rem"
67-
[class.cursor-not-allowed]="isDisabled">
65+
<td class="min-w-12rem" [class.cursor-not-allowed]="isDisabled">
6866
<p class="truncate-text">{{ item.title }}</p>
6967
</td>
70-
<td style="min-width: 8rem" [class.cursor-not-allowed]="isDisabled">
68+
<td class="min-w-8rem" [class.cursor-not-allowed]="isDisabled">
7169
{{ item.language | language }}
7270
</td>
73-
<td style="min-width: 8rem" [class.cursor-not-allowed]="isDisabled">
71+
<td class="min-w-8rem" [class.cursor-not-allowed]="isDisabled">
7472
@let status = item | contentletStatus;
7573
<p-chip [styleClass]="'p-chip-sm ' + status.classes" [label]="status.label" />
7674
</td>

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,16 @@
3737
background-color: $color-palette-gray-100;
3838
}
3939
}
40+
.min-w-12rem {
41+
min-width: 12rem;
42+
width: 12rem;
43+
max-width: 12rem;
44+
}
45+
.min-w-8rem {
46+
min-width: 8rem;
47+
width: 8rem;
48+
max-width: 8rem;
49+
}
50+
.min-w-3rem {
51+
min-width: 3rem;
52+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,8 @@ dot.file.relationship.field.table.language=Language
12301230
dot.file.relationship.field.table.status=Status
12311231
dot.file.relationship.field.table.existing.content=Existing Content
12321232
dot.file.relationship.field.table.new.content=New Content
1233-
dot.file.relationship.dialog.search.title=Search
1233+
dot.file.relationship.dialog.search.title=Relationship
1234+
dot.file.relationship.dialog.search.placeholder=Search
12341235
dot.file.relationship.dialog.search.empty.content=No related content available
12351236
dot.file.relationship.dialog.search.btn.clear=Clear All
12361237
dot.file.relationship.dialog.search.btn.search=Search

0 commit comments

Comments
 (0)