# What this PR does
Introduces a new class,
`apps.grafana_plugin.ui_url_builder.UIURLBuilder`, which is responsible
for... building UI URLs (😄). The class mainly does two things:
- it will decide if the URL should point to `grafana-oncall-app` or
`grafana-irm-app` based on the value of
`organization.is_grafana_irm_enabled` (**NOTE**: this value isn't yet
being set + defaults to `False`; logic for setting this value will be
done in a subsequent PR)
- Adds `enum`s, `OnCallPage` and `IncidentPage` to DRYify hardcoded UI
URLs (in case we decide to change these slightly in the near future)
## Checklist
- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
show up in the autogenerated release notes.
22 lines
932 B
Python
22 lines
932 B
Python
REDIRECT_AFTER_SLACK_INSTALL = "redirect_after_slack_install"
|
|
# slack errors flags
|
|
SLACK_AUTH_WRONG_WORKSPACE_ERROR = "wrong_workspace"
|
|
SLACK_AUTH_SLACK_USER_ALREADY_CONNECTED_ERROR = "user_already_connected"
|
|
SLACK_AUTH_FAILED = "auth_failed"
|
|
SLACK_REGION_ERROR = "region_error"
|
|
|
|
|
|
# Example of a slack oauth response to be used in tests.
|
|
# It contains NO actual tokens, got it from slack docs.
|
|
# https://api.slack.com/authentication/oauth-v2
|
|
SLACK_OAUTH_ACCESS_RESPONSE = {
|
|
"ok": True,
|
|
"access_token": "xoxb-17653672481-19874698323-pdFZKVeTuE8sk7oOcBrzbqgy",
|
|
"token_type": "bot",
|
|
"scope": "commands,incoming-webhook",
|
|
"bot_user_id": "U0KRQLJ9H",
|
|
"app_id": "A0KRD7HC3",
|
|
"team": {"name": "Slack Softball Team", "id": "T9TK3CUKW"},
|
|
"enterprise": {"name": "slack-sports", "id": "E12345678"},
|
|
"authed_user": {"id": "U1234", "scope": "chat:write", "access_token": "xoxp-1234", "token_type": "user"},
|
|
}
|