refs FOO-2280
flag = none
monitor the use of date-picker widgets to learn more about the use of
the free-form/natural parsing feature.
I've opted to track the events at the innermost layer (DatetimeField
and DateInput) and shove them onto a localStorage buffer that gets
posted to the (TBD) backend on the subsequent page load. This feels like
a simple approach with downsides that we can live with.
The buffer is capped at 50 events, and each event will truncate values
that are longer than 32 characters. There's an ID attached to each event
that points to the widget it came from, which we can use to group
related events to analyze the larger interaction.
:: test plan ::
first, we test the monitoring of the jQuery widget. Create an assignment
and go to its edit page. Scroll down to the "Assign" section as we'll be
spending our time with the date fields there.
- type something like "aug 17" into a date field like Due
- wait for a second and verify the buffer gets filled with a new event
of method "type" (run this or just look at ur localStorage):
console.log(
JSON.stringify(
JSON.parse(
localStorage.getItem('dtnpi')
), null, 4
)
)
- now, pick a date from the Picker widget
- wait for a second and verify the event this time is of the
method "pick"
- now, paste some value into the field and verify the new event is of
method "paste" and that "value" actually points to the PASTED VALUE
and not to whatever the widget ended up translating it to
at this point, we will exercise the same steps but for the React
<DateInput /> widget. Go to the course Assignments page and click on
"..." then "Edit Assignment Dates". You will see many date fields, any
of them will suffice:
- verify typing generates the expected event
- verify picking generates the expected event
- verify pasting generates the expected event
Change-Id: I1f3a4e82a62fb19487516a324dcb0ea34236725e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272364
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>