stable

Clone or download

Read-only

fix: JS error when changing report mode

Fixes request #40080 JavaScript error when switching from Cross-tracker search expert mode to default How to test: - In a Cross-tracker search widget, set up a query in expert mode and save the report. - Edit the query, switch to default mode, select a tracker, edit the query so that it is valid (for example @id >= 1). Click on "Search". - Only one network request should be sent, there should be no console error. - Click on "Cancel" to discard the changes. - Only one network request should be sent, there should be no console error, the "expert mode" results table should be shown. - If you redo the same process, but click on "Save" the report, only one network request should be sent, the "default mode" table should be shown. - If you redo the same process but switch from default mode to expert mode, only one network request should be sent, there should be no console error. Why? The widget has two "Table" components: ArtifactTable is for default mode, SelectableTable is for expert mode. Both are children of the Widget component, and are mounted using a v-if on the writing report mode (expert or not). There is a timing between the change of mode (expert -> default) and the change of state (edit query -> preview) where both components could be mounted at the same time. Since they both watch the report state, they would both trigger a request. Only one can succeed, because an "expert" query is invalid in default mode, and a "default" query is invalid in expert mode. When Cancelling a previewed report (and discarding changes), the "writing" cross-tracker report was also not correctly reset, it should now match the "backend" report and be back to the report that was saved. Change-Id: I9dbbbdf910bd0ac499c8cdab267a2510f32c290c

Modified Files

Name
M plugins/crosstracker/scripts/cross-tracker/src/CrossTrackerWidget.test.ts +4 −1 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/CrossTrackerWidget.vue +1 −1 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/components/selectable-table/SelectableTable.test.ts +23 −6 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/components/selectable-table/SelectableTable.vue +5 −2 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/components/table/ArtifactTable.test.ts +20 −3 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/components/table/ArtifactTable.vue +5 −2 Go to diff View file