Especially when using Agent gems it happens that an Agent was deleted from the gem or the user removed a gem from the
configuration. Instead of failing with an Internal Server Error the user now is offered to delete all undefined agents.
`type.constantize` is needed to invoke the Rails auto_loader in development since not all Agent classes are loaded when
the application boots.
* Ensure admin attribute can not be set at sign up and the agents user_id is not changeable
* Remove ACCESSIBLE_ATTRIBUTES from the User model
* Remove side effect on agent_params from AgentsController#build_agent
Added button to toggle visibility of disabled agents
* Moved index code to separate file
* Added cookie to allow toggling visibility of disabled agents
* Filter disabled agents based on cookie
* Removed js and use correct cookie name
* CR changes
User can test if an agent being saved will work as expected simply by
clicking the "Dry Run" button, which opens up a modal window that shows
dry-run results including log, events and memory. Resolves#593.
The current implementation only allows dry-run of Agents that do not
require an incoming event to be run.
Also, each Agent class must opt in for this feature by declaring
themselves as `can_dry_run!`. To begin with, only WebsiteAgent is
marked as dry-runnable for now.
When user stay agent details page, user can use action.
But user use "Delete agent" action, then exception error is occurred.
When action of "Delete agent" run, destory is called, it call "redirect_back".
Although @agent is destroyed, redirect_back used "path = agent_path(@agent)" .
So I add for this case.
if message include "deleted", redirect_back is called by destroy.
then redirect_back use "path = agents_path".
- Make agents#new take an optional :id for creating a clone of an
existing agent of the user.
- Delay the call for $(".select2").select2() so filled-in values of
sources can take effect.