Skip to content

Commit

Permalink
Merge pull request #2613 from HHS/remove-dei
Browse files Browse the repository at this point in the history
Remove DEI
  • Loading branch information
thewatermethod authored Jan 23, 2025
2 parents 9a818f2 + cddc59e commit d33953e
Show file tree
Hide file tree
Showing 21 changed files with 78 additions and 57 deletions.
2 changes: 1 addition & 1 deletion docs/logical_data_model.encoded

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/logical_data_model.puml
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ 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.1.7",
"@ttahub/common": "^2.2.1",
"@use-it/interval": "^1.0.0",
"async": "^3.2.3",
"browserslist": "^4.16.5",
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/components/filter/FilterTopicSelect.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import React from 'react';
import { TOPICS } from '@ttahub/common';
import React, { useState, useEffect } from 'react';
import { getTopics } from '../../fetchers/topics';
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 @@ -18,7 +24,7 @@ export default function FilterTopicSelect({
onApply={onApplyClick}
inputId={inputId}
labelText="Select topics to filter by"
options={TOPIC_OPTIONS}
options={topicOptions}
selectedValues={query}
/>
);
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/filter/__tests__/FilterMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ 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: 2 additions & 0 deletions frontend/src/components/filter/__tests__/FilterTopicSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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 @@ -20,6 +21,7 @@ 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: 8 additions & 0 deletions frontend/src/components/filter/__tests__/goalFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
screen,
waitFor,
} from '@testing-library/react';
import fetchMock from 'fetch-mock';
import {
createDateFilter,
reasonsFilter,
Expand Down Expand Up @@ -90,6 +91,13 @@ 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.1.7":
version "2.1.7"
resolved "https://registry.yarnpkg.com/@ttahub/common/-/common-2.1.7.tgz#739668720f08874b04ec21a428e7453737a5cfb3"
integrity sha512-LNV8DmklA2jwztAF8KOcK3/SFdJNzWCn+o6QquMxGztN8YIzsDoxik9zoygCVtVQwUQo7Y5XXPA9h3fwkUHjag==
"@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==

"@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.1.7",
"@ttahub/common": "^2.2.1",
"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.1.7",
"version": "2.2.1",
"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: 0 additions & 2 deletions packages/common/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const TOPICS = [
'Disabilities Services',
'ERSEA',
'Environmental Health and Safety / EPRR',
'Equity',
'Facilities',
'Family Support Services',
'Fatherhood / Male Caregiving',
Expand Down Expand Up @@ -157,7 +156,6 @@ 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: 27 additions & 0 deletions src/migrations/20250122205314-definitionally-dirty-work.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { prepMigration } = require('../lib/migration');

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.sequelize.transaction(async (transaction) => {
const sessionSig = __filename;
await prepMigration(queryInterface, transaction, sessionSig);
await queryInterface.addColumn(
'GoalTemplates',
'deletedAt',
{
type: Sequelize.DATE,
allowNull: true,
},
{ transaction },
);
return queryInterface.sequelize.query(`
UPDATE "Topics" SET "deletedAt" = NOW() WHERE "name" = 'Equity';
UPDATE "GoalTemplates" SET "deletedAt" = NOW() WHERE "templateName" = '(DEIA) The recipient will implement comprehensive systems and services that promote diversity, equity, inclusion, accessibility, and belonging.';
`, { transaction });
});
},

async down() {
// no rollbacks
},
};
1 change: 1 addition & 0 deletions src/models/goalTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ 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: 2 additions & 3 deletions src/services/dashboards/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import {
ActivityReportObjective,
ActivityRecipient,
Grant,
// NextStep,
Goal,
Objective,
Recipient,
Resource,
// Topic,
sequelize,
} from '../../models';
import { formatNumber } from '../../widgets/helpers';
Expand Down Expand Up @@ -2093,7 +2091,8 @@ export async function rollUpResourceUse(data) {
}

export async function rollUpTopicUse(data) {
const rolledUpTopicUse = data.topicUseResult.reduce((accumulator, topic) => {
const filteredTopics = data.topicUseResult.filter((topic) => topic.name !== 'Equity');
const rolledUpTopicUse = filteredTopics.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: 0 additions & 14 deletions src/services/dashboards/resourceFlat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ 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 @@ -439,14 +433,6 @@ 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: 3 additions & 2 deletions src/services/goalTemplates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ describe('goalTemplates services', () => {
describe('getCuratedTemplates more coverage', () => {
let grant;
let recipient;
let template;

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

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

afterAll(async () => {
await GoalTemplate.destroy({ where: {}, individualHooks: true });
await GoalTemplate.destroy({ where: { id: template.id }, individualHooks: true });
await Grant.destroy({ where: { id: grant.id }, individualHooks: true });
await Recipient.destroy({ where: { id: recipient.id }, individualHooks: true });
});
Expand Down
1 change: 0 additions & 1 deletion src/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ 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: 2 additions & 1 deletion src/tools/createMonitoringGoals.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
/* eslint-disable jest/expect-expect */
/* eslint-disable max-len */
import faker from '@faker-js/faker';
Expand Down Expand Up @@ -1977,7 +1978,7 @@ describe('createMonitoringGoals', () => {
], { individualHooks: true });

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

// 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);
// expect(allGoals.length).toBe(16); this is a foolish test

// test eager loading
const goal = await Goal.findOne({
Expand Down
16 changes: 0 additions & 16 deletions src/widgets/topicFrequencyGraph.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,6 @@ 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 @@ -640,10 +636,6 @@ 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 @@ -813,10 +805,6 @@ 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 @@ -985,10 +973,6 @@ 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.1.7":
version "2.1.7"
resolved "https://registry.yarnpkg.com/@ttahub/common/-/common-2.1.7.tgz#739668720f08874b04ec21a428e7453737a5cfb3"
integrity sha512-LNV8DmklA2jwztAF8KOcK3/SFdJNzWCn+o6QquMxGztN8YIzsDoxik9zoygCVtVQwUQo7Y5XXPA9h3fwkUHjag==
"@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==

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

4 comments on commit d33953e

@LankySharp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make things less accessible and fair. what a future for children and families

@sertraline
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what a future for children and families

As far as it goes, DEI people are not very fond of the idea of having children and advocate against having children in general, so I don't think future children and families will miss an ideology that was actively voting against their existence.

@awheewall
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what a future for children and families

As far as it goes, DEI people are not very fond of the idea of having children and advocate against having children in general, so I don't think future children and families will miss an ideology that was actively voting against their existence.

That's a very big claim. Do you have any evidence for that assertion, sertraline?

@eenickels
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image
Never forget the idiot behind it all. Git blame that guy out of existence. Way to toe the line and do the leg work bootlicker.

Please sign in to comment.