Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
sysadmin
mattermost
mattermost-webapp
Commits
ed5cbc05
Commit
ed5cbc05
authored
Jun 14, 2018
by
Jesús Espino
Committed by
Carlos Tadeu Panato Junior
Jun 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove number of members on teams to avoid a lot of requests (#1334)
parent
1fa5bfec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
84 deletions
+3
-84
components/team_info.jsx
components/team_info.jsx
+1
-21
components/team_info/index.jsx
components/team_info/index.jsx
+0
-27
components/team_selector_modal/team_selector_modal.jsx
components/team_selector_modal/team_selector_modal.jsx
+1
-1
tests/components/__snapshots__/team_info.test.jsx.snap
tests/components/__snapshots__/team_info.test.jsx.snap
+0
-26
tests/components/team_info.test.jsx
tests/components/team_info.test.jsx
+1
-9
No files found.
components/team_info
/team_info
.jsx
→
components/team_info.jsx
View file @
ed5cbc05
...
...
@@ -3,29 +3,16 @@
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
{
imageURLForTeam
}
from
'
utils/utils.jsx
'
;
export
default
class
TeamInList
extends
React
.
Component
{
static
propTypes
=
{
team
:
PropTypes
.
object
.
isRequired
,
stats
:
PropTypes
.
object
,
actions
:
PropTypes
.
shape
({
loadTeamStats
:
PropTypes
.
func
.
isRequired
,
}).
isRequired
,
}
componentDidMount
()
{
this
.
props
.
actions
.
loadTeamStats
(
this
.
props
.
team
.
id
);
}
render
()
{
const
{
team
,
stats
}
=
this
.
props
;
let
totalMembers
=
0
;
if
(
stats
&&
stats
[
team
.
id
])
{
totalMembers
=
stats
[
team
.
id
].
total_member_count
;
}
const
{
team
}
=
this
.
props
;
const
teamIconUrl
=
imageURLForTeam
(
team
);
let
icon
=
null
;
if
(
teamIconUrl
)
{
...
...
@@ -47,13 +34,6 @@ export default class TeamInList extends React.Component {
<
span
className
=
'icon'
>
{
icon
}
</
span
>
<
div
className
=
'team-data'
>
<
div
className
=
'title'
>
{
team
.
display_name
}
</
div
>
<
div
className
=
'members'
>
<
FormattedMessage
id
=
'admin.team_info.numMembers'
defaultMessage
=
'{count} {count, plural, one {Member} other {Members}}'
values
=
{
{
count
:
totalMembers
}
}
/>
</
div
>
</
div
>
</
div
>
);
...
...
components/team_info/index.jsx
deleted
100644 → 0
View file @
1fa5bfec
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import
{
connect
}
from
'
react-redux
'
;
import
{
bindActionCreators
}
from
'
redux
'
;
import
{
getTeamStats
as
loadTeamStats
}
from
'
mattermost-redux/actions/teams
'
;
import
{
getTeamStats
}
from
'
mattermost-redux/selectors/entities/teams
'
;
import
TeamInfo
from
'
./team_info.jsx
'
;
function
mapStateToProps
(
state
)
{
return
{
stats
:
getTeamStats
(
state
),
};
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
actions
:
bindActionCreators
({
loadTeamStats
,
},
dispatch
),
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
TeamInfo
);
components/team_selector_modal/team_selector_modal.jsx
View file @
ed5cbc05
...
...
@@ -10,7 +10,7 @@ import Constants from 'utils/constants.jsx';
import
{
localizeMessage
}
from
'
utils/utils.jsx
'
;
import
MultiSelect
from
'
components/multiselect/multiselect.jsx
'
;
import
TeamInfo
from
'
components/team_info
'
;
import
TeamInfo
from
'
components/team_info
.jsx
'
;
import
ConfirmModal
from
'
components/confirm_modal.jsx
'
;
const
TEAMS_PER_PAGE
=
50
;
...
...
tests/components/__snapshots__/team_info.test.jsx.snap
View file @
ed5cbc05
...
...
@@ -24,19 +24,6 @@ exports[`components/TeamInfo should match snapshot, with icon 1`] = `
>
Test team
</div>
<div
className="members"
>
<FormattedMessage
defaultMessage="{count} {count, plural, one {Member} other {Members}}"
id="admin.team_info.numMembers"
values={
Object {
"count": 5,
}
}
/>
</div>
</div>
</div>
`;
...
...
@@ -62,19 +49,6 @@ exports[`components/TeamInfo should match snapshot, without icon 1`] = `
>
Test team
</div>
<div
className="members"
>
<FormattedMessage
defaultMessage="{count} {count, plural, one {Member} other {Members}}"
id="admin.team_info.numMembers"
values={
Object {
"count": 5,
}
}
/>
</div>
</div>
</div>
`;
tests/components/team_info.test.jsx
View file @
ed5cbc05
...
...
@@ -4,7 +4,7 @@
import
React
from
'
react
'
;
import
{
shallow
}
from
'
enzyme
'
;
import
TeamInfo
from
'
components/team_info
/team_info
.jsx
'
;
import
TeamInfo
from
'
components/team_info.jsx
'
;
jest
.
mock
(
'
utils/utils.jsx
'
);
...
...
@@ -15,14 +15,6 @@ describe('components/TeamInfo', () => {
name
:
'
test-team
'
,
display_name
:
'
Test team
'
,
},
stats
:
{
xxxx
:
{
total_member_count
:
5
,
},
},
actions
:
{
loadTeamStats
:
jest
.
fn
(),
},
};
test
(
'
should match snapshot, without icon
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment