Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

PLT-8508: switch channel before leaving the channel #566

Merged
merged 1 commit into from
Jan 9, 2018
Merged

PLT-8508: switch channel before leaving the channel #566

merged 1 commit into from
Jan 9, 2018

Conversation

stephenkiers
Copy link
Contributor

Summary

This PR redirects a user to the town square channel before unsubscribing them from the current channel.

Ticket Link

https://mattermost.atlassian.net/browse/PLT-8508
mattermost/mattermost#8053

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed

@stephenkiers stephenkiers added the Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) label Jan 9, 2018
@stephenkiers stephenkiers added this to the v4.6.0 milestone Jan 9, 2018
await ChannelActions.leaveChannel(channelId)(dispatch, getState);
if (ChannelUtils.isFavoriteChannelId(channelId)) {
unmarkFavorite(channelId);
}

const townsquare = ChannelStore.getByName('town-square');
browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/channels/' + townsquare.name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bit that's actually doing the channel changing. It will essentially push us through this react-router route which you can follow down the rabbit-hole starting here if you want to see what's happening. (Warning it's had a lot of organic growth and is in need of cleaning).

Anyways, point is it might work better if you moved the browserHistory.push() to be before the ChannelActions.leaveChannel() instead of adding the ChannelActions.selectChannel() because the browserHistory.push() will eventually do the channel select somewhere down the rabbit hole

Let me know if that doesn't make sense and I'll clarify

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubted you, but was wrong. Great tip. It works now on localhost

@jasonblais jasonblais changed the title switch channel before leaving the channel PLT-8508: switch channel before leaving the channel Jan 9, 2018
@stephenkiers stephenkiers changed the base branch from master to PLT-6050 January 9, 2018 03:44
@stephenkiers stephenkiers changed the base branch from PLT-6050 to master January 9, 2018 03:45
@jwilander
Copy link
Member

@stephenkiers if this is for the 4.6 release you'll need to base this off release-4.6 branch instead of master. This is because we're past code complete and are in the release testing part of the cycle for 4.6

@jwilander
Copy link
Member

Also is this waiting on another PR? Just wondering why the Awaiting PR label

@jasonblais jasonblais added 4: Reviews Complete All reviewers have approved the pull request Awaiting Submitter Action Blocked on the author and removed Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) labels Jan 9, 2018
This PR redirects a user to the town square channel before unsubscribing them from the current channel.
@stephenkiers stephenkiers changed the base branch from master to release-4.6 January 9, 2018 15:19
@stephenkiers
Copy link
Contributor Author

This is now based on the branch release-4.6

@stephenkiers stephenkiers removed the Awaiting Submitter Action Blocked on the author label Jan 9, 2018
@GoldUniform GoldUniform merged commit 42ad4f3 into mattermost:release-4.6 Jan 9, 2018
@stephenkiers stephenkiers deleted the PLT-8508 branch January 10, 2018 05:15
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Jan 10, 2018
GoldUniform pushed a commit that referenced this pull request Jan 10, 2018
* PLT-8496 Fix shift+Up to open reply RHS (#554)

* Fix shift+Up to open reply RHS

* Feedback review

* Remove unsued vars

* Fix FF in mobile view (#559)

* Fix FF in mobile view

* show error in console when changeCss fails

* Fix hover and unmounting issues with post_info (#562)

* Release 4.6 (#567)

* PLT-8507 - Reply icon not inline in firefox

* PLT-8504 - Scroll bar cutting of File thumbnails

* Fix many places where components error when missing props (#571)

* Based on release-4.6 (#566)

This PR redirects a user to the town square channel before unsubscribing them from the current channel.

* RN-8502 Show errors on Join Another Team page (#563)

* fix incorrect channel notification settings when switching teams and reset active section whenever channel notification modal is closed or hidden (#560)

* [PLT-8424] Do not show add-user-to-channel ephemeral message at center (#533)

* do not show add-user-to-channel ephemeral message at center

* send add to channel ephemeral post via client app

* PLT-8510: Feature checks for older webkit support of Performance API. (#557)

* PLT-8510: Feature checks for older webkit support of Performance API.

* PLT-8510: Added global performance object for tests.

* Fixed autoFocus issue with delete modal after edit (#572)

* Fixed autoFocus issue with delete modal after edit

* check style fixes

* conditional check

* update copyTheme string on handleColorChange (#580)

* PLT-8335 fixing issue with iOS classic (#579)

* PLT-8335 fixing issue with iOS classic

* Fixing eslint errors

* PLT-8522 Added clientside rendering for removed from team messages (#576)

* PLT-8522 Added clientside rendering for removed from team messages

* Fixed extra quotation mark

* PLT-8521 - Fixing overlay on sidebar (#581)

* Fix merge
@jasonblais jasonblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jan 11, 2018
jwilander added a commit that referenced this pull request Jan 16, 2018
* PLT-8496 Fix shift+Up to open reply RHS (#554)

* Fix shift+Up to open reply RHS

* Feedback review

* Remove unsued vars

* Fix FF in mobile view (#559)

* Fix FF in mobile view

* show error in console when changeCss fails

* Fix hover and unmounting issues with post_info (#562)

* Release 4.6 (#567)

* PLT-8507 - Reply icon not inline in firefox

* PLT-8504 - Scroll bar cutting of File thumbnails

* Fix many places where components error when missing props (#571)

* Based on release-4.6 (#566)

This PR redirects a user to the town square channel before unsubscribing them from the current channel.

* RN-8502 Show errors on Join Another Team page (#563)

* fix incorrect channel notification settings when switching teams and reset active section whenever channel notification modal is closed or hidden (#560)

* [PLT-8424] Do not show add-user-to-channel ephemeral message at center (#533)

* do not show add-user-to-channel ephemeral message at center

* send add to channel ephemeral post via client app

* PLT-8510: Feature checks for older webkit support of Performance API. (#557)

* PLT-8510: Feature checks for older webkit support of Performance API.

* PLT-8510: Added global performance object for tests.

* Fixed autoFocus issue with delete modal after edit (#572)

* Fixed autoFocus issue with delete modal after edit

* check style fixes

* conditional check

* update copyTheme string on handleColorChange (#580)

* PLT-8335 fixing issue with iOS classic (#579)

* PLT-8335 fixing issue with iOS classic

* Fixing eslint errors

* PLT-8522 Added clientside rendering for removed from team messages (#576)

* PLT-8522 Added clientside rendering for removed from team messages

* Fixed extra quotation mark

* PLT-8521 - Fixing overlay on sidebar (#581)

* Fixed next button display logic (#586)

(cherry picked from commit 2b5ef33)

* PLT-8539: Fix flagged post attachment regression (#587)

* fix flagged post attachments

* update snapshots

* PLT-8534 added check to ensure that draft message is blank before doing anything (#590)

* added check to ensure that draft message is blank before doing anything

* refactored code to be more readable and easier to follow

* refactored a little more

refactored ctrlEnterKey combo and removed Up from ctrlKeyCombo var name

* PLT-8527 Fix error bar and bad connection state for textbox (#588)

* Correctly reset error connection count

* Force clear errors in announcement bar constructor

* PLT-8533 Fixed username autocomplete not working with mixed cases (#595)

* [PLT-8536] Call PostActions.createPost wrapper function instead of createPost from mattermost-redux (#592)

* call PostActions.createPost wrapper function instead of createPost from mattermost-redux

* revert GlobalActions.postListScrollChange(true) and remove unused createPost props

* PLT-8554 - Updating reply arrow issue (#596)

* PLT-8517: Fix for scrolling reply textarea into view when obstructed by mobile keyboard. (#594)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
6 participants