From c490a941ba28eb5787f051384b289149d2fbb715 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Wed, 6 May 2020 10:56:12 +0300 Subject: [PATCH] Fix: Stop Infinite spinning when login fails (#492) * stop infinite spinning and display error * add status text to localisation * fix failing internationalization --- .../views/authentication/Authentication.tsx | 39 ++++++++++++++----- src/messages/GE.json | 1 + src/types/authentication.ts | 4 ++ 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/app/views/authentication/Authentication.tsx b/src/app/views/authentication/Authentication.tsx index b43397f54..c4aa7d145 100644 --- a/src/app/views/authentication/Authentication.tsx +++ b/src/app/views/authentication/Authentication.tsx @@ -1,12 +1,13 @@ -import { Icon, Label, Spinner, SpinnerSize, styled } from 'office-ui-fabric-react'; +import { Icon, Label, MessageBarType, Spinner, SpinnerSize, styled } from 'office-ui-fabric-react'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, injectIntl } from 'react-intl'; import { IAuthenticationProps } from '../../../types/authentication'; import { Mode } from '../../../types/enums'; import * as authActionCreators from '../../services/actions/auth-action-creators'; +import * as queryStatusActionCreators from '../../services/actions/query-status-action-creator'; import { logIn } from '../../services/graph-client/msal-service'; import { classNames } from '../classnames'; import { showSignInButtonOrProfile } from './auth-util-components'; @@ -19,6 +20,9 @@ export class Authentication extends Component => { + const { + intl: { messages }, + }: any = this.props; this.setState({ loginInProgress: true }); const { mscc } = (window as any); @@ -27,15 +31,25 @@ export class Authentication extends Component