Skip to content

Commit

Permalink
Removes Handlebars from default label error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
HazelGrant committed Jan 9, 2025
1 parent 8e9727b commit 2b0c86b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 29 deletions.
43 changes: 39 additions & 4 deletions apps/dashboard/app/javascript/files/file_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,46 @@ class FileOps {
let id = `#${data.id}`;
$(id).fadeOut(4000);
}

reportTransferTemplate(data) {
let html = '';

if (data.completed) {
if (data.error_summary) {
html += `
<div id="${data.id}" class="alert alert-danger alert-dismissible fade show" role="alert">
<b><i class="fas fa-exclamation-triangle"></i> ${data.error_summary}</b>
<button class="btn btn-outline-dark btn-sm ms-3 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#${data.id}-error-report" aria-expanded="false" aria-controls="${data.id}-error-report">See details</button>
<div id="${data.id}-error-report" class="collapse">
<div class="mt-3 card">
<pre class="card-body">${data.error_message}</pre>
</div>
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
`;
} else {
html += `
<span class="text-${data.bootstrap_class}" id="${data.id}">
<b><i class="fas ${data.fa_label}"></i> ${data.summary}</b>
</span>
`;
}
} else {
html += `
<span class="text-${data.bootstrap_class}" id="${data.id}">
<b><i class="fas ${data.fa_label}"></i> ${data.summary}</b>
</span>
`;
}

return html;
};

reportTransferTemplate = (function(){
let template_str = $('#transfer-template').html();
return Handlebars.compile(template_str);
})();
// reportTransferTemplate = (function(){
// let template_str = $('#transfer-template').html();
// return Handlebars.compile(template_str);
// })();

poll(data) {

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion apps/dashboard/app/views/files/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<%= render partial: "favorites" %>
<%= render partial: "copy_move_popup" %>
<%= render partial: "file_action_menu" %>
<%= render partial: "default_label_error_messages" %>
</div>
<%= render partial: "files_table" %>
</div>
Expand Down

0 comments on commit 2b0c86b

Please sign in to comment.