grafana/public/app/features/manage-dashboards/state
AJ Tomko 5285d34cc0
Dashboard: Alerts user to incorrect tag format for JSON import (#54657)
* Dashboard: Alerts user to incorrect tag format for JSON import

Fixes #54285: Malformed tags cause hidden title and settings page crash

* Update public/app/features/manage-dashboards/utils/validation.ts

Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>

* Included Suggestions

- Removed Comments
- Updated Code Block accordingly
- Updated Tests to camelCase over snake_case

* Updates per comments

- Re-wrapped function in try{}, catch{} as I appear to have overlooked including it in the initial refactor
- Re-worded errors to align with initial error
- Added a test case for invalid json

* Update validation.ts

Updated errors to read correctly to the root cause.
Updated dashboard variable as const.

* Update actions.test.ts

Fix tests according to error output rewording

* Update validation.ts

- Included test for an empty string of non-array

* Update actions.test.ts

-- Commented incorrect commit for validation.ts, update:
- Refactored code to better align and separate from generic JSON package tests followed by our manual checks of (1) Is array, and (2) if array, is of strings

- Test cases now include a check for non-array empty string in the tag property

Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>
2022-10-19 08:59:24 -04:00
..
actions.test.ts Dashboard: Alerts user to incorrect tag format for JSON import (#54657) 2022-10-19 08:59:24 -04:00
actions.ts BackendSrv: Make it possible to pass options to .get|post|patch... methods (#51316) 2022-10-04 10:40:21 +02:00
reducers.test.ts Export: Fix export/import of dash with library panels (#49319) 2022-06-29 16:18:27 +01:00
reducers.ts Export: Fix export/import of dash with library panels (#49319) 2022-06-29 16:18:27 +01:00