Commit graph

135 commits

Author SHA1 Message Date
Dominik Sander
201b784562 Fix specs and deprecation warnings 2018-05-05 10:14:06 +02:00
Dominik Sander
ee485990f5 Upgrade Rails to 5.2 and adjust configuration to new defaults 2018-05-05 10:14:06 +02:00
Albert Sun
9a17bc68b9 use of_type 2017-08-01 08:37:59 -04:00
Albert Sun
f9695499ae add an upgrade warning for google cal publish agent. other cleanup. 2017-07-05 10:59:54 -04:00
Dominik Sander
1d3d3ebf16 Utilize strong parameter API to pass arbitrary hashes
By passing an empty hash to `permit` strong parameters permits
the complete hash.

e86524c0c5

Refactor ApplicationController#agent_params
2017-05-19 09:24:48 +02:00
Dominik Sander
f064e6bfdd Push docker images to new huginn namespace
For now we keep pushing to the old namespace but add a warning to users a
chance to change their images to the new namespace.
2017-05-17 21:18:39 +02:00
Albert Sun
2ac6927a6a Option for custom response headers for receive_web_request (#1977)
* Option for custom response headers for receive_web_request

In DataOutputAgent, WebhookAgent, LiquidOutputAgent, this enables
setting options['response_headers'] as a JSON object with custom
response headers to set on the HTTP response through the
WebRequestsController.

* code copy edits from @cantino
2017-04-27 12:19:59 +12:00
Dominik Sander
d277afbe12 Set created_at of dry-runned event to the current time
Allows the usage of `{{created_at}}` when dry-running Agents.

 #1964
2017-04-11 22:30:50 +02:00
Dominik Sander
c023c08cb1 Rename Delayed::Job failed scope to prevent warning
Fixes #1806
2017-01-30 13:11:13 +01:00
Thiago Talma
51b9bbca17 Allow Redirect Requests (#1881)
* Allow Redirect Requests

* specs

* type cast
2017-01-28 16:58:41 -05:00
Dominik Sander
e2917e8854 Fix scenario import when merges are required
Fixes #1875
2017-01-17 22:00:38 +01:00
Dominik Sander
5cfca6bf68 Ensure helper classes are available in production
Due to eager_loading being active in production helper classes in lib need to be explicitly required.
2016-10-05 22:47:38 +02:00
Dominik Sander
b651f08cc5 Fix the specs on rails5 2016-10-05 22:47:38 +02:00
Dominik Sander
26e878c61a Fix the rest of the deprecation warnings 2016-10-05 22:47:38 +02:00
Dominik Sander
5fbeb105b2 Update gems and configs to Rails5 2016-10-05 22:47:38 +02:00
Dominik Sander
42b132017f Rescue from AR:SubclassNotFound and allow to delete agents
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.
2016-09-21 20:10:49 +02:00
Dominik Sander
58f388d530 service_id is a valid part of the agent_params
Fixes #1685
2016-09-15 16:17:46 +02:00
Dominik Sander
b2f031003f Use strong_parameters and drop protected_attributes
* 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
2016-09-12 15:54:26 +02:00
Albert Sun
6bb61065ec Allow admins to login as another user (#1659)
* switch_to_user and switch_back routes

* Uses session to store original user id
2016-09-02 15:32:38 -04:00
Enfop
5cdc37f716 DryRunMemory (#1550) 2016-06-18 15:53:58 -07:00
Judy Ngai
1abcd947f5 Uploadicons (#1427)
* checking in work for glyph upload

* checking in icon selections

* added more icon options

* work on upload icon

* fix issue

* switched to options for select

* removed wrapper and removed commment

* add migration to support icon

* remove right floating

* rm params session add it to model

* rebuilt the menu

* rm extra div

* converted js to coffee

* quick change in indentation

* using the view helper

* submitting icons and loading into form

* added icon to both scenario export and import

* added icon to spec

* low level caching the icons

* tentative work in making a new coffee class

* renamed js page

* switched to cache in memory and worked on coffee class

* made pathsmatching compatible for all scenarios

* switched to rails root

* fixed all rubocop stylings

* fixed line is too long styling

* rm private method definition

* patch to avoid having no icon

* blank or nil?

* reordering the lines
2016-06-15 23:52:50 -07:00
Judy Ngai
f57a3af521 enable disable all agents within a scenario (#1506)
* tentative work on enable disable all agents within a scenario

* more work with pr

* more work

* better names and save a line of code

* coffeescript to change modal text and hidden disabled value

* redoing coffeescript class to save some code

* initing the function

* updated coffeescript

* change text from specific modal, made names more specific

* updates disabled test and rubocop bug

* improved test and refactored method per rubocop warnings

* switched from 0 to false

* switched from 0 to false and 1 to true

* fixed null bug in postgresql database

* fixed ruby boolean bug

* moved instances into let lazy load and use proper agent fixture

* putting in a different fix

* using existing membership and agent and another version of test

* switch back to 2 not 3 after rm an agent in yml

* made test passed locally

* forgot to remove debuging pp

* small spacing bug

* trying to get rid of newline in file

* typo not agent but scenario

* minor changes to syntax and naming

* rm potential failure and changed update_all statement

* fixing new line issue

* removed unnecessary if else statement from method
2016-06-13 22:36:22 -07:00
Dominik Sander
d573b98a68 Show recently received events in dry run modal 2016-05-18 09:58:49 +02:00
George Opritescu
ad4a15d6da Added button to toggle visibility of disabled agents (#1464)
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
2016-05-10 22:52:30 +02:00
Dominik Sander
ea95a9d6c3 Merge pull request #1446 from kreuzwerker/feature/scenario-deletion
Allow user to delete the scenarios agents with it
2016-04-24 10:28:51 +02:00
Dominik Sander
98fae41421 Allow user to delete the scenarios agents with it 2016-04-23 22:18:02 +02:00
Andrew Cantino
491dace4a0 Merge pull request #1394 from Jngai/uploadcredentialsfeature
new credentials uploading feature
2016-04-21 20:13:47 -07:00
Judy Ngai
26e776db4d new credentials uploading feature
rm req json, not saving file, styled button a bit

skinny controller fat model

minor spacing mistake

build user credentials fixed mass assignment issue

undo mass assignment variables

spec in progress

spec

fixed exception issue

json fixtures

slight change to test

added test to assert credentials created for current user only

added tests to satisfy requirements

refined import method

added status 422

saving two lines of code

one more test

fixed small bug, words changed

minor change in test

styled file upload button

deleted unnecessary spec

switched to modal format

made modal more presentable

minor change to modal

fix indentation issue

ok nested correctly within form tag
2016-04-21 07:16:28 -04:00
Dominik Sander
73bcd927e3 Do not run/enqueue event propagation when a AgentPropagateJob is already enqueued
Fixes the creation of duplicated events caused by Agent.receive! running multiple times concurrently.
2016-04-17 17:15:50 +02:00
Andrew Cantino
ee504ba067 Merge pull request #1415 from albertsun/feature/request-headers-in-web-request
Pass request headers to receive_web_request
2016-04-15 20:55:57 -07:00
Judy Ngai
2c412ce56f bug fix jobs controller 2016-04-13 12:28:30 -04:00
Albert Sun
5da40533c6 modify receive_web_request to take either 1 or 3 arguments 2016-04-13 11:19:19 -04:00
Andrew Cantino
35bbd2a492 Merge pull request #1423 from Jngai/queuedjobpatch
retry queued job patch
2016-04-12 21:07:42 -07:00
Judy Ngai
d8df930da0 retry queued job patch
quick rewording

changed glyphicon

skip failed jobs locked at and using update all

spec ready as well

rm without protection modify spec

rm unnecessary lines

work on delayed job feature

fixed render json

switched from ok to success

revert render json change for other methods

checking in work

test passed

reverting render and saving a line of code

add back sign in an user

run this on github

altered format.json

rm comment

prevent ajax error head no content
2016-04-12 11:04:10 -04:00
Albert Sun
9ddb4e97de receive_web_request can also now receive the ActionDispatch request object 2016-04-11 18:16:24 -04:00
Albert Sun
58f6307e2c Pass request headers through to agents that implement receive_web_request 2016-04-11 18:16:24 -04:00
Will Read
98f50de06b Sets the new user up with an example set of agents
- gives them a place to start from
- leverages existing code to import scenarios
- adds test coverage to seeds to ensure sees can run multiple times against the same db as is the case for Docker
- adds env variable to set if importing is turned on for new user
- adds env variable to point to a custom scenario for new users
2016-04-10 16:03:21 -07:00
Dominik Sander
bf7c2feba4 Merge pull request #1330 from kreuzwerker/feature/user-admin-interface
Admin user management
2016-03-17 21:02:27 +01:00
Dominik Sander
c0c74113bf Admins should not be able to deactivate their own accounts 2016-03-17 20:47:57 +01:00
Dominik Sander
8508928943 Admins can deactivate user accounts 2016-03-17 20:47:51 +01:00
Dominik Sander
4722ebfe4e Add admin user management interface 2016-03-17 20:36:07 +01:00
Andrew Cantino
7476d7dcf1 Add column with default sort to prioritize new Agents in the index view 2016-03-13 13:27:49 -07:00
Will Read
6435f0024c Allow multiple users to import the same scenario
- renames should_import? to import_confirmed? for readability

Related issue: #968
2015-12-07 01:47:48 +00:00
Andrew Cantino
4f329a86ed more return paths 2015-09-03 07:53:42 -07:00
Andrew Cantino
41f4d6e339 handle return paths mroe gracefully from "Back" in Agent show 2015-09-01 19:57:16 -07:00
Andrew Cantino
dc06e3aed0 do not delete running jobs 2015-08-17 00:01:04 -07:00
Andrew Cantino
8713dce4d8 integrate @knu's suggestions 2015-08-16 16:05:22 -07:00
Andrew Cantino
ce84f159e0 There is a button to add a new Agent directly in a Scenario; deleting an Agent from its show page no longer 404s; there is a button to destroy all delayed_jobs 2015-08-14 21:51:13 -07:00
Akinori MUSHA
fe857bc6f0 Make the dry_run action accept an event payload 2015-07-29 22:38:52 +09:00
Akinori MUSHA
8eaaff410a Always use POST for dry_run 2015-07-29 22:32:03 +09:00