Skip to content
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

✨ Reports: select Questionnaires #1374

Merged
merged 12 commits into from
Sep 21, 2023
Merged

✨ Reports: select Questionnaires #1374

merged 12 commits into from
Sep 21, 2023

Conversation

gildub
Copy link
Contributor

@gildub gildub commented Sep 19, 2023

Shows selection of possible questionnaires of current assessments
Pass to <Landscape>:

  • If "All questionnaires" option has been selected then the whole assessments list is passed
  • When a specific questionnaire is selected then only the assessments bound to that questionnaire are passed.

The consolidation of the risks is left to be handled by the Landscape component in following PR.

#1305

image

@gildub gildub self-assigned this Sep 19, 2023
@gildub gildub requested a review from ibolton336 September 19, 2023 16:08
@ibolton336 ibolton336 added the Custom Assessment Items relating to custom assessment work label Sep 19, 2023
@gildub gildub changed the title ✨ Reports: select Questionnaires ✨ [WIP] Reports: select Questionnaires Sep 19, 2023
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Patch coverage: 28.57% and project coverage change: -0.03% ⚠️

Comparison is base (bac5ce1) 41.55% compared to head (d087521) 41.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1374      +/-   ##
==========================================
- Coverage   41.55%   41.53%   -0.03%     
==========================================
  Files         137      137              
  Lines        4283     4290       +7     
  Branches     1035     1036       +1     
==========================================
+ Hits         1780     1782       +2     
- Misses       2415     2420       +5     
  Partials       88       88              
