2022-06-03 08:09:47 -06:00
|
|
|
{
|
|
|
|
|
"name": "grafana-oncall-app",
|
2024-07-26 10:04:57 +02:00
|
|
|
"version": "1.0.0",
|
2022-06-03 08:09:47 -06:00
|
|
|
"description": "Grafana OnCall Plugin",
|
|
|
|
|
"scripts": {
|
2024-08-28 16:43:52 +02:00
|
|
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx --max-warnings=20 ./src ./e2e-tests",
|
|
|
|
|
"lint:fix": "eslint --max-warnings=20 --fix --ext .js,.jsx,.ts,.tsx ./src ./e2e-tests",
|
2022-11-02 11:44:42 +00:00
|
|
|
"stylelint": "stylelint ./src/**/*.{css,scss,module.css,module.scss}",
|
|
|
|
|
"stylelint:fix": "stylelint --fix ./src/**/*.{css,scss,module.css,module.scss}",
|
2024-06-20 13:54:07 +02:00
|
|
|
"build": "NODE_ENV=production webpack -c ./webpack.config.ts --env production",
|
|
|
|
|
"build:dev": "NODE_ENV=development webpack -c ./webpack.config.ts --env development",
|
2024-09-02 14:48:23 +02:00
|
|
|
"labels:link": "pnpm --dir ../../gops-labels/frontend link && pnpm link \"@grafana/labels\" && pnpm --dir ../../gops-labels/frontend watch",
|
|
|
|
|
"labels:unlink": "pnpm --dir ../../gops-labels/frontend unlink",
|
2024-08-28 10:05:43 -04:00
|
|
|
"mage:build-dev": "go mod download && mage -v build:debug",
|
2024-08-27 10:47:01 -04:00
|
|
|
"mage:watch": "go mod download && mage -v watch",
|
2024-09-09 19:57:00 +02:00
|
|
|
"mod:download": "go mod download",
|
2024-04-09 17:06:11 +02:00
|
|
|
"test-utc": "TZ=UTC jest --verbose --testNamePattern '^((?!@london-tz).)*$'",
|
|
|
|
|
"test-london-tz": "TZ=Europe/London jest --verbose --testNamePattern '@london-tz'",
|
2024-09-02 14:48:23 +02:00
|
|
|
"test": "PLUGIN_ID=grafana-oncall-app pnpm test-utc && pnpm test-london-tz",
|
2024-08-20 12:07:33 +02:00
|
|
|
"test:ci": "PLUGIN_ID=grafana-oncall-app pnpm test-utc && pnpm test-london-tz",
|
2024-09-02 14:48:23 +02:00
|
|
|
"test:report": "HTML_REPORT_ENABLED=true pnpm test",
|
|
|
|
|
"test:silent": "pnpm test --silent",
|
|
|
|
|
"test:e2e": "PLUGIN_ID=grafana-oncall-app pnpm playwright test --grep-invert @expensive",
|
|
|
|
|
"test:e2e-expensive": "PLUGIN_ID=grafana-oncall-app pnpm playwright test --grep @expensive",
|
|
|
|
|
"test:e2e:watch": "pnpm test:e2e --ui",
|
|
|
|
|
"test:e2e-expensive:watch": "pnpm test:e2e-expensive --ui",
|
|
|
|
|
"test:e2e:gen": "pnpm playwright codegen http://localhost:3000",
|
|
|
|
|
"e2e-show-report": "pnpm playwright show-report --port 31000",
|
|
|
|
|
"generate-types": "cd ./src/network/oncall-api/types-generator && pnpm generate",
|
2024-09-13 14:44:20 +02:00
|
|
|
"dev": "NODE_ENV=development webpack -w -c ./webpack.config.ts --env development",
|
|
|
|
|
"serve": "serve -p 3001 ./dist",
|
|
|
|
|
"dev:serve": "concurrently --names \"serve,dev\" --prefix-colors \"blue,green\" \"pnpm serve\" \"pnpm dev\"",
|
2024-02-21 17:49:10 +03:00
|
|
|
"sign": "npx --yes @grafana/sign-plugin@latest",
|
2024-09-02 14:48:23 +02:00
|
|
|
"start": "pnpm watch",
|
2024-02-20 13:09:22 +01:00
|
|
|
"setversion": "setversion",
|
2024-08-28 16:43:52 +02:00
|
|
|
"type-check": "tsc --noEmit",
|
2024-09-02 14:48:23 +02:00
|
|
|
"type-check:watch": "pnpm type-check --watch --preserveWatchOutput false",
|
2024-03-06 09:06:03 +01:00
|
|
|
"find-dead-code": "knip"
|
2022-06-03 08:09:47 -06:00
|
|
|
},
|
|
|
|
|
"repository": {
|
|
|
|
|
"type": "git",
|
|
|
|
|
"url": "git+https://github.com/grafana/oncall.git"
|
|
|
|
|
},
|
|
|
|
|
"lint-staged": {
|
|
|
|
|
"*.ts?(x)": [
|
|
|
|
|
"prettier --write",
|
|
|
|
|
"eslint --fix"
|
|
|
|
|
],
|
|
|
|
|
"*.js?(x)": [
|
|
|
|
|
"prettier --write",
|
|
|
|
|
"eslint --fix"
|
|
|
|
|
],
|
|
|
|
|
"*.css": [
|
|
|
|
|
"stylelint --fix"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"author": "Grafana Labs",
|
|
|
|
|
"license": "Apache-2.0",
|
|
|
|
|
"devDependencies": {
|
2024-02-21 17:49:10 +03:00
|
|
|
"@grafana/eslint-config": "^6.0.0",
|
|
|
|
|
"@grafana/tsconfig": "^1.2.0-rc1",
|
2022-11-16 11:56:54 +02:00
|
|
|
"@jest/globals": "^27.5.1",
|
2024-08-20 12:07:33 +02:00
|
|
|
"@playwright/test": "1.46.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"@swc/core": "^1.3.90",
|
|
|
|
|
"@swc/helpers": "^0.5.0",
|
|
|
|
|
"@swc/jest": "^0.2.26",
|
2024-07-25 14:19:49 +02:00
|
|
|
"@testing-library/dom": "latest",
|
|
|
|
|
"@testing-library/jest-dom": "^6.4.2",
|
|
|
|
|
"@testing-library/react": "^14.1.2",
|
2022-11-21 16:26:00 +01:00
|
|
|
"@testing-library/user-event": "^14.4.3",
|
2022-08-25 19:31:42 +03:00
|
|
|
"@types/dompurify": "^2.3.4",
|
2024-03-28 11:37:22 -04:00
|
|
|
"@types/express": "^4.17.21",
|
2024-02-21 17:49:10 +03:00
|
|
|
"@types/jest": "^29.5.0",
|
|
|
|
|
"@types/lodash": "^4.14.194",
|
2022-08-25 19:31:42 +03:00
|
|
|
"@types/lodash-es": "^4.17.6",
|
2024-07-16 13:16:23 +02:00
|
|
|
"@types/node": "^20.14.10",
|
2022-11-21 16:26:00 +01:00
|
|
|
"@types/query-string": "^6.3.0",
|
2024-08-28 16:43:52 +02:00
|
|
|
"@types/react": "18.2.0",
|
2022-08-25 19:31:42 +03:00
|
|
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
2024-08-28 16:43:52 +02:00
|
|
|
"@types/react-dom": "18.2.0",
|
2022-08-25 19:31:42 +03:00
|
|
|
"@types/react-responsive": "^8.0.5",
|
2023-11-29 14:11:31 +02:00
|
|
|
"@types/react-test-renderer": "^18.0.5",
|
2022-11-21 16:26:00 +01:00
|
|
|
"@types/react-transition-group": "^4.4.5",
|
2024-02-21 17:49:10 +03:00
|
|
|
"@types/testing-library__jest-dom": "5.14.8",
|
2022-08-25 19:31:42 +03:00
|
|
|
"@types/throttle-debounce": "^5.0.0",
|
2022-10-24 14:27:03 +02:00
|
|
|
"@typescript-eslint/eslint-plugin": "^5.40.1",
|
2022-08-25 19:31:42 +03:00
|
|
|
"copy-webpack-plugin": "^11.0.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"css-loader": "^6.7.3",
|
2022-08-25 19:31:42 +03:00
|
|
|
"dompurify": "^2.3.12",
|
2022-10-24 14:27:03 +02:00
|
|
|
"eslint": "^8.25.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"eslint-plugin-deprecation": "^2.0.0",
|
2023-05-17 22:12:51 +02:00
|
|
|
"eslint-plugin-jsdoc": "^44.2.4",
|
2024-04-15 13:55:50 +02:00
|
|
|
"eslint-plugin-promise": "^6.1.1",
|
2022-10-24 14:27:03 +02:00
|
|
|
"eslint-plugin-react": "^7.31.10",
|
|
|
|
|
"eslint-plugin-react-hooks": "^4.6.0",
|
2022-06-03 08:09:47 -06:00
|
|
|
"eslint-plugin-rulesdir": "^0.2.1",
|
2024-02-26 14:52:26 +01:00
|
|
|
"eslint-plugin-unused-imports": "^3.1.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"eslint-webpack-plugin": "^4.0.1",
|
2024-03-29 09:00:18 +01:00
|
|
|
"express": "^4.19.2",
|
2024-02-21 17:49:10 +03:00
|
|
|
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
|
|
|
|
"glob": "^10.2.7",
|
|
|
|
|
"identity-obj-proxy": "3.0.0",
|
|
|
|
|
"jest": "^29.5.0",
|
|
|
|
|
"jest-environment-jsdom": "^29.5.0",
|
2024-03-12 13:21:53 +01:00
|
|
|
"jest-html-reporters": "^3.1.7",
|
2024-03-06 09:06:03 +01:00
|
|
|
"knip": "^5.0.3",
|
2022-06-03 08:09:47 -06:00
|
|
|
"lint-staged": "^10.2.11",
|
2022-08-25 19:31:42 +03:00
|
|
|
"lodash-es": "^4.17.21",
|
first UI integration test - phone verification + receive SMS alert flow (#900)
**What this PR does**:
Adds our first UI integration test using
[Playwright](https://playwright.dev/) and runs the test on CI. Right now
the test:
- logs into Grafana
- configures the plugin (if it isn't already)
- creates an OnCall schedule, where the current user will be OnCall
- creates an escalation chain to notify based on the newly created
OnCall schedule
- creates a webhook integration, attached to the created escalation
chain
- sends a demo alert for the new integration
- goes to the alert groups page and validates that the escalation step
to alert the OnCall user actually happened
Currently the Playwright tests are run against the 3 default headless
browsers, chromium, Firefox, and webkit. The CI job that runs these
tests is run as a matrix against 3 tagged versions of `grafana`; `main`,
`latest`, and `9.2.6`.
Secondly, it adds most of the logic for a second test which:
- logs into Grafana
- configures the plugin (if it isn't already)
- goes to the user's settings, verifies their phone number (using a tool
called [MailSlurp](https://www.mailslurp.com/))
- configures the current user's default escalation policy to send alerts
via SMS
- creates an escalation policy and configures it to send alerts to our
current user
- creates an integration and assigns the created escalation policy
- triggers a test alert + verifies that we receive the SMS alert text
(again, using MailSlurp)
**Which issue(s) this PR fixes**:
Closes #873
**Checklist**
- [x] Tests updated
- [ ] Documentation added (N/A)
- [ ] `CHANGELOG.md` updated (N/A)
2023-03-06 17:28:52 +01:00
|
|
|
"mailslurp-client": "^15.14.1",
|
2024-08-28 16:43:52 +02:00
|
|
|
"moment-timezone": "0.5.45",
|
2024-09-09 09:17:23 -03:00
|
|
|
"openapi-typescript": "^7.4.0",
|
2022-08-26 12:26:33 +03:00
|
|
|
"postcss-loader": "^7.0.1",
|
2024-02-21 17:49:10 +03:00
|
|
|
"prettier": "^2.8.7",
|
2023-11-29 14:11:31 +02:00
|
|
|
"react-test-renderer": "^18.0.2",
|
2024-02-21 17:49:10 +03:00
|
|
|
"replace-in-file-webpack-plugin": "^1.0.6",
|
|
|
|
|
"sass": "1.63.2",
|
|
|
|
|
"sass-loader": "13.3.1",
|
2024-02-27 14:21:53 +00:00
|
|
|
"semver": "^7.6.0",
|
2024-09-13 14:44:20 +02:00
|
|
|
"serve": "^14.2.3",
|
2024-02-21 17:49:10 +03:00
|
|
|
"style-loader": "3.3.3",
|
2022-10-24 14:27:03 +02:00
|
|
|
"stylelint-config-prettier": "^9.0.3",
|
|
|
|
|
"stylelint-prettier": "^2.0.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"swc-loader": "^0.2.3",
|
2022-11-03 16:20:20 +02:00
|
|
|
"ts-jest": "29.0.3",
|
2023-11-29 06:16:13 +01:00
|
|
|
"ts-node": "^10.9.1",
|
2024-02-21 17:49:10 +03:00
|
|
|
"tsconfig-paths": "^4.2.0",
|
2024-07-25 14:19:49 +02:00
|
|
|
"typescript": "5.1",
|
2024-02-21 17:49:10 +03:00
|
|
|
"webpack": "^5.86.0",
|
2024-01-15 11:38:36 +01:00
|
|
|
"webpack-bundle-analyzer": "^4.6.1",
|
2024-02-21 17:49:10 +03:00
|
|
|
"webpack-cli": "^5.1.4",
|
2024-01-15 11:38:36 +01:00
|
|
|
"webpack-livereload-plugin": "^3.0.2"
|
2022-06-03 08:09:47 -06:00
|
|
|
},
|
|
|
|
|
"dependencies": {
|
2023-11-29 14:11:31 +02:00
|
|
|
"@dnd-kit/core": "^6.0.8",
|
2024-01-18 13:15:13 +02:00
|
|
|
"@dnd-kit/modifiers": "^7.0.0",
|
2023-11-29 14:11:31 +02:00
|
|
|
"@dnd-kit/sortable": "^7.0.2",
|
|
|
|
|
"@dnd-kit/utilities": "^3.2.1",
|
2024-02-21 17:49:10 +03:00
|
|
|
"@emotion/css": "11.10.6",
|
2024-08-13 12:18:20 +02:00
|
|
|
"@grafana/data": "^11.1.3",
|
2024-03-11 10:49:54 +01:00
|
|
|
"@grafana/faro-web-sdk": "^1.4.2",
|
|
|
|
|
"@grafana/faro-web-tracing": "^1.4.2",
|
2024-09-18 17:21:16 +03:00
|
|
|
"@grafana/labels": "^1.6.4",
|
2024-08-13 12:18:20 +02:00
|
|
|
"@grafana/runtime": "^11.1.3",
|
2024-01-05 08:05:31 +01:00
|
|
|
"@grafana/scenes": "^1.28.0",
|
2024-08-13 12:18:20 +02:00
|
|
|
"@grafana/schema": "^11.1.3",
|
|
|
|
|
"@grafana/ui": "^11.1.3",
|
2023-11-30 12:05:13 +01:00
|
|
|
"@lifeomic/attempt": "^3.0.3",
|
2022-06-17 12:19:34 +03:00
|
|
|
"array-move": "^4.0.0",
|
2024-08-14 08:59:33 -04:00
|
|
|
"axios": "^1.7.4",
|
2022-06-03 08:09:47 -06:00
|
|
|
"change-case": "^4.1.1",
|
|
|
|
|
"circular-dependency-plugin": "^5.2.2",
|
2024-06-07 15:59:00 +02:00
|
|
|
"classnames": "^2.3.2",
|
2022-09-07 16:05:19 +03:00
|
|
|
"dayjs": "^1.11.5",
|
2024-03-06 09:06:03 +01:00
|
|
|
"eslint-plugin-import": "^2.29.1",
|
2023-11-29 14:11:31 +02:00
|
|
|
"immutability-helper": "^3.1.1",
|
2024-06-24 21:08:50 +02:00
|
|
|
"linkify-react": "^4.1.3",
|
|
|
|
|
"linkifyjs": "^4.1.3",
|
2024-01-03 14:37:01 +03:00
|
|
|
"mobx": "6.12.0",
|
|
|
|
|
"mobx-react": "9.1.0",
|
2023-01-31 20:00:14 +03:00
|
|
|
"object-hash": "^3.0.0",
|
2023-11-29 06:16:13 +01:00
|
|
|
"openapi-fetch": "^0.8.1",
|
2023-11-14 15:28:05 +01:00
|
|
|
"qrcode.react": "^3.1.0",
|
2024-06-07 15:59:00 +02:00
|
|
|
"query-string": "^7.1.1",
|
2023-02-24 13:14:45 +02:00
|
|
|
"raw-loader": "^4.0.2",
|
2022-06-03 08:09:47 -06:00
|
|
|
"rc-table": "^7.17.1",
|
2024-02-21 17:49:10 +03:00
|
|
|
"react": "18.2.0",
|
2022-06-03 08:09:47 -06:00
|
|
|
"react-copy-to-clipboard": "^5.0.2",
|
2024-02-21 17:49:10 +03:00
|
|
|
"react-dom": "18.2.0",
|
2022-06-17 12:19:34 +03:00
|
|
|
"react-draggable": "^4.4.5",
|
2022-06-03 08:09:47 -06:00
|
|
|
"react-emoji-render": "^1.2.4",
|
2024-03-04 13:43:05 +02:00
|
|
|
"react-hook-form": "^7.50.1",
|
2022-06-17 12:19:34 +03:00
|
|
|
"react-modal": "^3.15.1",
|
2022-06-03 08:09:47 -06:00
|
|
|
"react-responsive": "^8.1.0",
|
2024-07-26 13:36:20 +03:00
|
|
|
"react-router-dom-v5-compat": "^6.25.1",
|
2022-06-03 08:09:47 -06:00
|
|
|
"react-sortable-hoc": "^1.11.0",
|
|
|
|
|
"react-string-replace": "^0.4.4",
|
2022-08-29 13:19:56 +03:00
|
|
|
"react-transition-group": "^4.4.5",
|
2024-06-07 15:59:00 +02:00
|
|
|
"react-use": "^17.4.0",
|
2024-08-20 15:06:54 -04:00
|
|
|
"stylelint": "^14.0.0",
|
2022-06-03 08:09:47 -06:00
|
|
|
"stylelint-config-standard": "^22.0.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"throttle-debounce": "^2.1.0",
|
2024-04-29 11:13:26 +03:00
|
|
|
"tinycolor2": "^1.6.0",
|
2024-02-21 17:49:10 +03:00
|
|
|
"tslib": "2.5.3"
|
2024-08-20 10:29:01 -04:00
|
|
|
},
|
|
|
|
|
"resolutions": {
|
2024-08-20 15:06:54 -04:00
|
|
|
"braces": "3.0.3",
|
|
|
|
|
"micromatch": "4.0.6"
|
2024-06-07 15:59:00 +02:00
|
|
|
}
|
2022-06-03 08:09:47 -06:00
|
|
|
}
|