From 5067104d5e4cb5f98e10871e3871aed00b86236f Mon Sep 17 00:00:00 2001 From: Andrew Cantino Date: Sat, 9 May 2015 14:00:25 -0700 Subject: [PATCH] make create_event in dry_run work the same as the normal one; fix width of editor --- Gemfile.lock | 2 +- app/assets/stylesheets/application.css.scss.erb | 8 +++++++- app/concerns/dry_runnable.rb | 1 + app/models/agents/java_script_agent.rb | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fa449b9d77..e0ad71c70a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -388,7 +388,7 @@ GEM slop (3.6.0) spectrum-rails (1.3.4) railties (>= 3.1) - spring (1.3.3) + spring (1.3.6) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (2.12.3) diff --git a/app/assets/stylesheets/application.css.scss.erb b/app/assets/stylesheets/application.css.scss.erb index 625994cf80..9119d9235b 100644 --- a/app/assets/stylesheets/application.css.scss.erb +++ b/app/assets/stylesheets/application.css.scss.erb @@ -174,12 +174,18 @@ span.not-applicable:after { // Credentials and Ace Editor -#ace-credential-value, .ace-editor { +#ace-credential-value { position: relative; width: 940px; height: 300px; } +.ace-editor { + position: relative; + width: 550px; + height: 300px; +} + // Disabled .agent-unavailable { diff --git a/app/concerns/dry_runnable.rb b/app/concerns/dry_runnable.rb index bbca6ef408..165573eb96 100644 --- a/app/concerns/dry_runnable.rb +++ b/app/concerns/dry_runnable.rb @@ -56,6 +56,7 @@ def log(message, options = {}) def create_event(event_hash) if can_create_events? @dry_run_results[:events] << event_hash[:payload] + events.build({ user: user, expires_at: new_event_expiration_date }.merge(event_hash)) else error "This Agent cannot create events!" end diff --git a/app/models/agents/java_script_agent.rb b/app/models/agents/java_script_agent.rb index 0904e4d1fd..3b6e3ac47f 100644 --- a/app/models/agents/java_script_agent.rb +++ b/app/models/agents/java_script_agent.rb @@ -135,7 +135,7 @@ def code end def credential_referenced_by_code - interpolated['code'] =~ /\Acredential:(.*)\Z/ && $1 + interpolated['code'] =~ /\Acredential:(.*)\Z/ && $1.strip end def setup_javascript