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 />
|
<DeleteConfirm />
|
||||||
<ViewHeader
|
<ViewHeader
|
||||||
titleKey={
|
titleKey={
|
||||||
get(pageData, `config.${page.metadata.displayFields[0]}`)?.[0] ||
|
get(
|
||||||
t("createItem")
|
pageData,
|
||||||
|
`config.${page.metadata.displayFields?.[0] || page.properties[0].name}`,
|
||||||
|
)?.[0] || t("createItem")
|
||||||
}
|
}
|
||||||
dropdownItems={
|
dropdownItems={
|
||||||
id
|
id
|
||||||
|
|
|
@ -116,7 +116,10 @@ export default function PageList() {
|
||||||
searchPlaceholderKey="searchItem"
|
searchPlaceholderKey="searchItem"
|
||||||
loader={loader}
|
loader={loader}
|
||||||
columns={[
|
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]`,
|
name: `config.${name}[0]`,
|
||||||
displayKey: page.properties.find((p) => p.name === name)!.label,
|
displayKey: page.properties.find((p) => p.name === name)!.label,
|
||||||
cellRenderer:
|
cellRenderer:
|
||||||
|
|
Loading…
Reference in a new issue