From b46296e4a026dbe181cf7a03928713ea769ade58 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Thu, 18 Mar 2021 16:23:11 -0400 Subject: [PATCH 01/17] add legacy reconciliation service and tool --- R14ActivityReportsTest.csv | 42 +++++++-------- package.json | 3 +- src/models/user.js | 2 +- src/services/legacyreports.js | 82 +++++++++++++++++++++++++++++ src/services/users.js | 9 ++++ src/tools/reconcileLegacyReports.js | 3 ++ 6 files changed, 118 insertions(+), 23 deletions(-) create mode 100644 src/services/legacyreports.js create mode 100644 src/tools/reconcileLegacyReports.js diff --git a/R14ActivityReportsTest.csv b/R14ActivityReportsTest.csv index 111380c120..b7551c253f 100644 --- a/R14ActivityReportsTest.csv +++ b/R14ActivityReportsTest.csv @@ -1,5 +1,5 @@ -ReportID,Grantee Name,CDI Grantee Name (if applicable),Multi-Grantee Activities,Program Type(s),Non-Grantee Activity,Source of Request,Reason/s,T -TA,Topics,Other topics,Grantee Participants,Non-Grantee Participants,Number of Participants,Start Date,End Date,Duration,Other Specialists,Target Populations,Resources Used,Non-OHS Resources,GOAL 1,Grantee's learning level GOAL 1 (Optional),Objective 1.1,Objective 1.1 status,Objective 1.2,Objective 1.2 status,GOAL 2,Grantee's learning level GOAL 2 (Optional),Objective 2.1,Objective 2.1 status,Objective 2.2,Objective 2.2 status,TTA Provided and Grantee Progress Made,Grantee Follow Up Tasks & Objectives,Specialist Follow Up Tasks & Objectives,Format,Additional notes for this activity,,Manager,Manager approval,Created,Created By,Override Created By,Modified,Modified By -R14-AR-000435,"Action, Inc. | 14CH010848",,,,,Grantee,Need: Professional Development,Both,"Coaching / Teaching / Instructional Support | ECS, FES",,Manager / Coordinator / Specialist / Case Manager,,,2020-11-06,2020-11-06,2.0,,Preschool,,,"Grantee will have a minimum of 5% of staff receive mentoring and coaching (PG#1, Obj #4).",,Completed: Train the Education Manager on an overview of the TLC’s due to the cancelled even in May.,,,,,,,,,,"Pre TA: Working on PD plans and has a Creative Curriculum Training coming up. +ReportID,Grantee Name,CDI Grantee Name (if applicable),Multi-Grantee Activities,Program Type(s),Non-Grantee Activity,Source of Request,Reason/s,T -TA,Topics,Other topics,Grantee Participants,Non-Grantee Participants,Number of Participants,Start Date,End Date,Duration,Other Specialists,Target Populations,Resources Used,Non-OHS Resources,GOAL 1,Grantee's learning level GOAL 1 (Optional),Objective 1.1,Objective 1.1 status,Objective 1.2,Objective 1.2 status,GOAL 2,Grantee's learning level GOAL 2 (Optional),Objective 2.1,Objective 2.1 status,Objective 2.2,Objective 2.2 status,TTA Provided and Grantee Progress Made,Grantee Follow Up Tasks & Objectives,Specialist Follow Up Tasks & Objectives,Format,Additional notes for this activity,,Manager,Manager approval,Created,Created By,Override Created By,Modified,Modified By +R14-AR-000435,"Action, Inc. | 14CH010848",,,,,Grantee,Need: Professional Development,Both,"Coaching / Teaching / Instructional Support | ECS, FES",,Manager / Coordinator / Specialist / Case Manager,,,2020-11-06,2020-11-06,2,,Preschool,,,"Grantee will have a minimum of 5% of staff receive mentoring and coaching (PG#1, Obj #4).",,Completed: Train the Education Manager on an overview of the TLC’s due to the cancelled even in May.,,,,,,,,,,"Pre TA: Working on PD plans and has a Creative Curriculum Training coming up. Trained and provided TA for the education manager on Together Learning and Collaborating (TCL’s) with the following discussions: • Reviewed the content of the TLC group sessions 3 and 4. @@ -17,12 +17,12 @@ Post TA: • After program implements them, meet to give feedback and strategies ECS: -• Send Plan form• Mail a thing",Virtual,,,manager1@test.region14,Approved,2020-11-09 08:20:57,creator@first.row,,2020-12-21 07:47:05,creator@first.row +• Send Plan form• Mail a thing",Virtual,,,manager1@test.gov,Approved,2020-11-09 08:20:57,creator1@test.gov,,2020-12-21 07:47:05,creator1@test.gov R14-AR-000442,S College | 14CH011664,,,,,Regional Office,"Monitoring | Area of Concern Monitoring | Deficiency",Technical Assistance,"Behavioral / Mental Health | HS, FES Corrective Actions | GS Quality Improvement / QIP | GS",,"Coach / Trainer -Manager / Coordinator / Specialist / Case Manager",,,2020-11-05,2020-11-05,2.0,,"Infant/Toddlers +Manager / Coordinator / Specialist / Case Manager",,,2020-11-05,2020-11-05,2,,"Infant/Toddlers Preschool",,,"Grantee will finalize additions to Technical Service Plan, defining T/TA outcomes, plan steps, strategies and identify dates of service.",,"Continued support for Social/Emotional Plan implementation- In Progress Revise/refine coaching needs assessments- In Progress Support staff’s reflective practices- in Progress",,,,,,,,,,"Anticipated Outcome: Grantee will finalize additions to Technical Service Plan, defining T/TA outcomes, plan steps, strategies and identify dates of service. @@ -44,10 +44,10 @@ Post TA: November 13, 2020- revise education staff needs assessments per discussion. distribute needs assessments to education staff. November 30, 2020- review Head Start Heals materials for integration to services.","Next Steps for Specialist: -November 11, 2020- send participants the arrow-PD chart.",Virtual,,,manager1@test.region14,Approved,2020-11-09 10:39:08,creator@second.row,,2020-12-21 07:47:05,creator@second.row +November 11, 2020- send participants the arrow-PD chart.",Virtual,,,manager1@test.gov,Approved,2020-11-09 10:39:08,creator2@test.gov,,2020-12-21 07:47:05,creator2@test.gov R14-AR-000770,"Program, Inc. | 14CH014598",,,,,Grantee,Need: Program Planning,Technical Assistance,"CLASS / Learning Environments / Classroom Management | ECS Environmental Health and Safety | HS",,"Manager / Coordinator / Specialist / Case Manager -Teacher / Infant-Toddler Caregiver",,,2020-12-18,2020-12-18,2.0,,Preschool,"https://eclkc.ohs.acf.hhs.gov/publication/guiding-questions-active-supervision-safety +Teacher / Infant-Toddler Caregiver",,,2020-12-18,2020-12-18,2,,Preschool,"https://eclkc.ohs.acf.hhs.gov/publication/guiding-questions-active-supervision-safety https://eclkc.ohs.acf.hhs.gov/safety-practices/article/keep-children-safe-using-active-supervision https://eclkc.ohs.acf.hhs.gov/safety-practices/article/active-supervision https://eclkc.ohs.acf.hhs.gov/safety-practices/article/tips-keeping-children-safe-developmental-guide-preschoolers @@ -71,9 +71,9 @@ ECS facilitated an overview of the 6 strategies for Active Supervision and led p Post TA: *15 Minute In-service Suites *Scanning and counting in the classroom -*Transition ideas utilizing cue cards",Provide ongoing training and professional development opportunities to staff by utilizing the resources shared by ECS from the 6 strategies and provide follow up with staff. Grantee will ensure staff understand and have reviewed all policies and procedures of safety practices.,Follow-up with the Director during ongoing TTA visits and send data collected from training to Director,Virtual,,,manager2@test.region14,Approved,2020-12-18 11:32:54,creator@third.row,,2020-12-21 07:47:05,admin@test.gov +*Transition ideas utilizing cue cards",Provide ongoing training and professional development opportunities to staff by utilizing the resources shared by ECS from the 6 strategies and provide follow up with staff. Grantee will ensure staff understand and have reviewed all policies and procedures of safety practices.,Follow-up with the Director during ongoing TTA visits and send data collected from training to Director,Virtual,,,manager2@test.gov,Approved,2020-12-18 11:32:54,creator3@test.gov,,2020-12-21 07:47:05,admin@test.gov R14-AR-001005,The Public Schools | 14CH014747,,,Head Start (ages 3-5),,Grantee,New Director or Management,Technical Assistance,Other,Orientation/Onboarding,"Manager / Coordinator / Specialist -Program Director (HS/EHS)",,8.0,2021-01-28,2021-01-28,2.5,,Preschool,"TTA ECLKC Resources: +Program Director (HS/EHS)",,8,2021-01-28,2021-01-28,2.5,,Preschool,"TTA ECLKC Resources: https://eclkc.ohs.acf.hhs.gov/human-resources/article/ensuring-new-employees-success-best-practices-employee-onboarding",,"Anticipated Outcomes: GS Goal: The Grantee will strengthen its Human Resource system.",1 - Introductory,"TTA Objective: Assess current practices, identifying future methods, and formalizing plans to support the program goals and Head Start (HS) regulations.",In progress,,,,,,,,,"Pre-TA: The leadership staff from Quincy Public School District 172 provided the following updates related to the program since the last TTA virtual meeting on November 24, 2020: @@ -121,8 +121,8 @@ GS recommended/suggested the following: - continue to discuss HR as it relates to their orientation and onboarding process - complete HR Audit - Continue to build an Orientation and Onboarding Plan","The TTA Specialist will: (What more do you need from TTA Specialists?) -",Virtual,,,manager3@test.region14,Approved,2021-01-29 11:44:28,creator@third.row,,2021-02-03 02:13:36,creator@third.row -R14-AR-000892,Board of Trustees of | 14CH041588,,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Technical Assistance,Other,Staff Wellness,Manager / Coordinator / Specialist,,4.0,2021-01-14,2021-01-14,2.0,,Preschool,Trauma Briefs 1-5,Sesame St- Elmo & COVID www.sesamestreet.org,"Program will foster the growth and development of its staff through individualized, job-embedded professional development, mental health supports, and daily classroom support.",2 - Intermediate,ECS will provide TA to support program's efforts with resources related to school readiness and building staff resilience and wellness.,In progress,,,,,,,,,"T/TA Provided: ECS facilitated TA to provide further resources sharing, Sesame Street and Elmo COVID-19 information, Self-Care checklist, and introduced the concept of Compassion Fatigue and its effect on staff and remaining well. ECS provided Professional Quality of Life Scale allowing participants to complete and a de-brief where they expressed rating just as expected to thinking scores would be higher on burnout section to “shocked”. ECS guided them to the criteria on each section and elements of burnout vs. secondary trauma stress sharing the ProQOL helper card. ECS asked if they thought the scale could be used with staff. Participants did think it could be used and shared examples of staff challenges, asked for strategies to support. ECS recommended including the mental health consultant as possible, providing affirmation and validation of feelings as well as support to identify any resources. ECS spotlighted resource from NC Pyramid Model Innovations Self-Care for Teacher and HS NCPFCE Trauma Briefs to generate supports for staff and families. ECS offered data on staff wellness, retention, and engaged staff in discussion of characteristics that effect stress levels and job satisfaction. Grantee is in process of self-assessment and plan to review current practices in development of a formalized Wellness plan for PY 21-22 and requested one-page, parent-friendly resources on COVID supports to include on newsletters and/or distribution to parents. +",Virtual,,,manager3@test.gov,Approved,2021-01-29 11:44:28,creator3@test.gov,,2021-02-03 02:13:36,creator3@test.gov +R14-AR-000892,Board of Trustees of | 14CH041588,,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Technical Assistance,Other,Staff Wellness,Manager / Coordinator / Specialist,,4,2021-01-14,2021-01-14,2,,Preschool,Trauma Briefs 1-5,Sesame St- Elmo & COVID www.sesamestreet.org,"Program will foster the growth and development of its staff through individualized, job-embedded professional development, mental health supports, and daily classroom support.",2 - Intermediate,ECS will provide TA to support program's efforts with resources related to school readiness and building staff resilience and wellness.,In progress,,,,,,,,,"T/TA Provided: ECS facilitated TA to provide further resources sharing, Sesame Street and Elmo COVID-19 information, Self-Care checklist, and introduced the concept of Compassion Fatigue and its effect on staff and remaining well. ECS provided Professional Quality of Life Scale allowing participants to complete and a de-brief where they expressed rating just as expected to thinking scores would be higher on burnout section to “shocked”. ECS guided them to the criteria on each section and elements of burnout vs. secondary trauma stress sharing the ProQOL helper card. ECS asked if they thought the scale could be used with staff. Participants did think it could be used and shared examples of staff challenges, asked for strategies to support. ECS recommended including the mental health consultant as possible, providing affirmation and validation of feelings as well as support to identify any resources. ECS spotlighted resource from NC Pyramid Model Innovations Self-Care for Teacher and HS NCPFCE Trauma Briefs to generate supports for staff and families. ECS offered data on staff wellness, retention, and engaged staff in discussion of characteristics that effect stress levels and job satisfaction. Grantee is in process of self-assessment and plan to review current practices in development of a formalized Wellness plan for PY 21-22 and requested one-page, parent-friendly resources on COVID supports to include on newsletters and/or distribution to parents. Progress toward Outcome: Grantee participated in exercise, gained awareness of resources, and strategized on possible uses of resources. Health/Nutrition Coordinator reported feeling adequately prepared to incorporate ideas and complete draft staff wellness plan for PY 21-22 based on ECS TA and resource sharing. Final Check scheduled for May 18, 2021 to ensure no further needs are necessary. @@ -132,12 +132,12 @@ Post TA: 3. N/A","Next Steps for Grantee: draft staff wellness action plan.","Next Steps for Specialist: January- Send resources to grantee. -As identified- send short, parent-friendly resources on COVID support, well-being",Virtual,"Grantee Progress: Program has initiated and planned for several staff wellness activities such as weekly staff highlight, etc.",,manager1@test.region14,Approved,2021-01-15 14:46:25,creator@fourth.row,,2021-01-17 06:40:49,creator@fourth.row +As identified- send short, parent-friendly resources on COVID support, well-being",Virtual,"Grantee Progress: Program has initiated and planned for several staff wellness activities such as weekly staff highlight, etc.",,manager1@test.gov,Approved,2021-01-15 14:46:25,creator4@test.gov,,2021-01-17 06:40:49,creator4@test.gov R14-AR-001002,"High Five, Inc. | 14CH010143",,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Training,Other,Reflective Supervision,"Coach Family Service Worker / Case Manager Manager / Coordinator / Specialist Program Director (HS/EHS) -Teacher / Infant-Toddler Caregiver",,30.0,2021-01-25,2021-01-25,1.5,,Preschool,,,Enhance reflective practice.,2 - Intermediate,Grantee will increase understanding of the components of Reflective Supervision.,Completed,,,,,,,,,"Began with an opening activity around setting the intention for the year. +Teacher / Infant-Toddler Caregiver",,30,2021-01-25,2021-01-25,1.5,,Preschool,,,Enhance reflective practice.,2 - Intermediate,Grantee will increase understanding of the components of Reflective Supervision.,Completed,,,,,,,,,"Began with an opening activity around setting the intention for the year. Reviewed Reflective Supervision practices through video examples and discussion. Key points included: -The definition of reflective supervision @@ -158,11 +158,11 @@ Post TTA: 1. BETH strategy, Active listening reminder, video and practice. 2. Listen with intention",The Grantee will reflect on strategies and determine next steps,The ECS will conduct a virtual visit for Technical Service Plan development.,"Virtual In Person -Telephone",,,manager1@test.region14,Approved,2021-02-01 16:55:13,creator@row.seven,,2021-02-02 12:22:38,creator@row.seven +Telephone",,,manager1@test.gov,Approved,2021-02-01 16:55:13,creator7@test.gov,,2021-02-02 12:22:38,creator7@test.gov R14-AR-001162,Big District | 14CH014444,,,"Early Head Start (ages 0-3) Head Start (ages 3-5)",,Grantee,Planning/Coordination (also TTA Plan Agreement),Technical Assistance,Other,Grantee T/TA Planning,"Manager / Coordinator / Specialist Program Director (HS/EHS) -Program Support / Administrative Assistant",,4.0,2021-02-23,2021-02-23,3.0,"specialist1@test.gov,","Infant/Toddlers +Program Support / Administrative Assistant",,4,2021-02-23,2021-02-23,3,"specialist1@test.gov,","Infant/Toddlers Preschool",,,Reflect on the program’s strengths and areas to strengthen and set priorities for next program year.,,Develop a TTA plan for the grantee with action steps and timelines for the next program year.,Completed,,,,,,,,,"TTA Provided: ECS and leadership team, including Head Start Director (HSD), participated in a brainstorming session to review strengths and areas to strengthen in the next program year. The discussion included the following: *ECS shared the intention and purpose of developing a TTA Plan in coordination and the connection to the grantee’s annual planning time. @@ -191,8 +191,8 @@ ECS and leadership team, including Head Start Director (HSD), participated in a Progress Toward Outcomes: Participants contributed to the conversations regarding annual planning and developed the next steps.","Grantee will: *See TTA Plan","ECS will: -*See TTA Plan",Virtual,,,manager4@test.region14,Approved,2021-02-24 10:46:04,creator@row.seven,,2021-02-24 10:56:01,creator@row.seven -R14-AR-000279,Healthy | 14CH010545,,,,,Regional Office,Need: Program Planning,Technical Assistance,Other,TSP Development,Manager / Coordinator / Specialist / Case Manager,,,2020-10-16,2020-10-16,2.0,,"Infant/Toddlers +*See TTA Plan",Virtual,,,manager4@test.gov,Approved,2021-02-24 10:46:04,creator7@test.gov,,2021-02-24 10:56:01,creator7@test.gov +R14-AR-000279,Healthy | 14CH010545,,,,,Regional Office,Need: Program Planning,Technical Assistance,Other,TSP Development,Manager / Coordinator / Specialist / Case Manager,,,2020-10-16,2020-10-16,2,,"Infant/Toddlers Preschool",,,"Grantee will finalize Technical Service Plan, defining T/TA outcomes, plan steps, strategies and identify dates of service.",,TSP development - In progress,,,,,,,,,,"Anticipated Outcome: Grantee will finalize Technical Service Plan, defining T/TA outcomes, plan steps, strategies and identify dates of service. Grantee Progress: Grantee will close largest site due to COVID positive cases at site. Several counties in area are on state’s warning list due to increase in cases. Program is enrolled at 67%, PBC coach/specialist who recently resigned is returning to program position. @@ -205,9 +205,9 @@ Post TA: 1. Gained more information on Coordinated Approaches (CA). 2. Use in format development of CA","Next Steps for Grantee: - Email ECS child Outcomes PY 19-20 report and Coaching plan.","Next Steps for Specialist: -October- Email team PBC Program Leader’s Guide.",Virtual,,,manager9@test.region14,Approved,2020-10-19 07:23:40,creator@fourth.row,Person Overrider,2020-12-21 07:47:05,creator@fourth.row +October- Email team PBC Program Leader’s Guide.",Virtual,,,manager9@test.gov,Approved,2020-10-19 07:23:40,creator4@test.gov,Person Overrider,2020-12-21 07:47:05,creator4@test.gov R14-AR-000976,"ACRONYM, Co. | 14CH010140",,,"Early Head Start (ages 0-3) -Head Start (ages 3-5)",,Grantee,Ongoing Quality Improvement,Technical Assistance,Transition Practices,,Manager / Coordinator / Specialist,,1.0,2021-01-25,2021-01-25,2.0,,"Infant/Toddlers +Head Start (ages 3-5)",,Grantee,Ongoing Quality Improvement,Technical Assistance,Transition Practices,,Manager / Coordinator / Specialist,,1,2021-01-25,2021-01-25,2,,"Infant/Toddlers Preschool",https://eclkc.ohs.acf.hhs.gov/sites/default/files/pdf/supporting-transitions-brief-two.pdf,,We will provide responsive practices that support all children’s positive growth and development (PG#1).,2 - Intermediate,Incorporate new strategies to create smooth transitions.,In progress,,,,,,,,,"Pre TA: No big changes Brainstormed ideas for a smooth transition for children and families from EHS to HS, and HS to the school with the following conversations: @@ -235,7 +235,7 @@ Post TA: ECS: • Send Transition resources supporting multiple places • Send Transitions information found in the HS Act -• Plan for upcoming meeting on Transitions",Both,,,manager10@test.region,Approved,2021-01-26 12:28:28,creator@row.ten,,2021-01-26 12:33:04,creator@row.ten +• Plan for upcoming meeting on Transitions",Both,,,manager10@test.gov,Approved,2021-01-26 12:28:28,creator10@test.gov,,2021-01-26 12:33:04,creator10@test.gov R14-AR-001132,"Healthy | 14CH010545 Another | 14CH010114 This Is One | 14CH1414140",,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Training,"CLASS: Classroom Management @@ -243,7 +243,7 @@ CLASS: Emotional Support CLASS: Instructional Support",,"Center Director / Site Director Coach Manager / Coordinator / Specialist -Teacher / Infant-Toddler Caregiver",,10.0,2021-02-16,2021-02-18,16.0,"specialist1@test.gov, specialist2@test.gov, s3@test.gov",Preschool,,Teachstone Provided Materials,"Participants will demonstrate knowledge of the CLASS dimensions, indicators, and behavior markers; practice notetaking and coding process; and prepare for CLASS certification",,"reviewed all domains, dimensions, indicators, and behavior makers",Completed,provided knowledge about and practiced note taking and presented and practiced the CLASS scoring process,Completed,,,,,,,"TA Provided: +Teacher / Infant-Toddler Caregiver",,10,2021-02-16,2021-02-18,16,"specialist1@test.gov, specialist2@test.gov, s3@test.gov",Preschool,,Teachstone Provided Materials,"Participants will demonstrate knowledge of the CLASS dimensions, indicators, and behavior markers; practice notetaking and coding process; and prepare for CLASS certification",,"reviewed all domains, dimensions, indicators, and behavior makers",Completed,provided knowledge about and practiced note taking and presented and practiced the CLASS scoring process,Completed,,,,,,,"TA Provided: Trainers shared the three-day virtual training agenda, including the following: @@ -281,4 +281,4 @@ Complete the training process in Teachstone. Support participants until the testing is complete (through April 16th). -Share information with assigned ECS (as test results are available).",Virtual,,,manager11@test.region,Approved,2021-02-22 06:37:35,creatror@creator.biz,,2021-02-22 06:52:19,admin@test.gov +Share information with assigned ECS (as test results are available).",Virtual,,,manager11@test.gov,Approved,2021-02-22 06:37:35,creator@test.gov,,2021-02-22 06:52:19,admin@test.gov diff --git a/package.json b/package.json index 51b676328f..bf7b8e41d2 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "import:goals:local": "./node_modules/.bin/babel-node ./src/tools/importTTAPlanGoals.js", "import:goals": "node ./build/server/tools/importTTAPlanGoals.js", "import:hses:local": "./node_modules/.bin/babel-node ./src/tools/importGrantGranteesCLI.js --skipdownload", - "import:hses": "node ./build/server/tools/importGrantGranteesCLI.js" + "import:hses": "node ./build/server/tools/importGrantGranteesCLI.js", + "reconcile:legacy": "./node_modules/.bin/babel-node ./src/tools/reconcileLegacyReports.js" }, "repository": { "type": "git", diff --git a/src/models/user.js b/src/models/user.js index 2c262311b8..c6c2a60d1a 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -1,5 +1,5 @@ import { Model } from 'sequelize'; -import isEmail from 'validator/lib/isEmail'; +// import isEmail from 'validator/lib/isEmail'; const roles = [ 'Regional Program Manager', diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js new file mode 100644 index 0000000000..4aa940f260 --- /dev/null +++ b/src/services/legacyreports.js @@ -0,0 +1,82 @@ +/* eslint-disable no-restricted-syntax */ +/* eslint-disable no-await-in-loop */ + +import { Op } from 'sequelize'; +import { userByEmail } from './users'; +import { ActivityReport, ActivityReportCollaborator } from '../models'; +import { logger } from '../logger'; + +const getLegacyReports = async () => { + const reports = await ActivityReport.findAll({ + where: { + legacyId: { + [Op.ne]: null, + }, + userId: { + [Op.eq]: null, + }, + }, + }); + return reports; +}; + +const reconcileApprovingManagers = async (report) => { + try { + const user = await userByEmail(report.imported.manager); + if (user) { + await ActivityReport.update({ approvingManagerId: user.id }, { where: { id: report.id } }); + logger.info(`Updated approvingManager for report ${report.displayId} to user Id ${user.id}`); + } + } catch (err) { + logger.error(err); + } +}; + +export const reconcileAuthors = async (report) => { + try { + const user = await userByEmail(report.imported.createdBy); + if (user) { + await ActivityReport.update({ userId: user.id }, { where: { id: report.id } }); + logger.info(`Updated author for report ${report.displayId} to user Id ${user.id}`); + } + } catch (err) { + logger.error(err); + } +}; + +export const reconcileCollaborators = async (reportId, otherSpecialists) => { + for (const specialist of otherSpecialists) { + try { + const user = await userByEmail(specialist); + if (user) { + const [, created] = await ActivityReportCollaborator + .findOrCreate({ where: { activityReportId: reportId, userId: user.id } }); + if (created) { + logger.info(`Added ${specialist} as a collaborator on Report ${reportId}`); + } + } + } catch (err) { + logger.error(err); + } + } +}; + +export default async function reconcileLegacyReports() { + const reports = await getLegacyReports(); + for (const report of reports) { + if (!report.userId) { + reconcileAuthors(report); + } + if (!report.approvingManagerId) { + reconcileApprovingManagers(report); + } + if (report.imported.otherSpecialists !== '') { + const collaborators = await ActivityReportCollaborator + .findAll({ where: { activityReportId: report.id } }); + const otherSpecialists = report.imported.otherSpecialists.split(',').filter((j) => j !== '').map((i) => i.toLowerCase().trim()); + if (otherSpecialists.length !== collaborators.length) { + await reconcileCollaborators(report.id, otherSpecialists); + } + } + } +} diff --git a/src/services/users.js b/src/services/users.js index 3a9d1db2e1..fa97a34968 100644 --- a/src/services/users.js +++ b/src/services/users.js @@ -32,6 +32,15 @@ export async function userById(userId) { }); } +export async function userByEmail(email) { + return User.findOne({ + attributes: ['id'], + where: { + email: { [Op.iLike]: email }, + }, + }); +} + export async function usersWithPermissions(regions, scopes) { return User.findAll({ attributes: ['id', 'name'], diff --git a/src/tools/reconcileLegacyReports.js b/src/tools/reconcileLegacyReports.js new file mode 100644 index 0000000000..f65c166313 --- /dev/null +++ b/src/tools/reconcileLegacyReports.js @@ -0,0 +1,3 @@ +import reconcileLegacyReports from '../services/legacyreports'; + +reconcileLegacyReports(); From 958ad78eec6f1d7ee82b3d69ddfbb2b723a73c80 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Thu, 18 Mar 2021 16:39:43 -0400 Subject: [PATCH 02/17] restore isEmail validation to User model --- src/models/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/user.js b/src/models/user.js index c6c2a60d1a..2c262311b8 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -1,5 +1,5 @@ import { Model } from 'sequelize'; -// import isEmail from 'validator/lib/isEmail'; +import isEmail from 'validator/lib/isEmail'; const roles = [ 'Regional Program Manager', From 87a05e45a6ac3346a54284f3d0e29a351988ec7e Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Thu, 18 Mar 2021 16:54:33 -0400 Subject: [PATCH 03/17] simplify activity reports csv for testing --- ...portsTest.csv => R1ActivityReportsTest.csv | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) rename R14ActivityReportsTest.csv => R1ActivityReportsTest.csv (94%) diff --git a/R14ActivityReportsTest.csv b/R1ActivityReportsTest.csv similarity index 94% rename from R14ActivityReportsTest.csv rename to R1ActivityReportsTest.csv index b7551c253f..b93b95d547 100644 --- a/R14ActivityReportsTest.csv +++ b/R1ActivityReportsTest.csv @@ -17,7 +17,7 @@ Post TA: • After program implements them, meet to give feedback and strategies ECS: -• Send Plan form• Mail a thing",Virtual,,,manager1@test.gov,Approved,2020-11-09 08:20:57,creator1@test.gov,,2020-12-21 07:47:05,creator1@test.gov +• Send Plan form• Mail a thing",Virtual,,,manager@test.gov,Approved,2020-11-09 08:20:57,specialist1@test.gov,,2020-12-21 07:47:05,specialist1@test.gov R14-AR-000442,S College | 14CH011664,,,,,Regional Office,"Monitoring | Area of Concern Monitoring | Deficiency",Technical Assistance,"Behavioral / Mental Health | HS, FES Corrective Actions | GS @@ -44,7 +44,7 @@ Post TA: November 13, 2020- revise education staff needs assessments per discussion. distribute needs assessments to education staff. November 30, 2020- review Head Start Heals materials for integration to services.","Next Steps for Specialist: -November 11, 2020- send participants the arrow-PD chart.",Virtual,,,manager1@test.gov,Approved,2020-11-09 10:39:08,creator2@test.gov,,2020-12-21 07:47:05,creator2@test.gov +November 11, 2020- send participants the arrow-PD chart.",Virtual,,,manager@test.gov,Approved,2020-11-09 10:39:08,specialist2@test.gov,,2020-12-21 07:47:05,specialist2@test.gov R14-AR-000770,"Program, Inc. | 14CH014598",,,,,Grantee,Need: Program Planning,Technical Assistance,"CLASS / Learning Environments / Classroom Management | ECS Environmental Health and Safety | HS",,"Manager / Coordinator / Specialist / Case Manager Teacher / Infant-Toddler Caregiver",,,2020-12-18,2020-12-18,2,,Preschool,"https://eclkc.ohs.acf.hhs.gov/publication/guiding-questions-active-supervision-safety @@ -71,7 +71,7 @@ ECS facilitated an overview of the 6 strategies for Active Supervision and led p Post TA: *15 Minute In-service Suites *Scanning and counting in the classroom -*Transition ideas utilizing cue cards",Provide ongoing training and professional development opportunities to staff by utilizing the resources shared by ECS from the 6 strategies and provide follow up with staff. Grantee will ensure staff understand and have reviewed all policies and procedures of safety practices.,Follow-up with the Director during ongoing TTA visits and send data collected from training to Director,Virtual,,,manager2@test.gov,Approved,2020-12-18 11:32:54,creator3@test.gov,,2020-12-21 07:47:05,admin@test.gov +*Transition ideas utilizing cue cards",Provide ongoing training and professional development opportunities to staff by utilizing the resources shared by ECS from the 6 strategies and provide follow up with staff. Grantee will ensure staff understand and have reviewed all policies and procedures of safety practices.,Follow-up with the Director during ongoing TTA visits and send data collected from training to Director,Virtual,,,manager@test.gov,Approved,2020-12-18 11:32:54,specialist3@test.gov,,2020-12-21 07:47:05,manager@test.gov R14-AR-001005,The Public Schools | 14CH014747,,,Head Start (ages 3-5),,Grantee,New Director or Management,Technical Assistance,Other,Orientation/Onboarding,"Manager / Coordinator / Specialist Program Director (HS/EHS)",,8,2021-01-28,2021-01-28,2.5,,Preschool,"TTA ECLKC Resources: https://eclkc.ohs.acf.hhs.gov/human-resources/article/ensuring-new-employees-success-best-practices-employee-onboarding",,"Anticipated Outcomes: @@ -121,7 +121,7 @@ GS recommended/suggested the following: - continue to discuss HR as it relates to their orientation and onboarding process - complete HR Audit - Continue to build an Orientation and Onboarding Plan","The TTA Specialist will: (What more do you need from TTA Specialists?) -",Virtual,,,manager3@test.gov,Approved,2021-01-29 11:44:28,creator3@test.gov,,2021-02-03 02:13:36,creator3@test.gov +",Virtual,,,manager@test.gov,Approved,2021-01-29 11:44:28,specialist3@test.gov,,2021-02-03 02:13:36,specialist3@test.gov R14-AR-000892,Board of Trustees of | 14CH041588,,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Technical Assistance,Other,Staff Wellness,Manager / Coordinator / Specialist,,4,2021-01-14,2021-01-14,2,,Preschool,Trauma Briefs 1-5,Sesame St- Elmo & COVID www.sesamestreet.org,"Program will foster the growth and development of its staff through individualized, job-embedded professional development, mental health supports, and daily classroom support.",2 - Intermediate,ECS will provide TA to support program's efforts with resources related to school readiness and building staff resilience and wellness.,In progress,,,,,,,,,"T/TA Provided: ECS facilitated TA to provide further resources sharing, Sesame Street and Elmo COVID-19 information, Self-Care checklist, and introduced the concept of Compassion Fatigue and its effect on staff and remaining well. ECS provided Professional Quality of Life Scale allowing participants to complete and a de-brief where they expressed rating just as expected to thinking scores would be higher on burnout section to “shocked”. ECS guided them to the criteria on each section and elements of burnout vs. secondary trauma stress sharing the ProQOL helper card. ECS asked if they thought the scale could be used with staff. Participants did think it could be used and shared examples of staff challenges, asked for strategies to support. ECS recommended including the mental health consultant as possible, providing affirmation and validation of feelings as well as support to identify any resources. ECS spotlighted resource from NC Pyramid Model Innovations Self-Care for Teacher and HS NCPFCE Trauma Briefs to generate supports for staff and families. ECS offered data on staff wellness, retention, and engaged staff in discussion of characteristics that effect stress levels and job satisfaction. Grantee is in process of self-assessment and plan to review current practices in development of a formalized Wellness plan for PY 21-22 and requested one-page, parent-friendly resources on COVID supports to include on newsletters and/or distribution to parents. Progress toward Outcome: Grantee participated in exercise, gained awareness of resources, and strategized on possible uses of resources. Health/Nutrition Coordinator reported feeling adequately prepared to incorporate ideas and complete draft staff wellness plan for PY 21-22 based on ECS TA and resource sharing. Final Check scheduled for May 18, 2021 to ensure no further needs are necessary. @@ -132,7 +132,7 @@ Post TA: 3. N/A","Next Steps for Grantee: draft staff wellness action plan.","Next Steps for Specialist: January- Send resources to grantee. -As identified- send short, parent-friendly resources on COVID support, well-being",Virtual,"Grantee Progress: Program has initiated and planned for several staff wellness activities such as weekly staff highlight, etc.",,manager1@test.gov,Approved,2021-01-15 14:46:25,creator4@test.gov,,2021-01-17 06:40:49,creator4@test.gov +As identified- send short, parent-friendly resources on COVID support, well-being",Virtual,"Grantee Progress: Program has initiated and planned for several staff wellness activities such as weekly staff highlight, etc.",,manager@test.gov,Approved,2021-01-15 14:46:25,specialist1@test.gov,,2021-01-17 06:40:49,specialist1@test.gov R14-AR-001002,"High Five, Inc. | 14CH010143",,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Training,Other,Reflective Supervision,"Coach Family Service Worker / Case Manager Manager / Coordinator / Specialist @@ -158,7 +158,7 @@ Post TTA: 1. BETH strategy, Active listening reminder, video and practice. 2. Listen with intention",The Grantee will reflect on strategies and determine next steps,The ECS will conduct a virtual visit for Technical Service Plan development.,"Virtual In Person -Telephone",,,manager1@test.gov,Approved,2021-02-01 16:55:13,creator7@test.gov,,2021-02-02 12:22:38,creator7@test.gov +Telephone",,,manager@test.gov,Approved,2021-02-01 16:55:13,specialist2@test.gov,,2021-02-02 12:22:38,specialist2@test.gov R14-AR-001162,Big District | 14CH014444,,,"Early Head Start (ages 0-3) Head Start (ages 3-5)",,Grantee,Planning/Coordination (also TTA Plan Agreement),Technical Assistance,Other,Grantee T/TA Planning,"Manager / Coordinator / Specialist Program Director (HS/EHS) @@ -191,7 +191,7 @@ ECS and leadership team, including Head Start Director (HSD), participated in a Progress Toward Outcomes: Participants contributed to the conversations regarding annual planning and developed the next steps.","Grantee will: *See TTA Plan","ECS will: -*See TTA Plan",Virtual,,,manager4@test.gov,Approved,2021-02-24 10:46:04,creator7@test.gov,,2021-02-24 10:56:01,creator7@test.gov +*See TTA Plan",Virtual,,,manager@test.gov,Approved,2021-02-24 10:46:04,specialist2@test.gov,,2021-02-24 10:56:01,specialist2@test.gov R14-AR-000279,Healthy | 14CH010545,,,,,Regional Office,Need: Program Planning,Technical Assistance,Other,TSP Development,Manager / Coordinator / Specialist / Case Manager,,,2020-10-16,2020-10-16,2,,"Infant/Toddlers Preschool",,,"Grantee will finalize Technical Service Plan, defining T/TA outcomes, plan steps, strategies and identify dates of service.",,TSP development - In progress,,,,,,,,,,"Anticipated Outcome: Grantee will finalize Technical Service Plan, defining T/TA outcomes, plan steps, strategies and identify dates of service. @@ -205,7 +205,7 @@ Post TA: 1. Gained more information on Coordinated Approaches (CA). 2. Use in format development of CA","Next Steps for Grantee: - Email ECS child Outcomes PY 19-20 report and Coaching plan.","Next Steps for Specialist: -October- Email team PBC Program Leader’s Guide.",Virtual,,,manager9@test.gov,Approved,2020-10-19 07:23:40,creator4@test.gov,Person Overrider,2020-12-21 07:47:05,creator4@test.gov +October- Email team PBC Program Leader’s Guide.",Virtual,,,manager@test.gov,Approved,2020-10-19 07:23:40,specialist1@test.gov,Person Overrider,2020-12-21 07:47:05,specialist1@test.gov R14-AR-000976,"ACRONYM, Co. | 14CH010140",,,"Early Head Start (ages 0-3) Head Start (ages 3-5)",,Grantee,Ongoing Quality Improvement,Technical Assistance,Transition Practices,,Manager / Coordinator / Specialist,,1,2021-01-25,2021-01-25,2,,"Infant/Toddlers Preschool",https://eclkc.ohs.acf.hhs.gov/sites/default/files/pdf/supporting-transitions-brief-two.pdf,,We will provide responsive practices that support all children’s positive growth and development (PG#1).,2 - Intermediate,Incorporate new strategies to create smooth transitions.,In progress,,,,,,,,,"Pre TA: No big changes @@ -235,7 +235,7 @@ Post TA: ECS: • Send Transition resources supporting multiple places • Send Transitions information found in the HS Act -• Plan for upcoming meeting on Transitions",Both,,,manager10@test.gov,Approved,2021-01-26 12:28:28,creator10@test.gov,,2021-01-26 12:33:04,creator10@test.gov +• Plan for upcoming meeting on Transitions",Both,,,manager@test.gov,Approved,2021-01-26 12:28:28,specialist3@test.gov,,2021-01-26 12:33:04,specialist3@test.gov R14-AR-001132,"Healthy | 14CH010545 Another | 14CH010114 This Is One | 14CH1414140",,,Head Start (ages 3-5),,Grantee,Ongoing Quality Improvement,Training,"CLASS: Classroom Management @@ -243,7 +243,7 @@ CLASS: Emotional Support CLASS: Instructional Support",,"Center Director / Site Director Coach Manager / Coordinator / Specialist -Teacher / Infant-Toddler Caregiver",,10,2021-02-16,2021-02-18,16,"specialist1@test.gov, specialist2@test.gov, s3@test.gov",Preschool,,Teachstone Provided Materials,"Participants will demonstrate knowledge of the CLASS dimensions, indicators, and behavior markers; practice notetaking and coding process; and prepare for CLASS certification",,"reviewed all domains, dimensions, indicators, and behavior makers",Completed,provided knowledge about and practiced note taking and presented and practiced the CLASS scoring process,Completed,,,,,,,"TA Provided: +Teacher / Infant-Toddler Caregiver",,10,2021-02-16,2021-02-18,16,"specialist1@test.gov, specialist2@test.gov, specialist3@test.gov",Preschool,,Teachstone Provided Materials,"Participants will demonstrate knowledge of the CLASS dimensions, indicators, and behavior markers; practice notetaking and coding process; and prepare for CLASS certification",,"reviewed all domains, dimensions, indicators, and behavior makers",Completed,provided knowledge about and practiced note taking and presented and practiced the CLASS scoring process,Completed,,,,,,,"TA Provided: Trainers shared the three-day virtual training agenda, including the following: @@ -281,4 +281,4 @@ Complete the training process in Teachstone. Support participants until the testing is complete (through April 16th). -Share information with assigned ECS (as test results are available).",Virtual,,,manager11@test.gov,Approved,2021-02-22 06:37:35,creator@test.gov,,2021-02-22 06:52:19,admin@test.gov +Share information with assigned ECS (as test results are available).",Virtual,,,manager@test.gov,Approved,2021-02-22 06:37:35,specialist3@test.gov,,2021-02-22 06:52:19,manager@test.gov From bbb9ca57fefe6a19a1711f586a00b0d4a2425298 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Thu, 18 Mar 2021 17:21:02 -0400 Subject: [PATCH 04/17] add varying cases to email addresses in R1ActivityReportsTest.csv --- R1ActivityReportsTest.csv | 4 ++-- src/services/legacyreports.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R1ActivityReportsTest.csv b/R1ActivityReportsTest.csv index b93b95d547..d4c5243f1f 100644 --- a/R1ActivityReportsTest.csv +++ b/R1ActivityReportsTest.csv @@ -1,5 +1,5 @@ ReportID,Grantee Name,CDI Grantee Name (if applicable),Multi-Grantee Activities,Program Type(s),Non-Grantee Activity,Source of Request,Reason/s,T -TA,Topics,Other topics,Grantee Participants,Non-Grantee Participants,Number of Participants,Start Date,End Date,Duration,Other Specialists,Target Populations,Resources Used,Non-OHS Resources,GOAL 1,Grantee's learning level GOAL 1 (Optional),Objective 1.1,Objective 1.1 status,Objective 1.2,Objective 1.2 status,GOAL 2,Grantee's learning level GOAL 2 (Optional),Objective 2.1,Objective 2.1 status,Objective 2.2,Objective 2.2 status,TTA Provided and Grantee Progress Made,Grantee Follow Up Tasks & Objectives,Specialist Follow Up Tasks & Objectives,Format,Additional notes for this activity,,Manager,Manager approval,Created,Created By,Override Created By,Modified,Modified By -R14-AR-000435,"Action, Inc. | 14CH010848",,,,,Grantee,Need: Professional Development,Both,"Coaching / Teaching / Instructional Support | ECS, FES",,Manager / Coordinator / Specialist / Case Manager,,,2020-11-06,2020-11-06,2,,Preschool,,,"Grantee will have a minimum of 5% of staff receive mentoring and coaching (PG#1, Obj #4).",,Completed: Train the Education Manager on an overview of the TLC’s due to the cancelled even in May.,,,,,,,,,,"Pre TA: Working on PD plans and has a Creative Curriculum Training coming up. +R14-AR-000435,"Action, Inc. | 14CH010848",,,,,Grantee,Need: Professional Development,Both,"Coaching / Teaching / Instructional Support | ECS, FES",,Manager / Coordinator / Specialist / Case Manager,,,2020-11-06,2020-11-06,2,Specialist2@test.gov,Preschool,,,"Grantee will have a minimum of 5% of staff receive mentoring and coaching (PG#1, Obj #4).",,Completed: Train the Education Manager on an overview of the TLC’s due to the cancelled even in May.,,,,,,,,,,"Pre TA: Working on PD plans and has a Creative Curriculum Training coming up. Trained and provided TA for the education manager on Together Learning and Collaborating (TCL’s) with the following discussions: • Reviewed the content of the TLC group sessions 3 and 4. @@ -207,7 +207,7 @@ Post TA: - Email ECS child Outcomes PY 19-20 report and Coaching plan.","Next Steps for Specialist: October- Email team PBC Program Leader’s Guide.",Virtual,,,manager@test.gov,Approved,2020-10-19 07:23:40,specialist1@test.gov,Person Overrider,2020-12-21 07:47:05,specialist1@test.gov R14-AR-000976,"ACRONYM, Co. | 14CH010140",,,"Early Head Start (ages 0-3) -Head Start (ages 3-5)",,Grantee,Ongoing Quality Improvement,Technical Assistance,Transition Practices,,Manager / Coordinator / Specialist,,1,2021-01-25,2021-01-25,2,,"Infant/Toddlers +Head Start (ages 3-5)",,Grantee,Ongoing Quality Improvement,Technical Assistance,Transition Practices,,Manager / Coordinator / Specialist,,1,2021-01-25,2021-01-25,2,"specialist1@test.gov, Specialist3@Test.Gov","Infant/Toddlers Preschool",https://eclkc.ohs.acf.hhs.gov/sites/default/files/pdf/supporting-transitions-brief-two.pdf,,We will provide responsive practices that support all children’s positive growth and development (PG#1).,2 - Intermediate,Incorporate new strategies to create smooth transitions.,In progress,,,,,,,,,"Pre TA: No big changes Brainstormed ideas for a smooth transition for children and families from EHS to HS, and HS to the school with the following conversations: diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index 4aa940f260..67abd34c79 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -44,15 +44,15 @@ export const reconcileAuthors = async (report) => { } }; -export const reconcileCollaborators = async (reportId, otherSpecialists) => { +export const reconcileCollaborators = async (report, otherSpecialists) => { for (const specialist of otherSpecialists) { try { const user = await userByEmail(specialist); if (user) { const [, created] = await ActivityReportCollaborator - .findOrCreate({ where: { activityReportId: reportId, userId: user.id } }); + .findOrCreate({ where: { activityReportId: report.id, userId: user.id } }); if (created) { - logger.info(`Added ${specialist} as a collaborator on Report ${reportId}`); + logger.info(`Added ${specialist} as a collaborator on Report ${report.displayId}`); } } } catch (err) { @@ -75,7 +75,7 @@ export default async function reconcileLegacyReports() { .findAll({ where: { activityReportId: report.id } }); const otherSpecialists = report.imported.otherSpecialists.split(',').filter((j) => j !== '').map((i) => i.toLowerCase().trim()); if (otherSpecialists.length !== collaborators.length) { - await reconcileCollaborators(report.id, otherSpecialists); + await reconcileCollaborators(report, otherSpecialists); } } } From 18caf9bc0e1d622cba37135a88c7c6b97d92cf53 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:48:50 -0400 Subject: [PATCH 05/17] rename R14ActicityReportsTest.csv --- R1ActivityReportsTest.csv => R14ActivityReportsTest.csv | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename R1ActivityReportsTest.csv => R14ActivityReportsTest.csv (100%) diff --git a/R1ActivityReportsTest.csv b/R14ActivityReportsTest.csv similarity index 100% rename from R1ActivityReportsTest.csv rename to R14ActivityReportsTest.csv From 1f11066272d71b9a28688aaf3abf639fbe4da72a Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Fri, 19 Mar 2021 10:38:35 -0400 Subject: [PATCH 06/17] add tests for userByEmail in user service --- src/services/users.test.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/services/users.test.js b/src/services/users.test.js index 945164ea38..7c05917a35 100644 --- a/src/services/users.test.js +++ b/src/services/users.test.js @@ -3,7 +3,7 @@ import db, { } from '../models'; import { - usersWithPermissions, userById, + usersWithPermissions, userById, userByEmail, } from './users'; import SCOPES from '../middleware/scopeConstants'; @@ -43,6 +43,37 @@ describe('Users DB service', () => { expect(user.name).toBe('user 1'); }); }); + describe('userByEmail', () => { + beforeEach(async () => { + await User.create({ + id: 50, + name: 'user 1', + email: 'user1@test.gov', + hsesUsername: 'user.1', + hsesUserId: '50', + }); + await User.create({ + id: 51, + name: 'user 2', + email: 'user2@test.gov', + hsesUsername: 'user.2', + hsesUserId: '51', + }); + }); + + afterEach(async () => { + await User.destroy({ where: { id: [50, 51] } }); + }); + + it('retrieves the correct user', async () => { + const user = await userByEmail('user1@test.gov'); + expect(user.id).toBe(50); + }); + it('retrieves the correct user if case differs', async () => { + const user = await userByEmail('User2@Test.Gov'); + expect(user.id).toBe(51); + }); + }); describe('usersWithPermissions', () => { const users = [ From f826543225a091caa6c4a7ca03919dfbabd97ce4 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Fri, 19 Mar 2021 11:13:16 -0400 Subject: [PATCH 07/17] only select legacy reports that might need reconcilliation --- src/services/legacyreports.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index 67abd34c79..ca54d7585e 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -12,15 +12,32 @@ const getLegacyReports = async () => { legacyId: { [Op.ne]: null, }, - userId: { - [Op.eq]: null, - }, + [Op.or]: [ + { + userId: { + [Op.eq]: null, + }, + }, + { + approvingManagerId: { + [Op.eq]: null, + }, + }, + { + imported: { + otherSpecialists: { + [Op.ne]: '', + }, + }, + }, + ], + }, }); return reports; }; -const reconcileApprovingManagers = async (report) => { +export const reconcileApprovingManagers = async (report) => { try { const user = await userByEmail(report.imported.manager); if (user) { From c2804a2072f7e6c80c5cded048cf97ccf18941cc Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:23:40 -0400 Subject: [PATCH 08/17] move await outside of loop --- src/services/legacyreports.js | 66 ++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index ca54d7585e..72de532235 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -1,6 +1,3 @@ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable no-await-in-loop */ - import { Op } from 'sequelize'; import { userByEmail } from './users'; import { ActivityReport, ActivityReportCollaborator } from '../models'; @@ -61,39 +58,52 @@ export const reconcileAuthors = async (report) => { } }; -export const reconcileCollaborators = async (report, otherSpecialists) => { - for (const specialist of otherSpecialists) { - try { - const user = await userByEmail(specialist); - if (user) { - const [, created] = await ActivityReportCollaborator - .findOrCreate({ where: { activityReportId: report.id, userId: user.id } }); - if (created) { - logger.info(`Added ${specialist} as a collaborator on Report ${report.displayId}`); +export const reconcileCollaborators = async (report) => { + try { + const collaborators = await ActivityReportCollaborator + .findAll({ where: { activityReportId: report.id } }); + const otherSpecialists = report.imported.otherSpecialists.split(',').filter((j) => j !== '').map((i) => i.toLowerCase().trim()); + if (otherSpecialists.length !== collaborators.length) { + const users = []; + otherSpecialists.forEach((specialist) => { + users.push(userByEmail(specialist)); + }); + const userArray = await Promise.all(users); + const pendingCollaborators = []; + userArray.forEach((user) => { + if (user) { + pendingCollaborators.push(ActivityReportCollaborator + .findOrCreate({ where: { activityReportId: report.id, userId: user.id } })); } + }); + const newCollaborators = await Promise.all(pendingCollaborators); + const numberOfNewCollaborators = newCollaborators.filter((c) => c[1]).length + if (numberOfNewCollaborators > 0) { + logger.info(`Added ${numberOfNewCollaborators} collaborator for report ${report.displayId}`); } - } catch (err) { - logger.error(err); } + } catch (err) { + logger.error(err); } }; export default async function reconcileLegacyReports() { const reports = await getLegacyReports(); - for (const report of reports) { - if (!report.userId) { - reconcileAuthors(report); - } - if (!report.approvingManagerId) { - reconcileApprovingManagers(report); - } - if (report.imported.otherSpecialists !== '') { - const collaborators = await ActivityReportCollaborator - .findAll({ where: { activityReportId: report.id } }); - const otherSpecialists = report.imported.otherSpecialists.split(',').filter((j) => j !== '').map((i) => i.toLowerCase().trim()); - if (otherSpecialists.length !== collaborators.length) { - await reconcileCollaborators(report, otherSpecialists); + const updates = []; + try { + reports.forEach((report) => { + if (!report.userId) { + updates.push(reconcileAuthors(report)); } - } + if (!report.approvingManagerId) { + updates.push(reconcileApprovingManagers(report)); + } + if (report.imported.otherSpecialists !== '') { + updates.push(reconcileCollaborators(report)); + } + }); + await Promise.all(updates); + } catch (err) { + logger.error(err); } } From b9df3728086fb01dcd7d2da8fc19c3a30c89c980 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:39:48 -0400 Subject: [PATCH 09/17] fmt --- src/services/legacyreports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index 72de532235..4f1ec666dc 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -77,7 +77,7 @@ export const reconcileCollaborators = async (report) => { } }); const newCollaborators = await Promise.all(pendingCollaborators); - const numberOfNewCollaborators = newCollaborators.filter((c) => c[1]).length + const numberOfNewCollaborators = newCollaborators.filter((c) => c[1]).length; if (numberOfNewCollaborators > 0) { logger.info(`Added ${numberOfNewCollaborators} collaborator for report ${report.displayId}`); } From 40787a4ff9e647e9fcf7517512c0d2d303370152 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Fri, 19 Mar 2021 17:29:58 -0400 Subject: [PATCH 10/17] add legacyreport.test.js --- src/services/legacyreport.test.js | 126 ++++++++++++++++++++++++++++++ src/services/legacyreports.js | 3 + src/services/users.test.js | 16 ++-- 3 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 src/services/legacyreport.test.js diff --git a/src/services/legacyreport.test.js b/src/services/legacyreport.test.js new file mode 100644 index 0000000000..889e6ee597 --- /dev/null +++ b/src/services/legacyreport.test.js @@ -0,0 +1,126 @@ +import reconcileLegacyReports, +{ + reconcileAuthors, + reconcileCollaborators, + reconcileApprovingManagers, +} from './legacyreports'; +import db, { User, ActivityReport, ActivityReportCollaborator } from '../models'; +import { REPORT_STATUSES } from '../constants'; + +const report1 = { + activityRecipientType: 'grantee', + status: REPORT_STATUSES.DRAFT, + regionId: 1, + ECLKCResourcesUsed: ['test'], + legacyId: 'legacy-1', + imported: { + manager: 'Manager4099@Test.Gov', + createdBy: 'user4096@Test.gov', + otherSpecialists: 'user4097@TEST.gov, user4098@test.gov', + }, +}; + +const report2 = { + activityRecipientType: 'grantee', + status: REPORT_STATUSES.DRAFT, + regionId: 1, + ECLKCResourcesUsed: ['test'], + legacyId: 'legacy-2', + imported: { + manager: 'Manager4099@test.gov', + createdBy: 'user4097@Test.gov', + otherSpecialists: 'user4096@test.gov', + }, +}; + +const user1 = { + id: 4096, + homeRegionId: 1, + name: 'user', + hsesUsername: 'user', + hsesUserId: '4096', + email: 'user4096@test.gov', +}; + +const user2 = { + id: 4097, + homeRegionId: 1, + name: 'user2', + hsesUsername: 'user2', + hsesUserId: '4097', + email: 'user4097@test.gov', +}; + +const user3 = { + id: 4098, + homeRegionId: 1, + name: 'user3', + hsesUsername: 'user3', + hsesUserId: '4098', + email: 'user4098@test.gov', +}; + +const manager = { + id: 4099, + homeRegionId: 1, + name: 'manager', + hsesUsername: 'manager', + hsesUserId: '4099', + email: 'manager4099@test.gov', +}; + +describe('reconcile legacy reports', () => { + let mockReport1; + let mockReport2; + let mockUser1; + let mockUser2; + let mockUser3; + let mockManager; + + beforeAll(async () => { + mockReport1 = await ActivityReport.create(report1); + mockReport2 = await ActivityReport.create(report2); + mockUser1 = await User.create(user1); + mockUser2 = await User.create(user2); + mockUser3 = await User.create(user3); + mockManager = await User.create(manager); + }); + + afterAll(async () => { + await ActivityReportCollaborator.destroy({ + where: { activityReportId: [mockReport1.id, mockReport2.id] }, + }); + await ActivityReport.destroy({ where: { id: [mockReport1.id, mockReport2.id] } }); + await User.destroy({ + where: { id: [mockUser1.id, mockUser2.id, mockUser3.id, mockManager.id] }, + }); + db.sequelize.close(); + }); + it('adds an author if there is one', async () => { + await reconcileAuthors(mockReport1); + mockReport1 = await ActivityReport.findOne({ where: { id: mockReport1.id } }); + expect(mockReport1.userId).toBe(mockUser1.id); + }); + it('adds an approvingManager if there is one', async () => { + await reconcileApprovingManagers(mockReport1); + mockReport1 = await ActivityReport.findOne({ where: { id: mockReport1.id } }); + expect(mockReport1.approvingManagerId).toBe(manager.id); + }); + it('adds collaborators', async () => { + await reconcileCollaborators(mockReport1); + const collaborators = await ActivityReportCollaborator.findAll({ + where: { activityReportId: mockReport1.id }, + }); + expect(collaborators.length).toBe(2); + }); + it('tests the reconciliation process', async () => { + await reconcileLegacyReports(); + mockReport2 = await ActivityReport.findOne({ where: { id: mockReport2.id } }); + expect(mockReport2.userId).toBe(user2.id); + expect(mockReport2.approvingManagerId).toBe(manager.id); + const collaborators = await ActivityReportCollaborator.findAll({ + where: { activityReportId: mockReport2.id }, + }); + expect(collaborators.length).toBe(1); + }); +}); diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index 4f1ec666dc..bc550b2b24 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -9,6 +9,9 @@ const getLegacyReports = async () => { legacyId: { [Op.ne]: null, }, + imported: { + [Op.ne]: null, + }, [Op.or]: [ { userId: { diff --git a/src/services/users.test.js b/src/services/users.test.js index 7c05917a35..0675928435 100644 --- a/src/services/users.test.js +++ b/src/services/users.test.js @@ -47,16 +47,16 @@ describe('Users DB service', () => { beforeEach(async () => { await User.create({ id: 50, - name: 'user 1', - email: 'user1@test.gov', - hsesUsername: 'user.1', + name: 'user 50', + email: 'user50@test.gov', + hsesUsername: 'user.50', hsesUserId: '50', }); await User.create({ id: 51, - name: 'user 2', - email: 'user2@test.gov', - hsesUsername: 'user.2', + name: 'user 51', + email: 'user51@test.gov', + hsesUsername: 'user.51', hsesUserId: '51', }); }); @@ -66,11 +66,11 @@ describe('Users DB service', () => { }); it('retrieves the correct user', async () => { - const user = await userByEmail('user1@test.gov'); + const user = await userByEmail('user50@test.gov'); expect(user.id).toBe(50); }); it('retrieves the correct user if case differs', async () => { - const user = await userByEmail('User2@Test.Gov'); + const user = await userByEmail('User51@Test.Gov'); expect(user.id).toBe(51); }); }); From 8c42486f76194b1be1f6861a5d731e92ab478f8a Mon Sep 17 00:00:00 2001 From: kryswisnaskas Date: Mon, 22 Mar 2021 11:47:15 -0400 Subject: [PATCH 11/17] Redirect focus after date pick --- frontend/src/components/DatePicker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/components/DatePicker.js b/frontend/src/components/DatePicker.js index cf080a8ce7..dfa1cb9688 100644 --- a/frontend/src/components/DatePicker.js +++ b/frontend/src/components/DatePicker.js @@ -61,6 +61,8 @@ const DateInput = ({ onDateChange={(d) => { const newDate = d ? d.format(dateFmt) : d; onChange(newDate); + const input = document.getElementById(name); + if (input) input.focus(); }} onFocusChange={({ focused }) => { if (!focused) { From 330f754a94ab2ddfe34c3d2d185f64a3649e5aff Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Tue, 23 Mar 2021 09:50:30 -0400 Subject: [PATCH 12/17] clarify code and add comments --- src/services/legacyreport.test.js | 2 +- src/services/legacyreports.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/services/legacyreport.test.js b/src/services/legacyreport.test.js index 889e6ee597..42f98bd5c2 100644 --- a/src/services/legacyreport.test.js +++ b/src/services/legacyreport.test.js @@ -94,7 +94,7 @@ describe('reconcile legacy reports', () => { await User.destroy({ where: { id: [mockUser1.id, mockUser2.id, mockUser3.id, mockManager.id] }, }); - db.sequelize.close(); + await db.sequelize.close(); }); it('adds an author if there is one', async () => { await reconcileAuthors(mockReport1); diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index bc550b2b24..919f99d557 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -65,7 +65,11 @@ export const reconcileCollaborators = async (report) => { try { const collaborators = await ActivityReportCollaborator .findAll({ where: { activityReportId: report.id } }); - const otherSpecialists = report.imported.otherSpecialists.split(',').filter((j) => j !== '').map((i) => i.toLowerCase().trim()); + // In legacy reports, specialists are in a single column seperated by commas. + // First, get a list of other specialists and split on commas eliminating any blanks. + const splitOtherSpecialists = report.imported.otherSpecialists.split(',').filter((j) => j !== ''); + // Next we map the other specialists to lower case and trim whitespace to standardize them. + const otherSpecialists = splitOtherSpecialists.map((i) => i.toLowerCase().trim()); if (otherSpecialists.length !== collaborators.length) { const users = []; otherSpecialists.forEach((specialist) => { @@ -80,6 +84,9 @@ export const reconcileCollaborators = async (report) => { } }); const newCollaborators = await Promise.all(pendingCollaborators); + // findOrCreate returns an array with the second value being a boolean + // which is true if a new object is created. This counts the number of objects where + // c[1] is true const numberOfNewCollaborators = newCollaborators.filter((c) => c[1]).length; if (numberOfNewCollaborators > 0) { logger.info(`Added ${numberOfNewCollaborators} collaborator for report ${report.displayId}`); From e2bf1feb137789480dbdf51e670b16d68f2aaa52 Mon Sep 17 00:00:00 2001 From: kryswisnaskas Date: Tue, 23 Mar 2021 09:58:49 -0400 Subject: [PATCH 13/17] Deploy to sandbox --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 096bdc6e8f..647fa79175 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -164,7 +164,7 @@ parameters: default: "main" type: string sandbox_git_branch: # change to feature branch to test deployment - default: "js-392-small-fixes" + default: "kw-ie-keyboard-nav" type: string prod_new_relic_app_id: default: "877570491" From d8f1d2efdfdb73466ebad5c8affb8a9c2d976d02 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Tue, 23 Mar 2021 10:58:36 -0400 Subject: [PATCH 14/17] add more comments to legacyreports.js --- src/services/legacyreports.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index 919f99d557..bb5a113fc8 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -4,6 +4,11 @@ import { ActivityReport, ActivityReportCollaborator } from '../models'; import { logger } from '../logger'; const getLegacyReports = async () => { + // returns all legacy reports that either: + // 1. are missing an author + // 2. are missing an approving manager + // 3. have colloborators in the imported field + // These are the only reports that might need reconciliation const reports = await ActivityReport.findAll({ where: { legacyId: { @@ -37,6 +42,9 @@ const getLegacyReports = async () => { return reports; }; +// Checks a report to see if the email address listed in the imported.manager field +// belongs to any user. If it does, it updates the report with that user.id in the +// approvingManager column export const reconcileApprovingManagers = async (report) => { try { const user = await userByEmail(report.imported.manager); @@ -49,6 +57,9 @@ export const reconcileApprovingManagers = async (report) => { } }; +// Checks a report to see if the email address listed in the imported.createdBy field +// belongs to any user. If it does, it updates the report with that user.id in the +// userId column export const reconcileAuthors = async (report) => { try { const user = await userByEmail(report.imported.createdBy); @@ -61,6 +72,11 @@ export const reconcileAuthors = async (report) => { } }; +// First checks if the number of collaborators is different than the number of +// entries in the imported.otherSpecialists field. If not, then no reconciliation is needed. +// If there is a difference, it tries to find users matching the email addresses in the +// otherSpecialists field. It then uses findorCreate to add collaborators that haven't yet +// been added. export const reconcileCollaborators = async (report) => { try { const collaborators = await ActivityReportCollaborator @@ -98,20 +114,26 @@ export const reconcileCollaborators = async (report) => { }; export default async function reconcileLegacyReports() { + // Get all reports that might need reconciliation const reports = await getLegacyReports(); + // Array to help promises from reports that are getting reconciled const updates = []; try { reports.forEach((report) => { + // if there is no author, try to reconcile the author if (!report.userId) { updates.push(reconcileAuthors(report)); } + // if there is no approving manager, try to reconcile the approving manager if (!report.approvingManagerId) { updates.push(reconcileApprovingManagers(report)); } + // if the report has collaborators, check if collaborators need reconcilliation. if (report.imported.otherSpecialists !== '') { updates.push(reconcileCollaborators(report)); } }); + // let all promises resolve await Promise.all(updates); } catch (err) { logger.error(err); From d10fb238f07cdf52d49e8248a68121d660c60f1b Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Tue, 23 Mar 2021 11:07:14 -0400 Subject: [PATCH 15/17] fmt --- src/services/legacyreports.js | 41 ++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/services/legacyreports.js b/src/services/legacyreports.js index bb5a113fc8..56a267c97e 100644 --- a/src/services/legacyreports.js +++ b/src/services/legacyreports.js @@ -3,12 +3,14 @@ import { userByEmail } from './users'; import { ActivityReport, ActivityReportCollaborator } from '../models'; import { logger } from '../logger'; +/* +* Returns all legacy reports that either: +* 1. are missing an author +* 2. are missing an approving manager +* 3. have colloborators in the imported field +* These are the only reports that might need reconciliation +*/ const getLegacyReports = async () => { - // returns all legacy reports that either: - // 1. are missing an author - // 2. are missing an approving manager - // 3. have colloborators in the imported field - // These are the only reports that might need reconciliation const reports = await ActivityReport.findAll({ where: { legacyId: { @@ -42,9 +44,11 @@ const getLegacyReports = async () => { return reports; }; -// Checks a report to see if the email address listed in the imported.manager field -// belongs to any user. If it does, it updates the report with that user.id in the -// approvingManager column +/* +* Checks a report to see if the email address listed in the imported.manager field +* belongs to any user. If it does, it updates the report with that user.id in the +* approvingManager column +*/ export const reconcileApprovingManagers = async (report) => { try { const user = await userByEmail(report.imported.manager); @@ -56,10 +60,11 @@ export const reconcileApprovingManagers = async (report) => { logger.error(err); } }; - -// Checks a report to see if the email address listed in the imported.createdBy field -// belongs to any user. If it does, it updates the report with that user.id in the -// userId column +/* +* Checks a report to see if the email address listed in the imported.createdBy field +* belongs to any user. If it does, it updates the report with that user.id in the +* userId column +*/ export const reconcileAuthors = async (report) => { try { const user = await userByEmail(report.imported.createdBy); @@ -72,11 +77,13 @@ export const reconcileAuthors = async (report) => { } }; -// First checks if the number of collaborators is different than the number of -// entries in the imported.otherSpecialists field. If not, then no reconciliation is needed. -// If there is a difference, it tries to find users matching the email addresses in the -// otherSpecialists field. It then uses findorCreate to add collaborators that haven't yet -// been added. +/* +* First checks if the number of collaborators is different than the number of +* entries in the imported.otherSpecialists field. If not, then no reconciliation is needed. +* If there is a difference, it tries to find users matching the email addresses in the +* otherSpecialists field. It then uses findorCreate to add collaborators that haven't yet +* been added. +*/ export const reconcileCollaborators = async (report) => { try { const collaborators = await ActivityReportCollaborator From 2951bc81751bcabdc5f8891573d71981417bba0b Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Wed, 24 Mar 2021 11:06:50 -0400 Subject: [PATCH 16/17] add catch to tools/reconcileLegacyReports.js and reconcile:legacy:local command to package.json --- package.json | 3 ++- src/tools/reconcileLegacyReports.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bf7b8e41d2..fd88a5c4d6 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,8 @@ "import:goals": "node ./build/server/tools/importTTAPlanGoals.js", "import:hses:local": "./node_modules/.bin/babel-node ./src/tools/importGrantGranteesCLI.js --skipdownload", "import:hses": "node ./build/server/tools/importGrantGranteesCLI.js", - "reconcile:legacy": "./node_modules/.bin/babel-node ./src/tools/reconcileLegacyReports.js" + "reconcile:legacy": "./node_modules/.bin/babel-node ./build/server/tools/reconcileLegacyReports.js", + "reconcile:legacy:local": "./node_modules/.bin/babel-node ./src/tools/reconcileLegacyReports.js" }, "repository": { "type": "git", diff --git a/src/tools/reconcileLegacyReports.js b/src/tools/reconcileLegacyReports.js index f65c166313..0f651a1d87 100644 --- a/src/tools/reconcileLegacyReports.js +++ b/src/tools/reconcileLegacyReports.js @@ -1,3 +1,7 @@ import reconcileLegacyReports from '../services/legacyreports'; +import { auditLogger } from '../logger'; -reconcileLegacyReports(); +reconcileLegacyReports().then(process.exit(0)).catch((e) => { + auditLogger.error(e); + process.exit(1); +}); From af81eaac5e49664e39a206b39395d3d9c7b641f7 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Wed, 24 Mar 2021 11:19:00 -0400 Subject: [PATCH 17/17] remove babel-node from reconcile:legacy --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd88a5c4d6..9f964be43c 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "import:goals": "node ./build/server/tools/importTTAPlanGoals.js", "import:hses:local": "./node_modules/.bin/babel-node ./src/tools/importGrantGranteesCLI.js --skipdownload", "import:hses": "node ./build/server/tools/importGrantGranteesCLI.js", - "reconcile:legacy": "./node_modules/.bin/babel-node ./build/server/tools/reconcileLegacyReports.js", + "reconcile:legacy": "node ./build/server/tools/reconcileLegacyReports.js", "reconcile:legacy:local": "./node_modules/.bin/babel-node ./src/tools/reconcileLegacyReports.js" }, "repository": {