diff --git a/app/javascript/channels/notification_channel.js b/app/javascript/channels/notification_channel.js index 7d47346856862f2ad4bea953eee09ea92bf38f70..c820626d082438fe0d42f7be779401e376d1e6f5 100644 --- a/app/javascript/channels/notification_channel.js +++ b/app/javascript/channels/notification_channel.js @@ -19,7 +19,7 @@ consumer.subscriptions.create("NotificationChannel", { $("#experiment_area").attr("data-refresh", (!$("#experiment_area").attr("data-refresh"))) break case "notify": - if(window.location.pathname == "/search") { + if(window.location.pathname.endsWith("/search")) { const selected_dataset = $("#working_dataset_select").val() $("#working_dataset_select").html(data.dataset_options) $("#working_dataset_select").val(selected_dataset) @@ -35,7 +35,7 @@ consumer.subscriptions.create("NotificationChannel", { } break case "completion_rate": - if(window.location.pathname == `/experiment/${data.experiment_id}`) { + if(window.location.pathname.endsWith(`/experiment/${data.experiment_id}`)) { const progress_bar = $(`#tool_${data.tool_id}`).find(".completion-rate").find('.progress-bar') progress_bar.attr("style", `width: ${data.completion}%;`) progress_bar.attr("aria-valuenow", data.completion) diff --git a/app/workers/export_dataset_worker.rb b/app/workers/export_dataset_worker.rb index a0a760b5858893f7fdb5c11bc72df345ecf52eda..9ef8beba2078036d7ed370b76982b1b6c80d099d 100644 --- a/app/workers/export_dataset_worker.rb +++ b/app/workers/export_dataset_worker.rb @@ -73,7 +73,7 @@ class ExportDatasetWorker File.delete("/tmp/#{filename}") if filename end end - content = "<p>Your dataset is ready. <a target=\"_blank\" href=\"/send?filename=#{File.basename(file.path)}\">Click here</a> to download it.</p>" + content = "<p>Your dataset is ready. <a target=\"_blank\" href=\"/en/tool/newspapers-platform/send?filename=#{File.basename(file.path)}\">Click here</a> to download it.</p>" ActionCable.server.broadcast("notifications.#{user_id}", { type: "notify", html: ApplicationController.render(partial: "shared/notification", locals: { notif_title: dataset.title, notif_content: content }), diff --git a/config/cable.yml b/config/cable.yml index 5fc7ec89ca2e2d0f359d5ada58c4eadab0c089b8..07fb37bba77d693da9f4928f8a60880c78eaca4d 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,5 +1,7 @@ development: - adapter: async + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: newspapers_platform_production_dev test: adapter: test