Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard : permit to redirect to a custom screen (#8021) #8054

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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