diff --git a/CHANGELOG.md b/CHANGELOG.md index abcb3298..a81e264f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix issue where Slack user connection error message is sometimes shown despite successful connection by @joeyorlando ([#3327](https://github.com/grafana/oncall/pull/3327)) - Forward headers for Amazon SNS when organizations are moved @mderynck ([#3326](https://github.com/grafana/oncall/pull/3326)) ## v1.3.57 (2023-11-10) diff --git a/engine/apps/social_auth/pipeline.py b/engine/apps/social_auth/pipeline.py index 10acb47d..6eb6c621 100644 --- a/engine/apps/social_auth/pipeline.py +++ b/engine/apps/social_auth/pipeline.py @@ -57,6 +57,11 @@ def connect_user_to_slack(response, backend, strategy, user, organization, *args strategy.session[REDIRECT_FIELD_NAME] = url return HttpResponse(status=status.HTTP_400_BAD_REQUEST) + # at this point everything is correct and we can create the SlackUserIdentity + # be sure to clear any pre-existing sessions, in case the user previously enecountered errors we want + # to be sure to clear these so they do not see them again + strategy.session.flush() + slack_user_identity, _ = SlackUserIdentity.objects.get_or_create( slack_id=slack_user_id, slack_team_identity=slack_team_identity, diff --git a/grafana-plugin/src/containers/MobileAppConnection/MobileAppConnection.tsx b/grafana-plugin/src/containers/MobileAppConnection/MobileAppConnection.tsx index 4e87938f..b1ae577a 100644 --- a/grafana-plugin/src/containers/MobileAppConnection/MobileAppConnection.tsx +++ b/grafana-plugin/src/containers/MobileAppConnection/MobileAppConnection.tsx @@ -152,7 +152,8 @@ const MobileAppConnection = observer(({ userPk }: Props) => { App connected - You can sync one application to your account. To setup new device please disconnect app first. + You can only sync one application to your account. To setup a new device, please disconnect the currently + connected device first.
@@ -168,7 +169,9 @@ const MobileAppConnection = observer(({ userPk }: Props) => { Sign In - Open Grafana IRM mobile application and scan this code to sync it with your account. + + Open the Grafana IRM mobile application and scan this code to sync it with your account. +
{isQRBlurry && } diff --git a/grafana-plugin/src/containers/MobileAppConnection/__snapshots__/MobileAppConnection.test.tsx.snap b/grafana-plugin/src/containers/MobileAppConnection/__snapshots__/MobileAppConnection.test.tsx.snap index 1f46a2a3..74d48e6f 100644 --- a/grafana-plugin/src/containers/MobileAppConnection/__snapshots__/MobileAppConnection.test.tsx.snap +++ b/grafana-plugin/src/containers/MobileAppConnection/__snapshots__/MobileAppConnection.test.tsx.snap @@ -120,7 +120,7 @@ exports[`MobileAppConnection if we disconnect the app, it disconnects and fetche - Open Grafana IRM mobile application and scan this code to sync it with your account. + Open the Grafana IRM mobile application and scan this code to sync it with your account.
- You can sync one application to your account. To setup new device please disconnect app first. + You can only sync one application to your account. To setup a new device, please disconnect the currently connected device first.
{ diff --git a/grafana-plugin/src/containers/UserSettings/parts/tabs/SlackTab/SlackTab.tsx b/grafana-plugin/src/containers/UserSettings/parts/tabs/SlackTab/SlackTab.tsx index d6d72f0b..ae11270f 100644 --- a/grafana-plugin/src/containers/UserSettings/parts/tabs/SlackTab/SlackTab.tsx +++ b/grafana-plugin/src/containers/UserSettings/parts/tabs/SlackTab/SlackTab.tsx @@ -1,6 +1,6 @@ import React, { useCallback } from 'react'; -import { Button, VerticalGroup, Icon } from '@grafana/ui'; +import { Button, VerticalGroup, Icon, HorizontalGroup } from '@grafana/ui'; import cn from 'classnames/bind'; import Block from 'components/GBlock/Block'; @@ -48,7 +48,9 @@ export const SlackTab = () => { diff --git a/grafana-plugin/src/models/user/user.types.ts b/grafana-plugin/src/models/user/user.types.ts index 6d3caae3..06a60c2d 100644 --- a/grafana-plugin/src/models/user/user.types.ts +++ b/grafana-plugin/src/models/user/user.types.ts @@ -34,6 +34,7 @@ export interface User extends BaseUser { unverified_phone_number?: string; slack_user_identity: { avatar: string; + display_name: string; name: string; slack_id: string; slack_login: string; diff --git a/grafana-plugin/src/pages/settings/tabs/ChatOps/tabs/SlackSettings/SlackSettings.tsx b/grafana-plugin/src/pages/settings/tabs/ChatOps/tabs/SlackSettings/SlackSettings.tsx index bac6f633..e0540ec6 100644 --- a/grafana-plugin/src/pages/settings/tabs/ChatOps/tabs/SlackSettings/SlackSettings.tsx +++ b/grafana-plugin/src/pages/settings/tabs/ChatOps/tabs/SlackSettings/SlackSettings.tsx @@ -289,7 +289,9 @@ class SlackSettings extends Component { ) : ( {store.hasFeature(AppFeature.LiveSettings) && (