Revision 5285d34cc019c77f7eee2e00a2afd8ff6e84a606 authored by AJ Tomko on 19 October 2022, 12:59:24 UTC, committed by GitHub on 19 October 2022, 12:59:24 UTC
* 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>
1 parent e52c98b
History
File Mode Size
.bingo
.changelog-archive
.github
.husky
.vim
.vscode
.yarn
conf
contribute
cue.mod
devenv
docs
e2e
emails
grafana-mixin
packages
packaging
pkg
plugins-bundled
public
scripts
tools
.betterer.results -rw-r--r-- 499.9 KB
.betterer.ts -rw-r--r-- 2.4 KB
.bra.toml -rw-r--r-- 583 bytes
.browserslistrc -rw-r--r-- 255 bytes
.dockerignore -rw-r--r-- 243 bytes
.drone.star -rw-r--r-- 1.4 KB
.drone.yml -rw-r--r-- 137.3 KB
.editorconfig -rw-r--r-- 453 bytes
.eslintignore -rw-r--r-- 376 bytes
.eslintrc -rw-r--r-- 2.7 KB
.gitattributes -rw-r--r-- 19 bytes
.gitignore -rw-r--r-- 3.6 KB
.golangci.toml -rw-r--r-- 3.0 KB
.linguirc -rw-r--r-- 557 bytes
.nvmrc -rw-r--r-- 9 bytes
.pa11yci-pr.conf.js -rw-r--r-- 3.9 KB
.pa11yci.conf.js -rw-r--r-- 3.5 KB
.prettierignore -rw-r--r-- 502 bytes
.prettierrc.js -rw-r--r-- 95 bytes
.yarnrc.yml -rw-r--r-- 1.8 KB
CHANGELOG.md -rw-r--r-- 334.7 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.1 KB
CONTRIBUTING.md -rw-r--r-- 4.7 KB
Dockerfile -rw-r--r-- 2.8 KB
Dockerfile.ubuntu -rw-r--r-- 2.5 KB
GOVERNANCE.md -rw-r--r-- 12.6 KB
HALL_OF_FAME.md -rw-r--r-- 220 bytes
ISSUE_TRIAGE.md -rw-r--r-- 24.9 KB
LICENSE -rw-r--r-- 33.7 KB
LICENSING.md -rw-r--r-- 750 bytes
MAINTAINERS.md -rw-r--r-- 226 bytes
Makefile -rw-r--r-- 7.7 KB
NOTICE.md -rw-r--r-- 105 bytes
PLUGIN_DEV.md -rw-r--r-- 1.9 KB
README.md -rw-r--r-- 3.0 KB
ROADMAP.md -rw-r--r-- 322 bytes
SECURITY.md -rw-r--r-- 1.6 KB
SUPPORT.md -rw-r--r-- 661 bytes
UPGRADING_DEPENDENCIES.md -rw-r--r-- 3.2 KB
WORKFLOW.md -rw-r--r-- 4.7 KB
babel.config.json -rw-r--r-- 1.4 KB
build.go -rw-r--r-- 182 bytes
crowdin.yml -rw-r--r-- 274 bytes
embed.go -rw-r--r-- 306 bytes
go.mod -rw-r--r-- 18.0 KB
go.sum -rw-r--r-- 357.3 KB
jest.config.js -rw-r--r-- 1.3 KB
latest.json -rw-r--r-- 46 bytes
lerna.json -rw-r--r-- 107 bytes
metadata.md -rw-r--r-- 0 bytes
package.json -rw-r--r-- 16.3 KB
stylelint.config.js -rw-r--r-- 1.5 KB
tsconfig.json -rw-r--r-- 616 bytes
yarn.lock -rw-r--r-- 1.4 MB

README.md

back to top