Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

Commit f2f8310

Browse files
authored
Switch symptomDate to testDate for bulk uploader (#1193)
* Switch symptomDate to testDate * allow symptom 3rd col * fix dep ctx * add text
1 parent 65c71ec commit f2f8310

File tree

10 files changed

+14
-13
lines changed

10 files changed

+14
-13
lines changed

cmd/adminapi/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func realMain(ctx context.Context) error {
7878
if err != nil {
7979
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
8080
}
81-
if err := oe.StartExporter(); err != nil {
81+
if err := oe.StartExporter(ctx); err != nil {
8282
return fmt.Errorf("error initializing observability exporter: %w", err)
8383
}
8484
defer oe.Close()

cmd/apiserver/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func realMain(ctx context.Context) error {
8181
if err != nil {
8282
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
8383
}
84-
if err := oe.StartExporter(); err != nil {
84+
if err := oe.StartExporter(ctx); err != nil {
8585
return fmt.Errorf("error initializing observability exporter: %w", err)
8686
}
8787
defer oe.Close()

cmd/app-sync/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func realMain(ctx context.Context) error {
6969
if err != nil {
7070
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
7171
}
72-
if err := oe.StartExporter(); err != nil {
72+
if err := oe.StartExporter(ctx); err != nil {
7373
return fmt.Errorf("error initializing observability exporter: %w", err)
7474
}
7575
defer oe.Close()

cmd/cleanup/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func realMain(ctx context.Context) error {
7070
if err != nil {
7171
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
7272
}
73-
if err := oe.StartExporter(); err != nil {
73+
if err := oe.StartExporter(ctx); err != nil {
7474
return fmt.Errorf("error initializing observability exporter: %w", err)
7575
}
7676
defer oe.Close()

cmd/e2e-runner/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func realMain(ctx context.Context) error {
9191
if err != nil {
9292
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
9393
}
94-
if err := oe.StartExporter(); err != nil {
94+
if err := oe.StartExporter(ctx); err != nil {
9595
return fmt.Errorf("error initializing observability exporter: %w", err)
9696
}
9797
defer oe.Close()

cmd/enx-redirect/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func realMain(ctx context.Context) error {
7373
if err != nil {
7474
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
7575
}
76-
if err := oe.StartExporter(); err != nil {
76+
if err := oe.StartExporter(ctx); err != nil {
7777
return fmt.Errorf("error initializing observability exporter: %w", err)
7878
}
7979
defer oe.Close()

cmd/modeler/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func realMain(ctx context.Context) error {
7373
if err != nil {
7474
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
7575
}
76-
if err := oe.StartExporter(); err != nil {
76+
if err := oe.StartExporter(ctx); err != nil {
7777
return fmt.Errorf("error initializing observability exporter: %w", err)
7878
}
7979
defer oe.Close()

cmd/server/assets/codes/bulk-issue.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<label class="custom-file-label" for="csv" id="file-label">Select a CSV file...</label>
4040
</div>
4141
<small class="form-text text-muted">
42-
The CSV file must be of the format <code>phone,date</code>. Each
42+
The CSV file must be of the format <code>phone,testDate,[optional]symptomDate</code>. Each
4343
entry must appear on its own line, and phone numbers must be in
4444
<a href="https://www.twilio.com/docs/glossary/what-e164" target="_blank">E.164</a>
4545
format and dates in <a href="https://www.iso.org/iso-8601-date-and-time-format.html" target="_blank">ISO 8601</a>.
@@ -218,7 +218,7 @@
218218
if (batch.length >= batchSize || i == rows.length - 1 && batch.length > 0) {
219219
$tableBody.empty();
220220
for(let r = 0; r < batch.length; r++) {
221-
let row = "<tr><td>" + batch[r]["phone"] + "</td><td>" + batch[r]["symptomDate"] + "</td></tr>";
221+
let row = "<tr><td>" + batch[r]["phone"] + "</td><td>" + batch[r]["testDate"] + "</td></tr>";
222222
$tableBody.append(row);
223223
}
224224

@@ -265,7 +265,8 @@
265265

266266
// Escape csv row contents
267267
request["phone"] = $("<div>").text(cols[0].trim()).html();
268-
request["symptomDate"] = (cols.length > 1) ? $("<div>").text(cols[1].trim()).html() : "";
268+
request["testDate"] = (cols.length > 1) ? $("<div>").text(cols[1].trim()).html() : "";
269+
request["symptomDate"] = (cols.length > 2) ? $("<div>").text(cols[2].trim()).html() : "";
269270
if (request["phone"] == "") {
270271
return "";
271272
}

cmd/server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func realMain(ctx context.Context) error {
7171
if err != nil {
7272
return fmt.Errorf("unable to create ObservabilityExporter provider: %w", err)
7373
}
74-
if err := oe.StartExporter(); err != nil {
74+
if err := oe.StartExporter(ctx); err != nil {
7575
return fmt.Errorf("error initializing observability exporter: %w", err)
7676
}
7777
defer oe.Close()

docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Exchange a verification code for a long term verification token.
6262
* `["confirmed", "likely"]`
6363
* `["confirmed", "likely", "negative"]`
6464
* It is not possible to get just `likely` or just `negative` - if a client
65-
passes `likely` they are indiciating they can process both `confirmed` and `likely`.
65+
passes `likely` they are indicating they can process both `confirmed` and `likely`.
6666
* `padding` is a _recommended_ field that obfuscates the size of the request
6767
body to a network observer. The client should generate and insert a random
6868
number of base64-encoded bytes into this field. The server does not process
@@ -98,7 +98,7 @@ Possible error code responses. New error codes may be added in future releases.
9898
| `code_invalid` | 400 | No | Code invalid or used, user may need to obtain a new code. |
9999
| `code_expired` | 400 | No | Code has expired, user may need to obtain a new code. |
100100
| `code_not_found` | 400 | No | The server has no record of that code. |
101-
| `invalid_test_type` | 400 | No | The client sent an accept of an unrecgonized test type |
101+
| `invalid_test_type` | 400 | No | The client sent an accept of an unrecognized test type |
102102
| `missing_date` | 400 | No | The realm requires either a test or symptom date, but none was provided. |
103103
| `uuid_already_exists` | 409 | No | The UUID has already been used for an issued code |
104104
| `maintenance_mode ` | 429 | Yes | The server is temporarily down for maintenance. Wait and retry later. |

0 commit comments

Comments
 (0)