Skip to content

Commit

Permalink
Fall back to page properties if no display fields are specified (keyc…
Browse files Browse the repository at this point in the history
…loak#31769)

Closes keycloak/keycloak-quickstarts#587

Signed-off-by: Erik Jan de Wit <[email protected]>
Co-authored-by: Jon Koops <[email protected]>
  • Loading branch information
edewit and jonkoops authored Jul 30, 2024
1 parent 07cfdac commit 1fe5082
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions js/apps/admin-ui/src/page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion js/apps/admin-ui/src/page/PageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1fe5082

Please sign in to comment.