module ApplicationHelper
- include VersionHelper
-
def current_user
controller.current_user
end
module VersionHelper
- include ArvadosApiClientHelper
+ # api_version returns the git commit hash for the API server's
+ # current version. It is extracted from api_version_text, which
+ # returns the source_version provided by the discovery document and
+ # may have the word "-modified" appended to it (if the API server is
+ # running from a locally modified repository).
- # api_version returns the git commit hash for the API server's current version.
- # It is extracted from api_version_text, which returns the source_version provided
- # by the discovery document and may have the word "-modified" appended to it (if
- # the API server is running from a locally modified repository).
-
- def api_version()
- api_version_text().sub(/[^[:xdigit:]].*/, '')
+ def api_version
+ api_version_text.sub(/[^[:xdigit:]].*/, '')
end
- def api_version_text()
+ def api_version_text
arvados_api_client.discovery[:source_version]
end
# wb_version and wb_version_text provide the same strings for the
# code version that this Workbench is currently running.
- def wb_version()
+ def wb_version
Rails.configuration.source_version
end
- def wb_version_text()
- wbv = wb_version
- wbv += Rails.configuration.local_modified if Rails.configuration.local_modified
- wbv
+ def wb_version_text
+ wb_version + (Rails.configuration.local_modified or '')
+ end
+
+ def version_link_target version
+ "https://arvados.org/projects/arvados/repository/changes?rev=#{version}"
end
end
arvados_base = Rails.configuration.arvados_v1_base
support_email = Rails.configuration.support_email_address
- api_version_link = link_to api_version_text, "https://github.com/curoverse/arvados/tree/#{api_version}/services/api"
- wb_version_link = link_to wb_version_text, "https://github.com/curoverse/arvados/tree/#{wb_version}/apps/workbench"
+ api_version_link = link_to api_version_text, version_link_target(api_version)
+ wb_version_link = link_to wb_version_text, version_link_target(wb_version)
additional_info = {}
additional_info['Current location'] = params[:current_location]
assets.debug: true
profiling_enabled: true
site_name: Arvados Workbench (dev)
- local_modified: <%= '-modified' if `git status -s` %>
+ local_modified: "<%= '-modified' if `git status -s` != '' %>"
# API server configuration
arvados_login_base: ~
assert page.has_no_text?('Describe the problem?'), 'Found text - Describe the problem'
assert page.has_button?('Close'), 'No button - Close'
assert page.has_no_button?('Send problem report'), 'Found button - Send problem report'
- api_version_rgx = %r!^https://github.com/curoverse/arvados/tree/[0-9a-f]+/services/api/?$!
- wb_version_rgx = %r!^https://github.com/curoverse/arvados/tree/[0-9a-f]+/apps/workbench/?$!
- assert_not_empty(all("a").select { |a| a[:href] =~ wb_version_rgx })
- assert_not_empty(all("a").select { |a| a[:href] =~ api_version_rgx })
+ history_links = all('a').select do |a|
+ a[:href] =~ %r!^https://arvados.org/projects/arvados/repository/changes\?rev=[0-9a-f]+$!
+ end
+ assert_operator(2, :<=, history_links.count,
+ "Should have found two links to revision history " +
+ "in #{history_links.inspect}")
click_button 'Close'
end
active_record.auto_explain_threshold_in_seconds: 0.5
assets.compress: false
assets.debug: true
- local_modified: <%= '-modified' if `git status -s` %>
+ local_modified: "<%= '-modified' if `git status -s` != '' %>"
production:
force_ssl: true