mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 21:24:23 +08:00
Add repository snapshot error modal [SCI-6613] (#3993)
This commit is contained in:
parent
2d811cdc4c
commit
83ac50c57d
5 changed files with 21 additions and 5 deletions
|
@ -399,9 +399,10 @@ var MyModuleRepositories = (function() {
|
|||
|
||||
function checkSnapshotStatus(snapshotItem) {
|
||||
$.getJSON(snapshotItem.data('status-url'), (statusData) => {
|
||||
if (statusData.status === 'ready') {
|
||||
if (statusData.status !== 'provisioning') {
|
||||
$.getJSON(snapshotItem.data('version-item-url'), (itemData) => {
|
||||
snapshotItem.replaceWith(itemData.html);
|
||||
$('#snapshot-error-' + itemData.repository_id).modal('show');
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
|
|
|
@ -52,6 +52,7 @@ class MyModuleRepositorySnapshotsController < ApplicationController
|
|||
|
||||
def show
|
||||
render json: {
|
||||
repository_id: @repository_snapshot.parent_id,
|
||||
html: render_to_string(partial: 'my_modules/repositories/full_view_version',
|
||||
locals: { repository_snapshot: @repository_snapshot,
|
||||
can_delete_snapshot: can_manage_my_module_repository_snapshots?(@my_module) })
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
id: "snapshot-error",
|
||||
type: "error",
|
||||
shown: true,
|
||||
title: t("my_modules.modals.snapshot_error.title"),
|
||||
body:
|
||||
title: t("my_modules.modals.transition_snapshot_error.title"),
|
||||
body:
|
||||
t(
|
||||
"my_modules.modals.snapshot_error.body_html",
|
||||
"my_modules.modals.transition_snapshot_error.body_html",
|
||||
repository: Repository.find(flash["repository_snapshot_error"]["repository_id"]).name
|
||||
)
|
||||
%>
|
||||
|
|
|
@ -42,5 +42,16 @@
|
|||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= render 'shared/dialog',
|
||||
id: "snapshot-error-#{repository.id}",
|
||||
type: "error",
|
||||
shown: false,
|
||||
title: t("my_modules.modals.snapshot_error.title"),
|
||||
body:
|
||||
t(
|
||||
"my_modules.modals.snapshot_error.body_html",
|
||||
repository: repository.name
|
||||
)
|
||||
%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1046,9 +1046,12 @@ en:
|
|||
hidden_tasks: "No permission: There are %{size} tasks you can’t assign to."
|
||||
task: 'Assign to task'
|
||||
task_and_downstream: 'Assign to task & downstream'
|
||||
snapshot_error:
|
||||
transition_snapshot_error:
|
||||
title: "Cannot change status"
|
||||
body_html: "The task cannot be moved to the next status because the <strong>%{repository}</strong> inventory snapshot failed to generate. Please contact support if this problem persists."
|
||||
snapshot_error:
|
||||
title: "Snapshot error"
|
||||
body_html: "<strong>%{repository}</strong> inventory snapshot failed to generate. Please contact support if this problem persists."
|
||||
modules_list_partial:
|
||||
private_tasks_html: 'Assigned to <strong>%{nr}</strong> private task(s)'
|
||||
no_results:
|
||||
|
|
Loading…
Add table
Reference in a new issue