@pih/esm-referrals-queue-app 2.0.0-pre.11 → 2.0.0-pre.12
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/dist/319.js +1 -1
- package/dist/574.js +1 -1
- package/dist/757.js +1 -1
- package/dist/830.js +1 -1
- package/dist/pih-esm-referrals-queue-app.js.buildmanifest.json +14 -14
- package/package.json +1 -1
- package/src/referrals-queue/referrals-queue.component.tsx +22 -24
- package/src/referrals-queue/referrals-queue.scss +1 -13
- package/src/referrals-queue/referrals-queue.test.tsx +25 -15
- package/translations/en.json +2 -0
- package/translations/es.json +2 -0
- package/translations/fr.json +2 -0
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"132.js"
|
|
45
45
|
],
|
|
46
46
|
"auxiliaryFiles": [],
|
|
47
|
-
"hash": "
|
|
47
|
+
"hash": "f0ec2086103a5bfe7fee",
|
|
48
48
|
"childrenByOrder": {}
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"main.js"
|
|
96
96
|
],
|
|
97
97
|
"auxiliaryFiles": [],
|
|
98
|
-
"hash": "
|
|
98
|
+
"hash": "6b108a42d6b242e0afac",
|
|
99
99
|
"childrenByOrder": {}
|
|
100
100
|
},
|
|
101
101
|
{
|
|
@@ -150,9 +150,9 @@
|
|
|
150
150
|
"initial": false,
|
|
151
151
|
"entry": false,
|
|
152
152
|
"recorded": false,
|
|
153
|
-
"size":
|
|
153
|
+
"size": 375,
|
|
154
154
|
"sizes": {
|
|
155
|
-
"javascript":
|
|
155
|
+
"javascript": 375
|
|
156
156
|
},
|
|
157
157
|
"names": [],
|
|
158
158
|
"idHints": [],
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"319.js"
|
|
165
165
|
],
|
|
166
166
|
"auxiliaryFiles": [],
|
|
167
|
-
"hash": "
|
|
167
|
+
"hash": "8276b3c3ed78dc838866",
|
|
168
168
|
"childrenByOrder": {}
|
|
169
169
|
},
|
|
170
170
|
{
|
|
@@ -197,9 +197,9 @@
|
|
|
197
197
|
"initial": false,
|
|
198
198
|
"entry": false,
|
|
199
199
|
"recorded": false,
|
|
200
|
-
"size":
|
|
200
|
+
"size": 335,
|
|
201
201
|
"sizes": {
|
|
202
|
-
"javascript":
|
|
202
|
+
"javascript": 335
|
|
203
203
|
},
|
|
204
204
|
"names": [],
|
|
205
205
|
"idHints": [],
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"574.js"
|
|
212
212
|
],
|
|
213
213
|
"auxiliaryFiles": [],
|
|
214
|
-
"hash": "
|
|
214
|
+
"hash": "da6b74efbd20e349ed91",
|
|
215
215
|
"childrenByOrder": {}
|
|
216
216
|
},
|
|
217
217
|
{
|
|
@@ -472,9 +472,9 @@
|
|
|
472
472
|
"initial": false,
|
|
473
473
|
"entry": false,
|
|
474
474
|
"recorded": false,
|
|
475
|
-
"size":
|
|
475
|
+
"size": 348,
|
|
476
476
|
"sizes": {
|
|
477
|
-
"javascript":
|
|
477
|
+
"javascript": 348
|
|
478
478
|
},
|
|
479
479
|
"names": [],
|
|
480
480
|
"idHints": [],
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
"757.js"
|
|
487
487
|
],
|
|
488
488
|
"auxiliaryFiles": [],
|
|
489
|
-
"hash": "
|
|
489
|
+
"hash": "09d28da7cd1c7d212321",
|
|
490
490
|
"childrenByOrder": {}
|
|
491
491
|
},
|
|
492
492
|
{
|
|
@@ -494,10 +494,10 @@
|
|
|
494
494
|
"initial": false,
|
|
495
495
|
"entry": false,
|
|
496
496
|
"recorded": false,
|
|
497
|
-
"size":
|
|
497
|
+
"size": 1032276,
|
|
498
498
|
"sizes": {
|
|
499
499
|
"consume-shared": 126,
|
|
500
|
-
"javascript":
|
|
500
|
+
"javascript": 1032150
|
|
501
501
|
},
|
|
502
502
|
"names": [],
|
|
503
503
|
"idHints": [],
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
"830.js"
|
|
510
510
|
],
|
|
511
511
|
"auxiliaryFiles": [],
|
|
512
|
-
"hash": "
|
|
512
|
+
"hash": "910b36549298f5eeeb36",
|
|
513
513
|
"childrenByOrder": {}
|
|
514
514
|
}
|
|
515
515
|
]
|
package/package.json
CHANGED
|
@@ -83,32 +83,30 @@ export default function ReferralsQueue(props: ReferralsQueueProps) {
|
|
|
83
83
|
</Heading>
|
|
84
84
|
<div className={styles.controlsContainer}>
|
|
85
85
|
<div className={styles.inputContainer}>
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
setToDate(date ? moment(date[1]) : null);
|
|
97
|
-
}
|
|
86
|
+
<DatePicker
|
|
87
|
+
dateFormat="d/M/Y"
|
|
88
|
+
datePickerType="range"
|
|
89
|
+
locale={language === "ht" ? "fr" : language}
|
|
90
|
+
maxDate={new Date().toISOString()}
|
|
91
|
+
onChange={(date) => {
|
|
92
|
+
if (date && date.length > 0) {
|
|
93
|
+
setFromDate(date ? moment(date[0]) : null);
|
|
94
|
+
if (date.length > 1) {
|
|
95
|
+
setToDate(date ? moment(date[1]) : null);
|
|
98
96
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
99
|
+
value={[fromDate.toISOString(), toDate.toISOString()]}
|
|
100
|
+
>
|
|
101
|
+
<DatePickerInput id="from-date" labelText={t("from", "From")} />
|
|
102
|
+
<DatePickerInput id="to-date" labelText={t("to", "To")} />
|
|
103
|
+
</DatePicker>
|
|
106
104
|
</div>
|
|
107
105
|
<div className={styles.inputContainer}>
|
|
108
|
-
<div style={{ width:
|
|
106
|
+
<div style={{ width: 400 }}>
|
|
109
107
|
<Dropdown
|
|
110
108
|
id="referral-type"
|
|
111
|
-
label=""
|
|
109
|
+
label={t("select-referral-type", "Select Referral Type")}
|
|
112
110
|
titleText={t("referral-type", "Referral Type")}
|
|
113
111
|
items={referralTypes}
|
|
114
112
|
onChange={(e) => setReferralTypeFilter(e.selectedItem)}
|
|
@@ -116,7 +114,7 @@ export default function ReferralsQueue(props: ReferralsQueueProps) {
|
|
|
116
114
|
</div>
|
|
117
115
|
</div>
|
|
118
116
|
<div className={styles.inputContainer}>
|
|
119
|
-
<div>
|
|
117
|
+
<div style={{ width: 400 }}>
|
|
120
118
|
<label htmlFor="query-input">
|
|
121
119
|
<Trans i18nKey="filter-by-patient">Filter by patient</Trans>
|
|
122
120
|
</label>
|
|
@@ -128,10 +126,10 @@ export default function ReferralsQueue(props: ReferralsQueueProps) {
|
|
|
128
126
|
</div>
|
|
129
127
|
</div>
|
|
130
128
|
<div className={styles.inputContainer}>
|
|
131
|
-
<div style={{ width:
|
|
129
|
+
<div style={{ width: 400 }}>
|
|
132
130
|
<Dropdown
|
|
133
131
|
id="status"
|
|
134
|
-
label=""
|
|
132
|
+
label={t("select-status", "Select Status")}
|
|
135
133
|
titleText={t("status", "Status")}
|
|
136
134
|
items={statuses}
|
|
137
135
|
onChange={(e) => setStatusFilter(e.selectedItem)}
|
|
@@ -6,13 +6,9 @@
|
|
|
6
6
|
max-width: 1500px;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
.tableContainer {
|
|
11
10
|
height: 500px;
|
|
12
11
|
overflow-x: auto;
|
|
13
|
-
margin: 0 1rem;
|
|
14
|
-
border: 2px solid lightgrey;
|
|
15
|
-
border-radius: 0.25rem;
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
.controlsContainer {
|
|
@@ -26,14 +22,6 @@
|
|
|
26
22
|
min-width: 300px;
|
|
27
23
|
text-align: left;
|
|
28
24
|
padding: 0.5rem;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.inputContainer label {
|
|
32
|
-
display: inline-block;
|
|
33
|
-
margin: 0 0.5rem 0.5rem 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.dateInputContainer {
|
|
37
|
-
margin: 2rem 2rem 1rem 0;
|
|
25
|
+
align-items: flex-end;
|
|
38
26
|
}
|
|
39
27
|
|
|
@@ -93,7 +93,7 @@ describe("referrals queue", () => {
|
|
|
93
93
|
screen.getByText("28 Mar");
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
// TODO
|
|
96
|
+
// TODO figure out how to test links
|
|
97
97
|
it.skip("navigates to the links", async () => {
|
|
98
98
|
const table = screen.getByRole("table");
|
|
99
99
|
const pt0DashLink = within(table).getByText(referrals[0].zl_emr_id);
|
|
@@ -125,32 +125,42 @@ describe("referrals queue", () => {
|
|
|
125
125
|
expect(within(table).getByText("Test Complete").tagName).not.toBe("A"); // the actual test
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
it
|
|
129
|
-
|
|
130
|
-
selector: "
|
|
131
|
-
});
|
|
132
|
-
fireEvent.
|
|
128
|
+
it("filters by referral type", () => {
|
|
129
|
+
fireEvent.click(screen.getByLabelText("Referral Type", {
|
|
130
|
+
selector: "button",
|
|
131
|
+
}));
|
|
132
|
+
fireEvent.click(screen.getByText("Mental Health", {
|
|
133
|
+
selector: "div"
|
|
134
|
+
}));
|
|
133
135
|
expect(screen.queryByText("PTID1")).toBeNull();
|
|
134
136
|
expect(screen.queryByText("PTID2")).not.toBeNull();
|
|
135
137
|
expect(screen.queryByText("PTID3")).toBeNull();
|
|
136
138
|
});
|
|
137
139
|
|
|
138
|
-
it
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
it("infers list of referral types from data", () => {
|
|
141
|
+
expect(screen.queryByText("Test Referral Type", { selector: "span" })).toBeNull(); // sanity check
|
|
142
|
+
fireEvent.click(screen.getByLabelText("Referral Type", {
|
|
143
|
+
selector: "button",
|
|
144
|
+
}));
|
|
145
|
+
fireEvent.click(screen.getByText("Test Referral Type", {
|
|
146
|
+
selector: "div"
|
|
147
|
+
}));
|
|
148
|
+
expect(screen.queryByText("Test Referral Type", { selector: "span" })).not.toBeNull();
|
|
144
149
|
});
|
|
145
150
|
|
|
146
|
-
it
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
it("filters by statuses, with dropdown inferred from data", () => {
|
|
152
|
+
fireEvent.click(screen.getByLabelText("Status", {
|
|
153
|
+
selector: "button",
|
|
154
|
+
}));
|
|
155
|
+
fireEvent.click(screen.getByText("Test Complete", {
|
|
156
|
+
selector: "div"
|
|
157
|
+
}));
|
|
149
158
|
expect(screen.queryByText("PTID1")).toBeNull();
|
|
150
159
|
expect(screen.queryByText("PTID2")).toBeNull();
|
|
151
160
|
expect(screen.queryByText("PTID3")).not.toBeNull();
|
|
152
161
|
});
|
|
153
162
|
|
|
163
|
+
// TODO figure out how to interact with Carbon datepicker
|
|
154
164
|
it.skip("calls getReferrals with the correct date arguments", () => {
|
|
155
165
|
const monthAgoString = "2020-09-30";
|
|
156
166
|
expect(mockedGetReferrals).lastCalledWith({
|
package/translations/en.json
CHANGED
package/translations/es.json
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"referral-date": "Fecha de referencia",
|
|
9
9
|
"referral-type": "Tipo de referencia",
|
|
10
10
|
"referrals-queue": "Cola de referencias",
|
|
11
|
+
"select-referral-type": "Seleccionar tipo de referencia",
|
|
12
|
+
"select-status": "Seleccionar estado",
|
|
11
13
|
"status": "Estado",
|
|
12
14
|
"to": "Hasta"
|
|
13
15
|
}
|
package/translations/fr.json
CHANGED