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

[PROD] 06/20/24 TTAHUB-2667: Fix save pdf white space, TTAHUB-2519: Show Fei root cause per recipient #2219

Merged
merged 22 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
66d09c4
BE update for fei by grant
AdamAdHocTeam Jun 13, 2024
87dfd90
add missing to BE and add FE with tests
AdamAdHocTeam Jun 14, 2024
8f89e81
put on sandbox
AdamAdHocTeam Jun 14, 2024
a45133b
update api joi test
AdamAdHocTeam Jun 14, 2024
a67e5a1
update property def
AdamAdHocTeam Jun 14, 2024
b2083ed
update joi
AdamAdHocTeam Jun 14, 2024
e3ddb43
fixes per Matt and Lauren
AdamAdHocTeam Jun 17, 2024
b440b58
fix unwanted space after activity date
AdamAdHocTeam Jun 17, 2024
6ce0d5c
make sure we roll up recipients missing info
AdamAdHocTeam Jun 17, 2024
b2f0fe9
Add check per Garrett
AdamAdHocTeam Jun 17, 2024
0155824
Bump urllib3 from 2.0.7 to 2.2.2 in /similarity_api/src
dependabot[bot] Jun 17, 2024
328fef7
Update yarn-audit-known-issues
GarrettEHill Jun 18, 2024
a654c12
Bump scikit-learn from 1.3.0 to 1.5.0 in /similarity_api/src
dependabot[bot] Jun 18, 2024
f525b82
sort recipients by alpha
AdamAdHocTeam Jun 18, 2024
c77c4cc
Merge branch 'main' into al-ttahub-add-fei-root-cause-to-review
AdamAdHocTeam Jun 18, 2024
e01012c
update label and test
nvms Jun 20, 2024
a5365af
Merge pull request #2206 from HHS/al-ttahub-add-fei-root-cause-to-review
AdamAdHocTeam Jun 20, 2024
174dedd
Merge pull request #2207 from HHS/al-ttahub-2667-fix-print-to-pdf
AdamAdHocTeam Jun 20, 2024
640e2e3
change ", " to " - " per design review
nvms Jun 20, 2024
39f3008
Merge pull request #2218 from HHS/jp/2132/grant-status-filter
nvms Jun 20, 2024
2b83ebc
Merge pull request #2212 from HHS/dependabot/pip/similarity_api/src/u…
AdamAdHocTeam Jun 20, 2024
69b87c0
Merge pull request #2214 from HHS/dependabot/pip/similarity_api/src/s…
AdamAdHocTeam Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ parameters:
default: "lr/ttahub-1521/display-regions-in-AR-header"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "al-ttahub-2726-goals-and-objectives-review-redesign"
default: "al-ttahub-add-fei-root-cause-to-review"
type: string
prod_new_relic_app_id:
default: "877570491"
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/ReadOnlyContent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
// print styles

@media print{
.ttahub-read-only-content-section {
padding: 0;
margin-bottom: 2rem;
page-break-inside: avoid;
.ttahub-read-only-content-section,
.ttahub-read-only-content-section h3 {
padding: 0 !important;
margin-bottom: 2rem !important;
page-break-inside: avoid !important;
}
}

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/filter/__tests__/goalFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ describe('goalFilters', () => {
const grantFilter = grantNumberFilter([{
numberWithProgramTypes: 'number EHS',
number: 'number',
status: 'Active',
}]);

const grantFilterWithNoPossibleGrantsYet = grantNumberFilter([]);
Expand Down Expand Up @@ -139,7 +140,7 @@ describe('goalFilters', () => {
const apply = jest.fn();
renderFilter(() => grantFilter.renderInput('1', 'test', [], apply));
const grantNumberInput = await screen.findByLabelText('Select grant numbers to filter by');
await selectEvent.select(grantNumberInput, ['number EHS']);
await selectEvent.select(grantNumberInput, ['number EHS - Active']);
expect(apply).toHaveBeenCalled();
});
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/filter/goalFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const grantNumberFilter = (possibleGrants) => ({
labelText="Select grant numbers to filter by"
options={possibleGrants.map((g) => ({
value: g.number,
label: g.numberWithProgramTypes,
label: `${g.numberWithProgramTypes} - ${g.status}`,
}))}
selectedValues={query}
mapByValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';
import { v4 as uuidv4 } from 'uuid';
import { useFormContext } from 'react-hook-form';
import { reportIsEditable } from '../../../../utils';
Expand All @@ -24,6 +26,8 @@ const RecipientReviewSection = () => {
items: [
{ label: 'Recipient\'s goal', name: 'name' },
{ label: 'Goal source', name: 'source' },
{ label: 'Goal number', name: 'goalNumber' },
{ label: 'Root cause', name: 'promptsForReview' },
{
label: 'Anticipated close date', name: 'endDate',
},
Expand Down Expand Up @@ -56,8 +60,50 @@ const RecipientReviewSection = () => {
},
];

const buildGoalReview = (goal) => goalSection[0].items.map((item) => (
<>
const buildFeiRootCauseReviewSection = (item, goal) => {
const promptsForReview = goal.promptsForReview || [];
return (promptsForReview.length > 0 && (
<div className="grid-row margin-bottom-3 desktop:margin-bottom-0 margin-top-1">
{promptsForReview.map((v) => (
<>
<div className="grid-col-12 desktop:grid-col-6 print:grid-col-6 font-sans-2xs desktop:font-sans-sm text-bold desktop:text-normal">
{item.label}
</div>
<div className="grid-col-12 desktop:grid-col-6 print:grid-col-6">
<div key={`${item.label}${v}`} className="desktop:flex-align-end display-flex flex-column flex-justify-center">
{
v.responses.length
? v.responses.join(', ')
: (
<div>
<FontAwesomeIcon className="margin-right-1" icon={faTriangleExclamation} />
{' '}
Missing Information
</div>
)
}
</div>
<div>
<ul className="margin-y-1 padding-left-2 font-body-2xs">
{v.recipients.map((r) => (
<li key={uuidv4()}>{r.name}</li>
))}
</ul>
</div>
</div>
</>
))}
</div>
)
);
};

const buildGoalReview = (goal) => goalSection[0].items.map((item) => {
if (item.label === 'Root cause') {
return buildFeiRootCauseReviewSection(item, goal);
}

return (
<ReviewItem
key={uuidv4()}
label={item.label}
Expand All @@ -66,8 +112,8 @@ const RecipientReviewSection = () => {
sortValues={item.sort}
customValue={goal}
/>
</>
));
);
});

const buildObjectiveReview = (objectives, isLastGoal) => {
const returnObjectives = objectives.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,55 @@ describe('RecipientReviewSection', () => {
expect(screen.queryAllByText(/Resource links/i).length).toBe(3);
expect(screen.queryAllByText(/Resource attachments/i).length).toBe(3);
});

it('renders fei response correctly', async () => {
RenderReviewSection([{
...defaultGoalsAndObjectives[0],
promptsForReview: [
{
key: 'Root Cause 1',
promptId: 1,
prompt: 'Prompt 1',
recipients: [{ id: 1, name: 'Recipient 1' }, { id: 2, name: 'Recipient 2' }],
responses: ['Response 1', 'Response 2'],
},
{
key: 'Root Cause 2',
promptId: 1,
prompt: 'Prompt 2',
recipients: [{ id: 3, name: 'Recipient 3' }, { id: 4, name: 'Recipient 4' }],
responses: ['Response 3'],
},
{
key: 'Root Cause 3',
promptId: 1,
prompt: 'Prompt 3',
recipients: [{ id: 3, name: 'Recipient 5' }],
responses: [],
},
],
}]);

// Assert generic goal information is displayed.
expect(screen.queryAllByText(/Goal summary/i).length).toBe(1);
expect(screen.getByText(/this is my 1st goal title/i)).toBeInTheDocument();

// Expect the text 'Root cause' to be displayed 3 times.
expect(screen.queryAllByText(/Root cause/i).length).toBe(3);

// Assert Response 1 and Response 2 are displayed.
expect(screen.getByText(/response 1, response 2/i)).toBeInTheDocument();

// Assert Response 3 is displayed.
expect(screen.getByText('Response 3')).toBeInTheDocument();

// Assert that the correct number of recipients are displayed.
expect(screen.queryAllByText(/Recipient 1/).length).toBe(1);
expect(screen.queryAllByText(/Recipient 2/).length).toBe(1);
expect(screen.queryAllByText(/Recipient 3/).length).toBe(1);
expect(screen.queryAllByText(/Recipient 5/).length).toBe(1);

// Assert 'Missing information' is displayed once.
expect(screen.queryAllByText(/Missing Information/).length).toBe(1);
});
});
4 changes: 2 additions & 2 deletions similarity_api/src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ psycopg2==2.9.7
pydantic==2.4.0
pydantic-core==2.10.0
requests==2.32.0
scikit-learn==1.3.0
scikit-learn==1.5.0
scipy==1.11.1
smart-open==6.3.0
spacy==3.6.1
Expand All @@ -39,7 +39,7 @@ threadpoolctl==3.2.0
tqdm==4.66.3
typer==0.9.0
typing_extensions==4.7.1
urllib3==2.0.7
urllib3==2.2.2
wasabi==1.1.2
Werkzeug==3.0.3
zipp==3.16.2
Expand Down
Loading