Background
In order to make creating the chart process more intuitive, we need to add the ability for users to preview before submitting the chart.
Technical notes
As noted in T425608, the JCChartContentView class is used for rendering chart pages, which feeds the JSON to the #chart parser function. All this means is getting a preview from JavaScript should be pretty simple.
Requirements
- Add a preview area to the UI (already done in r1275553)
- Add the JSON blob to the Vue data store
- When changes are made to any field (say on change or blur, not input), we trigger another parse request, and let JCChartContentView handle the rest
- Errors and what not can be shown directly in the preview as they are given by JCChartContentView.
- If needed and deemed helpful, we could have the preview handler fire a JS hook (or whatever) to tell the Vue app which fields to highlight as erroneous (but this may be fragile and unnecessary)
Acceptance criteria
- After making changes to any field in the form, the preview should be updated accordingly.
- For now, errors surfaced by the chart rendering are only shown in the preview panel, and not necessarily also in the form.