-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: build slot search component * feat: change to slot bff * feat: make slot tiles visible * feat: adjust translations and html ids, fix layout * feat: fix search * feat: center filter * feat: finish slot tests * feat: change page permission * feat: adjust search tests * feat: show sort field again --------- Co-authored-by: Christian Badura <[email protected]>
- Loading branch information
Showing
26 changed files
with
1,439 additions
and
131 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
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
99 changes: 99 additions & 0 deletions
99
src/app/product-store/slot-search/slot-search.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,99 @@ | ||
<ocx-portal-page permission="SLOT#SEARCH" helpArticleId="PAGE_SLOT_SEARCH"> | ||
<ocx-search-header | ||
[header]="'DIALOG.SEARCH.SLOTS.HEADER' | translate" | ||
[subheader]="'DIALOG.SEARCH.SLOTS.SUBHEADER' | translate" | ||
(searched)="onSearch()" | ||
(resetted)="onSearchReset()" | ||
[manualBreadcrumbs]="false" | ||
[actions]="(actions$ | async) ?? []" | ||
> | ||
<div id="slot_search_criteria" [formGroup]="slotSearchCriteriaGroup" class="flex flex-wrap gap-4 row-gap-3 px-2"> | ||
<span class="p-float-label"> | ||
<input | ||
pInputText | ||
id="slot_search_criteria_slot_name" | ||
type="text" | ||
formControlName="slotName" | ||
class="w-18rem" | ||
[clear]="true" | ||
[title]="'SLOT.TOOLTIPS.NAME' | translate" | ||
/> | ||
<label for="slot_search_criteria_slot_name">{{ 'SLOT.NAME' | translate }}</label> | ||
</span> | ||
</div> | ||
</ocx-search-header> | ||
|
||
<ocx-page-content> | ||
<div *ngIf="exceptionKey" id="slot_search_criteria_error" class="card px-3 align-items-center"> | ||
<p-message | ||
id="slot_search_criteria_error_message" | ||
severity="error" | ||
styleClass="p-2" | ||
[text]="exceptionKey | translate" | ||
></p-message> | ||
</div> | ||
<p-dataView | ||
*ngIf="!exceptionKey" | ||
id="slot_search_dataview" | ||
[value]="(slots$ | async)?.stream!.sort(sortSlotsByName)" | ||
[paginator]="true" | ||
[alwaysShowPaginator]="false" | ||
[rowsPerPageOptions]="[10, 20, 50]" | ||
[rows]="12" | ||
[layout]="viewMode" | ||
[emptyMessage]="'ACTIONS.SEARCH.NOT_FOUND' | translate" | ||
filterBy="name" | ||
[sortField]="sortField" | ||
[sortOrder]="sortOrder" | ||
> | ||
<ng-template pTemplate="header"> | ||
<ocx-data-view-controls | ||
id="slot_search_dataview_controls" | ||
[enableFiltering]="true" | ||
[enableSorting]="true" | ||
[supportedViews]="['grid']" | ||
[initialViewMode]="viewMode" | ||
[defaultSortOption]="sortField" | ||
[sortingOptions]="[ | ||
{ label: 'PRODUCT.NAME' | translate, value: 'name' }, | ||
{ label: 'APP.APP_ID' | translate, value: 'appId' } | ||
]" | ||
[defaultSortDirection]="sortOrder === -1" | ||
(sortChange)="onSortChange($event)" | ||
(sortDirectionChange)="onSortDirChange($event)" | ||
(filterChange)="onFilterChange($event)" | ||
[filterColumns]="['SLOT.NAME' | translate]" | ||
[translations]="dataViewControlsTranslations" | ||
> | ||
</ocx-data-view-controls> | ||
</ng-template> | ||
<ng-template let-slot let-idx="rowIndex" pTemplate="gridItem"> | ||
<div [id]="'slot_search_data_grid_' + idx" class="col-12 sm:col-6 md:col-4 lg:col-4 xl:col-3 p-3"> | ||
<div class="card relative p-2 flex flex-column justify-content-center hover:bg-gray-200 cursor-pointer"> | ||
<div class="h-5rem flex flex-column justify-content-between gap-1 text-center"> | ||
<div | ||
[id]="'slot_search_data_grid_' + idx + '_slot_name'" | ||
class="mt-2 font-bold text-lg" | ||
[title]="('SLOT.NAME' | translate) + ': ' + slot.name" | ||
> | ||
{{ limitText(slot.name, 25) }} | ||
</div> | ||
<div | ||
[id]="'slot_search_data_grid_' + idx + '_slot_app_id'" | ||
[title]="('APP.APP_ID' | translate) + ': ' + slot.appId" | ||
> | ||
{{ limitText(slot.appId, 25) }} | ||
</div> | ||
<div | ||
[id]="'slot_search_data_grid_' + idx + '_product_name'" | ||
[title]="('SLOT.PRODUCT_NAME' | translate) + ': ' + limitText(slot.productName, 100)" | ||
> | ||
{{ limitText(slot.productName, 20) }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-template> | ||
</p-dataView> | ||
</ocx-page-content> | ||
</ocx-portal-page> |
20 changes: 20 additions & 0 deletions
20
src/app/product-store/slot-search/slot-search.component.scss
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,20 @@ | ||
@import '/src/_mixins.scss'; | ||
|
||
@include correct-data-view-control; | ||
@include correct-search-criteria; | ||
@include card-badges; | ||
@include danger-action; | ||
|
||
:host ::ng-deep { | ||
.p-dataview-content .p-grid > div { | ||
min-height: 60px; | ||
&.listview-row { | ||
&:nth-child(odd) { | ||
background-color: #f8f9fa; | ||
} | ||
} | ||
} | ||
.h-05rem { | ||
height: 0.5rem; | ||
} | ||
} |
Oops, something went wrong.