Skip to content

Commit

Permalink
Merge pull request #2184 from HHS/main
Browse files Browse the repository at this point in the history
[Prod] Open HSES links in new tabs, create QA dashboard scaffold, adjust import schedule
  • Loading branch information
Jones-QuarteyDana authored Jun 4, 2024
2 parents f28aa1f + c7a2faa commit 6bcf644
Show file tree
Hide file tree
Showing 42 changed files with 294 additions and 1,707 deletions.
2 changes: 1 addition & 1 deletion docs/logical_data_model.encoded

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/logical_data_model.puml
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,7 @@ class Users{
enum enum_Users_flags {
anv_statistics
closed_goal_merge_override
quality_assurance_dashboard
regional_goal_dashboard
training_reports_dashboard
}
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import Group from './pages/AccountManagement/Group';
import SessionForm from './pages/SessionForm';
import ViewTrainingReport from './pages/ViewTrainingReport';
import useGaUserData from './hooks/useGaUserData';
import QADashboard from './pages/QADashboard';

const WHATSNEW_NOTIFICATIONS_KEY = 'whatsnew-read-notifications';

Expand Down Expand Up @@ -307,6 +308,24 @@ function App() {
</AppWrapper>
)}
/>
<Route
exact
path="/dashboards/qa-dashboard"
render={() => (
<FeatureFlag
renderNotFound
flag="quality_assurance_dashboard"
>
<AppWrapper
authenticated
logout={logout}
hasAlerts={!!(alert)}
>
<QADashboard />
</AppWrapper>
</FeatureFlag>
)}
/>
<Route
exact
path="/dashboards/regional-dashboard/activity-reports"
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/components/SiteNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ const SiteNav = ({
Resource Dashboard
</NavLink>
</li>
<FeatureFlag flag="quality_assurance_dashboard">
<li>
<NavLink
to="/dashboards/qa-dashboard"
>
Quality Assurance Dashboard
</NavLink>
</li>
</FeatureFlag>
<li>
<NavLink
to="/recipient-tta-records"
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/pages/QADashboard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { Helmet } from 'react-helmet';

export default function QADashboard() {
return (
<>
<Helmet>
<title>Quality Assurance Dashboard</title>
</Helmet>
<div className="ttahub-dashboard">
<h1 className="landing margin-top-0 margin-bottom-3">
Quality assurance dashboard
</h1>
</div>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ const ClassReview = ({ grantNumber, recipientId, regionId }) => {
className="display-flex flex-align-center"
href={`https://hses.ohs.acf.hhs.gov/grant-summary/?grant=${grantNumber}`}
arial-label={`HSES CLASS scores for grant ${grantNumber}`}
target="_blank"
rel="noopener noreferrer"
>
HSES CLASS
{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const MonitoringReview = ({ grantNumber, regionId, recipientId }) => {
className="display-flex flex-align-center"
href={`https://hses.ohs.acf.hhs.gov/monitoring/grant?grant=${grantNumber}`}
aria-label={`HSES monitoring for grant ${grantNumber}`}
target="_blank"
rel="noopener noreferrer"
>
HSES monitoring
{' '}
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const FEATURE_FLAGS = [
'regional_goal_dashboard',
'closed_goal_merge_override',
'training_reports_dashboard',
'quality_assurance_dashboard',
];

const MAINTENANCE_CATEGORY = {
Expand Down
4 changes: 2 additions & 2 deletions src/goalServices/changeGoalStatus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const mockUser = {

describe('changeGoalStatus service', () => {
let user;
let userRole;
let role;
let goal;
let grant;
Expand Down Expand Up @@ -47,7 +46,7 @@ describe('changeGoalStatus service', () => {
name: 'Astronaut',
isSpecialist: true,
});
userRole = await db.UserRole.create({
await db.UserRole.create({
userId: user.id,
roleId: role.id,
});
Expand All @@ -61,6 +60,7 @@ describe('changeGoalStatus service', () => {
await db.UserRole.destroy({ where: { userId: user.id } });
await db.Role.destroy({ where: { id: role.id } });
await db.User.destroy({ where: { id: mockUser.id } });
await db.sequelize.close();
});

it('should change the status of a goal and create a status change log', async () => {
Expand Down
2 changes: 2 additions & 0 deletions src/goalServices/getGoalsByActivityRecipient.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ describe('Goals by Recipient Test', () => {
where: {
id: topic.id,
},
individualHooks: true,
force: true,
});

// Delete Objectives.
Expand Down
6 changes: 6 additions & 0 deletions src/goalServices/getGoalsForReport.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ describe('getGoalsForReport', () => {
},
});

await User.destroy({
where: {
id: user.id,
},
});

await sequelize.close();
});
it('returns the correct number of goals and objectives', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,43 @@ describe('getGoalsMissingDataForActivityReportSubmission', () => {
where: {
goalId: goalOne.id,
},
individualHooks: true,
});

await GoalTemplateFieldPrompt.destroy({
where: {
goalTemplateId: template.id,
},
individualHooks: true,
});

await Goal.destroy({
where: {
id: [goalOne.id, goalTwo.id],
},
force: true,
individualHooks: true,
});

await GoalTemplate.destroy({
where: {
id: template.id,
},
individualHooks: true,
});

await Grant.destroy({
where: {
id: activeGrant.id,
},
individualHooks: true,
});

await Recipient.destroy({
where: {
id: recipient.id,
},
individualHooks: true,
});

await sequelize.close();
Expand Down
45 changes: 32 additions & 13 deletions src/goalServices/goalWithCache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ import { REPORT_STATUSES } from '@ttahub/common';
import {
saveGoalsForReport,
} from './goals';
import {
import db, {
Goal,
Grant,
ActivityReport,

ActivityReportGoal,
Recipient,
GoalTemplateFieldPrompt,
GoalFieldResponse,
ActivityReportGoalFieldResponse,
} from '../models';
import { createReport, destroyReport } from '../testUtils';

describe('saveGoalsForReport multi recipient', () => {
// Recipients.
Expand Down Expand Up @@ -78,12 +79,19 @@ describe('saveGoalsForReport multi recipient', () => {
});

// Create activity report.
multiRecipientActivityReport = await ActivityReport.create({
submissionStatus: REPORT_STATUSES.DRAFT,
regionId: 1,
userId: 1,
activityRecipientType: 'recipient',
version: 2,
multiRecipientActivityReport = await createReport({
status: REPORT_STATUSES.DRAFT,
activityRecipients: [
{
grantId: multiRecipientGrantOneA.id,
},
{
grantId: multiRecipientGrantOneB.id,
},
{
grantId: multiRecipientGrantTwo.id,
},
],
});

// Create goals.
Expand Down Expand Up @@ -152,49 +160,60 @@ describe('saveGoalsForReport multi recipient', () => {
where: {
activityReportGoalId: activityReportGoalIds,
},
individualHooks: true,
});

// Delete ActivityReportGoals.
await ActivityReportGoal.destroy({
where: {
id: activityReportGoalIds,
},
individualHooks: true,
});

// Delete GoalFieldResponses.
await GoalFieldResponse.destroy({
where: {
goalId: [multiRecipientGoalOneA.id, multiRecipientGoalOneB.id, multiRecipientGoalTwo.id],
},
individualHooks: true,
});

// Delete Goals.
await Goal.destroy({
where: {
id: [multiRecipientGoalOneA.id, multiRecipientGoalOneB.id, multiRecipientGoalTwo.id],
},
individualHooks: true,
force: true,
});

// Delete ActivityReport.
await ActivityReport.destroy({
where: {
id: multiRecipientActivityReport.id,
},
});
// await ActivityReport.destroy({
// where: {
// id: multiRecipientActivityReport.id,
// },
// individualHooks: true,
// });
await destroyReport(multiRecipientActivityReport);

// Delete Grants.
await Grant.destroy({
where: {
id: [multiRecipientGrantOneA.id, multiRecipientGrantOneB.id, multiRecipientGrantTwo.id],
},
individualHooks: true,
});

// Delete Recipients.
await Recipient.destroy({
where: {
id: [multiRecipientRecipientA.id, multiRecipientRecipientB.id],
},
individualHooks: true,
});

await db.sequelize.close();
});

it('correctly updates multi recipient report root causes', async () => {
Expand Down
2 changes: 0 additions & 2 deletions src/goalServices/goals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ describe('Goals DB service', () => {
});
});

test.todo('can update an existing goal');

it('can create new objectives', async () => {
ActivityReportGoal.findOne.mockResolvedValue([
{
Expand Down
2 changes: 2 additions & 0 deletions src/goalServices/mergeGoals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ describe('mergeGoals', () => {
where: {
name: topic.name,
},
individualHooks: true,
force: true,
});

await Grant.destroy({
Expand Down
Loading

0 comments on commit 6bcf644

Please sign in to comment.