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

[MM-10430] Add selector to check if the channel is hidden #493

Merged
merged 3 commits into from
May 24, 2018

Conversation

saturninoabril
Copy link
Member

@saturninoabril saturninoabril commented May 9, 2018

Summary

Add selector to check if the channel is hidden

(Didn't added a test as I'm not sure how to effectively test it. Will try to revisit next time)

Server PR - mattermost/mattermost#8751
Webapp PR - mattermost/mattermost-webapp#1194

Ticket Link

Jira ticket: MM-10430

@saturninoabril
Copy link
Member Author

Update: While working on Mobile RN, I realized that there are some store related implementation in webapp that is needed by mobile RN as well. This update moves the "hiddenDefaultChannelId" here which was initially introduced at webapp.

@lieut-data Sorry but you might want to take a look again.

@lieut-data
Copy link
Member

@saturninoabril, will do! Sometimes I miss comments, though, so feel free to always re-add me as a reviewer to put it in my https://github.com/pulls/review-requested list :)

@lieut-data lieut-data self-requested a review May 11, 2018 14:03
state = store.getState();
hiddenChannel = state.entities.channels.hiddenDefaultChannelId;
assert.ok(hiddenChannel);
assert.ok(!hiddenChannel[teamId]);
Copy link
Member

Choose a reason for hiding this comment

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

Worth adding test cases for when the teamId or channelId is falsy when passed to the action creators?

@@ -382,6 +382,27 @@ function stats(state = {}, action) {
}
}

function hiddenDefaultChannelId(state = {}, action) {
Copy link
Member

Choose a reason for hiding this comment

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

Worth adding a test case for this reducer as well?

Copy link
Member

@hmhealey hmhealey left a comment

Choose a reason for hiding this comment

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

Sorry to come back to this a few days after it was submitted, but why do we need to store the ID of the town square channels? Why can't we just have a selector that looks through the channels on the given team and returns the town square?

@saturninoabril
Copy link
Member Author

Thanks @hmhealey and @lieut-data!
Sorry for not giving update on this PR which I'm still in the process of updating. Actually you (@hmhealey) and @enahum have the same concern about storing that ID.
Will just ping both of you whenever this PR is ready for dev review :)

@saturninoabril saturninoabril added 2: Dev Review Requires review by a core commiter and removed Work In Progress Not yet ready for review labels May 23, 2018
@saturninoabril
Copy link
Member Author

@lieut-data @hmhealey I've updated the PR and just retain the selector shouldHideDefaultChannel. I initially add other selectors before when I was trying to figure out how to make the default channel become available at "More Channels" modal but now that it's not needed per ticket, I've removed all of those.

@saturninoabril saturninoabril added 4: Reviews Complete All reviewers have approved the pull request Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) labels May 24, 2018
@saturninoabril saturninoabril removed the 2: Dev Review Requires review by a core commiter label May 24, 2018
@saturninoabril saturninoabril merged commit 1cc6009 into mattermost:master May 24, 2018
@saturninoabril saturninoabril deleted the MM-10430 branch May 24, 2018 20:46
chetanyakan pushed a commit to brightscout-alpha/mattermost-redux that referenced this pull request Feb 9, 2021
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 Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants