removed channels will disappear from channel list in policy edit (#31140)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
93aad1d1f0
Коммит
2cf345dd5c
@@ -10,10 +10,9 @@
|
|||||||
.ChannelList__nameColumn {
|
.ChannelList__nameColumn {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
span.channel-icon {
|
span.channel-icon {
|
||||||
margin: 3px 8px 0 0;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ export default class ChannelList extends React.PureComponent<Props, State> {
|
|||||||
// Combine channels to add with existing channels
|
// Combine channels to add with existing channels
|
||||||
const channelsToDisplay = [
|
const channelsToDisplay = [
|
||||||
...Object.values(channelsToAdd),
|
...Object.values(channelsToAdd),
|
||||||
...channels,
|
...channels.filter((channel) => !channelsToRemove[channel.id]),
|
||||||
].slice(startCount - 1, endCount);
|
].slice(startCount - 1, endCount);
|
||||||
|
|
||||||
return channelsToDisplay.map((channel) => {
|
return channelsToDisplay.map((channel) => {
|
||||||
@@ -271,16 +271,8 @@ export default class ChannelList extends React.PureComponent<Props, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isMarkedForRemoval = channelsToRemove[channel.id] === channel;
|
|
||||||
|
|
||||||
// Determine the button text and action based on the channel state
|
// Determine the button text and action based on the channel state
|
||||||
const buttonClassName = `group-actions TeamList_editText${isMarkedForRemoval ? ' marked-for-removal' : ''}`;
|
const buttonText = (
|
||||||
const buttonText = isMarkedForRemoval ? (
|
|
||||||
<FormattedMessage
|
|
||||||
id='admin.access_control.policy.edit_policy.channel_selector.to_be_removed'
|
|
||||||
defaultMessage='To be removed'
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='admin.access_control.policy.edit_policy.channel_selector.remove'
|
id='admin.access_control.policy.edit_policy.channel_selector.remove'
|
||||||
defaultMessage='Remove'
|
defaultMessage='Remove'
|
||||||
@@ -307,7 +299,7 @@ export default class ChannelList extends React.PureComponent<Props, State> {
|
|||||||
remove: (
|
remove: (
|
||||||
<a
|
<a
|
||||||
id={`remove-channel-${channel.id}`}
|
id={`remove-channel-${channel.id}`}
|
||||||
className={buttonClassName}
|
className={'group-actions TeamList_editText'}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.removeChannel(channel);
|
this.removeChannel(channel);
|
||||||
|
|||||||
@@ -283,7 +283,6 @@
|
|||||||
"admin.access_control.policy.edit_policy.channel_selector.remove": "Remove",
|
"admin.access_control.policy.edit_policy.channel_selector.remove": "Remove",
|
||||||
"admin.access_control.policy.edit_policy.channel_selector.subtitle": "Add channels that this attribute based access policy will apply to.",
|
"admin.access_control.policy.edit_policy.channel_selector.subtitle": "Add channels that this attribute based access policy will apply to.",
|
||||||
"admin.access_control.policy.edit_policy.channel_selector.title": "Assigned channels",
|
"admin.access_control.policy.edit_policy.channel_selector.title": "Assigned channels",
|
||||||
"admin.access_control.policy.edit_policy.channel_selector.to_be_removed": "To be removed",
|
|
||||||
"admin.access_control.policy.edit_policy.delete_confirmation.confirm_button": "Delete Policy",
|
"admin.access_control.policy.edit_policy.delete_confirmation.confirm_button": "Delete Policy",
|
||||||
"admin.access_control.policy.edit_policy.delete_confirmation.message": "Are you sure you want to delete this policy? This action cannot be undone.",
|
"admin.access_control.policy.edit_policy.delete_confirmation.message": "Are you sure you want to delete this policy? This action cannot be undone.",
|
||||||
"admin.access_control.policy.edit_policy.delete_confirmation.title": "Confirm Policy Deletion",
|
"admin.access_control.policy.edit_policy.delete_confirmation.title": "Confirm Policy Deletion",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user