-
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.
Merge branch 'main' into issue-30733-ftm-new-uve-toolbar-implement-ap…
…i-button
- Loading branch information
Showing
25 changed files
with
862 additions
and
39 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
...ld/components/dot-select-existing-content/components/pagination/pagination.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@let currentPage = $currentPage(); | ||
@let totalPages = $totalPages(); | ||
|
||
<div class="flex justify-content-center gap-3"> | ||
<span class="text-primary-500 flex align-items-center"> | ||
{{ currentPage }} of {{ totalPages }} | ||
</span> | ||
<div class="flex justify-content-center gap-1"> | ||
<p-button | ||
type="button" | ||
(onClick)="previousPage.emit()" | ||
icon="pi pi-angle-left" | ||
[rounded]="true" | ||
[text]="true" | ||
[disabled]="currentPage === 1" | ||
size="small" /> | ||
<p-button | ||
type="button" | ||
(onClick)="nextPage.emit()" | ||
icon="pi pi-angle-right" | ||
[rounded]="true" | ||
[text]="true" | ||
[disabled]="currentPage === totalPages" | ||
size="small" /> | ||
</div> | ||
</div> |
33 changes: 33 additions & 0 deletions
33
...ield/components/dot-select-existing-content/components/pagination/pagination.component.ts
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Component, input, output } from '@angular/core'; | ||
|
||
import { ButtonModule } from 'primeng/button'; | ||
|
||
@Component({ | ||
selector: 'dot-pagination', | ||
standalone: true, | ||
imports: [ButtonModule], | ||
templateUrl: './pagination.component.html' | ||
}) | ||
export class PaginationComponent { | ||
/** | ||
* A signal that holds the total number of pages. | ||
* It is used to display the total number of pages in the pagination component. | ||
*/ | ||
$totalPages = input.required<number>({ alias: 'totalPages' }); | ||
|
||
/** | ||
* A signal that holds the current page number. | ||
* It is used to display the current page number in the pagination component. | ||
*/ | ||
$currentPage = input.required<number>({ alias: 'currentPage' }); | ||
|
||
/** | ||
* An output signal that emits when the previous page button is clicked. | ||
*/ | ||
previousPage = output<void>(); | ||
|
||
/** | ||
* An output signal that emits when the next page button is clicked. | ||
*/ | ||
nextPage = output<void>(); | ||
} |
50 changes: 50 additions & 0 deletions
50
...ship-field/components/dot-select-existing-content/components/search/search.compoment.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<p-inputGroup size="small"> | ||
<input | ||
#searchInput | ||
pInputText | ||
type="search" | ||
[placeholder]="'dot.file.relationship.dialog.search' | dm" | ||
(input)="onSearch.emit(searchInput.value)" /> | ||
<p-button | ||
(onClick)="op.toggle($event)" | ||
size="small" | ||
type="button" | ||
icon="pi pi-sliders-h" | ||
[text]="true" /> | ||
</p-inputGroup> | ||
|
||
<p-overlayPanel #op> | ||
<form class="w-11rem" [formGroup]="form"> | ||
<div class="flex flex-column gap-2"> | ||
<div class="flex flex-column gap-2"> | ||
<p-dropdown | ||
styleClass="w-full" | ||
[options]="[]" | ||
formControlName="language" | ||
optionLabel="language" /> | ||
|
||
<p-dropdown | ||
styleClass="w-full" | ||
[options]="[]" | ||
formControlName="site" | ||
optionLabel="Site or Host" /> | ||
</div> | ||
|
||
<div class="flex justify-content-end gap-2"> | ||
<p-button | ||
(onClick)="op.toggle($event)" | ||
label="Clear all" | ||
type="button" | ||
text="true" | ||
severity="primary" | ||
outline="true" /> | ||
|
||
<p-button | ||
(onClick)="op.toggle($event)" | ||
label="Search" | ||
type="button" | ||
severity="primary" /> | ||
</div> | ||
</div> | ||
</form> | ||
</p-overlayPanel> |
44 changes: 44 additions & 0 deletions
44
...onship-field/components/dot-select-existing-content/components/search/search.compoment.ts
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component, inject, output } from '@angular/core'; | ||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; | ||
|
||
import { ButtonModule } from 'primeng/button'; | ||
import { DropdownModule } from 'primeng/dropdown'; | ||
import { InputGroupModule } from 'primeng/inputgroup'; | ||
import { InputTextModule } from 'primeng/inputtext'; | ||
import { OverlayPanelModule } from 'primeng/overlaypanel'; | ||
|
||
import { DotMessagePipe } from '@dotcms/ui'; | ||
|
||
@Component({ | ||
selector: 'dot-search', | ||
standalone: true, | ||
imports: [ | ||
InputTextModule, | ||
ButtonModule, | ||
InputGroupModule, | ||
OverlayPanelModule, | ||
DotMessagePipe, | ||
DropdownModule, | ||
ReactiveFormsModule | ||
], | ||
templateUrl: './search.compoment.html' | ||
}) | ||
export class SearchComponent { | ||
/** | ||
* An output signal that emits when the search input is changed. | ||
*/ | ||
onSearch = output<string>(); | ||
|
||
/** | ||
* Injects FormBuilder to create form control groups. | ||
*/ | ||
readonly #formBuilder = inject(FormBuilder); | ||
|
||
/** | ||
* Initializes the form group with default values for language and site. | ||
*/ | ||
readonly form = this.#formBuilder.group({ | ||
language: [''], | ||
site: [''] | ||
}); | ||
} |
118 changes: 118 additions & 0 deletions
118
...p-field/components/dot-select-existing-content/dot-select-existing-content.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 |
---|---|---|
@@ -0,0 +1,118 @@ | ||
@let data = store.data(); | ||
@let pagination = store.pagination(); | ||
|
||
<p-dialog | ||
[header]="'dot.file.relationship.dialog.select.existing.content' | dm" | ||
[modal]="true" | ||
[(visible)]="$visible" | ||
dataKey="id" | ||
appendTo="body" | ||
width="90%" | ||
[style]="{ width: '90%', 'max-width': '1040px' }"> | ||
<p-table | ||
#datatable | ||
[value]="data" | ||
selectionMode="multiple" | ||
[(selection)]="$selectedItems" | ||
[first]="pagination.offset" | ||
[loading]="store.isLoading()" | ||
[paginator]="true" | ||
[rows]="pagination.rowsPerPage" | ||
[globalFilterFields]="['title', 'step', 'description']" | ||
styleClass="p-datatable-sm p-datatable-existing-content"> | ||
<ng-template pTemplate="caption"> | ||
<div class="flex justify-content-between align-items-center w-full"> | ||
<div class="flex align-items-center gap-2"> | ||
<div class="flex-none"> | ||
<dot-search (onSearch)="datatable.filterGlobal($event, 'contains')" /> | ||
</div> | ||
<div class="flex-grow-1"> | ||
<p class="text-primary-500"> | ||
{{ | ||
'dot.file.relationship.dialog.per.page' | ||
| dm: [pagination.rowsPerPage.toString()] | ||
}} | ||
</p> | ||
</div> | ||
</div> | ||
<div> | ||
<dot-pagination | ||
(nextPage)="store.nextPage()" | ||
(previousPage)="store.previousPage()" | ||
[totalPages]="store.totalPages()" | ||
[currentPage]="pagination.currentPage" /> | ||
</div> | ||
</div> | ||
</ng-template> | ||
<ng-template pTemplate="header" styleClass="relative"> | ||
<tr> | ||
<th scope="col" style="width: 4rem"><p-tableHeaderCheckbox /></th> | ||
<th scope="col" pSortableColumn="title"> | ||
Title | ||
<p-sortIcon field="title" /> | ||
</th> | ||
<th scope="col" pSortableColumn="step"> | ||
Step | ||
<p-sortIcon field="step" /> | ||
</th> | ||
<th scope="col" pSortableColumn="description"> | ||
Description | ||
<p-sortIcon field="description" /> | ||
</th> | ||
<th scope="col" pSortableColumn="lastUpdate"> | ||
Last Update | ||
<p-sortIcon field="lastUpdate" /> | ||
</th> | ||
<th scope="col">Menu</th> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="emptymessage"> | ||
<tr> | ||
<td colspan="6"> | ||
<div class="flex p-2 gap-2 justify-content-center"> | ||
<p class="text-500">Relate content by clicking on the Plus Button</p> | ||
</div> | ||
</td> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="body" let-item> | ||
<tr> | ||
<td> | ||
<p-tableCheckbox [value]="item" /> | ||
</td> | ||
<td class="max-w-12rem"> | ||
<p class="truncate-text">{{ item.title }}</p> | ||
</td> | ||
<td>{{ item.step }}</td> | ||
<td class="max-w-12rem"> | ||
<p class="truncate-text">{{ item.description }}</p> | ||
</td> | ||
<td>{{ item.lastUpdate | date }}</td> | ||
<td> | ||
<i class="pi pi-pencil"></i> | ||
</td> | ||
</tr> | ||
</ng-template> | ||
</p-table> | ||
<ng-template pTemplate="footer"> | ||
<div class="flex justify-content-between"> | ||
<div> | ||
<p class="text-primary-500"> | ||
{{ | ||
'dot.file.relationship.dialog.selected.items' | ||
| dm: [$selectedItems().length.toString()] | ||
}} | ||
</p> | ||
</div> | ||
<div> | ||
<p-button | ||
[label]="'Cancel' | dm" | ||
[outlined]="true" | ||
(onClick)="closeDialog()" | ||
[text]="true" | ||
severity="primary" /> | ||
<p-button [disabled]="$isApplyDisabled()" [label]="$applyLabel()" /> | ||
</div> | ||
</div> | ||
</ng-template> | ||
</p-dialog> |
Oops, something went wrong.