Flag Coverage Δ
client 41.53% <28.57%> (-0.03%) ⬇️
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
client/src/app/api/models.ts 100.00% <ø> (ø)
client/src/app/queries/assessments.ts 26.08% <20.00%> (-0.75%) ⬇️
client/src/app/api/rest.ts 49.71% <50.00%> (+<0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gildub gildub changed the title ✨ [WIP] Reports: select Questionnaires ✨ Reports: select Questionnaires Sep 19, 2023
@gildub gildub requested a review from ibolton336 September 19, 2023 21:09
Copy link
Member

@ibolton336 ibolton336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data still being driven from questionnaires.

client/src/app/pages/reports/reports.tsx Show resolved Hide resolved
@gildub gildub requested a review from ibolton336 September 19, 2023 21:22
@ibolton336
Copy link
Member

Screenshot 2023-09-19 at 6 28 48 PM

Copy link
Member

@ibolton336 ibolton336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reports page crashes on load when navigating from applications section

@gildub
Copy link
Contributor Author

gildub commented Sep 20, 2023

@ibolton336, loading has been addressed.

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually see where the Landscape component is sensitive to a selected questionnaire. What am I missing?

Comment on lines 113 to 119
<Donut
value={landscapeData.high}
total={applications.length}
color={RISK_LIST["red"].hexColor}
riskLabel={t("terms.highRisk")}
riskDescription={t("terms.unsuitableForContainers")}
color={RISK_LIST["green"].hexColor}
riskLabel={t("colors.green")}
// riskDescription={}
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this one is 'green', should the value be switched to landscapeData.low?

client/src/app/pages/reports/reports.tsx Outdated Show resolved Hide resolved
<Landscape />
<Landscape
assessments={
selectedQuestionnaire === "All questionnaires"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swap out the string for a constant for safety

client/src/app/pages/reports/reports.tsx Outdated Show resolved Hide resolved
client/src/app/pages/reports/reports.tsx Outdated Show resolved Hide resolved
@gildub gildub requested review from sjd78 and ibolton336 September 21, 2023 11:49
Signed-off-by: Gilles Dubreuil <[email protected]>
@sjd78 sjd78 merged commit 44a40e8 into konveyor:main Sep 21, 2023
6 checks passed
@sjd78 sjd78 mentioned this pull request Sep 21, 2023
4 tasks
@gildub gildub deleted the reports-questionnaires-dropdown branch September 21, 2023 20:01
sjd78 added a commit to sjd78/tackle2-ui that referenced this pull request Sep 22, 2023
Custom assessments changes risk and confidence to be accessed from
`Assessment` and not `Application`.  The reports page in general, and
the `Landscape` component in specific need to be updated to use risk
values from `Assessment`.

Summary of Change:
  - `Reports`
    - Fetch `Questionnaires` and `Assessments` to allow easy use
      in the Questionnaire select menu
    - Adjust the `Card`s to be clickable and selectable when we provide
      custom actions (to avoid a console warning)

  - `Landscape`
    - Use data from props instead of fetching any additional data. The
      containing component is now responsible for controlling the
      source data.
    - Aggregate risk data into buckets matching `Risk` options
    - Setup responsive layout so the donut charts wrap nicely when the
      view becomes narrow

  - `Donut`
    - Force `id` to be provided
    - Set the width to `200px`
    - Make sure content lines up centered in its container

  - Deprecated `useFetchRisks()`

Enhancement: https://github.com/konveyor/enhancements/blob/90b827b68cc367284a66bf66f087d5c263487e05/enhancements/assessment-module/README.md#changes-in-the-application-reports-view
Part Of: konveyor#1305
Follow Up: konveyor#1374

Signed-off-by: Scott J Dickerson <[email protected]>
sjd78 added a commit to sjd78/tackle2-ui that referenced this pull request Sep 22, 2023
Custom assessments changes risk and confidence to be accessed from
`Assessment` and not `Application`.  The reports page in general, and
the `Landscape` component in specific need to be updated to use risk
values from `Assessment`.

Summary of Change:
  - `Reports`
    - Fetch `Questionnaires` and `Assessments` to allow easy use
      in the Questionnaire select menu
    - Adjust the `Card`s to be clickable and selectable when we provide
      custom actions (to avoid a console warning)

  - `Landscape`
    - Use data from props instead of fetching any additional data. The
      containing component is now responsible for controlling the
      source data.
    - Aggregate risk data into buckets matching `Risk` options
    - Setup responsive layout so the donut charts wrap nicely when the
      view becomes narrow

  - `Donut`
    - Force `id` to be provided
    - Set the width to `200px`
    - Make sure content lines up centered in its container

  - Deprecated `useFetchRisks()`

Enhancement: https://github.com/konveyor/enhancements/blob/90b827b68cc367284a66bf66f087d5c263487e05/enhancements/assessment-module/README.md#changes-in-the-application-reports-view
Part Of: konveyor#1305
Follow Up: konveyor#1374

Signed-off-by: Scott J Dickerson <[email protected]>
ibolton336 added a commit that referenced this pull request Sep 25, 2023
# Summary
Custom assessments changes risk and confidence to be accessed from
`Assessment` and not `Application`. The reports page in general, and the
`Landscape` component in specific need to be updated to use risk values
from `Assessment`.

## Changes
`Reports`
- Fetch `Questionnaires` and `Assessments` to allow easy use in the
Questionnaire select menu
- Adjust the `Card`s to be clickable and selectable when we provide
custom actions (to avoid a console warning)

`Landscape`
- Use data from props instead of fetching any additional data. The
containing component is now responsible for controlling the source data.
- Aggregate risk data into buckets matching `Risk` options - Setup
responsive layout so the donut charts wrap nicely when the view becomes
narrow

`Donut`
  - Force `id` to be provided
  - Set the width to `200px`
  - Make sure content lines up centered in its container

Deprecated `useFetchRisks()`

## Screenshots
All questionnaires:

![image](https://github.com/konveyor/tackle2-ui/assets/3985964/9711a2b9-aa7d-4d00-b1fc-22402e97f727)

Single questionnaire:

![image](https://github.com/konveyor/tackle2-ui/assets/3985964/30cb1134-c368-4843-9534-d532db2b320a)


## References
Enhancement:
https://github.com/konveyor/enhancements/blob/90b827b68cc367284a66bf66f087d5c263487e05/enhancements/assessment-module/README.md#changes-in-the-application-reports-view
Part Of: #1305
Follow Up: #1374

Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Ian Bolton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Custom Assessment Items relating to custom assessment work
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants