Skip to content

Commit

Permalink
👻 Share assessments between app & archetypes (#1348)
Browse files Browse the repository at this point in the history
- New component created for assessment actions row to include delete
logic and clean up files.
- Get tag create working again in preparation for auto answer by tag
work integration
- Wire up archetype crud to api
- Move assessment code to its own page in directory structure 
- Remove deprecated bulk copy code
- Remove assess application hook
- Update risk code to use hub api values for risk on assessment
- Remove deprecated rest handlers for getAssessments

---------

Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 authored Sep 14, 2023
1 parent 3ff9fe9 commit 88ae668
Show file tree
Hide file tree
Showing 105 changed files with 1,967 additions and 2,607 deletions.
8 changes: 4 additions & 4 deletions client/src/app/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,25 @@ type RiskListType = {
// t('risks.unknown')

export const RISK_LIST: RiskListType = {
GREEN: {
green: {
i18Key: "risks.low",
hexColor: "#68b240",
labelColor: "green",
sortFactor: 1,
},
AMBER: {
yellow: {
i18Key: "risks.medium",
hexColor: "#f0ab0b",
labelColor: "orange",
sortFactor: 2,
},
RED: {
red: {
i18Key: "risks.high",
hexColor: "#cb440d",
labelColor: "red",
sortFactor: 3,
},
UNKNOWN: {
unknown: {
i18Key: "risks.unknown",
hexColor: black.value,
labelColor: "grey",
Expand Down
12 changes: 8 additions & 4 deletions client/src/app/Paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ export enum Paths {
applicationsAssessmentTab = "/applications/assessment-tab",
applicationsImports = "/applications/application-imports",
applicationsImportsDetails = "/applications/application-imports/:importId",
archetypesAssessment = "/archetypes/assessment/:assessmentId",
applicationsAssessment = "/applications/assessment/:assessmentId",
assessmentActions = "/applications/assessment-actions/:applicationId",
applicationAssessmentActions = "/applications/assessment-actions/:applicationId",
archetypeAssessmentActions = "/archetypes/assessment-actions/:archetypeId",
assessmentSummary = "/applications/assessment-summary/:assessmentId",
applicationsReview = "/applications/application/:applicationId/review",
applicationsReview = "/applications/:applicationId/review",
applicationsAnalysis = "/applications/analysis",
archetypes = "/archetypes",
controls = "/controls",
Expand Down Expand Up @@ -50,11 +52,13 @@ export interface AssessmentRoute {
}

export interface AssessmentActionsRoute {
applicationId: string;
applicationId?: string;
archetypeId?: string;
}

export interface ReviewRoute {
applicationId: string;
applicationId?: string;
archetypeId?: string;
}

export interface ImportSummaryRoute {
Expand Down
45 changes: 28 additions & 17 deletions client/src/app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@ import { RepositoriesGit } from "./pages/repositories/Git";
import { RepositoriesMvn } from "./pages/repositories/Mvn";
import { RepositoriesSvn } from "./pages/repositories/Svn";
import { Paths } from "@app/Paths";
import { ApplicationAssessment } from "./pages/applications/application-assessment/application-assessment";
import { RouteWrapper } from "./components/RouteWrapper";
import { adminRoles, devRoles } from "./rbac";
import { ErrorBoundary } from "react-error-boundary";
import { ErrorFallback } from "@app/components/ErrorFallback";
import { FEATURES_ENABLED } from "./FeatureFlags";

const Assessment = lazy(() => import("./pages/assessment/assessment-page"));
const Review = lazy(() => import("./pages/review/review-page"));
const AssessmentSettings = lazy(
() =>
import(
"./pages/assessment-management/assessment-settings/assessment-settings-page"
)
);
const Applications = lazy(() => import("./pages/applications"));
const ManageImports = lazy(() => import("./pages/applications/manage-imports"));
const ImportDetails = lazy(
() => import("./pages/applications/manage-imports-details")
);

const Reviews = lazy(() => import("./pages/applications/application-review"));
const Reports = lazy(() => import("./pages/reports"));
const Controls = lazy(() => import("./pages/controls"));
const Identities = lazy(() => import("./pages/identities"));
Expand All @@ -34,27 +40,22 @@ const AffectedApplications = lazy(
);
const Dependencies = lazy(() => import("./pages/dependencies"));

const AssessmentSettings = lazy(
() =>
import(
"./pages/assessment-management/assessment-settings/assessment-settings-page"
)
);

const Questionnaire = lazy(
() => import("./pages/assessment-management/questionnaire/questionnaire-page")
);

const AssessmentActions = lazy(
() =>
import("./pages/applications/assessment-actions/assessment-actions-page")
import(
"./pages/assessment/components/assessment-actions/assessment-actions-page"
)
);
const Archetypes = lazy(() => import("./pages/archetypes/archetypes-page"));

const AssessmentSummary = lazy(
() =>
import(
"./pages/applications/application-assessment/components/assessment-summary/assessment-summary-page"
"./pages/assessment/components/assessment-summary/assessment-summary-page"
)
);
export interface IRoute {
Expand All @@ -75,24 +76,34 @@ export const devRoutes: IRoute[] = [
comp: ManageImports,
exact: false,
},
{
path: Paths.archetypesAssessment,
comp: Assessment,
exact: false,
},
{
path: Paths.applicationsAssessment,
comp: ApplicationAssessment,
comp: Assessment,
exact: false,
},
{
path: Paths.applicationsReview,
comp: Review,
exact: false,
},
{
path: Paths.assessmentActions,
path: Paths.applicationAssessmentActions,
comp: AssessmentActions,
exact: false,
},
{
path: Paths.assessmentSummary,
comp: AssessmentSummary,
path: Paths.archetypeAssessmentActions,
comp: AssessmentActions,
exact: false,
},
{
path: Paths.applicationsReview,
comp: Reviews,
path: Paths.assessmentSummary,
comp: AssessmentSummary,
exact: false,
},
{
Expand Down
29 changes: 9 additions & 20 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ export interface Application {
}

export interface Review {
id?: number;
id: number;
proposedAction: ProposedAction;
effortEstimate: EffortEstimate;
businessCriticality: number;
workPriority: number;
comments?: string;
application?: Application;
application?: Ref;
}

export interface ApplicationDependency {
Expand Down Expand Up @@ -172,13 +172,6 @@ export interface ApplicationImport {
isValid: boolean;
}

export interface BulkCopyReview {
id?: number;
sourceReview: number;
targetApplications: number[];
completed?: boolean;
}

export type IdentityKind =
| "source"
| "maven"
Expand Down Expand Up @@ -214,13 +207,6 @@ export interface Proxy {
enabled: boolean;
}

export interface BulkCopyAssessment {
bulkId?: number;
fromAssessmentId: number;
applications: { applicationId: number }[];
completed?: boolean;
}

// Pagination

export interface BusinessServicePage {
Expand Down Expand Up @@ -703,7 +689,7 @@ export interface Thresholds {
yellow: number;
}
export type AssessmentStatus = "empty" | "started" | "complete";
export type Risk = "GREEN" | "AMBER" | "RED" | "UNKNOWN";
export type Risk = "green" | "yellow" | "red" | "unknown";

export interface InitialAssessment {
application?: Ref;
Expand All @@ -720,6 +706,8 @@ export interface Assessment
description: string;
status: AssessmentStatus;
risk: Risk;
stakeholders: Ref[];
stakeholderGroups: Ref[];
}
export interface CategorizedTag {
category: TagCategory;
Expand Down Expand Up @@ -757,9 +745,10 @@ export interface Archetype {
description: string;
comments: string;
criteriaTags: Tag[];
archetypeTags: Tag[];
tags: Tag[];
assessmentTags?: Tag[];
stakeholders?: Stakeholder[];
stakeholderGroups?: StakeholderGroup[];
stakeholders?: Ref[];
stakeholderGroups?: Ref[];
applications?: Application[];
assessments?: Ref[];
}
Loading

0 comments on commit 88ae668

Please sign in to comment.