Skip to content

Commit

Permalink
feat: added displayName as criteria in product search
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Jul 31, 2024
1 parent 8240d92 commit 5bd8307
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/product-store/app-search/app-search.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<div
*ngIf="app.appType === 'MS'"
class="text-sm"
[pTooltip]="'APP.APP_TYPE' | translate"
[pTooltip]="'ACTIONS.SEARCH.APP.QUICK_FILTER.MS' | translate"
tooltipPosition="top"
tooltipEvent="hover"
>
Expand Down
22 changes: 18 additions & 4 deletions src/app/product-store/product-search/product-search.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,29 @@
[formGroup]="productSearchCriteriaGroup"
class="flex flex-wrap gap-4 row-gap-3 px-2"
>
<span class="p-float-label">
<input
id="product_search_criteria_display_name"
pInputText
type="text"
class="w-18rem"
[clear]="true"
formControlName="displayName"
[pTooltip]="('PRODUCT.TOOLTIPS.DISPLAY_NAME' | translate) + ('ACTIONS.SEARCH.WILDCARD_SUPPORT' | translate)"
tooltipPosition="top"
tooltipEvent="hover"
/>
<label for="product_search_criteria_display_name">{{ 'PRODUCT.DISPLAY_NAME' | translate }}</label>
</span>
<span class="p-float-label">
<input
id="product_search_criteria_product_name"
pInputText
type="text"
formControlName="productName"
class="w-18rem"
[clear]="true"
[pTooltip]="'PRODUCT.TOOLTIPS.NAME' | translate"
formControlName="productName"
[pTooltip]="('PRODUCT.TOOLTIPS.NAME' | translate) + ('ACTIONS.SEARCH.WILDCARD_SUPPORT' | translate)"
tooltipPosition="top"
tooltipEvent="hover"
/>
Expand Down Expand Up @@ -60,17 +74,17 @@
[supportedViews]="['grid', 'list']"
[initialViewMode]="viewMode"
[sortingOptions]="[
{ label: 'PRODUCT.NAME' | translate, value: 'name' },
{ label: 'PRODUCT.DISPLAY_NAME' | translate, value: 'displayName' },
{ label: 'PRODUCT.NAME' | translate, value: 'name' },
{ label: 'PRODUCT.UNDEPLOYED' | translate, value: 'undeployed' }
]"
[defaultSortOption]="sortField"
[defaultSortDirection]="false"
(dataViewChange)="onLayoutChange($event)"
(filterChange)="onFilterChange($event)"
[filterColumns]="[
'PRODUCT.NAME' | translate,
'PRODUCT.DISPLAY_NAME' | translate,
'PRODUCT.NAME' | translate,
'PRODUCT.CLASSIFICATIONS' | translate
]"
(sortChange)="onSortChange($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@include correct-data-view-control;
@include correct-search-criteria;
@include correct-select-button;
@include dataview-zebra-rows;
@include card-badges;
@include danger-action;
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { bffImageUrl, limitText } from 'src/app/shared/utils'

export interface ProductSearchCriteria {
displayName: FormControl<string | null>
productName: FormControl<string | null>
}

Expand Down Expand Up @@ -47,6 +48,7 @@ export class ProductSearchComponent implements OnInit {
private imageApi: ImagesInternalAPIService
) {
this.productSearchCriteriaGroup = new FormGroup<ProductSearchCriteria>({
displayName: new FormControl<string | null>(null),
productName: new FormControl<string | null>(null)
})
}
Expand All @@ -63,6 +65,7 @@ export class ProductSearchComponent implements OnInit {
.searchProducts({
productSearchCriteria: {
name: this.productSearchCriteriaGroup.controls['productName'].value,
displayName: this.productSearchCriteriaGroup.controls['displayName'].value,
pageSize: 1000
}
})
Expand Down Expand Up @@ -103,10 +106,10 @@ export class ProductSearchComponent implements OnInit {
filterInputPlaceholder: data['ACTIONS.DATAVIEW.FILTER'],
filterInputTooltip:
data['ACTIONS.DATAVIEW.FILTER_OF'] +
data['PRODUCT.NAME'] +
', ' +
data['PRODUCT.DISPLAY_NAME'] +
', ' +
data['PRODUCT.NAME'] +
', ' +
data['PRODUCT.CLASSIFICATIONS'],
viewModeToggleTooltips: {
grid: data['ACTIONS.DATAVIEW.VIEW_MODE_GRID'],
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/generated/model/productSearchCriteria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

export interface ProductSearchCriteria {
name?: string | null;
displayName?: string | null;
/**
* The number of page.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/assets/api/openapi-bff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,9 @@ components:
name:
type: string
nullable: true
displayName:
type: string
nullable: true
pageNumber:
format: int32
description: The number of page.
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
},
"SEARCH": {
"NOT_FOUND": "Keine Daten gefunden",
"WILDCARD_SUPPORT": " (Wildcards: ?, *)",
"APP": {
"NOT_EXISTS": "Eine App mit diesem Namen konnte nicht gefunden werden.",
"LOAD_ERROR": "App konnte nicht geladen werden",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
},
"SEARCH": {
"NOT_FOUND": "No data found",
"WILDCARD_SUPPORT": " Wildcards: ?, *",
"APP": {
"NOT_EXISTS": "An App with this name could not be found.",
"LOAD_ERROR": "Failed to load App",
Expand Down

0 comments on commit 5bd8307

Please sign in to comment.