[ARVADOS] updated: f974126f19caf199f95de18266b906e02e17d7ff
Git user
git at public.curoverse.com
Tue Jul 19 15:24:07 EDT 2016
Summary of changes:
apps/workbench/app/controllers/application_controller.rb | 11 +++++------
apps/workbench/app/controllers/projects_controller.rb | 3 +--
apps/workbench/app/controllers/work_units_controller.rb | 3 +--
.../api => apps/workbench}/config/initializers/time_format.rb | 0
4 files changed, 7 insertions(+), 10 deletions(-)
copy {services/api => apps/workbench}/config/initializers/time_format.rb (100%)
via f974126f19caf199f95de18266b906e02e17d7ff (commit)
from bc74bad26abfe8af69ef6c86aef44915075054cd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit f974126f19caf199f95de18266b906e02e17d7ff
Author: radhika <radhika at curoverse.com>
Date: Tue Jul 19 15:23:32 2016 -0400
9319: add time_format initializer
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index b675b4b..10c33c3 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -176,7 +176,7 @@ class ApplicationController < ActionController::Base
if params[:partial]
@next_page_href = next_page_href(partial: params[:partial], filters: @filters.to_json)
render json: {
- content: render_to_string(partial: "#{params[:partial_path] || ''}show_#{params[:partial]}",
+ content: render_to_string(partial: "show_#{params[:partial]}",
formats: [:html]),
next_page_href: @next_page_href
}
@@ -242,11 +242,10 @@ class ApplicationController < ActionController::Base
end
helper_method :next_page_filters
- def next_page_filters nextpage_operator, rejections
+ def next_page_filters nextpage_operator
next_page_filters = @filters.reject do |attr, op, val|
- if rejections.has_key?(attr)
- attr == attr and op == rejections[attr]
- end
+ (attr == 'created_at' and op == nextpage_operator) or
+ (attr == 'uuid' and op == 'not in')
end
if @objects.any?
@@ -257,7 +256,7 @@ class ApplicationController < ActionController::Base
last_uuids << obj.uuid if obj.created_at.eql?(last_created_at)
end
- next_page_filters += [['created_at', nextpage_operator, last_created_at.strftime("%Y-%m-%dT%H:%M:%S.%N%z")]]
+ next_page_filters += [['created_at', nextpage_operator, last_created_at]]
next_page_filters += [['uuid', 'not in', last_uuids]]
end
diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index f0ab6ad..8ec8d5e 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -232,8 +232,7 @@ class ProjectsController < ApplicationController
@objects = @objects[0.. at limit-1]
if @objects.any?
- @next_page_filters = next_page_filters(nextpage_operator,
- {'created_at' => nextpage_operator, 'uuid' => 'not in'})
+ @next_page_filters = next_page_filters(nextpage_operator)
@next_page_href = url_for(partial: :contents_rows,
limit: @limit,
filters: @next_page_filters.to_json)
diff --git a/apps/workbench/app/controllers/work_units_controller.rb b/apps/workbench/app/controllers/work_units_controller.rb
index af7b9dc..ff69d89 100644
--- a/apps/workbench/app/controllers/work_units_controller.rb
+++ b/apps/workbench/app/controllers/work_units_controller.rb
@@ -22,9 +22,8 @@ class WorkUnitsController < ApplicationController
@objects = (jobs.to_a + pipelines.to_a + crs.to_a).sort_by(&:created_at).reverse.first(@limit)
if @objects.any?
- @next_page_filters = next_page_filters('<=', {'created_at' => '<=', 'uuid' => 'not in'})
+ @next_page_filters = next_page_filters('<=')
@next_page_href = url_for(partial: :all_processes_rows,
- partial_path: 'work_units/',
filters: @next_page_filters.to_json)
preload_links_for_objects(@objects.to_a)
else
diff --git a/apps/workbench/config/initializers/time_format.rb b/apps/workbench/config/initializers/time_format.rb
new file mode 100644
index 0000000..d476781
--- /dev/null
+++ b/apps/workbench/config/initializers/time_format.rb
@@ -0,0 +1,5 @@
+class ActiveSupport::TimeWithZone
+ def as_json *args
+ strftime "%Y-%m-%dT%H:%M:%S.%NZ"
+ end
+end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list