Repository navigation
|
I have been tasked with creating a modified theme for the account console. So far I have figured out how to override certain colors without recompiling patternfly or the account console app itself. I would also like to add links/buttons to the navigation. In the original "base" templates there is also a button to lead the user back to the referring application. That's not in the new theme, right? I guess I need to fork and recompile the entire account console app, right? Is there any guidance how to go about that? |
Replies: 1 comment
|
Ok, so I figured out some stuff. I wanted to add another Link to the side navigation. First: as far as I can see, even the Keycloak.v2 account theme is still in the main keycloak repository. There is also a new keycloak-ui repository which may eventually become another account app/theme but it's not ready yet. I'm not involved in keycloak development, so I don't know for sure. Also this will probably have different mechanisms for extending, so what I am describing below may not work in future versions of Keycloak. To make that work, I first need to copy the content.json from the original theme and adapt it to include something like the following: {
"id": "my-redirect",
"icon": "pf-icon-applications",
"path": "redirect",
"label": "MRM",
"descriptionLabel": "applicationsIntroMessage",
"modulePath": "/MyRedirect.js",
"componentName": "MyRedirect"
}Next I create the import * as React from "../../common/keycloak/web_modules/react.js";
export class MyRedirect extends React.Component{
render(){
window.location.href="/"
}
}So this is probably the simplest case. If you want to actually add another working page, you could probably set up typescript compilation with a reference to the original source code. |
Ok, so I figured out some stuff. I wanted to add another Link to the side navigation.
First: as far as I can see, even the Keycloak.v2 account theme is still in the main keycloak repository. There is also a new keycloak-ui repository which may eventually become another account app/theme but it's not ready yet. I'm not involved in keycloak development, so I don't know for sure. Also this will probably have different mechanisms for extending, so what I am describing below may not work in future versions of Keycloak.
To make that work, I first need to copy the content.json from the original theme and adapt it to include something like the following: