Skip to content

Commit

Permalink
Merge pull request #260 from adhocteam/main
Browse files Browse the repository at this point in the history
Add activity report fields
  • Loading branch information
rahearn authored Jan 20, 2021
2 parents 4d8bf0a + 1c9ee97 commit dbb9e36
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ parameters:
default: "main"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "js-saving-activity-report-frontend"
default: "js-add-report-fields"
type: string
jobs:
build_and_lint:
Expand Down
7 changes: 4 additions & 3 deletions docs/logical_data_model.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Logical Data Model
==================

<img src="http://www.plantuml.com/plantuml/png/nLRRRkCs47tNL_2jxG8nYXP5WKMms4kzHHxg6dRo0RGuaTcI77OuIc34-VUQ8YABiP8oLe5ziQ4pzyF3oyV0ahYrfWgrD21-dFtwIrLz9-GTQYKyuSQ03U9UyrP8rnXGeYQy3-8MWAlmjtPUahJ2Q0Uyyo2GU8jLLHiPWhW9GEAX4kATq4gy5zenD0Veyh811oGPr8SF1_CsG8Y-Lz4fC6dN750dBGo__HOTB5gx0Jh2CJTOgSqGOiq6tWjmhOtPqS8A6etkQj34zp__z8DOpR_EL_F5b_bQ-7PZT3rBZc6cLPUw9eXTVk9386iBWQNrdQNrQiJo-3HwobCo_Bjyq6EATOqUpiaWX89Ga_QiqVNef76MG5Q7K3nI6u0As8wBtdDDPwvHY3mLX7Ly_Xyh-qzxmEP4IA643VJnGwCRhb1BUlXfWRUOgPzIcS-eTZaSFBe0B-5VK46FJnmKpPZyNfFiDNfTbyVqPL9SaR883PHe1CrnhJcclrB_5TDrCLqWlwCqPHm84LXo6uP8J7XBpznq-4ferrOIXoq0NxDS6Xa5jK4q8DsaZjEolTPsSx0La1vJV2lIIJg6GhrEh_HYdPFhwTnJhKa3bR2UF5FWYQ0YGloRP7WsA3XrYauc9agWO2EVCs1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YaWHgDl890qwfgOrBKQTeU1aN6_AvwrCky6MbtxPY7epihZ4GIqrvnaWzjyCRR787WTOcNLnWDoGuKLKM-k_tLy1YMXCIqvEzeD6Q1-JTRr_SRBelrw76rZYm4pMcuOfi9n2KoGu53NgvtGMSkJEFteSpUo8mTGmknISSc65taQs9407kKAuez7ReTCw74IBv6KEOCd9apiVYh44WzJDZQSaB_YsJ0Q336ydi_179d_peiX3bOnRKkzqBWvThTAIUkdq24t5Nz3lT3Rdn5vqVESIN_LmHjodE2uXAHAlz_fmULRuPCl94v-Vxnz5xl1cUjJDuZfepa2t-m-tR3B_gQJz0wG1iSl_5hHpjJVhv0iqfLokL_aSfvw5Sj6GhoBXmchoK-3pA11iJD5taPlgPVUOabuib-xovh2C-x_C6lUwT_GS0">

