Skip to content
Snippets Groups Projects
Commit 4acbb510 authored by smayer's avatar smayer
Browse files

Changes for correct notification display when downloading files and adding documents to datasets

parent 082930b8
No related branches found
No related tags found
1 merge request!2Merging development into onb as preparation for Annolyzer release
...@@ -19,7 +19,7 @@ consumer.subscriptions.create("NotificationChannel", { ...@@ -19,7 +19,7 @@ consumer.subscriptions.create("NotificationChannel", {
$("#experiment_area").attr("data-refresh", (!$("#experiment_area").attr("data-refresh"))) $("#experiment_area").attr("data-refresh", (!$("#experiment_area").attr("data-refresh")))
break break
case "notify": case "notify":
if(window.location.pathname == "/search") { if(window.location.pathname.endsWith("/search")) {
const selected_dataset = $("#working_dataset_select").val() const selected_dataset = $("#working_dataset_select").val()
$("#working_dataset_select").html(data.dataset_options) $("#working_dataset_select").html(data.dataset_options)
$("#working_dataset_select").val(selected_dataset) $("#working_dataset_select").val(selected_dataset)
...@@ -35,7 +35,7 @@ consumer.subscriptions.create("NotificationChannel", { ...@@ -35,7 +35,7 @@ consumer.subscriptions.create("NotificationChannel", {
} }
break break
case "completion_rate": 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') const progress_bar = $(`#tool_${data.tool_id}`).find(".completion-rate").find('.progress-bar')
progress_bar.attr("style", `width: ${data.completion}%;`) progress_bar.attr("style", `width: ${data.completion}%;`)
progress_bar.attr("aria-valuenow", data.completion) progress_bar.attr("aria-valuenow", data.completion)
......
...@@ -73,7 +73,7 @@ class ExportDatasetWorker ...@@ -73,7 +73,7 @@ class ExportDatasetWorker
File.delete("/tmp/#{filename}") if filename File.delete("/tmp/#{filename}") if filename
end end
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}", { ActionCable.server.broadcast("notifications.#{user_id}", {
type: "notify", type: "notify",
html: ApplicationController.render(partial: "shared/notification", locals: { notif_title: dataset.title, notif_content: content }), html: ApplicationController.render(partial: "shared/notification", locals: { notif_title: dataset.title, notif_content: content }),
......
development: development:
adapter: async adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: newspapers_platform_production_dev
test: test:
adapter: test adapter: test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment