-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Remove pathfinder and convert assessment wizard to use new api #1315
✨ Remove pathfinder and convert assessment wizard to use new api #1315
Conversation
48a8986
to
0072127
Compare
01ca3db
to
d561af2
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1315 +/- ##
==========================================
- Coverage 42.92% 42.54% -0.38%
==========================================
Files 146 136 -10
Lines 4454 4207 -247
Branches 1040 1000 -40
==========================================
- Hits 1912 1790 -122
+ Misses 2530 2405 -125
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that was a lot to look through, but lots of consistent object/name changes.
Overall my impressions are it looks good. Maybe a bit more thought will need to go in to handling multiple assessments for a single application (no matter where the assessments are sourced) in terms of showing application/assessment statuses. A single status icon may not be comprehensive enough in the table. Not sure on that.
export const getAssessmentsPromise = (filters: { | ||
applicationId?: number | string; | ||
}): Promise<Assessment[]> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about just using destructuring (also kinda a nit-pick):
export const getAssessmentsPromise = (filters: { | |
applicationId?: number | string; | |
}): Promise<Assessment[]> => { | |
export const getAssessmentsPromise = ({ applicationId }: { | |
applicationId?: number | string; | |
}): Promise<Assessment[]> => { |
and then just using applicationId
later?
Not that it is applicable here, but default values are pretty easy this way. For example:
export const getAssessments = ({
applicationId = 1,
}: { applicationId?: number | string } = {}) => {
const query: string[] = buildQuery({ applicationId });
return axios.get(`${ASSESSMENTS}?${query.join("&")}`);
};
(the extra default param = {}
takes care of calls like getAssessments()
or getAssessments(null)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is a good idea. All of this code is also going to be deleted as soon as the back end guys finish the /applications/:id/assessments endpoint. This query param will go away entirely.
</ApplicationAssessmentPageHeader> | ||
); | ||
expect(wrapper).toMatchSnapshot(); | ||
it.skip("Renders without crashing", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought on the render tests --
We can reuse the MSW layer to provide simple applications/assessments/etc for the render tests. It would be a step towards a fully mocked static demo UI. For some basic background on MSW on node/jest: https://mswjs.io/docs/getting-started/integrate/node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to open an issue for this to circle back on.
...cation-assessment/components/application-assessment-wizard/application-assessment-wizard.tsx
Outdated
Show resolved
Hide resolved
@@ -39,11 +39,10 @@ export const AssessmentStakeholdersForm: React.FC = () => { | |||
const { setValue, control, formState } = | |||
useFormContext<ApplicationAssessmentWizardValues>(); | |||
|
|||
const { stakeholders } = useFetchStakeholders(); | |||
// const { stakeholders } = useFetchStakeholders(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self - stakeholder work is on the TODO list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we need the hub guys to add stakeholders/stakeholderGroups to the assessment struct.
client/src/app/pages/applications/assessment-actions/components/assessment-actions-table.tsx
Outdated
Show resolved
Hide resolved
const { t } = useTranslation(); | ||
const { assessment } = useFetchAssessmentByID(assessments?.[0]?.id || 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limiting the application to a the single first assessment is temporary?
Will there be times where the status of multiple assessments for a single application will be available and shown?
If there are multiple, will the 0th assessment always be the most current one and that is the one to show the status on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a great question re: how are we showing net questionnaire status with multiple potential active questionnaires/assessments.
I raised this with Justin & Jeff. Not sure if we can expect a hub status for applications / archetypes around status. Probably need to think about if we want to perform an operation to check if "some" of the assessments have an in progress status etc. I will open an issue around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like currently there is an "assessed" bool on the application within the hub struct. So maybe we just keep it simple for now and use that.
client/src/app/pages/assessment-management/questionnaire/questionnaire-page.tsx
Outdated
Show resolved
Hide resolved
31b62bf
to
8775e40
Compare
Signed-off-by: ibolton336 <ibolton@redhat.com>
8775e40
to
8f64628
Compare
Signed-off-by: ibolton336 <ibolton@redhat.com>
8f64628
to
a9282ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little late finishing my review but LGTM :)
Screen.Recording.2023-08-30.at.10.19.07.AM.mov
This pull request aims to start the development of the single-app application assessment flow. It includes the addition of a full flow for the assessment process against the new data model, updates to match the latest Go structs from the hub PR, removal of pathfinder-specific elements, creation of msw mocks to handle assessment initial post and patch operations, and a few other things.
Changes Made:
TODO: