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

MM-10268 Count inactive users towards total count in system console user list #1228

Merged
merged 1 commit into from
May 30, 2018

Conversation

jwilander
Copy link
Member

Summary

Count inactive users towards total count in system console user list. I refactored the system_users component a bit to use more redux patterns.

Ticket Link

https://mattermost.atlassian.net/browse/MM-10268

Checklist

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

@jwilander jwilander added the 2: Dev Review Requires review by a core commiter label May 18, 2018
teamId = search.team || '';

if (!teamId || teamId === SearchUserTeamFilter.ALL_USERS) {
const stats = state.entities.admin.analytics || {[Stats.TOTAL_USERS]: 0, [Stats.TOTAL_INACTIVE_USERS]: 0};
Copy link
Member

Choose a reason for hiding this comment

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

This should be done through a selector so that it doesn't create a new object each time when state.entities.admin.analytics is empty. Perhaps you could just make a getTotalUsers selector for this page to obscure that logic

Copy link
Member Author

@jwilander jwilander May 29, 2018

Choose a reason for hiding this comment

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

That object isn't getting passed in as a prop, I'm passing in totalUsers as an integer as the prop. I don't think the added complexity of a selector is worth the savings of not creating an object

} else if (teamId === SearchUserTeamFilter.NO_TEAM) {
totalUsers = 0;
} else {
const stats = state.entities.teams.stats[teamId] || {total_member_count: 0};
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Member Author

Choose a reason for hiding this comment

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

See above comment

@@ -15,6 +15,17 @@ function modalSearch(state = '', action) {
}
}

function systemUsersSearch(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.

It might be better to have this under reducers/views/admin.js unless we want open this page to more people

Copy link
Member Author

Choose a reason for hiding this comment

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

Meh, I think it doesn't matter that much but if you're more than 0/5 I'll change it

@jasonblais jasonblais added this to the v5.0.0 milestone May 25, 2018
@jwilander jwilander requested a review from hmhealey May 29, 2018 14:36
@hmhealey
Copy link
Member

@jwilander Needs a rebase

@hmhealey hmhealey added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels May 29, 2018
@jwilander jwilander merged commit ec3e625 into master May 30, 2018
@jwilander jwilander deleted the mm-10268 branch May 30, 2018 14:52
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels May 30, 2018
@lindalumitchell lindalumitchell added the Tests/Done Release tests have been written label Jun 13, 2018
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/Done Release tests have been written
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants