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

[TTAHUB-3402] Hook up QA widgets to BE #2394

Open
wants to merge 37 commits into
base: al-ttahub-3316-3317-overview-widgets
Choose a base branch
from

Conversation

AdamAdHocTeam
Copy link
Collaborator

@AdamAdHocTeam AdamAdHocTeam commented Oct 1, 2024

Description of change

This hooks up the new QA dashboard to the SSDI.

How to test

  • Review the code
  • Make sure all widgets are displaying correctly
  • Verify filters work correctly
  • Sorting and exporting should work as it does on other pages

Issue(s)

Checklists

Every PR

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • Boundary diagram updated
  • Logical Data Model updated
  • Architectural Decision Records written for major infrastructure decisions
  • UI review complete

Before merge to main

  • OHS demo complete
  • Ready to create production PR

Production Deploy

  • Staging smoke test completed

After merge/deploy

  • Update JIRA ticket status

@AdamAdHocTeam AdamAdHocTeam changed the base branch from main to al-ttahub-3316-3317-overview-widgets October 1, 2024 15:16
AdamAdHocTeam and others added 28 commits October 1, 2024 15:36
@AdamAdHocTeam AdamAdHocTeam marked this pull request as ready for review October 15, 2024 20:41
@thewatermethod
Copy link
Collaborator

thewatermethod commented Oct 16, 2024

Looked at this branch on dev, on the main QA dash landing page the filters don't seem to update the page

@thewatermethod
Copy link
Collaborator

The new dashboard routes 404 and I also don't see them in your code so I expect you have a bad merge w/main

@AdamAdHocTeam
Copy link
Collaborator Author

The new dashboard routes 404 and I also don't see them in your code so I expect you have a bad merge w/main

Bad merge should now be fixed.

@thewatermethod
Copy link
Collaborator

Verify filters work correctly

First two filters I tried on the landing page:

  1. Report ID contains does not change the result set as far as I can tell, at least on the overview widget
  2. Created on throws an error
    Screenshot 2024-10-17 at 9 27 49 AM

Comment on lines 48 to 49
'region',
'regionIds',
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was waiting till Garrett updated the BE, I have removed it.

const url = getSelfServiceUrl(filterName, filters);

const response = await get(url);
const urlToUse = url + (dataSetSelection && dataSetSelection.length ? dataSetSelection.map((s) => `&dataSetSelection[]=${s}`).join('') : '');
Copy link
Collaborator

@thewatermethod thewatermethod Oct 17, 2024

Choose a reason for hiding this comment

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

do we need to account for this case (dataSetSelection is falsy?) If so, did we add a test?
Note also there is no need to check for length: if dataSetSelection is empty, the map will be an empty array and will join out to be the same as your else statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed checks.

Comment on lines 25 to 31
const requestSort = useCallback((sortBy, passedDirection = null) => {
// Get sort direction.
let direction = 'asc';
if (
if (passedDirection) {
// If the direction is passed, use it.
direction = passedDirection;
} else if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you leave a comment explaining why we need to optionally override the sortConfig direction?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just seems like you could mutate the object that already has the direction in it instead of adding another parameter and all this additional logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a comment.

This seems to just take the opposite of whats currently set in the sortConfig (arrow sort).

@@ -15,7 +17,7 @@ function GoalCard({
<DataRow
label="Goal number"
value={(
<Link to="recipient-tta-records/376/region/1/goals?id[]=83697">
<Link to={`../../recipient-tta-records/${recipientId}/region/${regionId}/goals?id[]=${goal.id}`}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor but I don't think you need the ../../, just starting with "/recipient-tta-records" should do it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are correct.

});
updateError('');
} catch (e) {
updateError('Unable to fetch QA data');
Copy link
Collaborator

Choose a reason for hiding this comment

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

No test for this case I don't think

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@@ -24,7 +24,7 @@ const DEFAULT_SORT_CONFIG = {
activePage: 1,
};

export default function PercentageActivityReportByRole({ data }) {
export default function PercentageActivityReportByRole({ data, loading }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I left the loading attribute off these graphs on purpose; we don't really want all those announcements/mini "loading" spinners since the whole page is wrapped in a loader. There's an outstanding accessibility ticket to fix it. everywhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok I removed loaders from all of the individual widgets and just added one loader on the dashboard itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been cleaned up.

}
}
// Call resources fetch.
fetchQaDat();
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we fix the spelling of this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

});
updateError('');
} catch (e) {
updateError('Unable to fetch QA data');
Copy link
Collaborator

Choose a reason for hiding this comment

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

no test for this case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

});
updateError('');
} catch (e) {
updateError('Unable to fetch QA data');
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comments as before, no test for this case that I can see, and the function has a typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added test fixed typo

@AdamAdHocTeam
Copy link
Collaborator Author

Verify filters work correctly

First two filters I tried on the landing page:

  1. Report ID contains does not change the result set as far as I can tell, at least on the overview widget
  2. Created on throws an error
    Screenshot 2024-10-17 at 9 27 49 AM

This should be fixed in Garrett's latest push.

@thewatermethod
Copy link
Collaborator

FYI @AdamAdHocTeam, @GarrettEHill Dashboard no longer loads any data at all

@AdamAdHocTeam
Copy link
Collaborator Author

FYI @AdamAdHocTeam, @GarrettEHill Dashboard no longer loads any data at all

@thewatermethod this should be good now @GarrettEHill resolved the BE issues.

@thewatermethod
Copy link
Collaborator

thewatermethod commented Oct 18, 2024

@AdamAdHocTeam @GarrettEHill
I noticed that the total number of reports (11,510) on delivery method and percentage of activity reports by role does not change, I think that needs to be hooked up to the backend.

Filters that error:

  • Created on
  • Date started
  • Date ended
  • Group
  • Reasons
  • Recipient name
  • State, if you pick more than one

Filters that do not seem to update the data (none of the charts, even the ones that would make sense to update, lke the root cause chart)

Please double check these are being applied

  • Goal status
  • FEI root cause
  • Goal text
  • Target population
  • Number of recipients
  • Specialist roles
  • TTA type

These only apply to the landing page; when I started picking through the sub pages I found similar issues but I'm not going to document them rn

@AdamAdHocTeam
Copy link
Collaborator Author

AdamAdHocTeam commented Oct 18, 2024

@AdamAdHocTeam @GarrettEHill I noticed that the total number of reports (11,510) on delivery method and percentage of activity reports by role does not change, I think that needs to be hooked up to the backend.

Filters that error:

  • Created on
  • Date started
  • Date ended
  • Group
  • Reasons
  • Recipient name
  • State, if you pick more than one

Filters that do not seem to update the data (none of the charts, even the ones that would make sense to update, lke the root cause chart)

Please double check these are being applied

  • Goal status
  • FEI root cause
  • Goal text
  • Target population
  • Number of recipients
  • Specialist roles
  • TTA type

These only apply to the landing page; when I started picking through the sub pages I found similar issues but I'm not going to document them rn

@GarrettEHill can you please have a look at this on Monday seems we are missing data points and filters.

const totalRecipients = widgetData ? widgetData.total : 0;
const grants = widgetData ? widgetData['grants with class'] : 0;
const pct = widgetData ? widgetData['% recipients with class'] : 0;
const recipoientsWithClass = widgetData ? widgetData['recipients with class'] : 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

spelling

@thewatermethod
Copy link
Collaborator

@AdamAdHocTeam

I noticed that the total number of reports (11,510) on delivery method and percentage of activity reports by role does not change, I think that needs to be hooked up to the backend.

This is a frontend change, they were hardcoded in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants