Fall back to page properties if no display fields are specified (#31769)
Closes keycloak/keycloak-quickstarts#587 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com> Co-authored-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
parent
07cfdac862
commit
1fe5082edd
2 changed files with 8 additions and 3 deletions
|
@ -60,8 +60,10 @@ export default function Page() {
|
|||
<DeleteConfirm />
|
||||
<ViewHeader
|
||||
titleKey={
|
||||
get(pageData, `config.${page.metadata.displayFields[0]}`)?.[0] ||
|
||||
t("createItem")
|
||||
get(
|
||||
pageData,
|
||||
`config.${page.metadata.displayFields?.[0] || page.properties[0].name}`,
|
||||
)?.[0] || t("createItem")
|
||||
}
|
||||
dropdownItems={
|
||||
id
|
||||
|
|
|
@ -116,7 +116,10 @@ export default function PageList() {
|
|||
searchPlaceholderKey="searchItem"
|
||||
loader={loader}
|
||||
columns={[
|
||||
...page.metadata.displayFields.map((name: string, index: number) => ({
|
||||
...(
|
||||
page.metadata.displayFields ||
|
||||
page.properties.slice(0, 3).map((p) => p.name)
|
||||
).map((name: string, index: number) => ({
|
||||
name: `config.${name}[0]`,
|
||||
displayKey: page.properties.find((p) => p.name === name)!.label,
|
||||
cellRenderer:
|
||||
|
|
Loading…
Reference in a new issue