Skip to content

Commit

Permalink
descriptive message after pop-up blocked in browser (#762)
Browse files Browse the repository at this point in the history
* descriptive message after pop-up blocked in browser

* fix lint

* add message translation
  • Loading branch information
ezkemboi authored Nov 17, 2020
1 parent b7a82dc commit 15e79ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/app/views/authentication/Authentication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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 { translateMessage } from '../../utils/translate-messages';
import { classNames } from '../classnames';
import { showSignInButtonOrProfile } from './auth-util-components';
import { authenticationStyles } from './Authentication.styles';
Expand Down Expand Up @@ -38,7 +39,9 @@ export class Authentication extends Component<IAuthenticationProps, { loginInPro
this.props.actions!.setQueryResponseStatus({
ok: false,
statusText: messages['Authentication failed'],
status: errorCode.replace('_', ' '),
status: errorCode === 'popup_window_error'
? translateMessage('popup blocked, allow pop-up windows in your browser')
: errorCode.replace('_', ' '),
messageType: MessageBarType.error
});
this.setState({ loginInProgress: false });
Expand Down
3 changes: 2 additions & 1 deletion src/messages/GE.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,6 @@
"Get token details (Powered by jwt.ms)": "Get token details (Powered by jwt.ms)",
"HTTP request method option": "HTTP request method option",
"Microsoft Graph API Version option": "Microsoft Graph API Version option",
"Query Sample Input": "Query sample input"
"Query Sample Input": "Query sample input",
"popup blocked, allow pop-up windows in your browser": "popup blocked, allow pop-up windows in your browser"
}

0 comments on commit 15e79ab

Please sign in to comment.