-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* OY2 23552: Latest Package Activity - Package Details Page + Dashboard (#1353) Co-authored-by: Valencia McMurray <[email protected]> * Oy2 23798 - Subsequent Submissions (#1342) * add subsequent submission action (form not yet implemented) * fix error in action delegate and corresponding tests * add new forms and config for subsequent submission * not sure where that came from??? * Add custom success banner * placeholder in one stream to build parent so that submit can release lock * fix Cover Letter filter and attachment link for medicaid * fix navigational back button on form Let back nav button return you to details page if that is where you came from or to proper tab in package list if that is where you came from * fix attachment language text per figma - despite nothing in the ACs ;) * tests to cover subsequent submissions * consolidate more of the Config * Update submitWaiverAmendmentSubsequentSubmission.js * tune required markings * test updates had the wrong message in the success banner but realized I maybe shouldn't automate the actual submission without some extra seed data (and holding off on that until reverse chrono seed data is pushed up). * OY2 24868: Update NOSOs Admin Package Change Log Language (#1352) * move secondClockStatuses to common configs (#1346) * Bump @adobe/css-tools from 4.2.0 to 4.3.1 in /services/ui-src (#1355) Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.2.0 to 4.3.1. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * keep current status after subsequent submission * Bump tough-cookie and @cypress/request (#1332) Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) and [@cypress/request](https://github.com/cypress-io/request). These dependencies needed to be updated together. Updates `tough-cookie` from 2.5.0 to 4.1.3 - [Release notes](https://github.com/salesforce/tough-cookie/releases) - [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md) - [Commits](salesforce/tough-cookie@v2.5.0...v4.1.3) Updates `@cypress/request` from 2.88.11 to 2.88.12 - [Release notes](https://github.com/cypress-io/request/releases) - [Changelog](https://github.com/cypress-io/request/blob/master/CHANGELOG.md) - [Commits](cypress-io/request@v2.88.11...v2.88.12) --- updated-dependencies: - dependency-name: tough-cookie dependency-type: indirect - dependency-name: "@cypress/request" dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kristin Grue <[email protected]> * fix and update subsub tests * final test update some pending packages have actions because of the enable withdraw (unrelated to this work) story. Updated those. The tests failing because they can't find a package will be left and those are fixed elsewhere. * OY2 24628: OneMAC Package Details - Reverse Chronological order (#1338) Co-authored-by: Valencia McMurray <[email protected]> * some of the tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Valencia McMurray <[email protected]> Co-authored-by: Kristin Grue <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Valencia McMurray <[email protected]> * merge develop to sub-sub * OY2-25114 - subsequent submission reverse chrono (#1372) * initial implementation of subsequent submission chronological order * Update actionDelegate.test.js * test Subsequent Documentation in reverse chrono --------- Co-authored-by: Valencia McMurray <[email protected]> * Oy2 23799 - add emails for subsequent submissions (#1368) * add emails for subsequent submissions * lint * rebuild package lock just to force a build * Update package-lock.json * fix lint * test refactor * add subsequent submission maps * test updates: latest activity re-adding latest activity and updating some attachment steps to match current dev. * Mege latest develop (#1479) * Update serverless.yml changed x-content-type-options to lowercase to see if the value will change * Update api-gateway.yml Another addition to set the x-Content-Type-Options to nosniff * Update api-gateway.yml Fix error where code was placed * Add aws-sdk, esbuild, and configuration to fix the legacy source to kafka * set default timeout to 2.5minutes for all api lambda (#1475) * continue pipeline even if issues with seed data (#1478) --------- Co-authored-by: Dark-Knight-1313 <[email protected]> Co-authored-by: Mike Dial <[email protected]> * add changes for Oy2 28890 to sub sub (#1480) * Update serverless.yml changed x-content-type-options to lowercase to see if the value will change * Update api-gateway.yml Another addition to set the x-Content-Type-Options to nosniff * Update api-gateway.yml Fix error where code was placed * ignore email records for package builder --------- Co-authored-by: Dark-Knight-1313 <[email protected]> * OY2-28810 - keep substatus after subsequent submission * Update buildAnyPackage.js * oy2-28987 - update email notification text to state for sub sub (#1484) updated email notification text to state for subsequent submissions * oy2-28988: sub sub CMS email fix (#1491) updated text in email notification for cms for subsequent submissions * added same text change from the other broken branch (#1488) * oy2-28672 - update sub sub confirmation popup text (#1486) * oy2-28671 - update subsequent submission additional information text (#1482) * update subsequent submission additional information text * added conditional text on the package details page for sub subs --------- Co-authored-by: Andie Swift <[email protected]> * update build package to add latest activity timestamp * remove submissionTimestamp from subsequent submission config * Merge branch 'subsub2' into develop --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Kristin Grue <[email protected]> Co-authored-by: Valencia McMurray <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Valencia McMurray <[email protected]> Co-authored-by: Dark-Knight-1313 <[email protected]> Co-authored-by: Mike Dial <[email protected]> Co-authored-by: Andie Swift <[email protected]> Co-authored-by: Andie Swift <[email protected]>
- Loading branch information
1 parent
75ce829
commit 638c3d0
Showing
112 changed files
with
2,913 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { formatPackageDetails } from "./formatPackageDetails.js"; | ||
import { getCPOCandSRTEmailAddresses } from "../utils/getCpocAndSrtEmail.js"; | ||
|
||
/** | ||
* Package Submission email to CMS | ||
* @param {Object} data from the package. | ||
* @returns {Object} email parameters in generic format. | ||
*/ | ||
export const CMSSubsequentSubmissionNotice = async (data, config) => { | ||
data.submitterName = ""; // remove this bc we dont want it on the cms email | ||
const CMSEmailItem = await getCPOCandSRTEmailAddresses(data.componentId); | ||
|
||
const ToAddresses = CMSEmailItem.reviewTeamEmailList | ||
? [...CMSEmailItem.reviewTeamEmailList] | ||
: []; | ||
|
||
CMSEmailItem?.cpocEmail && ToAddresses.push(CMSEmailItem.cpocEmail); | ||
// changing config to match the docs in this one instance | ||
if (config.idLabel === "SPA ID") { | ||
let typeLabel = config.typeLabel; | ||
// cut the type label at sub sub and set that at the new idLabel | ||
typeLabel = typeLabel | ||
.substring(0, typeLabel.indexOf("Subsequent Submission")) | ||
.trim(); | ||
config.idLabel = `${typeLabel} Package ID`; | ||
} | ||
|
||
return { | ||
ToAddresses: ToAddresses, | ||
CcAddresses: [], | ||
Subject: `Action required: review new documents for ${config.typeLabel} ${data.componentId}`, | ||
HTML: ` | ||
<p>New documents have been submitted for ${config.typeLabel} ${ | ||
data.componentId | ||
} in OneMAC.</p> | ||
${formatPackageDetails(data, config)} | ||
<p><b>How to access:</b></p> | ||
<ul> | ||
<li> | ||
These documents can be found in OneMAC through <a href="${ | ||
process.env.applicationEndpoint | ||
}/dashboard">this link</a>. | ||
</li> | ||
<li> | ||
If you are not already logged in, please click the "Login" link at the | ||
top of the page and log in using your Enterprise User Administration | ||
(EUA) credentials. | ||
</li> | ||
<li> | ||
After you have logged in, you will be taken to the OneMAC application. | ||
The submission will be listed on the dashboard page, and you can view | ||
its details by clicking on its ID number. | ||
</li> | ||
</ul> | ||
<br> | ||
<p>If the contents of this email seem suspicious, do not open them, and instead forward this email to <a href="mailto:[email protected]">[email protected]</a>.</p> | ||
<p>Thank you!</p> | ||
`, | ||
}; | ||
}; |
26 changes: 26 additions & 0 deletions
26
services/app-api/email/CMSSubsequentSubmissionNotice.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { CMSSubsequentSubmissionNotice } from "./CMSSubsequentSubmissionNotice"; | ||
|
||
it("builds the CMS Submission Notice Email", async () => { | ||
const testData = { | ||
submitterName: "name", | ||
componentId: "MI-11-1111-22", | ||
proposedEffectiveDate: "2022-06-07", | ||
}; | ||
const testConfig = { | ||
typeLabel: "Test Type", | ||
}; | ||
const warnings = []; | ||
|
||
Check failure on line 13 in services/app-api/email/CMSSubsequentSubmissionNotice.test.js GitHub Actions / Unit Test
|
||
const response2 = await CMSSubsequentSubmissionNotice(testData, testConfig); | ||
|
||
expect(response2.Subject).toBe( | ||
"Subsequent Documentation for " + | ||
testConfig.typeLabel + | ||
" " + | ||
testData.componentId | ||
); | ||
|
||
expect(response2.HTML.includes(testData.componentId)).toBe(true); | ||
expect(response2.HTML.includes(process.env.applicationEndpoint)).toBe(true); | ||
expect(response2.HTML.length).toBe(1293); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
services/app-api/email/stateSubsequentSubmissionReceipt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { formatPackageDetails } from "./formatPackageDetails.js"; | ||
|
||
/** | ||
* Package submission receipt email to state user(s) | ||
* @param {Object} data from the package. | ||
* @returns {Object} email parameters in generic format. | ||
*/ | ||
export const stateSubsequentSubmissionReceipt = (data, config) => { | ||
// changing config to match the docs in this one instance | ||
if (config.idLabel === "SPA ID") { | ||
let typeLabel = config.typeLabel; | ||
// cut the type label at sub sub and set that at the new idLabel | ||
typeLabel = typeLabel | ||
.substring(0, typeLabel.indexOf("Subsequent Submission")) | ||
.trim(); | ||
config.idLabel = `${typeLabel} Package ID`; | ||
} | ||
|
||
return { | ||
ToAddresses: [`${data.submitterName} <${data.submitterEmail}>`], | ||
CcAddresses: [], | ||
Subject: `Additional documents submitted for ${config.typeLabel} ${data.componentId}`, | ||
HTML: ` | ||
<p> You’ve successfully submitted the following to CMS reviewers for ${ | ||
config.typeLabel | ||
} ${data.componentId}:</p> | ||
${formatPackageDetails(data, config)} | ||
<p>If you have questions or did not expect this email, please contact <a href="mailto:[email protected]">[email protected]</a>.</p> | ||
<p>Thank you.</p>`, | ||
}; | ||
}; |
19 changes: 19 additions & 0 deletions
19
services/app-api/email/stateSubsequentSubmissionReceipt.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { stateSubsequentSubmissionReceipt } from "./stateSubsequentSubmissionReceipt"; | ||
|
||
it("builds the State Submission Receipt Email", async () => { | ||
const testData = { | ||
submitterName: "name", | ||
submitterEmail: "[email protected]", | ||
componentId: "MI-11-1111-22", | ||
clockEndTimestamp: 1631626754502, | ||
}; | ||
const testConfig = { | ||
typeLabel: "Test Type", | ||
}; | ||
try { | ||
const response2 = stateSubsequentSubmissionReceipt(testData, testConfig); | ||
expect(response2.HTML.length).toBe(999); | ||
} catch (e) { | ||
console.log("reeived error: ", e); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
services/app-api/form/submitChipSPASubsequentSubmission.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { chipSPASubsequentSubmission } from "cmscommonlib"; | ||
import handler from "../libs/handler-lib"; | ||
import { submitAny } from "./submitAny"; | ||
import { defaultSubsequentSubmissionConfig } from "./defaultFormConfig"; | ||
|
||
export const chipSPASubsequentSubmissionFormConfig = { | ||
...defaultSubsequentSubmissionConfig, | ||
...chipSPASubsequentSubmission, | ||
}; | ||
|
||
export const main = handler(async (event) => | ||
submitAny(event, chipSPASubsequentSubmissionFormConfig) | ||
); |
39 changes: 39 additions & 0 deletions
39
services/app-api/form/submitInitialWaiverSubsequentSubmission.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import handler from "../libs/handler-lib"; | ||
import { submitAny } from "./submitAny"; | ||
import { defaultWaiverSubsequentSubmissionConfig } from "./defaultFormConfig"; | ||
import { | ||
initialWaiverB4SubsequentSubmission, | ||
initialWaiverBSubsequentSubmission, | ||
waiverAuthorityB, | ||
waiverAuthorityB4, | ||
} from "cmscommonlib"; | ||
|
||
export const initialWaiverB4SubsequentFormConifg = { | ||
...defaultWaiverSubsequentSubmissionConfig, | ||
...initialWaiverB4SubsequentSubmission, | ||
}; | ||
|
||
export const initialWaiverBSubsequentFormConifg = { | ||
...defaultWaiverSubsequentSubmissionConfig, | ||
...initialWaiverBSubsequentSubmission, | ||
}; | ||
|
||
export const main = handler(async (event) => { | ||
let data, formConfig; | ||
try { | ||
data = JSON.parse(event.body); | ||
} catch (error) { | ||
console.log("event couldn't parse: ", error); | ||
throw error; | ||
} | ||
|
||
if (data.waiverAuthority === waiverAuthorityB4.value) { | ||
formConfig = initialWaiverB4SubsequentFormConifg; | ||
} else if (data.waiverAuthority === waiverAuthorityB.value) { | ||
formConfig = initialWaiverBSubsequentFormConifg; | ||
} else { | ||
throw new Error("Waiver Authority not found"); | ||
} | ||
|
||
return await submitAny(event, formConfig); | ||
}); |
61 changes: 61 additions & 0 deletions
61
services/app-api/form/submitInitialWaiverSubsequentSubmissionT.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { | ||
main, | ||
initialWaiverB4SubsequentFormConifg, | ||
initialWaiverBSubsequentFormConifg, | ||
} from "./submitInitialWaiverSubsequentSubmission"; | ||
import { waiverAuthorityB4, waiverAuthorityB } from "cmscommonlib"; | ||
import { submitAny } from "./submitAny"; | ||
import handler from "../libs/handler-lib"; | ||
|
||
//jest.mock("../libs/handler-lib"); | ||
jest.mock("./submitAny"); | ||
|
||
const testResult = { | ||
body: "submitAny result", | ||
headers: { | ||
"Access-Control-Allow-Credentials": true, | ||
"Access-Control-Allow-Origin": "*", | ||
}, | ||
statusCode: 200, | ||
}; | ||
|
||
describe("main function", () => { | ||
beforeEach(() => { | ||
//handler.mockImplementation((func) => func); | ||
submitAny.mockResolvedValue(testResult); | ||
}); | ||
|
||
it("should call submitAny with B4 form config when waiverAuthority is B4", async () => { | ||
const event = { | ||
body: JSON.stringify({ waiverAuthority: waiverAuthorityB4.value }), | ||
}; | ||
const result = await main(event); | ||
expect(submitAny).toHaveBeenCalledWith( | ||
event, | ||
initialWaiverB4SubsequentFormConifg | ||
); | ||
}); | ||
|
||
it("should call submitAny with B form config when waiverAuthority is B", async () => { | ||
const event = { | ||
body: JSON.stringify({ waiverAuthority: waiverAuthorityB.value }), | ||
}; | ||
const result = await main(event); | ||
expect(submitAny).toHaveBeenCalledWith( | ||
event, | ||
initialWaiverBSubsequentFormConifg | ||
); | ||
}); | ||
|
||
it("should throw an error when waiverAuthority is not found", async () => { | ||
const event = { body: JSON.stringify({ waiverAuthority: "not-found" }) }; | ||
const result = await main(event); | ||
expect(result.statusCode).toEqual(500); | ||
//await expect(main(event)).rejects.toThrow("Waiver Authority not found"); | ||
}); | ||
|
||
// it("should throw an error when body is not a valid JSON", async () => { | ||
// const event = { body: "invalid json" }; | ||
// await expect(main(event)).rejects.toThrow(); | ||
// }); | ||
}); |
Oops, something went wrong.