-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Fixes #326, Fixes #593: AdminsController finishing #498
Conversation
d46dc3d
to
b328cfc
Compare
…ganization dashboard to nav. Adds a few feature specs for that.
2395fa0
to
63312a2
Compare
# Conflicts: # spec/features/admin/admin_namespace_spec.rb
…ich barcode items are shown.
…ganization dashboard to nav. Adds a few feature specs for that.
…ich barcode items are shown.
75b10df
to
d991439
Compare
… into 326-admins-controller # Conflicts: # app/controllers/admin/barcode_items_controller.rb
… into 326-admins-controller # Conflicts: # app/controllers/admin/barcode_items_controller.rb
…d items with barcode items. Specs to cover it. Modifies JS to handle new method for barcodes.
Fixes #593 With the newest updates. I finished the majority of the additional features required for that Issue. There may be additional CRUD to add to Admin namespace, will need to check. |
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 like it, great info in there that will be helpful for "at a glance info."
What do you think about also putting in recent users? Something like:
@active_users = User.where('last_sign_in_at > ?', 1.week.ago)
or something like that. So we can see who is actively using the system.
@seanmarcia OK I think this is ready. It incorporates teh changes @jcavena made as well. I also added a basic Dashboard in the admin area. |
I just made some comments on a few things I think were mistakes from copy pasta and a suggestion. (That I'm also happy to implement.) |
@seanmarcia Yup -- Rspec caught all those mistakes, whoops! Not sure about gravatar, but it gives "an icon" regardless -- if they have one registered, all the better, haha. :) I like the idea for the additional stat! |
<ul class="users-list clearfix"> | ||
<% @recent_organizations.each do |org| %> | ||
<li> | ||
<%= image_tag(org.logo) %> |
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 think my other suggestion of using logo_path
might make this not break if they don't ahve a logo uploaded. Maybe active storage handles this gracefully if they don't.
@seanmarcia @armahillo The "active users" won't work the way you think unless we implement |
@armahillo I just added to your PR. I put in the @active_users to the dashboard that looks for people logged in in the past week and then displays their name, email, organization, and last login time. I took JC's suggestion and added |
app/controllers/admin_controller.rb
Outdated
def dashboard | ||
@recent_organizations = Organization.where('created_at > ?', 1.week.ago) | ||
@recent_users = User.where('created_at > ?', 1.week.ago) | ||
@active_users = User.where('last_sign_in_at > ?', 1.week.ago) |
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.
@seanmarcia This is the "previous" sign in date, not the "current" one. You want current_sign_in_at
for their most recent sign in date.
600 minutes is 10 hours. You're likely going to log people out every day for this "nice to have". I'm not sure it's a good idea to do that in order to have an admin "active users" list.
`last_request_at` is updated at a minimum 10 minute interval so it doesn't update the database on each request.
@seanmarcia @armahillo I implemented |
This PR finishes the AdminsController namespace (Started in #493)
Completed so far (in this PR):
Most still need specs.