Skip to content
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

Added button to toggle visibility of disabled agents #1464

Merged
merged 6 commits into from
May 10, 2016

Conversation

International
Copy link
Collaborator

@International International commented Apr 30, 2016

It happens that over time I disable some agents, but keep them in the list, for possible future use. However, they tend to take some space. With this PR, I've added a button to the bottom list, to be able to toggle visibility of disabled agents. Do you think this would be an useful addition to the project?

Screenshot:
new-menu-bar

@cantino
Copy link
Member

cantino commented Apr 30, 2016

Cool idea @International! I wonder if we should do this server-side with filtering on the list of Agents returned from the database? We could use a cookie to store the user's preferences.

@International
Copy link
Collaborator Author

Sure, we could do it that way also. Would it then make sense for the button to be a button? Or should it be a checkbox? Also, do you think it would make sense to move this menu bar to the top of the table, instead of having the users scroll through a potential long list?

@cantino
Copy link
Member

cantino commented Apr 30, 2016

Maybe it could be a small checkbox in the header of the table in the Name column or something? I'm not sure what'd be the simplest UI.

@International
Copy link
Collaborator Author

I'm not that great with css or stuff related to design ... did you mean something like this? Does not look all that great imho :)
menu-checkbox

@cantino
Copy link
Member

cantino commented Apr 30, 2016

Hmm, agreed. I guess let's go for a button for now, like your original design. It should probably still set a cookie on the backend and filter in Arel instead of JS, though, so that pages are all the same size when rendered.

@International
Copy link
Collaborator Author

@cantino can you have a look at the PR?


private
def show_only_enabled_agents?
!!cookies[:huginn_view_only_enabled_agents]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to store that in the session instead of separate cookie?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

either solution works from my point of view

@dsander
Copy link
Collaborator

dsander commented May 1, 2016

I like the idea! It would be great to have the same functionally for the Scenario#show page.

@@ -0,0 +1,10 @@
class @AgentIndexPage
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this JS now, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i've removed it

@cantino
Copy link
Member

cantino commented May 1, 2016

Nice!

@International
Copy link
Collaborator Author

I like the idea! It would be great to have the same functionally for the Scenario#show page.

@dsander not sure how much time I will have the next 2 weeks or so, but if I get some moments, I'll see what I can do :)

@cantino
Copy link
Member

cantino commented May 4, 2016

The spec failure looks unrelated. Is this ready to merge @International?

@International
Copy link
Collaborator Author

Yes, it is. I've ran all the tests locally multiple times, they all pass.

@International
Copy link
Collaborator Author

@cantino @dsander can this be merged?

@@ -6,6 +6,14 @@ def agent_show_view(agent)
end
end

def toggle_disabled_text
if cookies[:huginn_view_only_enabled_agents]
"Show Disabled Agents"
Copy link
Collaborator

Choose a reason for hiding this comment

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

One minor thing, can you add a leading space like it is done for the other links? The text looks a little bit cramped right next to the icon.

@dsander
Copy link
Collaborator

dsander commented May 9, 2016

@International Just some minor nitpicking, looks good to me otherwise!

@International
Copy link
Collaborator Author

@dsander thanks, it's done!

@dsander
Copy link
Collaborator

dsander commented May 10, 2016

Nice, thanks you. Do you mind me squashing the commit during the merge or would you like to do it manually?

@International
Copy link
Collaborator Author

No problem, you can squash it .

@dsander dsander merged commit ad4a15d into huginn:master May 10, 2016
@dsander
Copy link
Collaborator

dsander commented May 10, 2016

Great, thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants