Skip to content

Commit

Permalink
🐛 Fix inconsistent styles between app inventory tables, fix wrong dra…
Browse files Browse the repository at this point in the history
…wer component being used on analysis table, remove stray character

Signed-off-by: Mike Turley <[email protected]>
  • Loading branch information
mturley committed Sep 25, 2023
1 parent fbd5e60 commit 806124b
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -550,7 +550,7 @@ export const ApplicationsTableAnalyze: React.FC = () => {

<ToolbarItem {...paginationToolbarItemProps}>
<SimplePagination
idPrefix="s-table"
idPrefix="app-analysis-table"
isTop
paginationProps={paginationProps}
/>
Expand Down Expand Up @@ -585,7 +585,7 @@ export const ApplicationsTableAnalyze: React.FC = () => {
}
numRenderedColumns={numRenderedColumns}
>
<Tbody style={{ cursor: "pointer" }}>
<Tbody>
{currentPageItems.map((application, rowIndex) => (
<Tr
key={application.id}
Expand Down Expand Up @@ -748,12 +748,13 @@ export const ApplicationsTableAnalyze: React.FC = () => {
</ConditionalTableBody>
</Table>
<SimplePagination
idPrefix="app-assessments-table"
idPrefix="app-analysis-table"
isTop={false}
paginationProps={paginationProps}
/>
<ApplicationDetailDrawerAssessment
<ApplicationDetailDrawerAnalysis
application={activeRowItem}
applications={applications}
onCloseClick={clearActiveRow}
task={activeRowItem ? getTask(activeRowItem) : null}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
Th,
Td,
ActionsColumn,
Tbody,
} from "@patternfly/react-table";

// @app components and utilities
Expand Down Expand Up @@ -575,7 +576,7 @@ export const ApplicationsTable: React.FC = () => {

<ToolbarItem {...paginationToolbarItemProps}>
<SimplePagination
idPrefix="s-table"
idPrefix="app-assessments-table"
isTop
paginationProps={paginationProps}
/>
Expand Down Expand Up @@ -611,115 +612,120 @@ export const ApplicationsTable: React.FC = () => {
}
numRenderedColumns={numRenderedColumns}
>
{currentPageItems?.map((application, rowIndex) => {
return (
<Tr
style={{ cursor: "pointer" }}
key={application.name}
{...getClickableTrProps({ item: application })}
>
<TableRowContentWithControls
{...tableControls}
item={application}
rowIndex={rowIndex}
<Tbody>
{currentPageItems?.map((application, rowIndex) => {
return (
<Tr
key={application.name}
{...getClickableTrProps({ item: application })}
>
<Td
width={20}
{...getTdProps({ columnKey: "name" })}
modifier="truncate"
>
{application.name}
</Td>
<Td
width={25}
{...getTdProps({ columnKey: "description" })}
modifier="truncate"
>
{application.description}
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "businessService" })}
<TableRowContentWithControls
{...tableControls}
item={application}
rowIndex={rowIndex}
>
{application.businessService && (
<ApplicationBusinessService
id={application.businessService.id}
<Td
width={20}
{...getTdProps({ columnKey: "name" })}
modifier="truncate"
>
{application.name}
</Td>
<Td
width={25}
{...getTdProps({ columnKey: "description" })}
modifier="truncate"
>
{application.description}
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "businessService" })}
>
{application.businessService && (
<ApplicationBusinessService
id={application.businessService.id}
/>
)}
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "assessment" })}
>
<ApplicationAssessmentStatus
assessments={application.assessments}
/>
)}
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "assessment" })}
>
<ApplicationAssessmentStatus
assessments={application.assessments}
/>
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "review" })}
>
<IconedStatus
preset={application.review ? "Completed" : "NotStarted"}
/>
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "tags" })}
>
<TagIcon />
{application.tags ? application.tags.length : 0}
</Td>
<Td isActionCell id="pencil-action">
<Button
variant="plain"
icon={<PencilAltIcon />}
onClick={() =>
setSaveApplicationModalState(application)
}
/>
</Td>
<Td isActionCell id="row-actions">
<ActionsColumn
items={[
{
title: t("actions.assess"),
onClick: () => assessSelectedApp(application),
},
{
title: t("actions.review"),
onClick: () => reviewSelectedApp(application),
},
...(application?.review
? [
{
title: t("actions.discardAssessment"),
onClick: () =>
setAssessmentOrReviewToDiscard(application),
},
]
: []),
{
title: t("actions.delete"),
onClick: () =>
setApplicationsToDelete([application]),
},
{
title: t("actions.manageDependencies"),
onClick: () =>
setApplicationDependenciesToManage(application),
},
]}
/>
</Td>
</TableRowContentWithControls>
</Tr>
);
})}
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "review" })}
>
<IconedStatus
preset={
application.review ? "Completed" : "NotStarted"
}
/>
</Td>
<Td
width={10}
modifier="truncate"
{...getTdProps({ columnKey: "tags" })}
>
<TagIcon />
{application.tags ? application.tags.length : 0}
</Td>
<Td isActionCell id="pencil-action">
<Button
variant="plain"
icon={<PencilAltIcon />}
onClick={() =>
setSaveApplicationModalState(application)
}
/>
</Td>
<Td isActionCell id="row-actions">
<ActionsColumn
items={[
{
title: t("actions.assess"),
onClick: () => assessSelectedApp(application),
},
{
title: t("actions.review"),
onClick: () => reviewSelectedApp(application),
},
...(application?.review
? [
{
title: t("actions.discardAssessment"),
onClick: () =>
setAssessmentOrReviewToDiscard(
application
),
},
]
: []),
{
title: t("actions.delete"),
onClick: () =>
setApplicationsToDelete([application]),
},
{
title: t("actions.manageDependencies"),
onClick: () =>
setApplicationDependenciesToManage(application),
},
]}
/>
</Td>
</TableRowContentWithControls>
</Tr>
);
})}
</Tbody>
</ConditionalTableBody>
</Table>
<SimplePagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ApplicationRisk: React.FC<IApplicationRiskProps> = ({
if (!assessments || assessments.length === 0) {
return (
<>
<RiskLabel risk={"unknown"} />;
<RiskLabel risk={"unknown"} />
{isFetchingAssessmentsById && <Spinner />}
</>
);
Expand Down

0 comments on commit 806124b

Please sign in to comment.