Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding integrations to team view tabs #8985

Merged
merged 7 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ const TeamPromptOptionsMenu = (props: Props) => {
<MenuItem
key='slack'
label={
<Link
to={`/team/${team.id}/settings/integrations`}
target='_blank'
rel='noopener noreferrer'
>
<Link to={`/team/${team.id}/integrations`} target='_blank' rel='noopener noreferrer'>
<OptionMenuItem>
<SlackSVG />
<span className='ml-2'>Configure Slack</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const TeamDashHeader = (props: Props) => {
const {organization, id: teamId, name: teamName, teamMembers} = team
const {name: orgName, id: orgId} = organization
const isTasks = useRouteMatch('/team/:teamId/tasks')
const isIntegrations = useRouteMatch('/team/:teamId/integrations')
const {history} = useRouter()

return (
Expand Down Expand Up @@ -143,7 +144,7 @@ const TeamDashHeader = (props: Props) => {
title={'Settings & Integrations'}
to={`/team/${teamId}/settings/`}
>
{'Settings & Integrations'}
{'Settings'}
</NavLink>
)
}}
Expand All @@ -157,11 +158,12 @@ const TeamDashHeader = (props: Props) => {
</Avatars>
</TeamHeaderAndAvatars>
<Tabs
activeIdx={isTasks ? 1 : 0}
activeIdx={isTasks ? 1 : 0 || isIntegrations ? 2 : 0}
Dschoordsch marked this conversation as resolved.
Show resolved Hide resolved
className='full-w max-w-none border-b border-solid border-slate-300'
>
<Tab label='Activity' onClick={() => history.push(`/team/${teamId}/activity`)} />
<Tab label='Tasks' onClick={() => history.push(`/team/${teamId}/tasks`)} />
<Tab label='Integrations' onClick={() => history.push(`/team/${teamId}/integrations`)} />
</Tabs>
</DashSectionHeader>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, {lazy} from 'react'

interface Props {
teamRef: string
}
const TeamIntegrationsRoot = lazy(
() =>
import(
/* webpackChunkName: 'TeamIntegrationsRoot' */ '../../containers/TeamIntegrationsRoot/TeamIntegrationsRoot'
)
)

const TeamDashIntegrationsTab = (props: Props) => {
const {teamRef} = props
return (
<div className='flex w-full flex-wrap px-4'>
<div className='m-0'>
<TeamIntegrationsRoot teamId={teamRef} />
</div>
</div>
)
}
export default TeamDashIntegrationsTab
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import TeamTasksHeaderContainer from '../../containers/TeamTasksHeader/TeamTasks
import TeamDrawer from './TeamDrawer'
import TeamDashTasksTab from '../TeamDashTasksTab/TeamDashTasksTab'
import TeamDashActivityTab from '../TeamDashActivityTab/TeamDashActivityTab'
import TeamDashIntegrationsTab from '../TeamDashIntegrationsTab/TeamDashIntegrationsTab'
import {Route, Switch} from 'react-router-dom'
import getTeamIdFromPathname from '../../../../utils/getTeamIdFromPathname'

const AbsoluteFab = styled(StartMeetingFAB)({
position: 'absolute'
Expand Down Expand Up @@ -44,6 +46,7 @@ const TeamDashMain = (props: Props) => {
const {viewer} = data
const team = viewer.team!
const {name: teamName} = team
const teamId = getTeamIdFromPathname()
useDocumentTitle(`Team Dashboard | ${teamName}`, teamName)

return (
Expand All @@ -56,6 +59,9 @@ const TeamDashMain = (props: Props) => {
<Route path='/team/:teamId/tasks'>
<TeamDashTasksTab viewerRef={viewer} />
</Route>
<Route path='/team/:teamId/integrations'>
<TeamDashIntegrationsTab teamRef={teamId} />
</Route>
{/*Fall back to activity view if nothing is specified*/}
<Route path='/team/:teamId'>
<TeamDashActivityTab teamRef={team} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from '@emotion/styled'
import React, {lazy} from 'react'
import {Route} from 'react-router'
import {matchPath, RouteComponentProps, Switch, withRouter} from 'react-router-dom'
import TeamSettingsToggleNav from '../TeamSettingsToggleNav/TeamSettingsToggleNav'
import {RouteComponentProps, Switch, withRouter} from 'react-router-dom'

const TeamSettings = lazy(
() => import(/* webpackChunkName: 'TeamSettingsRoot' */ '../TeamSettingsRoot')
Expand All @@ -23,17 +22,12 @@ const IntegrationPage = styled('div')({
flexDirection: 'column'
})
const TeamSettingsWrapper = (props: Props) => {
const {
location: {pathname},
match
} = props
const {match} = props
const {
params: {teamId}
} = match
const areaMatch = matchPath(pathname, {path: `${match.url}/:area?`}) || {params: {area: ''}}
return (
<IntegrationPage>
<TeamSettingsToggleNav activeKey={(areaMatch.params as any).area || ''} teamId={teamId} />
<Switch>
Dschoordsch marked this conversation as resolved.
Show resolved Hide resolved
<Route exact path={match.url} render={(p) => <TeamSettings {...p} teamId={teamId} />} />
<Route
Expand Down
Loading