Skip to content

Commit

Permalink
Revert "Merge pull request #2613 from HHS/remove-dei"
Browse files Browse the repository at this point in the history
This reverts commit d33953e, reversing
changes made to 9a818f2.
  • Loading branch information
thewatermethod committed Jan 23, 2025
1 parent d183104 commit 4cc484f
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 78 deletions.
2 changes: 1 addition & 1 deletion docs/logical_data_model.encoded

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/logical_data_model.puml
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ class GoalTemplates{
* templateName : text
* templateNameModifiedAt : timestamp with time zone
* updatedAt : timestamp with time zone
deletedAt : timestamp with time zone
lastUsed : timestamp with time zone
source : varchar(255)
standard : text
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@react-hook/resize-observer": "^1.2.6",
"@silevis/reactgrid": "3.1",
"@trussworks/react-uswds": "4.1.1",
"@ttahub/common": "^2.2.1",
"@ttahub/common": "^2.1.7",
"@use-it/interval": "^1.0.0",
"async": "^3.2.3",
"browserslist": "^4.16.5",
Expand Down
16 changes: 5 additions & 11 deletions frontend/src/components/filter/FilterTopicSelect.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import React, { useState, useEffect } from 'react';
import { getTopics } from '../../fetchers/topics';
import React from 'react';
import { TOPICS } from '@ttahub/common';
import FilterSelect from './FilterSelect';
import { filterSelectProps } from './props';

const TOPIC_OPTIONS = TOPICS.map((label, value) => ({ value, label }));

export default function FilterTopicSelect({
onApply,
inputId,
query,
}) {
const [topicOptions, setTopicOptions] = useState([]);

useEffect(() => {
getTopics().then((topics) => {
setTopicOptions(topics.map((topic) => ({ value: topic.id, label: topic.name })));
});
}, []);

const onApplyClick = (selected) => {
onApply(selected);
};
Expand All @@ -24,7 +18,7 @@ export default function FilterTopicSelect({
onApply={onApplyClick}
inputId={inputId}
labelText="Select topics to filter by"
options={topicOptions}
options={TOPIC_OPTIONS}
selectedValues={query}
/>
);
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/components/filter/__tests__/FilterMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ describe('Filter Menu', () => {
jest.restoreAllMocks();
});

beforeEach(() => {
fetchMock.get('api/topic', [{ id: 58, name: 'Behavioral / Mental Health / Trauma' }, { id: 60, name: 'CLASS: Classroom Organization' }, { id: 61, name: 'CLASS: Emotional Support' }, { id: 62, name: 'CLASS: Instructional Support' }, { id: 63, name: 'Coaching' }, { id: 64, name: 'Communication' }, { id: 65, name: 'Community and Self-Assessment' }, { id: 66, name: 'Culture & Language' }, { id: 67, name: 'Curriculum (Instructional or Parenting)' }, { id: 68, name: 'Data and Evaluation' }, { id: 69, name: 'ERSEA' }, { id: 70, name: 'Environmental Health and Safety / EPRR' }, { id: 72, name: 'Facilities' }, { id: 73, name: 'Family Support Services' }, { id: 74, name: 'Fiscal / Budget' }, { id: 75, name: 'Five-Year Grant' }, { id: 76, name: 'Home Visiting' }, { id: 77, name: 'Human Resources' }, { id: 78, name: 'Leadership / Governance' }, { id: 79, name: 'Learning Environments' }, { id: 80, name: 'Nutrition' }, { id: 81, name: 'Oral Health' }, { id: 82, name: 'Parent and Family Engagement' }, { id: 83, name: 'Partnerships and Community Engagement' }, { id: 84, name: 'Physical Health and Screenings' }, { id: 85, name: 'Pregnancy Services / Expectant Families' }, { id: 86, name: 'Program Planning and Services' }, { id: 87, name: 'Quality Improvement Plan / QIP' }, { id: 88, name: 'Recordkeeping and Reporting' }, { id: 89, name: 'Safety Practices' }, { id: 90, name: 'Staff Wellness' }, { id: 92, name: 'Technology and Information Systems' }, { id: 93, name: 'Transition Practices' }, { id: 94, name: 'Transportation' }, { id: 124, name: 'Child Screening and Assessment' }, { id: 125, name: 'Teaching / Caregiving Practices' }, { id: 126, name: 'Disabilities Services' }, { id: 128, name: 'Training and Professional Development' }, { id: 129, name: 'Fatherhood / Male Caregiving' }, { id: 130, name: 'Ongoing Monitoring and Continuous Improvement' }]);
});

afterEach(() => {
fetchMock.restore();
});

const renderFilterMenu = (
filters = [],
onApplyFilters = jest.fn(),
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/filter/__tests__/FilterTopicSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
screen,
} from '@testing-library/react';
import selectEvent from 'react-select-event';
import fetchMock from 'fetch-mock';
import FilterTopicSelect from '../FilterTopicSelect';

const { findByText } = screen;
Expand All @@ -21,7 +20,6 @@ describe('FilterTopicSelect', () => {
));

it('calls the onapply handler', async () => {
fetchMock.get('api/topic', [{ id: 58, name: 'Behavioral / Mental Health / Trauma' }, { id: 60, name: 'CLASS: Classroom Organization' }, { id: 61, name: 'CLASS: Emotional Support' }, { id: 62, name: 'CLASS: Instructional Support' }, { id: 63, name: 'Coaching' }, { id: 64, name: 'Communication' }, { id: 65, name: 'Community and Self-Assessment' }, { id: 66, name: 'Culture & Language' }, { id: 67, name: 'Curriculum (Instructional or Parenting)' }, { id: 68, name: 'Data and Evaluation' }, { id: 69, name: 'ERSEA' }, { id: 70, name: 'Environmental Health and Safety / EPRR' }, { id: 72, name: 'Facilities' }, { id: 73, name: 'Family Support Services' }, { id: 74, name: 'Fiscal / Budget' }, { id: 75, name: 'Five-Year Grant' }, { id: 76, name: 'Home Visiting' }, { id: 77, name: 'Human Resources' }, { id: 78, name: 'Leadership / Governance' }, { id: 79, name: 'Learning Environments' }, { id: 80, name: 'Nutrition' }, { id: 81, name: 'Oral Health' }, { id: 82, name: 'Parent and Family Engagement' }, { id: 83, name: 'Partnerships and Community Engagement' }, { id: 84, name: 'Physical Health and Screenings' }, { id: 85, name: 'Pregnancy Services / Expectant Families' }, { id: 86, name: 'Program Planning and Services' }, { id: 87, name: 'Quality Improvement Plan / QIP' }, { id: 88, name: 'Recordkeeping and Reporting' }, { id: 89, name: 'Safety Practices' }, { id: 90, name: 'Staff Wellness' }, { id: 92, name: 'Technology and Information Systems' }, { id: 93, name: 'Transition Practices' }, { id: 94, name: 'Transportation' }, { id: 124, name: 'Child Screening and Assessment' }, { id: 125, name: 'Teaching / Caregiving Practices' }, { id: 126, name: 'Disabilities Services' }, { id: 128, name: 'Training and Professional Development' }, { id: 129, name: 'Fatherhood / Male Caregiving' }, { id: 130, name: 'Ongoing Monitoring and Continuous Improvement' }]);
const onApply = jest.fn();
renderTopicSelect(onApply);

Expand Down
8 changes: 0 additions & 8 deletions frontend/src/components/filter/__tests__/goalFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
screen,
waitFor,
} from '@testing-library/react';
import fetchMock from 'fetch-mock';
import {
createDateFilter,
reasonsFilter,
Expand Down Expand Up @@ -91,13 +90,6 @@ describe('goalFilters', () => {
});

describe('topicsFilter', () => {
beforeEach(() => {
fetchMock.get('api/topic', [{ id: 58, name: 'Behavioral / Mental Health / Trauma' }, { id: 60, name: 'CLASS: Classroom Organization' }, { id: 61, name: 'CLASS: Emotional Support' }, { id: 62, name: 'CLASS: Instructional Support' }, { id: 63, name: 'Coaching' }, { id: 64, name: 'Communication' }, { id: 65, name: 'Community and Self-Assessment' }, { id: 66, name: 'Culture & Language' }, { id: 67, name: 'Curriculum (Instructional or Parenting)' }, { id: 68, name: 'Data and Evaluation' }, { id: 69, name: 'ERSEA' }, { id: 70, name: 'Environmental Health and Safety / EPRR' }, { id: 72, name: 'Facilities' }, { id: 73, name: 'Family Support Services' }, { id: 74, name: 'Fiscal / Budget' }, { id: 75, name: 'Five-Year Grant' }, { id: 76, name: 'Home Visiting' }, { id: 77, name: 'Human Resources' }, { id: 78, name: 'Leadership / Governance' }, { id: 79, name: 'Learning Environments' }, { id: 80, name: 'Nutrition' }, { id: 81, name: 'Oral Health' }, { id: 82, name: 'Parent and Family Engagement' }, { id: 83, name: 'Partnerships and Community Engagement' }, { id: 84, name: 'Physical Health and Screenings' }, { id: 85, name: 'Pregnancy Services / Expectant Families' }, { id: 86, name: 'Program Planning and Services' }, { id: 87, name: 'Quality Improvement Plan / QIP' }, { id: 88, name: 'Recordkeeping and Reporting' }, { id: 89, name: 'Safety Practices' }, { id: 90, name: 'Staff Wellness' }, { id: 92, name: 'Technology and Information Systems' }, { id: 93, name: 'Transition Practices' }, { id: 94, name: 'Transportation' }, { id: 124, name: 'Child Screening and Assessment' }, { id: 125, name: 'Teaching / Caregiving Practices' }, { id: 126, name: 'Disabilities Services' }, { id: 128, name: 'Training and Professional Development' }, { id: 129, name: 'Fatherhood / Male Caregiving' }, { id: 130, name: 'Ongoing Monitoring and Continuous Improvement' }]);
});

afterEach(() => {
fetchMock.restore();
});
it('renders correctly', async () => {
renderFilter(() => topicsFilter.renderInput('1', 'test', ['ERSEA'], () => {}));
const topicsInput = await screen.findByLabelText('Select topics to filter by');
Expand Down
8 changes: 4 additions & 4 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2431,10 +2431,10 @@
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==

"@ttahub/common@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@ttahub/common/-/common-2.2.1.tgz#a2e6cc6c79c40fc90ac59b4f5524fef1fbf2196e"
integrity sha512-acVo635O0I6qMtkge5G2rM00OjXcW9AErphs9Uut0mRvcex4BSuO3KCAqZFM3lTExE+OcaBcf4FeciW6SXF2KA==
"@ttahub/common@^2.1.7":
version "2.1.7"
resolved "https://registry.yarnpkg.com/@ttahub/common/-/common-2.1.7.tgz#739668720f08874b04ec21a428e7453737a5cfb3"
integrity sha512-LNV8DmklA2jwztAF8KOcK3/SFdJNzWCn+o6QquMxGztN8YIzsDoxik9zoygCVtVQwUQo7Y5XXPA9h3fwkUHjag==

"@turf/area@^6.4.0":
version "6.5.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
"@babel/runtime": "^7.12.1",
"@faker-js/faker": "^6.0.0",
"@opensearch-project/opensearch": "^1.1.0",
"@ttahub/common": "^2.2.1",
"@ttahub/common": "^2.1.7",
"adm-zip": "^0.5.1",
"aws-sdk": "^2.826.0",
"aws4": "^1.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ttahub/common",
"version": "2.2.1",
"version": "2.1.7",
"description": "The purpose of this package is to reduce code duplication between the frontend and backend projects.",
"main": "src/index.js",
"author": "",
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const TOPICS = [
'Disabilities Services',
'ERSEA',
'Environmental Health and Safety / EPRR',
'Equity',
'Facilities',
'Family Support Services',
'Fatherhood / Male Caregiving',
Expand Down Expand Up @@ -156,6 +157,7 @@ const TARGET_POPULATIONS = [
exports.TARGET_POPULATIONS = TARGET_POPULATIONS;

const EVENT_TARGET_POPULATIONS = [
'Children/Families affected by systemic discrimination/bias/exclusion',
'Children/Families affected by traumatic events',
'Parents/Families impacted by health disparities',
];
Expand Down
27 changes: 0 additions & 27 deletions src/migrations/20250122205314-definitionally-dirty-work.js

This file was deleted.

1 change: 0 additions & 1 deletion src/models/goalTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default (sequelize, DataTypes) => {
afterCreate: async (instance, options) => afterCreate(sequelize, instance, options),
afterUpdate: async (instance, options) => afterUpdate(sequelize, instance, options),
},
paranoid: true,
});
return GoalTemplate;
};
5 changes: 3 additions & 2 deletions src/services/dashboards/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import {
ActivityReportObjective,
ActivityRecipient,
Grant,
// NextStep,
Goal,
Objective,
Recipient,
Resource,
// Topic,
sequelize,
} from '../../models';
import { formatNumber } from '../../widgets/helpers';
Expand Down Expand Up @@ -2091,8 +2093,7 @@ export async function rollUpResourceUse(data) {
}

export async function rollUpTopicUse(data) {
const filteredTopics = data.topicUseResult.filter((topic) => topic.name !== 'Equity');
const rolledUpTopicUse = filteredTopics.reduce((accumulator, topic) => {
const rolledUpTopicUse = data.topicUseResult.reduce((accumulator, topic) => {
const exists = accumulator.find((r) => r.name === topic.name);
if (!exists) {
// Add a property with the resource's name.
Expand Down
14 changes: 14 additions & 0 deletions src/services/dashboards/resourceFlat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ describe('Resources dashboard', () => {
raw: true,
});

const { topicId: equityTopicId } = await Topic.findOne({
attributes: [['id', 'topicId']],
where: { name: 'Equity' },
raw: true,
});

// Report 1 (Mixed Resources).
const reportOne = await ActivityReport.create({
...regionOneReportA,
Expand Down Expand Up @@ -433,6 +439,14 @@ describe('Resources dashboard', () => {
[ECLKC_RESOURCE_URL, NONECLKC_RESOURCE_URL],
);

// Draft Report 5 Topic 1.
await ActivityReportObjectiveTopic.findOrCreate({
where: {
activityReportObjectiveId: activityReportObjectiveDraft.id,
topicId: equityTopicId,
},
});

// Draft Report 5 Topic 2.
await ActivityReportObjectiveTopic.findOrCreate({
where: {
Expand Down
5 changes: 2 additions & 3 deletions src/services/goalTemplates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ describe('goalTemplates services', () => {
describe('getCuratedTemplates more coverage', () => {
let grant;
let recipient;
let template;

beforeAll(async () => {
recipient = await Recipient.create({
Expand All @@ -302,14 +301,14 @@ describe('goalTemplates services', () => {
recipientId: recipient.id,
});

template = await GoalTemplate.create({
await GoalTemplate.create({
templateName: faker.lorem.sentence(5),
creationMethod: AUTOMATIC_CREATION,
});
});

afterAll(async () => {
await GoalTemplate.destroy({ where: { id: template.id }, individualHooks: true });
await GoalTemplate.destroy({ where: {}, individualHooks: true });
await Grant.destroy({ where: { id: grant.id }, individualHooks: true });
await Recipient.destroy({ where: { id: recipient.id }, individualHooks: true });
});
Expand Down
1 change: 1 addition & 0 deletions src/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export function mockTrainingReportData(data) {
'Affected by Disaster',
'Affected by Substance Use',
'Children Experiencing Homelessness',
'Children/Families affected by systemic discrimination/bias/exclusion.',
'Children/Families affected by traumatic events (select the other reasons for child welfare, disaster, substance use or homelessness)',
'Children in Migrant and Seasonal Families',
'Children with Disabilities',
Expand Down
3 changes: 1 addition & 2 deletions src/tools/createMonitoringGoals.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
/* eslint-disable jest/expect-expect */
/* eslint-disable max-len */
import faker from '@faker-js/faker';
Expand Down Expand Up @@ -1978,7 +1977,7 @@ describe('createMonitoringGoals', () => {
], { individualHooks: true });

// Retrieve the goal template.
goalTemplate = await GoalTemplate.findOne({ where: { standard: 'Monitoring' }, paranoid: false });
goalTemplate = await GoalTemplate.findOne({ where: { standard: 'Monitoring' } });

// Create a goal for grantThatAlreadyHasMonitoringGoal2.
await Goal.create({
Expand Down
2 changes: 1 addition & 1 deletion src/tools/importPlanGoals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Import TTA plan goals', () => {
],
});
expect(allGoals).toBeDefined();
// expect(allGoals.length).toBe(16); this is a foolish test
expect(allGoals.length).toBe(16);

// test eager loading
const goal = await Goal.findOne({
Expand Down
16 changes: 16 additions & 0 deletions src/widgets/topicFrequencyGraph.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ describe('Topics and frequency graph widget', () => {
topic: 'Environmental Health and Safety / EPRR',
count: 0,
},
{
topic: 'Equity',
count: 0,
},
{
topic: 'ERSEA',
count: 0,
Expand Down Expand Up @@ -636,6 +640,10 @@ describe('Topics and frequency graph widget', () => {
topic: 'Environmental Health and Safety / EPRR',
count: 0,
},
{
topic: 'Equity',
count: 0,
},
{
topic: 'ERSEA',
count: 0,
Expand Down Expand Up @@ -805,6 +813,10 @@ describe('Topics and frequency graph widget', () => {
topic: 'Environmental Health and Safety / EPRR',
count: 0,
},
{
topic: 'Equity',
count: 0,
},
{
topic: 'ERSEA',
count: 0,
Expand Down Expand Up @@ -973,6 +985,10 @@ describe('Topics and frequency graph widget', () => {
topic: 'Environmental Health and Safety / EPRR',
count: 0,
},
{
topic: 'Equity',
count: 0,
},
{
topic: 'ERSEA',
count: 0,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3261,10 +3261,10 @@
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==

"@ttahub/common@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@ttahub/common/-/common-2.2.1.tgz#a2e6cc6c79c40fc90ac59b4f5524fef1fbf2196e"
integrity sha512-acVo635O0I6qMtkge5G2rM00OjXcW9AErphs9Uut0mRvcex4BSuO3KCAqZFM3lTExE+OcaBcf4FeciW6SXF2KA==
"@ttahub/common@^2.1.7":
version "2.1.7"
resolved "https://registry.yarnpkg.com/@ttahub/common/-/common-2.1.7.tgz#739668720f08874b04ec21a428e7453737a5cfb3"
integrity sha512-LNV8DmklA2jwztAF8KOcK3/SFdJNzWCn+o6QquMxGztN8YIzsDoxik9zoygCVtVQwUQo7Y5XXPA9h3fwkUHjag==

"@types/[email protected]":
version "1.0.38"
Expand Down

0 comments on commit 4cc484f

Please sign in to comment.