Slack
- Connect Outline to your Slack team to instantly search for documents
- using the /outline command and preview Outline links.
+ Preview Outline links your team mates share and use the{' '}
+ /outline slash command in Slack to search for documents
+ in your teams wiki.
+
+
+ {this.commandIntegration ? (
+ Disconnect
+ ) : (
+
+ )}
+
+
+
+ Collections
+
+ Connect Outline collections to Slack channels and messages will be
+ posted in Slack when documents are published or updated.
-
+
+ {collections.orderedData.map(collection => {
+ const integration = _.find(integrations.slackIntegrations, {
+ collectionId: collection.id,
+ });
+
+ if (integration) {
+ return (
+
+
+ {collection.name} posting activity to the{' '}
+ {integration.settings.channel} Slack
+ channel
+
+ Disconnect
+
+ );
+ }
+
+ return (
+
+ {collection.name}
+
+
+ );
+ })}
+
);
}
}
+const List = styled.ol`
+ list-style: none;
+ margin: 8px 0;
+ padding: 0;
+`;
+
+const ListItem = styled.li`
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 8px 0;
+ border-bottom: 1px solid #eaebea;
+`;
+
const Code = styled.code`
padding: 4px 6px;
margin: 0 2px;
@@ -36,4 +119,4 @@ const Code = styled.code`
border-radius: 4px;
`;
-export default Slack;
+export default inject('collections', 'integrations')(Slack);
diff --git a/app/scenes/Settings/components/SlackButton.js b/app/scenes/Settings/components/SlackButton.js
index 9dcb63c5b..241e6ed60 100644
--- a/app/scenes/Settings/components/SlackButton.js
+++ b/app/scenes/Settings/components/SlackButton.js
@@ -1,5 +1,5 @@
// @flow
-import React from 'react';
+import * as React from 'react';
import styled from 'styled-components';
import { inject } from 'mobx-react';
import { slackAuth } from 'shared/utils/routeHelpers';
@@ -11,19 +11,27 @@ type Props = {
auth: AuthStore,
scopes?: string[],
redirectUri?: string,
+ state?: string,
+ label?: string,
};
-function SlackButton({ auth, scopes, redirectUri }: Props) {
+function SlackButton({ auth, state, label, scopes, redirectUri }: Props) {
const handleClick = () =>
(window.location.href = slackAuth(
- auth.getOauthState(),
+ state ? auth.saveOauthState(state) : auth.genOauthState(),
scopes,
redirectUri
));
return (