2020-10-19 18:17:03 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PwaHelper
|
2020-10-21 20:56:20 +08:00
|
|
|
def pwa_mobile_app_url(team_id, project_id, experiment_id, task_id, protocol_id, step_id, domain)
|
|
|
|
url = Constants::PWA_URL.dup
|
2020-10-19 18:17:03 +08:00
|
|
|
{
|
|
|
|
':pwa_domain' => Rails.configuration.x.pwa_domain,
|
|
|
|
':team_id' => team_id,
|
|
|
|
':project_id' => project_id,
|
|
|
|
':experiment_id' => experiment_id,
|
|
|
|
':task_id' => task_id,
|
|
|
|
':protocol_id' => protocol_id,
|
2020-10-21 20:56:20 +08:00
|
|
|
':step_id' => step_id,
|
|
|
|
':domain' => domain
|
2020-10-19 18:17:03 +08:00
|
|
|
}.each { |k, v| url.gsub!(k, v.to_s) }
|
|
|
|
url
|
|
|
|
end
|
|
|
|
end
|