Skip to content

Commit

Permalink
refactor: make download button a primary action, update text
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
  • Loading branch information
akhilnarang committed Mar 13, 2024
1 parent 6a5af14 commit 5f087ed
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions frappe/public/js/frappe/list/bulk_operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,15 @@ export default class BulkOperations {
let task_id = response.message.task_id;
frappe.realtime.task_subscribe(task_id);
frappe.realtime.on(`task_complete:${task_id}`, (data) => {
frappe.msgprint(
`Please click <a href=${data.file_url} target="_blank">here</a> to download the PDF`
);
frappe.msgprint({
title: __("Bulk PDF Export"),
message: __("Your PDF is ready for download"),
primary_action: {
label: __("Download PDF"),
client_action: "window.open",
args: data.file_url,
},
});
frappe.realtime.task_unsubscribe(task_id);
frappe.realtime.off(`task_complete:${task_id}`);
});
Expand Down

0 comments on commit 5f087ed

Please sign in to comment.