forked from mattermost/mattermost-plugin-msteams
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MI-3828] Add feature to show linked channels and search the linked c…
…hannels (#41) * [MI-3828] Add feature to show linked channels and search the linked channels * [MI-3828] Fix issue of view not displaying correctly on disconnecting user * [MI-3828] Fix ci * [MI-3828] Remove coverage folder * [MI-3828] Update util classes and refactor some code * [MI-3828] Update style and minor review comments * [MI-3828] Remove extra unit test case and make a common function * [MI-3828] Update breaking ui * [MI-3828] Update snapshot * [MI-3828] Review fixes for Phase 2 UI given by QA (#49) * [MI-3828] Review fixes for Phase 2 UI given by QA * [MI-3828] Fix warning card title
- Loading branch information
1 parent
620e672
commit ee3ad52
Showing
33 changed files
with
576 additions
and
2,004 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 31 additions & 11 deletions
42
webapp/src/components/LinkedChannelCard/LinkedChannelCard.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,50 @@ | ||
import React from 'react'; | ||
|
||
import {Tooltip} from '@brightscout/mattermost-ui-library'; | ||
|
||
import {General as MMConstants} from 'mattermost-redux/constants'; | ||
|
||
import {Icon} from 'components/Icon'; | ||
|
||
import {LinkedChannelCardProps} from './LinkedChannelCard.types'; | ||
|
||
import './LinkedChannelCard.styles.scss'; | ||
|
||
export const LinkedChannelCard = ({msTeamsChannelName, msTeamsTeamName, mattermostChannelName, mattermostTeamName}: LinkedChannelCardProps) => ( | ||
<div className='msteams-sync-utils'> | ||
export const LinkedChannelCard = ({msTeamsChannelName, msTeamsTeamName, mattermostChannelName, mattermostTeamName, mattermostChannelType}: LinkedChannelCardProps) => { | ||
const getData = (channelName: string, teamName: string) => { | ||
return ( | ||
<> | ||
<Tooltip | ||
placement='left' | ||
text={channelName} | ||
> | ||
<h5 className='my-0 msteams-linked-channel__entity-label'>{channelName}</h5> | ||
</Tooltip> | ||
<Tooltip | ||
placement='left' | ||
text={teamName} | ||
> | ||
<h5 className='my-0 opacity-6 msteams-linked-channel__entity-label'>{teamName}</h5> | ||
</Tooltip> | ||
</> | ||
); | ||
}; | ||
|
||
return ( | ||
<div className='px-16 py-12 border-t-1 d-flex gap-4 msteams-linked-channel'> | ||
<div className='msteams-linked-channel__link-icon d-flex align-items-center flex-column justify-center'> | ||
<Icon iconName='link'/> | ||
</div> | ||
<div className='d-flex flex-column gap-6'> | ||
<div className='d-flex flex-column gap-6 msteams-linked-channel__body'> | ||
<div className='d-flex gap-8 align-items-center'> | ||
{/* TODO: Update icon on basis of channel type */} | ||
<Icon iconName='globe'/> | ||
<h5 className='my-0'>{mattermostChannelName}</h5> | ||
<h5 className='my-0 opacity-6'>{mattermostTeamName}</h5> | ||
<Icon iconName={mattermostChannelType === MMConstants.PRIVATE_CHANNEL ? 'lock' : 'globe'}/> | ||
{getData(mattermostChannelName, mattermostTeamName)} | ||
</div> | ||
<div className='d-flex gap-8 align-items-center'> | ||
<Icon iconName='msTeams'/> | ||
<h5 className='my-0'>{msTeamsChannelName}</h5> | ||
<h5 className='my-0 opacity-6'>{msTeamsTeamName}</h5> | ||
{getData(msTeamsChannelName, msTeamsTeamName)} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
webapp/src/components/LinkedChannelCard/LinkedChannelCard.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export type LinkedChannelCardProps = Pick<ChannelLinkData, 'mattermostChannelName' | 'msTeamsChannelName' | 'msTeamsTeamName' | 'mattermostTeamName'> & { | ||
export type LinkedChannelCardProps = Pick<ChannelLinkData, 'mattermostChannelName' | 'msTeamsChannelName' | 'msTeamsTeamName' | 'mattermostTeamName' | 'mattermostChannelType'> & { | ||
channelId: string | ||
} |
Oops, something went wrong.