From 4ab5428823a97bb8ae3b558c81053d73b0f04db0 Mon Sep 17 00:00:00 2001 From: Mike Turley Date: Mon, 25 Sep 2023 13:41:30 -0400 Subject: [PATCH 1/6] :bug: Fix inconsistent styles between app inventory tables, fix wrong drawer component being used on analysis table, remove stray character (#1397) * Fixes the difference in cell spacing between the two tabs of the application inventory page - one was using a `` and one was not. * Removes `style={{ cursor: "pointer" }}` inline styles from these tables as they seem to have no effect with the `getClickableTrProps` being used * Restores the use of the `ApplicationDetailDrawerAnalysis` component on the analysis table instead of the `ApplicationDetailDrawerAssessment` * Removes a `;` character that snuck into the drawer Signed-off-by: Mike Turley --- .../applications-table-analyze.tsx | 11 +- .../applications-table-assessment.tsx | 220 +++++++++--------- .../application-risk.tsx | 2 +- 3 files changed, 120 insertions(+), 113 deletions(-) diff --git a/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx b/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx index eaa2b03bd1..ab51251729 100644 --- a/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx +++ b/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx @@ -74,7 +74,7 @@ import { useFetchTagCategories } from "@app/queries/tags"; // Relative components import { ApplicationBusinessService } from "../components/application-business-service"; -import { ApplicationDetailDrawerAssessment } from "../components/application-detail-drawer"; +import { ApplicationDetailDrawerAnalysis } from "../components/application-detail-drawer"; import { ApplicationForm } from "../components/application-form"; import { ApplicationIdentityForm } from "../components/application-identity-form/application-identity-form"; import { ImportApplicationsForm } from "../components/import-applications-form"; @@ -550,7 +550,7 @@ export const ApplicationsTableAnalyze: React.FC = () => { @@ -585,7 +585,7 @@ export const ApplicationsTableAnalyze: React.FC = () => { } numRenderedColumns={numRenderedColumns} > - + {currentPageItems.map((application, rowIndex) => ( { - diff --git a/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx b/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx index f641c5ee29..f82438efba 100644 --- a/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx +++ b/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx @@ -26,6 +26,7 @@ import { Th, Td, ActionsColumn, + Tbody, } from "@patternfly/react-table"; // @app components and utilities @@ -575,7 +576,7 @@ export const ApplicationsTable: React.FC = () => { @@ -611,115 +612,120 @@ export const ApplicationsTable: React.FC = () => { } numRenderedColumns={numRenderedColumns} > - {currentPageItems?.map((application, rowIndex) => { - return ( - - + {currentPageItems?.map((application, rowIndex) => { + return ( + - - {application.name} - - - {application.description} - - - {application.businessService && ( - + {application.name} + + + {application.description} + + + {application.businessService && ( + + )} + + + - )} - - - - - - - - - - {application.tags ? application.tags.length : 0} - - - - - - , - "container":
-
+ , + "container":
+
, "debug": [Function], "findAllByAltText": [Function], diff --git a/client/src/app/components/tests/__snapshots__/PageHeader.test.tsx.snap b/client/src/app/components/tests/__snapshots__/PageHeader.test.tsx.snap index 9ed3bc61e1..b5efda83a8 100644 --- a/client/src/app/components/tests/__snapshots__/PageHeader.test.tsx.snap +++ b/client/src/app/components/tests/__snapshots__/PageHeader.test.tsx.snap @@ -97,34 +97,38 @@ exports[`PageHeader Renders without crashing 1`] = `
- + +
@@ -290,34 +294,38 @@ exports[`PageHeader Renders without crashing 1`] = `
- + +
diff --git a/client/src/app/layout/HeaderApp/MobileDropdown.tsx b/client/src/app/layout/HeaderApp/MobileDropdown.tsx index 715b382181..acf6f77421 100644 --- a/client/src/app/layout/HeaderApp/MobileDropdown.tsx +++ b/client/src/app/layout/HeaderApp/MobileDropdown.tsx @@ -1,39 +1,20 @@ import React, { useState } from "react"; -import { - Dropdown, - DropdownItem, - KebabToggle, -} from "@patternfly/react-core/deprecated"; +import { DropdownItem } from "@patternfly/react-core"; import HelpIcon from "@patternfly/react-icons/dist/esm/icons/help-icon"; -import { AppAboutModal } from "../AppAboutModal"; +import { KebabDropdown } from "@app/components/KebabDropdown"; +import { AppAboutModal } from "@app/layout/AppAboutModal"; export const MobileDropdown: React.FC = () => { - const [isKebabDropdownOpen, setIsKebabDropdownOpen] = useState(false); const [isAboutModalOpen, setAboutModalOpen] = useState(false); - const onKebabDropdownToggle = (isOpen: boolean) => - setIsKebabDropdownOpen(isOpen); - - const onKebabDropdownSelect = () => { - setIsKebabDropdownOpen((current) => !current); - }; - const toggleAboutModal = () => { setAboutModalOpen((current) => !current); }; return ( <> - onKebabDropdownToggle(isOpen)} - /> - } - isOpen={isKebabDropdownOpen} + diff --git a/client/src/app/layout/HeaderApp/SSOMenu.tsx b/client/src/app/layout/HeaderApp/SSOMenu.tsx index d43b08d970..27f352c8d8 100644 --- a/client/src/app/layout/HeaderApp/SSOMenu.tsx +++ b/client/src/app/layout/HeaderApp/SSOMenu.tsx @@ -2,11 +2,13 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useKeycloak } from "@react-keycloak/web"; import { + Dropdown, + MenuToggle, DropdownGroup, DropdownItem, + DropdownList, ToolbarItem, } from "@patternfly/react-core"; -import { Dropdown, DropdownToggle } from "@patternfly/react-core/deprecated"; import { isAuthRequired, LocalStorageKey } from "@app/Constants"; import { useHistory } from "react-router-dom"; @@ -35,19 +37,20 @@ export const SSOMenu: React.FC = () => { > ( + onDropdownToggle(isOpen)} + onClick={() => onDropdownToggle(!isDropdownOpen)} > {(keycloak?.idTokenParsed as any)["preferred_username"]} - - } - dropdownItems={[ - + + )} + > + + { > {t("actions.logout")} - , - ]} - /> + + +
)} diff --git a/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap b/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap index 77df778eaf..880956053b 100644 --- a/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap +++ b/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap @@ -93,35 +93,16 @@ exports[`Test snapshot 1`] = `
- +
@@ -236,35 +217,16 @@ exports[`Test snapshot 1`] = `
- +
diff --git a/client/src/app/pages/applications/manage-imports/manage-imports.tsx b/client/src/app/pages/applications/manage-imports/manage-imports.tsx index 0f88325529..69a89f3dcd 100644 --- a/client/src/app/pages/applications/manage-imports/manage-imports.tsx +++ b/client/src/app/pages/applications/manage-imports/manage-imports.tsx @@ -4,13 +4,13 @@ import { useTranslation } from "react-i18next"; import { Button, ButtonVariant, + DropdownItem, Modal, PageSection, Popover, ToolbarGroup, ToolbarItem, } from "@patternfly/react-core"; -import { DropdownItem } from "@patternfly/react-core/deprecated"; import { cellWidth, IAction, @@ -350,12 +350,10 @@ export const ManageImports: React.FC = () => { dropdownItems={[ - {t("actions.downloadCsvTemplate")} - - } - />, + to="/template_application_import.csv" + > + {t("actions.downloadCsvTemplate")} + , ]} />