Skip to content

Commit

Permalink
✨ Initial Assessment page (konveyor#1268)
Browse files Browse the repository at this point in the history
The hub is going to provide Questionnaire type so the legacy
Questionnaire (in model.ts) is renamed PathfinderQuestionnaire which is
likely to become obsolete.

This uses PF5 Dropdown for Kebab menu instead of deprecated Dropdown.


![image](https://github.com/konveyor/tackle2-ui/assets/1901741/4e847ee6-a175-4364-80b2-3ced296f8a5a)

Resolves konveyor#1260
  • Loading branch information
gildub authored Aug 9, 2023
1 parent db53222 commit e07b603
Show file tree
Hide file tree
Showing 9 changed files with 639 additions and 3 deletions.
10 changes: 9 additions & 1 deletion client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"delete": "Delete",
"discardAssessment": "Discard assessment/review",
"downloadCsvTemplate": "Download CSV template",
"download": "Download {{what}}",
"edit": "Edit",
"export": "Export",
"filterBy": "Filter by {{what}}",
Expand All @@ -47,6 +48,7 @@
"selectNone": "Select none",
"selectPage": "Select page",
"submitReview": "Submit review",
"view": "View",
"viewErrorReport": "View error report"
},
"colors": {
Expand Down Expand Up @@ -101,8 +103,11 @@
"copyApplicationAssessmentFrom": "Copy {{what}} assessment",
"delete": "Delete {{what}}?",
"discard": "Discard {{what}}?",
"download": "Download {{what}}",
"edit": "Edit {{what}}",
"export": "Export {{what}}",
"importApplicationFile": "Import application file",
"import": "Import {{what}}",
"leavePage": "Leave page",
"new": "New {{what}}",
"newApplication": "New application",
Expand Down Expand Up @@ -302,6 +307,8 @@
"proxyConfig": "Proxy configuration",
"proxyConfigDetails": "Manage connections to proxy servers",
"question": "Question",
"questionnaire": "Questionnaire",
"questionnaires": "Questionnaires",
"rank": "Rank",
"project": "Project",
"refresh": "Refresh",
Expand Down Expand Up @@ -356,7 +363,8 @@
"user": "User",
"version": "Version",
"workPriority": "Work priority",
"tag": "Tag"
"tag": "Tag",
"YAMLTemplate": "YAML template"
},
"toastr": {
"success": {
Expand Down
1 change: 1 addition & 0 deletions client/src/app/Paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export enum Paths {
repositoriesMvn = "/repositories/maven",
proxies = "/proxies",
migrationTargets = "/migration-targets",
assessment = "/assessment",
jira = "/jira",
}

Expand Down
6 changes: 6 additions & 0 deletions client/src/app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const AffectedApplications = lazy(
() => import("./pages/issues/affected-applications")
);
const Dependencies = lazy(() => import("./pages/dependencies"));
const Questionnaires = lazy(() => import("./pages/assessment"));

export interface IRoute {
path: string;
Expand Down Expand Up @@ -120,6 +121,11 @@ export const devRoutes: IRoute[] = [
},
]
: []),
{
path: Paths.assessment,
comp: Questionnaires,
exact: false,
},
];

export const adminRoutes: IRoute[] = [
Expand Down
14 changes: 12 additions & 2 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ export interface Assessment {
status: AssessmentStatus;
stakeholders?: number[];
stakeholderGroups?: number[];
questionnaire: Questionnaire;
questionnaire: PathfinderQuestionnaire;
}

export interface Questionnaire {
export interface PathfinderQuestionnaire {
categories: QuestionnaireCategory[];
}

Expand Down Expand Up @@ -704,3 +704,13 @@ export type HubFile = {
name: string;
path: string;
};

export interface Questionnaire {
id: number;
required: boolean;
name: string;
questions: number;
rating: string;
dateImported: string;
system: boolean;
}
15 changes: 15 additions & 0 deletions client/src/app/api/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
Rule,
Target,
HubFile,
Questionnaire,
} from "./models";
import { QueryKey } from "@tanstack/react-query";
import { serializeRequestParamsForHub } from "@app/hooks/table-controls";
Expand Down Expand Up @@ -106,6 +107,8 @@ export const ANALYSIS_ISSUES = HUB + "/analyses/issues";
export const ANALYSIS_ISSUE_INCIDENTS =
HUB + "/analyses/issues/:issueId/incidents";

export const QUESTIONNAIRES = HUB + "/questionnaires";

// PATHFINDER
export const PATHFINDER = "/hub/pathfinder";
export const ASSESSMENTS = PATHFINDER + "/assessments";
Expand Down Expand Up @@ -739,3 +742,15 @@ export const getProxies = (): Promise<Proxy[]> =>

export const updateProxy = (obj: Proxy): Promise<Proxy> =>
axios.put(`${PROXIES}/${obj.id}`, obj);

// Questionnaires

export const getQuestionnaires = (): Promise<Questionnaire[]> =>
axios.get(QUESTIONNAIRES).then((response) => response.data);

export const updateQuestionnaire = (
obj: Questionnaire
): Promise<Questionnaire> => axios.put(`${QUESTIONNAIRES}/${obj.id}`, obj);

export const deleteQuestionnaire = (id: number): Promise<Questionnaire> =>
axios.delete(`${QUESTIONNAIRES}/${id}`);
5 changes: 5 additions & 0 deletions client/src/app/layout/SidebarApp/SidebarApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ export const SidebarApp: React.FC = () => {
</NavItem>
</NavExpandable>
) : null}
<NavItem>
<NavLink to={Paths.assessment} activeClassName="pf-m-current">
Assessment
</NavLink>
</NavItem>
</NavList>
)}
</Nav>
Expand Down
Loading

0 comments on commit e07b603

Please sign in to comment.