diff --git a/packages/client/components/Tabs/Tabs.tsx b/packages/client/components/Tabs/Tabs.tsx index 9e574d5a13e..8e24d765230 100644 --- a/packages/client/components/Tabs/Tabs.tsx +++ b/packages/client/components/Tabs/Tabs.tsx @@ -25,7 +25,6 @@ const InkBar = styled('div')({ const TabsAndBar = styled('div')({ display: 'flex', flexDirection: 'column', - maxWidth: '24rem', position: 'relative', width: '100%' }) diff --git a/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx b/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx index ff389046562..3842c1338ba 100644 --- a/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx +++ b/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx @@ -129,7 +129,7 @@ const TeamPromptWorkDrawer = (props: Props) => { - + {baseTabs.map((tab, idx) => ( { } return (
- + {tabs .filter((tab) => tab.isVisible) .map((tab, idx) => ( diff --git a/packages/mattermost-plugin/components/CreateTaskModal/CreateTaskModal.tsx b/packages/mattermost-plugin/components/CreateTaskModal/CreateTaskModal.tsx index 5ff3592eff1..ca37b6f4b37 100644 --- a/packages/mattermost-plugin/components/CreateTaskModal/CreateTaskModal.tsx +++ b/packages/mattermost-plugin/components/CreateTaskModal/CreateTaskModal.tsx @@ -122,7 +122,7 @@ const CreateTaskModal = () => { }) if (channel) { - const teamUrl = `${pluginServerRoute}/parabol/team/${teamId}` + const teamUrl = `${pluginServerRoute}/parabol/team/${teamId}/tasks` const message = `Task created in [${teamName}](${teamUrl})` Client4.doFetch(`${Client4.getPostsRoute()}/ephemeral`, { method: 'post', diff --git a/packages/mattermost-plugin/components/Sidepanel/ActiveMeetings.tsx b/packages/mattermost-plugin/components/Sidepanel/ActiveMeetings.tsx index 57b3cf04cc2..954adc2b1f4 100644 --- a/packages/mattermost-plugin/components/Sidepanel/ActiveMeetings.tsx +++ b/packages/mattermost-plugin/components/Sidepanel/ActiveMeetings.tsx @@ -1,8 +1,10 @@ import graphql from 'babel-plugin-relay/macro' import {useMemo} from 'react' +import {useDispatch} from 'react-redux' import {useLazyLoadQuery} from 'react-relay' import {ActiveMeetingsQuery} from '../../__generated__/ActiveMeetingsQuery.graphql' import {useCurrentChannel} from '../../hooks/useCurrentChannel' +import {openStartActivityModal} from '../../reducers' import LoadingSpinner from '../LoadingSpinner' import MeetingRow from './MeetingRow' @@ -17,6 +19,7 @@ graphql` const ActiveMeetings = () => { const channel = useCurrentChannel() + const dispatch = useDispatch() const data = useLazyLoadQuery( graphql` query ActiveMeetingsQuery { @@ -56,11 +59,21 @@ const ActiveMeetings = () => { ) }, [data, channel]) + const handleStart = () => { + dispatch(openStartActivityModal()) + } + const isLoading = false const error = false return ( -
+ <> +
+ Open Activities + +
{isLoading && } {error && (
Loading meetings failed, try refreshing the page
@@ -68,10 +81,12 @@ const ActiveMeetings = () => { {linkedTeams?.length === 0 && (

There are no teams linked to this channel

)} - {linkedTeams?.map((team) => - team.activeMeetings.map((meeting) => ) - )} -
+
+ {linkedTeams?.map((team) => + team.activeMeetings.map((meeting) => ) + )} +
+ ) } diff --git a/packages/mattermost-plugin/components/Sidepanel/LinkedTeams.tsx b/packages/mattermost-plugin/components/Sidepanel/LinkedTeams.tsx index 72fea860caa..79a78873c2e 100644 --- a/packages/mattermost-plugin/components/Sidepanel/LinkedTeams.tsx +++ b/packages/mattermost-plugin/components/Sidepanel/LinkedTeams.tsx @@ -1,13 +1,16 @@ import graphql from 'babel-plugin-relay/macro' import {useMemo} from 'react' +import {useDispatch} from 'react-redux' import {useLazyLoadQuery} from 'react-relay' import {LinkedTeamsQuery} from '../../__generated__/LinkedTeamsQuery.graphql' import {useCurrentChannel} from '../../hooks/useCurrentChannel' +import {openLinkTeamModal} from '../../reducers' import LoadingSpinner from '../LoadingSpinner' import TeamRow from './TeamRow' const LinkedTeams = () => { const channel = useCurrentChannel() + const dispatch = useDispatch() const data = useLazyLoadQuery( graphql` query LinkedTeamsQuery { @@ -41,18 +44,30 @@ const LinkedTeams = () => { ) }, [data, channel]) + const handleLink = () => { + dispatch(openLinkTeamModal()) + } + const isLoading = false const error = false return ( -
+ <> +
+ Linked Teams + +
{isLoading && } {error &&
Loading teams failed, try refreshing the page
} {linkedTeams?.length === 0 && (

There are no teams linked to this channel

)} - {linkedTeams?.map((team) => )} -
+
+ {linkedTeams?.map((team) => )} +
+ ) } diff --git a/packages/mattermost-plugin/components/Sidepanel/SidePanel.tsx b/packages/mattermost-plugin/components/Sidepanel/SidePanel.tsx index 9034dd2b255..8af8d636bc2 100644 --- a/packages/mattermost-plugin/components/Sidepanel/SidePanel.tsx +++ b/packages/mattermost-plugin/components/Sidepanel/SidePanel.tsx @@ -1,8 +1,9 @@ +import {Forum, Group} from '@mui/icons-material' import graphql from 'babel-plugin-relay/macro' -import {useEffect, useMemo, useState} from 'react' -import {useDispatch} from 'react-redux' +import Tab from 'parabol-client/components/Tab/Tab' +import {Suspense, useEffect, useMemo, useState} from 'react' import {useLazyLoadQuery} from 'react-relay' -import ReactSelect from 'react-select' +import Tabs from '~/components/Tabs/Tabs' import {SidePanelQuery} from '../../__generated__/SidePanelQuery.graphql' import {useCurrentChannel} from '../../hooks/useCurrentChannel' import {openLinkTeamModal, openStartActivityModal} from '../../reducers' @@ -11,13 +12,15 @@ import LinkedTeams from './LinkedTeams' const panels = { teams: { - label: 'Linked Parabol Teams', + label: 'Teams', + icon: , panel: LinkedTeams, action: openLinkTeamModal, actionLabel: 'Link Team' }, meetings: { - label: 'Active Meetings', + label: 'Activies', + icon: , panel: ActiveMeetings, action: openStartActivityModal, actionLabel: 'Start Activity' @@ -62,37 +65,27 @@ const SidePanel = () => { } }, [linkedTeams]) - const dispatch = useDispatch() - - const handleClick = () => { - dispatch(panels[activePanel]?.action()) - } - return ( -
-
- ({value, label})) as any} - onChange={(newValue) => { - newValue && setActivePanel(newValue.value) - }} - components={{ - Control: ({children, innerRef, innerProps}) => ( -
- {children} +
+ + {Object.entries(panels).map(([key, {icon, label}]) => ( + + {icon} +
{label}
- ), - IndicatorSeparator: () => null - }} - /> - -
- {panels[activePanel]?.panel()} + } + className='p-2' + onClick={() => setActivePanel(key as any)} + /> + ))} + + {panels[activePanel]?.panel()}
) } diff --git a/packages/mattermost-plugin/components/Sidepanel/index.tsx b/packages/mattermost-plugin/components/Sidepanel/index.tsx index 614151dece2..78b2b171558 100644 --- a/packages/mattermost-plugin/components/Sidepanel/index.tsx +++ b/packages/mattermost-plugin/components/Sidepanel/index.tsx @@ -9,7 +9,7 @@ const SidePanelRoot = () => { const pluginServerRoute = useSelector(getPluginServerRoute) return ( -
+
{loggedIn ? ( ) : (