Closes #665 - Correctly handle user not granting auth permissions, display friendly error

This commit is contained in:
Tom Moor
2018-06-04 21:06:47 -07:00
parent 53a0f423c3
commit 22e823df9a
5 changed files with 49 additions and 11 deletions

View File

@@ -11,6 +11,8 @@ import HelpText from 'components/HelpText';
import SlackButton from './components/SlackButton';
import CollectionsStore from 'stores/CollectionsStore';
import IntegrationsStore from 'stores/IntegrationsStore';
import Notice from 'shared/components/Notice';
import getQueryVariable from 'shared/utils/getQueryVariable';
type Props = {
collections: CollectionsStore,
@@ -19,7 +21,10 @@ type Props = {
@observer
class Slack extends React.Component<Props> {
error: ?string;
componentDidMount() {
this.error = getQueryVariable('error');
this.props.integrations.fetchPage();
}
@@ -36,6 +41,12 @@ class Slack extends React.Component<Props> {
<CenteredContent>
<PageTitle title="Slack" />
<h1>Slack</h1>
{this.error === 'access_denied' && (
<Notice>
Whoops, you need to accept the permissions in Slack to connect
Outline to your team. Try again?
</Notice>
)}
<HelpText>
Preview Outline links your team mates share and use the{' '}
<Code>/outline</Code> slash command in Slack to search for documents