fix: integrate slack button redirect, and doc link
This commit is contained in:
parent
0dfea227da
commit
712fa6fe55
4 changed files with 37 additions and 13 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import React from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import { TextEllipsis, NoContent } from 'UI';
|
||||
import { NoContent } from 'UI';
|
||||
import { remove, edit } from 'Duck/integrations/slack'
|
||||
import DocLink from 'Shared/DocLink/DocLink';
|
||||
|
||||
function SlackChannelList(props) {
|
||||
const { list } = props;
|
||||
|
|
@ -14,7 +15,12 @@ function SlackChannelList(props) {
|
|||
return (
|
||||
<div className="mt-6">
|
||||
<NoContent
|
||||
title="No data available."
|
||||
title={
|
||||
<div>
|
||||
<div className="text-base text-left p-5">Integrate Slack with OpenReplay and share insights with the rest of the team, directly from the recording page.</div>
|
||||
<DocLink className="mt-4" label="Integrate Slack" url="https://docs.openreplay.com/integrations/slack" />
|
||||
</div>
|
||||
}
|
||||
size="small"
|
||||
show={ list.size === 0 }
|
||||
>
|
||||
|
|
@ -30,11 +36,6 @@ function SlackChannelList(props) {
|
|||
{c.endpoint}
|
||||
</div>
|
||||
</div>
|
||||
{/* <div className="flex-shrink-0">
|
||||
<Button plain onClick={() => remove(c.webhookId) }>
|
||||
<Icon name="trash"/>
|
||||
</Button>
|
||||
</div> */}
|
||||
</div>
|
||||
))}
|
||||
</NoContent>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
import React from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import { IconButton } from 'UI'
|
||||
import { CLIENT_TABS, client as clientRoute } from 'App/routes';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
|
||||
function IntegrateSlackButton({ history, tenantId }) {
|
||||
const gotoPreferencesIntegrations = () => {
|
||||
history.push(clientRoute(CLIENT_TABS.INTEGRATIONS));
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<IconButton
|
||||
className="my-auto mt-2 mb-2"
|
||||
icon="integrations/slack"
|
||||
label="Integrate Slack"
|
||||
onClick={gotoPreferencesIntegrations}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default withRouter(connect(state => ({
|
||||
tenantId: state.getIn([ 'user', 'client', 'tenantId' ]),
|
||||
}))(IntegrateSlackButton))
|
||||
|
|
@ -0,0 +1 @@
|
|||
export { default } from './IntegrateSlackButton'
|
||||
|
|
@ -4,6 +4,7 @@ import withRequest from 'HOCs/withRequest';
|
|||
import { Popup, Dropdown, Icon, IconButton } from 'UI';
|
||||
import { pause } from 'Player';
|
||||
import styles from './sharePopup.css';
|
||||
import IntegrateSlackButton from '../IntegrateSlackButton/IntegrateSlackButton';
|
||||
|
||||
@connect(state => ({
|
||||
channels: state.getIn([ 'slack', 'list' ]),
|
||||
|
|
@ -62,12 +63,7 @@ export default class SharePopup extends React.PureComponent {
|
|||
</div>
|
||||
{ options.length === 0 ?
|
||||
<div className={ styles.body }>
|
||||
<a
|
||||
href={ `https://slack.com/oauth/authorize?client_id=252578014882.345694377157&scope=incoming-webhook&state=${ tenantId }` }
|
||||
target="_blank"
|
||||
>
|
||||
<IconButton className="my-auto mt-2 mb-2" icon="integrations/slack" label="Integrate Slack" />
|
||||
</a>
|
||||
<IntegrateSlackButton />
|
||||
</div>
|
||||
:
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue