Configure the search results.
To configure the search results, the following actions must be taken.
ACTION S5: Add additional properties
Here you can add additional properties which you need for your <SearchFeatureResponse>
.
-
The
<FeatureName>
data object structure in the BFF yaml can be adapted.-
If you have chosen a custom DataObjectName in the generation, the schema entry will be named accordingly.
-
All the data that should be displayed in the results must be in that data structure either on top-level or in sub data structures.
-
The data should be as minimal as possible to not create too much load to the backend and the DB.
-
Adapt in File: <feature>-bff.yaml
<Feature>:
type: object
required:
- 'modificationCount'
- 'id'
properties:
modificationCount:
type: integer
format: int32
id:
type: integer
format: int64
exampleProperty:
type: string
After updating the OpenAPI specification, execute the command npm run apigen to generate the corresponding TypeScript code. |
Remove the "ACTION" comment after working on this task |
ACTION S6: Define search results columns
The column mappings must be defined.
Adapt in File: <feature>-search.columns.ts
.Example:
export const FeaturePropertySearchColumns: DataTableColumn[] = [
{
columnType: ColumnType.STRING,
id: 'columnId',
nameKey: 'FEATURE_PROPERTY_SEARCH.RESULTS.COLUMN_ID',
filterable: true,
sortable: true,
predefinedGroupKeys: [
'FEATURE_PROPERTY_SEARCH.PREDEFINED_GROUP.DEFAULT',
'FEATURE_PROPERTY_SEARCH.PREDEFINED_GROUP.EXTENDED',
'FEATURE_PROPERTY_SEARCH.PREDEFINED_GROUP.FULL',
],
},
]
Refer to the DataTableColumn properties overview cookbook for more information.
Remove the "ACTION" comment after working on this task |
ACTION S7: Mapping of the items and respective translations
Here you can create a mapping of the items and their corresponding translation strings for columns with type TRANSLATION_KEY
to translate the values in the talbe rows respective to the column.
Adapt in File: <feature>-search.selectors.ts .Example:
export const selectResults = createSelector(
ExampleFeaturePropertySearchSelectors.selectResults,
(results): RowListGridData[] => {
return results.map((item) => ({
imagePath: '',
...item,
columnId1: item.columnId1
? `EXAMPLE_FEATUTRE_PROPERTY_SEARCH.RESULTS.COLUMNID1.${item.columnId1}`
: '',
}));
}
);
Remove the "ACTION" comment after working on this task |