@ttahub/common 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -47
- package/package.json +1 -1
- package/src/index.js +30 -39
package/README.md
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
# @ttahub/common
|
|
2
|
-
|
|
3
|
-
This is a CommonJS package and thus no build step is required.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
yarn add @ttahub/common
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Developers
|
|
12
|
-
|
|
13
|
-
Whenever changes to this package are made, you will need to:
|
|
14
|
-
|
|
15
|
-
- Bump the version in `package.json`.
|
|
16
|
-
- Publish the latest version of the package to npm by running `npm publish` in this directory. There is also a yarn task in the root of the TTAHUB app you can run ```yarn publish:common```
|
|
17
|
-
|
|
18
|
-
If your PR depends on the latest version of this package, please don't forget to run `yarn upgrade @ttahub/common` (in BE and FE) and commit the changes to `package.json` (all 3: ./package.json, ./frontend/package.json, ./packages/common/package.json) and `yarn.lock` (BE and FE).
|
|
19
|
-
|
|
20
|
-
Note: On Windows you will need to use `yarn add @ttahub/common@1.x.0` to update the package.json file's.
|
|
21
|
-
|
|
22
|
-
## Versions
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### 1.1.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### 1.1.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### 1.1.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### 1.1.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
# @ttahub/common
|
|
2
|
+
|
|
3
|
+
This is a CommonJS package and thus no build step is required.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @ttahub/common
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Developers
|
|
12
|
+
|
|
13
|
+
Whenever changes to this package are made, you will need to:
|
|
14
|
+
|
|
15
|
+
- Bump the version in `package.json`.
|
|
16
|
+
- Publish the latest version of the package to npm by running `npm publish` in this directory. There is also a yarn task in the root of the TTAHUB app you can run ```yarn publish:common```
|
|
17
|
+
|
|
18
|
+
If your PR depends on the latest version of this package, please don't forget to run `yarn upgrade @ttahub/common` (in BE and FE) and commit the changes to `package.json` (all 3: ./package.json, ./frontend/package.json, ./packages/common/package.json) and `yarn.lock` (BE and FE).
|
|
19
|
+
|
|
20
|
+
Note: On Windows you will need to use `yarn add @ttahub/common@1.x.0` to update the package.json file's.
|
|
21
|
+
|
|
22
|
+
## Versions
|
|
23
|
+
|
|
24
|
+
### 1.1.9/1.2.0
|
|
25
|
+
(Sorry for the multiple versions) Update the name of the const COLLABORATOR_TRAINING_REPORTS to POC_TRAINING_REPORTS
|
|
26
|
+
|
|
27
|
+
### 1.1.8
|
|
28
|
+
Reorder training report url param statuses so suspended is third tab and not second on TR landing
|
|
29
|
+
|
|
30
|
+
### 1.1.6/7
|
|
31
|
+
Add suspended as an option to training report URL params and status
|
|
32
|
+
|
|
33
|
+
### 1.1.4
|
|
34
|
+
Distinguish between training report url params and training report statuses
|
|
35
|
+
|
|
36
|
+
### 1.1.3
|
|
37
|
+
Add "event target populations"
|
|
38
|
+
|
|
39
|
+
### 1.1.2
|
|
40
|
+
#### 1.1.1
|
|
41
|
+
- Add COLLABORATOR_TRAINING_REPORTS permissions
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -16,7 +16,6 @@ const RECIPIENT_PARTICIPANTS = [
|
|
|
16
16
|
'Teacher / Infant-Toddler Caregiver',
|
|
17
17
|
'Volunteer',
|
|
18
18
|
];
|
|
19
|
-
exports.RECIPIENT_PARTICIPANTS = RECIPIENT_PARTICIPANTS;
|
|
20
19
|
|
|
21
20
|
const OTHER_ENTITY_PARTICIPANTS = [
|
|
22
21
|
'HSCO',
|
|
@@ -29,13 +28,11 @@ const OTHER_ENTITY_PARTICIPANTS = [
|
|
|
29
28
|
'State Head Start Association',
|
|
30
29
|
'Other',
|
|
31
30
|
];
|
|
32
|
-
exports.OTHER_ENTITY_PARTICIPANTS = OTHER_ENTITY_PARTICIPANTS;
|
|
33
31
|
|
|
34
32
|
const ALL_PARTICIPANTS = [
|
|
35
33
|
...RECIPIENT_PARTICIPANTS,
|
|
36
34
|
...OTHER_ENTITY_PARTICIPANTS,
|
|
37
35
|
];
|
|
38
|
-
exports.ALL_PARTICIPANTS = ALL_PARTICIPANTS;
|
|
39
36
|
|
|
40
37
|
const TOPICS = [
|
|
41
38
|
'Behavioral / Mental Health / Trauma',
|
|
@@ -79,7 +76,6 @@ const TOPICS = [
|
|
|
79
76
|
'Transition Practices',
|
|
80
77
|
'Transportation',
|
|
81
78
|
];
|
|
82
|
-
exports.TOPICS = TOPICS;
|
|
83
79
|
|
|
84
80
|
const REASONS = [
|
|
85
81
|
'Below Competitive Threshold (CLASS)',
|
|
@@ -100,7 +96,6 @@ const REASONS = [
|
|
|
100
96
|
'Monitoring | Noncompliance',
|
|
101
97
|
'Monitoring | Deficiency',
|
|
102
98
|
];
|
|
103
|
-
exports.REASONS = REASONS;
|
|
104
99
|
|
|
105
100
|
const REPORT_STATUSES = {
|
|
106
101
|
DRAFT: 'draft',
|
|
@@ -109,7 +104,6 @@ const REPORT_STATUSES = {
|
|
|
109
104
|
APPROVED: 'approved',
|
|
110
105
|
NEEDS_ACTION: 'needs_action',
|
|
111
106
|
};
|
|
112
|
-
exports.REPORT_STATUSES = REPORT_STATUSES;
|
|
113
107
|
|
|
114
108
|
const TRAINING_REPORT_STATUSES = {
|
|
115
109
|
NOT_STARTED: 'Not started',
|
|
@@ -117,7 +111,6 @@ const TRAINING_REPORT_STATUSES = {
|
|
|
117
111
|
COMPLETE: 'Complete',
|
|
118
112
|
SUSPENDED: 'Suspended',
|
|
119
113
|
};
|
|
120
|
-
exports.TRAINING_REPORT_STATUSES = TRAINING_REPORT_STATUSES;
|
|
121
114
|
|
|
122
115
|
const TRAINING_REPORT_STATUSES_URL_PARAMS = {
|
|
123
116
|
'not-started': TRAINING_REPORT_STATUSES.NOT_STARTED,
|
|
@@ -126,15 +119,11 @@ const TRAINING_REPORT_STATUSES_URL_PARAMS = {
|
|
|
126
119
|
complete: TRAINING_REPORT_STATUSES.COMPLETE,
|
|
127
120
|
};
|
|
128
121
|
|
|
129
|
-
exports.TRAINING_REPORT_STATUSES_URL_PARAMS = TRAINING_REPORT_STATUSES_URL_PARAMS;
|
|
130
|
-
|
|
131
122
|
const EVENT_REPORT_STATUSES = {
|
|
132
123
|
IN_PROGRESS: 'In progress',
|
|
133
124
|
COMPLETE: 'Complete',
|
|
134
125
|
}
|
|
135
126
|
|
|
136
|
-
exports.EVENT_REPORT_STATUSES = EVENT_REPORT_STATUSES;
|
|
137
|
-
|
|
138
127
|
const TARGET_POPULATIONS = [
|
|
139
128
|
'Infants and Toddlers (ages birth to 3)',
|
|
140
129
|
'Preschool (ages 3-5)',
|
|
@@ -148,7 +137,6 @@ const TARGET_POPULATIONS = [
|
|
|
148
137
|
'Dual-Language Learners',
|
|
149
138
|
'Program Staff',
|
|
150
139
|
];
|
|
151
|
-
exports.TARGET_POPULATIONS = TARGET_POPULATIONS;
|
|
152
140
|
|
|
153
141
|
const EVENT_TARGET_POPULATIONS = [
|
|
154
142
|
'Children/Families affected by systemic discrimination/bias/exclusion',
|
|
@@ -156,8 +144,6 @@ const EVENT_TARGET_POPULATIONS = [
|
|
|
156
144
|
'Parents/Families impacted by health disparities'
|
|
157
145
|
];
|
|
158
146
|
|
|
159
|
-
exports.EVENT_TARGET_POPULATIONS = EVENT_TARGET_POPULATIONS;
|
|
160
|
-
|
|
161
147
|
const USER_ROLES = [
|
|
162
148
|
'Central Office',
|
|
163
149
|
'Other Federal Staff',
|
|
@@ -178,26 +164,23 @@ const USER_ROLES = [
|
|
|
178
164
|
'Health Specialist',
|
|
179
165
|
'System Specialist',
|
|
180
166
|
];
|
|
181
|
-
exports.USER_ROLES = USER_ROLES;
|
|
182
167
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
'Recipient
|
|
168
|
+
// TODO: This is the deduped combination of GOAL_CLOSE_REASONS and GOAL_SUSPEND_REASONS
|
|
169
|
+
const CLOSE_SUSPEND_REASONS = [
|
|
170
|
+
'Duplicate goal',
|
|
171
|
+
'Key staff turnover / vacancies',
|
|
172
|
+
'Recipient is not responding',
|
|
173
|
+
'Recipient request',
|
|
188
174
|
'Regional Office request',
|
|
189
175
|
'TTA complete',
|
|
190
176
|
];
|
|
191
177
|
|
|
192
|
-
exports.CLOSE_SUSPEND_REASONS = CLOSE_SUSPEND_REASONS;
|
|
193
|
-
|
|
194
178
|
const GOAL_CLOSE_REASONS = [
|
|
195
179
|
'Duplicate goal',
|
|
196
180
|
'Recipient request',
|
|
197
181
|
'Regional Office request',
|
|
198
182
|
'TTA complete',
|
|
199
183
|
];
|
|
200
|
-
exports.GOAL_CLOSE_REASONS = GOAL_CLOSE_REASONS;
|
|
201
184
|
|
|
202
185
|
const GOAL_SUSPEND_REASONS = [
|
|
203
186
|
'Key staff turnover / vacancies',
|
|
@@ -205,7 +188,6 @@ const GOAL_SUSPEND_REASONS = [
|
|
|
205
188
|
'Recipient is not responding',
|
|
206
189
|
'Regional Office request',
|
|
207
190
|
];
|
|
208
|
-
exports.GOAL_SUSPEND_REASONS = GOAL_SUSPEND_REASONS;
|
|
209
191
|
|
|
210
192
|
const GOAL_SOURCES = [
|
|
211
193
|
'Federal monitoring issues, including CLASS and RANs',
|
|
@@ -215,13 +197,10 @@ const GOAL_SOURCES = [
|
|
|
215
197
|
'Training event follow-up',
|
|
216
198
|
];
|
|
217
199
|
|
|
218
|
-
exports.GOAL_SOURCES = GOAL_SOURCES;
|
|
219
|
-
|
|
220
200
|
const APPROVER_STATUSES = {
|
|
221
201
|
APPROVED: 'approved',
|
|
222
202
|
NEEDS_ACTION: 'needs_action',
|
|
223
203
|
};
|
|
224
|
-
exports.APPROVER_STATUSES = APPROVER_STATUSES;
|
|
225
204
|
|
|
226
205
|
const SCOPE_IDS = {
|
|
227
206
|
SITE_ACCESS: 1,
|
|
@@ -234,34 +213,46 @@ const SCOPE_IDS = {
|
|
|
234
213
|
READ_TRAINING_REPORTS: 8,
|
|
235
214
|
POC_TRAINING_REPORTS: 9,
|
|
236
215
|
};
|
|
237
|
-
exports.SCOPE_IDS = SCOPE_IDS;
|
|
238
216
|
|
|
239
217
|
const DECIMAL_BASE = 10;
|
|
240
|
-
exports.DECIMAL_BASE = DECIMAL_BASE;
|
|
241
218
|
|
|
242
219
|
const ALERT_STATUSES = {
|
|
243
220
|
UNPUBLISHED: 'Unpublished',
|
|
244
221
|
PUBLISHED: 'Published'
|
|
245
222
|
};
|
|
246
|
-
exports.ALERT_STATUSES = ALERT_STATUSES;
|
|
247
223
|
|
|
248
224
|
const ALERT_VARIANTS = {
|
|
249
225
|
INFO: 'info',
|
|
250
226
|
EMERGENCY: 'emergency'
|
|
251
227
|
};
|
|
252
|
-
exports.ALERT_VARIANTS = ALERT_VARIANTS;
|
|
253
228
|
|
|
254
229
|
const ALERT_SIZES = {
|
|
255
230
|
STANDARD: 'standard',
|
|
256
231
|
SLIM: 'slim',
|
|
257
232
|
LARGE: 'large'
|
|
258
233
|
};
|
|
259
|
-
exports.ALERT_SIZES = ALERT_SIZES;
|
|
260
234
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
235
|
+
module.exports = {
|
|
236
|
+
RECIPIENT_PARTICIPANTS,
|
|
237
|
+
OTHER_ENTITY_PARTICIPANTS,
|
|
238
|
+
ALL_PARTICIPANTS,
|
|
239
|
+
TOPICS,
|
|
240
|
+
REASONS,
|
|
241
|
+
REPORT_STATUSES,
|
|
242
|
+
TRAINING_REPORT_STATUSES,
|
|
243
|
+
TRAINING_REPORT_STATUSES_URL_PARAMS,
|
|
244
|
+
EVENT_REPORT_STATUSES,
|
|
245
|
+
TARGET_POPULATIONS,
|
|
246
|
+
EVENT_TARGET_POPULATIONS,
|
|
247
|
+
USER_ROLES,
|
|
248
|
+
CLOSE_SUSPEND_REASONS,
|
|
249
|
+
GOAL_CLOSE_REASONS,
|
|
250
|
+
GOAL_SUSPEND_REASONS,
|
|
251
|
+
GOAL_SOURCES,
|
|
252
|
+
APPROVER_STATUSES,
|
|
253
|
+
SCOPE_IDS,
|
|
254
|
+
DECIMAL_BASE,
|
|
255
|
+
ALERT_STATUSES,
|
|
256
|
+
ALERT_VARIANTS,
|
|
257
|
+
ALERT_SIZES,
|
|
258
|
+
};
|