UML Source
----------
Expand Down Expand Up @@ -139,7 +139,7 @@ class ActivityReport {
duration : decimal
endDate : date
startDate : date
participantType : string
activityRecipientType : string
requester : string
* status : string
programTypes : array<string>
Expand All @@ -148,6 +148,7 @@ class ActivityReport {
participants : array<string>
topics : array<string>
ttaType : array<string>
context : string
pageState : json
* userId : integer(32) REFERENCES public.Users.id
* lastUpdatedById : integer(32) REFERENCES public.Users.id
Expand Down Expand Up @@ -189,7 +190,7 @@ NonGrantee ||-{ ActivityParticipant
Instructions
------------

1. [Edit this diagram with plantuml.com](http://www.plantuml.com/plantuml/umla/nLRRRkCs47tNL_2jxG8nYXP5WKMms4kzHHxg6dRo0RGuaTcI77OuIc34-VUQ8YABiP8oLe5ziQ4pzyF3oyV0ahYrfWgrD21-dFtwIrLz9-GTQYKyuSQ03U9UyrP8rnXGeYQy3-8MWAlmjtPUahJ2Q0Uyyo2GU8jLLHiPWhW9GEAX4kATq4gy5zenD0Veyh811oGPr8SF1_CsG8Y-Lz4fC6dN750dBGo__HOTB5gx0Jh2CJTOgSqGOiq6tWjmhOtPqS8A6etkQj34zp__z8DOpR_EL_F5b_bQ-7PZT3rBZc6cLPUw9eXTVk9386iBWQNrdQNrQiJ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EyQLqKFgbZ5r-LOEWM8SHW4N1aiVz8pbwVFeEK_Dy6T7WvOKDoq5F2M3KXfZooQ88L_GHUDS8JiJO_L8VKIkO3ijUk6QJroZc7Yg21lu_2zMzgyUewoPYMCD6nJIXo4_Ng6UpVZJeMnfedxEPTwHtatX6CX7V0v_JneBld1GidFo-vfaRocOjZwcbCbnLSfYiZMBdRAMjPQK_bB_MypGnNA1_4fWwpXGAWf87yT8IdZFHsucVc1oDmvOuXPHRWMkB2H1tH5P1B-ius7mhxNT7MmLfASK_nVf35wmKg_BAprRv_XwElbKw_90DQndpnGu8wY4iFm2WaU3ejSpw59YaWHgDl890qwfgOrBKQTeU1aN6_AvwrCky6MbtxPY7epihZ4GIqrvnaWzjyCRR787WTOcNLnWDoGuKLKM-k_tLy1YMXCIqvEzeD6Q1-JTRr_SRBelrw76rZYm4pMcuOfi9n2KoGu53NgvtGMSkJEFteSpUo8mTGmknISSc65taQs9407kKAuez7ReTCw74IBv6KEOCd9apiVYh44WzJDZQSaB_YsJ0Q336ydi_179d_peiX3bOnRKkzqBWvThTAIUkdq24t5Nz3lT3Rdn5vqVESIN_LmHjodE2uXAHAlz_fmULRuPCl94v-Vxnz5xl1cUjJDuZfepa2t-m-tR3B_gQJz0wG1iSl_5hHpjJVhv0iqfLokL_aSfvw5Sj6GhoBXmchoK-3pA11iJD5taPlgPVUOabuib-xovh2C-x_C6lUwT_GS0)
2. Copy and paste the final UML into the UML Source section
3. Update the img src and edit link target to the current values

Expand Down
3 changes: 3 additions & 0 deletions docs/openapi/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ components:
description: Why the activity was conducted
items:
type: string
context:
type: string
description: Additional context an author can provide for a report
participants:
type: array
description: The roles of the people attending the TTA
Expand Down
14 changes: 9 additions & 5 deletions frontend/src/pages/ActivityReport/Pages/activitySummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import {
import DatePicker from '../../../components/DatePicker';
import MultiSelect from '../../../components/MultiSelect';
import {
otherParticipants,
nonGranteeParticipants,
granteeParticipants,
reasons,
otherUsers,
programTypes,
targetPopulations,
} from './constants';
} from '../constants';

const ActivitySummary = ({
register,
Expand Down Expand Up @@ -47,10 +48,13 @@ const ActivitySummary = ({
const selectedRecipients = nonGranteeSelected ? nonGrantees : grants;
const previousActivityRecipientType = useRef(activityRecipientType);
const recipientLabel = nonGranteeSelected ? 'Non-grantee name(s)' : 'Grantee name(s)';
const participantsLabel = nonGranteeSelected ? 'Non-grantee participants' : 'Grantee participants';
const participants = nonGranteeSelected ? nonGranteeParticipants : granteeParticipants;

useEffect(() => {
if (previousActivityRecipientType.current !== activityRecipientType) {
setValue('activityParticipants', []);
setValue('activityRecipients', []);
setValue('participants', []);
previousActivityRecipientType.current = activityRecipientType;
}
}, [activityRecipientType, setValue]);
Expand Down Expand Up @@ -240,10 +244,10 @@ const ActivitySummary = ({
<div className="smart-hub--form-section">
<MultiSelect
name="participants"
label="Grantee participant(s) involved"
label={participantsLabel}
control={control}
options={
otherParticipants.map((participant) => ({ value: participant, label: participant }))
participants.map((participant) => ({ value: participant, label: participant }))
}
/>
</div>
Expand Down
37 changes: 0 additions & 37 deletions frontend/src/pages/ActivityReport/Pages/constants.js

This file was deleted.

36 changes: 27 additions & 9 deletions frontend/src/pages/ActivityReport/Pages/goalsObjectives.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';

const GoalsObjectives = () => (
import {
Fieldset, Label, Textarea,
} from '@trussworks/react-uswds';

const GoalsObjectives = ({ register }) => (
<>
<Helmet>
<title>Goals and objectives</title>
</Helmet>
<div>
Goals and objectives
</div>
<Fieldset className="smart-hub--report-legend smart-hub--form-section" legend="Context">
<Label htmlFor="context">OPTIONAL: Provide background or context for this activity</Label>
<Textarea id="context" name="context" inputRef={register()} />
</Fieldset>
</>
);

GoalsObjectives.propTypes = {};
const sections = [];
GoalsObjectives.propTypes = {
register: PropTypes.func.isRequired,
};

const sections = [
{
title: 'Context',
anchor: 'context',
items: [
{ label: 'Context', name: 'context' },
],
},
];

export default {
position: 3,
label: 'Goals and objectives',
path: 'goals-objectives',
review: false,
sections,
render: () => (
<GoalsObjectives />
),
render: (hookForm) => {
const { register } = hookForm;
return <GoalsObjectives register={register} />;
},
};
2 changes: 1 addition & 1 deletion frontend/src/pages/ActivityReport/Pages/topicsResources.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import MultiSelect from '../../../components/MultiSelect';
import FileUploader from '../../../components/FileUploader';
import { topics } from './constants';
import { topics } from '../constants';

const TopicsResources = ({
register,
Expand Down
74 changes: 74 additions & 0 deletions frontend/src/pages/ActivityReport/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
export const reasons = [
'Below Competitive Threshold (CLASS)',
'Below Quality Threshold (CLASS)',
'Change in Scope',
'Full Enrollment',
'New Grantee',
'New Director or Management',
'New Program Option',
'New Staff / Turnover',
'Ongoing Quality Improvement',
'Planning/Coordination (also TTA Plan Agreement)',
'School Readiness Goals',
'Monitoring | Area of Concern',
'Monitoring | Noncompliance',
'Monitoring | Deficiency',
];

export const granteeParticipants = [
'CEO / CFO / Executive',
'Center Director / Site Director',
'Coach',
'Direct Service: Other',
'Family Service Worker / Case Manager',
'Fiscal Manager/Team',
'Governing Body / Tribal Council / Policy Council',
'Home Visitor',
'Manager / Coordinator / Specialist',
'Parent / Guardian',
'Program Director (HS / EHS)',
'Program Support / Administrative Assistant',
'Teacher / Infant-Toddler Caregiver',
'Volunteer',
];

export const nonGranteeParticipants = [
'Local/State Agency(ies)',
'HSCO',
'OCC Regional Office',
'OHS Regional Office',
'Regional Head Start Association',
'Regional TTA Team / Specialists',
'State Early Learning System',
'State Head Start Association',
'Other',
];

export const targetPopulations = [
'Affected by Child Welfare Involvement',
'Affected by Disaster',
'Affected by Substance Use',
'Children with Disabilities',
'Children Experiencing Homelessness',
'Dual-Language Learners',
'Pregnant Women',
];

export const otherUsers = [
'User 1',
'User 2',
'User 3',
];

export const programTypes = [
'program type 1',
'program type 2',
'program type 3',
'program type 4',
'program type 5',
];

export const topics = [
'first',
'second',
];
1 change: 1 addition & 0 deletions frontend/src/pages/ActivityReport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const defaultValues = {
deliveryMethod: [],
activityType: [],
attachments: [],
context: '',
duration: '',
endDate: null,
grantees: [],
Expand Down
15 changes: 15 additions & 0 deletions src/migrations/20210120153248-add-context-field.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
up: async (queryInterface, Sequelize) => {
queryInterface.addColumn(
'ActivityReports',
'context',
{
type: Sequelize.DataTypes.STRING,
},
);
},

down: async (queryInterface) => {
queryInterface.removeColumn('ActivityReports', 'context');
},
};
3 changes: 3 additions & 0 deletions src/models/activityReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export default (sequelize, DataTypes) => {
topics: {
type: DataTypes.ARRAY(DataTypes.STRING),
},
context: {
type: DataTypes.STRING,
},
pageState: {
type: DataTypes.JSON,
},
Expand Down

0 comments on commit dbb9e36

Please sign in to comment.