Skip to content

Commit

Permalink
Dashboard : permit to redirect to a custom screen (#8021)
Browse files Browse the repository at this point in the history
Signed-off-by: ClementBouvierN <[email protected]>
  • Loading branch information
ClementBouvierN committed Feb 28, 2025
1 parent fef955d commit b77691a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
5 changes: 5 additions & 0 deletions config/docker/ui-config/web-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@
"stateId": "chartLineState",
"menuId": "uid_test_0",
"urlExtension": "?search=chart&fulltext=1"
},
{
"processId": "defaultProcess",
"stateId": "questionState",
"screenId": "testId"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ For example adding `Keycloak` application, with `'Keycloak'` as `name`, `1` as `

|checkIfUrlIsLocked|true|no| if set to false, an OperatorFabric url can be used by several tabs in the same browser. Note that there can only be one token per browser for a given OperatorFabric url, so the first session will be replaced by the second one

|customCssToLoad||no|List of URLs of css files to be loaded at startup

|customJsToLoad||no|List of URLs of javascript files to be loaded at startup

|dashboard.processStateRedirects||no| Declares if a state when clicked in the dashboard should redirect to a custom menu or custom screen. If nothing is specified the redirection is pointing to the card feed. Here is a declaration with one redirection to a custom menu and one to a custom screen. The ids declared should match the ones in the ui-menu config.
[source, json]
----
"dashboard": {
"processStateRedirects": [
{
"processId": "defaultProcess",
"stateId": "chartLineState",
"menuId": "uid_test_0",
"urlExtension": "?search=chart&fulltext=1"
},
{
"processId": "defaultProcess",
"stateId": "questionState",
"screenId": "testId"
}
]
}
----

|defaultEntryPage|feed|no|This configuration determines the default page that will be displayed after a user logs in. The possible values include all core menus, with the exception of 'usercard' and 'about'. Additionally, you can set a custom application as the entry page by using 'businessconfigparty/menuId' as the value.
|environmentColor|blue|no| Color of the background of the environment name. The format of color is css, for example : `red` , `#4052FF`
|environmentName||no| Name of the environment to display in the top-right corner (examples: PROD , TEST .. ), if the value not set the environment name is not shown .
Expand Down Expand Up @@ -191,9 +215,6 @@ a|authentication mode, available options:

|usercard.useDescriptionFieldForEntityList|false|no|If true, show entity `description` field instead of `name` in user card page

|customJsToLoad||no|List of URLs of javascript files to be loaded at startup

|customCssToLoad||no|List of URLs of css files to be loaded at startup

|===

Expand Down
7 changes: 5 additions & 2 deletions ui/main/src/app/components/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ export class DashboardComponent implements OnInit, OnDestroy {
const redirect = this.processStateRedirects.filter(
(redirect) => redirect.processId === processId && redirect.stateId === stateId
);

if (redirect?.length > 0) {
opfab.navigate.redirectToBusinessMenu(redirect[0].menuId, redirect[0].urlExtension);
if (redirect[0]?.screenId) {
NavigationService.navigateTo('customscreen/' + redirect[0].screenId);
} else if (redirect[0]?.menuId) {
opfab.navigate.redirectToBusinessMenu(redirect[0].menuId, redirect[0].urlExtension);
}
} else if (!this.hideProcessFilter && !this.hideStateFilter) {
NavigationService.navigateToFeedWithProcessStateFilter(processId, stateId);
}
Expand Down

0 comments on commit b77691a

Please sign in to comment.