From 389ce2de84844628dfa2eaca2569b166d33f8dbc Mon Sep 17 00:00:00 2001 From: Carla Martinez Date: Tue, 14 Jan 2025 11:31:26 +0100 Subject: [PATCH] Add contextual help panel in Services The Context Help Links Panel needs to be implemented in Services main page to provide help links according to the shown page. Signed-off-by: Carla Martinez --- .../documentation/documentation-links.json | 10 ++ src/pages/Services/Services.tsx | 140 ++++++++++-------- tests/features/contextual_help_panel.feature | 14 ++ 3 files changed, 106 insertions(+), 58 deletions(-) diff --git a/src/assets/documentation/documentation-links.json b/src/assets/documentation/documentation-links.json index 7b1191b1..bd4d52cd 100644 --- a/src/assets/documentation/documentation-links.json +++ b/src/assets/documentation/documentation-links.json @@ -122,5 +122,15 @@ "name": "Rebuilding automatic membership for a single user or host only", "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/managing_idm_users_groups_hosts_and_access_control_rules/index#rebuilding-automatic-membership-for-a-single-user-or-host-only_applying-automember-rules-to-existing-entries-using-idm-web-ui" } + ], + "services": [ + { + "name": "Associating authentication indicators with an IdM service using IdM Web UI", + "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/managing_idm_users_groups_hosts_and_access_control_rules/managing-kerberos-ticket-policies_managing-users-groups-hosts#associating-authentication-indicators-with-an-idm-service-using-idm-web-ui_enforcing-authentication-indicators-for-an-idm-service" + }, + { + "name": "The IdM services", + "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/accessing_identity_management_services/viewing-starting-and-stopping-the-ipa-server_accessing-idm-services#the-idm-services_start-stop-ipa" + } ] } diff --git a/src/pages/Services/Services.tsx b/src/pages/Services/Services.tsx index 5fbbaac9..76388fbc 100644 --- a/src/pages/Services/Services.tsx +++ b/src/pages/Services/Services.tsx @@ -21,6 +21,7 @@ import HelpTextWithIconLayout from "../../components/layouts/HelpTextWithIconLay // Components import BulkSelectorPrep from "../../components/BulkSelectorPrep"; import PaginationLayout from "../../components/layouts/PaginationLayout"; +import ContextualHelpPanel from "src/components/ContextualHelpPanel/ContextualHelpPanel"; // Tables import ServicesTable from "./ServicesTable"; // Redux @@ -438,6 +439,18 @@ const Services = () => { clearSelectedServices, }; + // Contextual links panel + const [isContextualPanelExpanded, setIsContextualPanelExpanded] = + React.useState(false); + + const onOpenContextualPanel = () => { + setIsContextualPanelExpanded(!isContextualPanelExpanded); + }; + + const onCloseContextualPanel = () => { + setIsContextualPanelExpanded(false); + }; + // List of toolbar items const toolbarItems: ToolbarItem[] = [ { @@ -509,7 +522,12 @@ const Services = () => { }, { key: 7, - element: , + element: ( + + ), }, { key: 8, @@ -527,65 +545,71 @@ const Services = () => { // Render component return ( - - - - - - - + + + + + + + +
+ + + {batchError !== undefined && batchError ? ( + + ) : ( + + )} + + +
+ +
+ + -
- - - {batchError !== undefined && batchError ? ( - - ) : ( - - )} - - -
- -
- - - -
+ + ); }; diff --git a/tests/features/contextual_help_panel.feature b/tests/features/contextual_help_panel.feature index 7f3a1583..a5d3ca61 100644 --- a/tests/features/contextual_help_panel.feature +++ b/tests/features/contextual_help_panel.feature @@ -69,3 +69,17 @@ Feature: Contextual help links panel Given I should see contextual help panel When I click on close button in the panel Then I should not see contextual help panel + + # Services + Scenario: Open the contextual help links panel on 'services' main page + Given I am on "services" page + When I click on "Help" button + Then I should see contextual help panel + And I should see a title "Links" in the panel + * I should see a list of links + + Scenario: Close the contextual help links panel on 'Services' main page + Given I am on "services" page + Given I should see contextual help panel + When I click on close button in the panel + Then I should not see contextual help panel