Unverified Commit 5d16794b authored by Hossein Ahmadian-Yazdi's avatar Hossein Ahmadian-Yazdi Committed by GitHub
Browse files

[MM-26960] Fix Archive Icon not showing up for archived channels on system...

[MM-26960] Fix Archive Icon not showing up for archived channels on system console > Channels page (#5926) (#6012)

* Fix archive icon

* fix linting

* Fix wrong icon showing up

* Fix linting

* Address stylistic changes

* fix test

* Address PR comments

* Fix test
parent a40f08c8
......@@ -183,7 +183,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -397,7 +397,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -444,7 +444,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -491,7 +491,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -538,7 +538,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -585,7 +585,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -632,7 +632,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -679,7 +679,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -726,7 +726,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -773,7 +773,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......@@ -820,7 +820,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelList should match sn
data-testid="channel-display-name"
>
<GlobeIcon
className="channel-icon channel-icon__globe channel-icon___lowerOpacity"
className="channel-icon"
/>
<span
className="TeamList_channelDisplayName"
......
......@@ -3,6 +3,7 @@
.DataGrid_row {
min-height: 40px;
cursor: pointer;
padding-left: 16px;
}
.DataGrid_cell {
......@@ -15,9 +16,18 @@
color: #333333;
opacity: 0.8;
}
.channel-icon___lowerOpacity {
.channel-icon {
display: inline-flex;
justify-content: center;
margin-right: 10px;
opacity: 0.8;
width: 16px;
}
.row-content {
display: flex;
align-items: center;
}
}
}
......
......@@ -12,12 +12,14 @@ import {debounce} from 'mattermost-redux/actions/helpers';
import {browserHistory} from 'utils/browser_history';
import {Constants} from 'utils/constants';
import {isArchivedChannel} from 'utils/channel_utils';
import DataGrid, {Row, Column} from 'components/admin_console/data_grid/data_grid';
import {FilterOptions} from 'components/admin_console/filter/filter';
import TeamFilterDropdown from 'components/admin_console/filter/team_filter_dropdown';
import {PAGE_SIZE} from 'components/admin_console/team_channel_settings/abstract_list.jsx';
import GlobeIcon from 'components/widgets/icons/globe_icon';
import LockIcon from 'components/widgets/icons/lock_icon';
import ArchiveIcon from 'components/widgets/icons/archive_icon';
import './channel_list.scss';
interface ChannelListProps {
......@@ -173,6 +175,16 @@ export default class ChannelList extends React.PureComponent<ChannelListProps, C
channelsToDisplay = channelsToDisplay.slice(startCount - 1, endCount);
return channelsToDisplay.map((channel) => {
let iconToDisplay = <GlobeIcon className='channel-icon'/>;
if (channel.type === Constants.PRIVATE_CHANNEL) {
iconToDisplay = <LockIcon className='channel-icon'/>;
}
if (isArchivedChannel(channel)) {
iconToDisplay = <ArchiveIcon className='channel-icon'/>;
}
return {
cells: {
id: channel.id,
......@@ -181,11 +193,7 @@ export default class ChannelList extends React.PureComponent<ChannelListProps, C
className='group-name overflow--ellipsis row-content'
data-testid='channel-display-name'
>
{channel.type === Constants.PRIVATE_CHANNEL ? (
<LockIcon className='channel-icon channel-icon__lock channel-icon___lowerOpacity'/>
) : (
<GlobeIcon className='channel-icon channel-icon__globe channel-icon___lowerOpacity'/>
)}
{iconToDisplay}
<span className='TeamList_channelDisplayName'>
{channel.display_name}
</span>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment