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

Update popover_list_members.jsx #1

Closed
wants to merge 6 commits into from
Closed

Conversation

prixone
Copy link
Contributor

@prixone prixone commented Sep 7, 2017

Summary

Added user status to channel member list
Added CSS to fix the online indicator positioning and size

Ticket Link

PLT-7409 item 1 only, which I had laying around on my own build of Mattermost.

Can't rebase, reference mattermost/mattermost#7382

Checklist

  • minor change

Added user status to channel member list
Added CSS to fix the online indicator positioning and size
@jwilander jwilander added the 2: Dev Review Requires review by a core commiter label Sep 7, 2017
@jwilander jwilander added this to the v4.3.0 milestone Sep 7, 2017
@@ -124,9 +124,9 @@ export default class PopoverListMembers extends React.Component {
key={'popover-member-' + i}
>
<ProfilePicture
className='user__picture'
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this prop does anything

Copy link
Contributor Author

@prixone prixone Sep 7, 2017

Choose a reason for hiding this comment

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

Well that prop exists on the portrait at the top left corner so I've added it, perhaps it will be added later so it will keep the same format. If you think it won't I can remove it, I was merely following the already existing patterns.

Copy link
Member

Choose a reason for hiding this comment

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

It's supported by the img tag used there, but it doesn't do anything when you're using a ProfilePicture component. We should remove it since it might suggest to people using this code that this component will be affected by any CSS changes made to user__picture

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 see, removed.

src={Client4.getProfilePictureUrl(m.id, m.last_picture_update)}
width='40'
height='40'
status={UserStore.getStatus(m.id)}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of contacting the store directly, can you pass this in from the container? You can use the getStatusForUserId selector from mattermost-redux/selectors/entities/users to get it from the redux store instead of using the old UserStore

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 was using the store because all the status example around the code were also using the store. I am not sure if I did it right as I am not knowledge in redux, but let me know, if the syntax is right.

@hmhealey hmhealey self-assigned this Sep 7, 2017
src={Client4.getProfilePictureUrl(m.id, m.last_picture_update)}
width='40'
height='40'
status={getStatusForUserId(state, m.id)}
Copy link
Member

@hmhealey hmhealey Sep 8, 2017

Choose a reason for hiding this comment

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

My bad for not clarifying. I wasn't sure if you'd worked with Redux before, so I can give you a quick rundown of how it should work.

Basically, we want the container object (components/popover_list_members/index.js) to be the only thing that talks directly to the store. It will then pass anything that this component needs to render as part of the props. If you look at the mapStateToProps function in that file, it's used to read from the redux store and set the props for this component. So what you'll want to do is:

  1. Add status to the object returned by mapStateToProps so that it gets passed in as this.props.status
  2. Add the prop type as you would with any other prop
  3. Use this.props.status here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking the time to explain that, very helpful, hopefully it looks alright now :)

Changed to use store thru redux
Added statuses to props
@hmhealey hmhealey removed their assignment Sep 8, 2017
@hmhealey
Copy link
Member

hmhealey commented Sep 8, 2017

Awesome, looks good

Copy link
Contributor

@asaadmahmood asaadmahmood left a comment

Choose a reason for hiding this comment

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

There was one minor theme issue, fixed that. Other than that looks good.

@jwilander
Copy link
Member

@prixone if you want to give this a rebase we can get it merged

@jwilander jwilander added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Sep 29, 2017
@esethna esethna modified the milestones: v4.3.0, v4.4.0 Oct 4, 2017
@jasonblais jasonblais removed this from the v4.4.0 milestone Oct 31, 2017
@jasonblais
Copy link
Contributor

@prixone Would you be able to help resolve the merge conflicts and rebase the PR? Should be good to merge otherwise

@jasonblais
Copy link
Contributor

Closing in favor of #421, which should cover the changes made here

@jasonblais jasonblais closed this Jan 2, 2018
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Jan 4, 2018
lieut-data added a commit that referenced this pull request Feb 16, 2018
* MM-8589: change i18n/getLanguages to use store

This also removes the caching of the available languages data structure,
as it obviously needs to be able to change. It's not on a frequently
used code path so the caching appears to (at least now) be unnecessary.

* MM-8589: eliminate UserStore.getNoAccounts()

No changes to the use of global variables here. Rather, I'm just pushing
down an indirect use of same.

* MM-8589: expunge global mm_(config|license) from claim components

This also eliminates `LdapPasswordFieldName` as the server-side
configuration does not exist.

* MM-8589: clarify props passed to claim components

* MM-8589: expunge unnecessary ownProps

* MM-8589: use the get(Config|License) selector
lieut-data added a commit that referenced this pull request Feb 28, 2018
) (#862)

* MM-9635: expunge global mm_config from profile popover component.

This change updates the tests to expect a connected profile popover,
which in turns subtly changes the pluggable expectations.

Tested with the hovercardexample plugin to verify that the connected
ProfilePopover can still be overridden.

* MM-9635: expunge global mm_config from error page

* MM-9635: expunge global mm_config from team selection page

* MM-9635: expunge global mm_config from switch channel provider
kkekkonen pushed a commit to kkekkonen/mattermost-webapp that referenced this pull request Jul 17, 2018
add different colors to different threads
@miguelespinoza miguelespinoza mentioned this pull request Aug 23, 2018
6 tasks
mkraft pushed a commit that referenced this pull request Jul 8, 2019
Zlash65 added a commit to kredily/mattermost-webapp that referenced this pull request Apr 28, 2020
Release branch for kredily changes
@jgilliam17 jgilliam17 mentioned this pull request Aug 15, 2020
clarmso pushed a commit to clarmso/mattermost-webapp that referenced this pull request Aug 17, 2020
clarmso pushed a commit to clarmso/mattermost-webapp that referenced this pull request Aug 18, 2020
prapti pushed a commit that referenced this pull request Aug 27, 2020
* Steps #1 of MM-T576

* Finish steps #1

* Add steps 2 to 4 of the test

* Update instructions.

* Address code review comments. Include poll plugin in fixtures.

* Remove matterpoll plugin tar.gz

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
furqanmlk pushed a commit that referenced this pull request Dec 8, 2020
nguyenkkent referenced this pull request in diegovega49/mattermost-webapp Aug 9, 2022
diegovega49 added a commit to michellejtan/mattermost-webapp that referenced this pull request Aug 12, 2022
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 Tests/Not Needed Does not require new release tests
Projects
None yet
7 participants