-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RA-552:Adding the View Logged in Users functionality to core #3706
Conversation
import java.util.List; | ||
import java.util.Map; | ||
import java.util.TreeMap; | ||
import javax.servlet.http.HttpSession; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brandones so am adding the view users functionality in core as suggested by @djazayeri here https://talk.openmrs.org/t/view-logged-in-users-is-empty/19348/3, just a quick question, why not have HttpSession and ServletContext implemented at core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HerbertYiga in core, they are not in the api
but web
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkayiwa does this mean it will be a nice idea to add this functionality under the web module ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True dat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkayiwa awesome, let me go on and do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to test and confirm that it all works.
Thanks @HerbertYiga feel free to check out my comment on the ticket, however i would also think this should be fixed in legacyui |
thanks @sharif this exists in ui and a suggestion came in to have it under core |
Do you mind pointing me to that thread talking about core please thanks |
@HerbertYiga did you see the travis build failure? |
0165c4f
to
4c3c4ba
Compare
12e8ff9
to
beacb42
Compare
Thanks @HerbertYiga for the link sorry for late response |
ddcdaea
to
fbe4dfc
Compare
@dkayiwa how do things look on this pr,the travis breaks only for openjdk 10 |
public void getCurrentUsernames_shoulReturnAllCurrentUserNames() { | ||
executeDataSet(USER_SET); | ||
MockHttpSession session = new MockHttpSession(); | ||
User user = userService.getUser(5508); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test simply about users stored in the database or logged in users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test simply about users stored in the database or logged in users?
@dkayiwa ohh let me fix this, currently its about users stored in the database
hi @dkayiwa i have included logged in users for the tests |
|
||
public class CurrentUsersTest extends BaseWebContextSensitiveTest { | ||
|
||
protected static final String USER_SET = "org/openmrs/CurrentUserTest.xml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why this is not private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have fixed this
|
||
@Test | ||
|
||
public void getCurrentUsernames_shoulReturnAllCurrentUserNames() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the test method name reflecting what you are testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the test method name reflecting what you are testing?
i have fixed this too
@HerbertYiga did you run the web application and confirm that this is behaving as expected? |
@dkayiwa my plan around this is to access the introduced method from reference application module so that i create a view there, could this be a right direction? |
hi @dkayiwa tested this with a running instance of openmrs and i see now the CurrentUsers.addUser() from core is used,i have added the current screenshot to the ticket id |
@HerbertYiga which method in core calls |
hi @dkayiwa i have changed the implementation of this and now i implement the UserSessionListener,tested things on a running instance with legacy ui module and things run fine,the current screen shot can be found on the ticket id thanks |
Did you see the travis build failure? |
efec5fb
to
a624c31
Compare
hi @dkayiwa ,i fixed the breaking part, re-tested on a running instance things run as required, ie (when a user logs in ,he is added on the list and when he logs out ,he is removed from the list of current users) |
hi @dkayiwa is this good enough to be merged in? |
thanks for the review @ibacher |
@HerbertYiga So, I think the code here looks decent enough for what it needs to do, but there are two things we'll also need to complete this work:
|
Thanks @ibacher let me look through this |
tl;dr our action detected no activity on this PR and will close it in 30 days if the stale label is not removed. OpenMRS welcomes your contribution! It means a lot to us that you want to contribute to equity in healthcare! This PR has not seen any activity in the last 5 months. That is why we wanted to check whether you are still working on it or need assistance from our side. If you do not have time to continue the work or have moved on you don’t need to do anything. We will automatically close the PR in 30 days. We hope to see you back soon :) |
getting some time for this |
ticket Id:https://issues.openmrs.org/browse/RA-552
Adding the View Logged in Users functionality to core