-
Notifications
You must be signed in to change notification settings - Fork 109
fix issue not show icon start call in chaneel #1221
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; | |
| import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; | ||
| import {connect} from 'react-redux'; | ||
| import { | ||
| areGroupCallsAllowed, | ||
| callsShowButton, | ||
| channelIDForCurrentCall, | ||
| currentChannelHasCall, | ||
|
|
@@ -14,14 +15,15 @@ import { | |
| isLimitRestricted, | ||
| maxParticipants, | ||
| } from 'src/selectors'; | ||
| import {isDmGmChannel} from 'src/utils'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GM channels are being shown as callable where backend still blocks them on unlicensed cloud. Line 26 uses Suggested fix-import {isDmGmChannel} from 'src/utils';
@@
- show: callsShowButton(state, channel?.id) && (areGroupCallsAllowed(state) || isDmGmChannel(channel)),
+ show: callsShowButton(state, channel?.id) && (areGroupCallsAllowed(state) || channel?.type === 'D'),Also applies to: 26-26 🤖 Prompt for AI Agents |
||
|
|
||
| import ChannelHeaderDropdownButton from './component'; | ||
|
|
||
| const mapStateToProps = (state: GlobalState) => { | ||
| const channel = getCurrentChannel(state); | ||
|
|
||
| return { | ||
| show: callsShowButton(state, channel?.id), | ||
| show: callsShowButton(state, channel?.id) && (areGroupCallsAllowed(state) || isDmGmChannel(channel)), | ||
| inCall: Boolean(channelIDForCurrentCall(state) && channelIDForCurrentCall(state) === channel?.id), | ||
| hasCall: currentChannelHasCall(state), | ||
| isAdmin: isCurrentUserSystemAdmin(state), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stabilize these tests by pinning
MM_CALLS_GROUP_CALLS_ALLOWED.Both subtests rely on the default branch of
GroupCallsAllowed(), but they never set/reset the env var. If the runner environment setsMM_CALLS_GROUP_CALLS_ALLOWED, these expectations can flip and become flaky.Suggested fix
t.Run("allow calls in DMs only on unlicensed cloud", func(t *testing.T) { + t.Setenv("MM_CALLS_GROUP_CALLS_ALLOWED", "") defer mockAPI.AssertExpectations(t) defer mockMetrics.AssertExpectations(t) defer ResetTestStore(t, p.store) @@ t.Run("allow calls in all channels on self-hosted", func(t *testing.T) { + t.Setenv("MM_CALLS_GROUP_CALLS_ALLOWED", "") defer mockAPI.AssertExpectations(t) defer mockMetrics.AssertExpectations(t) defer ResetTestStore(t, p.store)Also applies to: 171-175
🤖 Prompt for AI Agents