mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 23:54:43 +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) {
|
function checkSnapshotStatus(snapshotItem) {
|
||||||
$.getJSON(snapshotItem.data('status-url'), (statusData) => {
|
$.getJSON(snapshotItem.data('status-url'), (statusData) => {
|
||||||
if (statusData.status === 'ready') {
|
if (statusData.status !== 'provisioning') {
|
||||||
$.getJSON(snapshotItem.data('version-item-url'), (itemData) => {
|
$.getJSON(snapshotItem.data('version-item-url'), (itemData) => {
|
||||||
snapshotItem.replaceWith(itemData.html);
|
snapshotItem.replaceWith(itemData.html);
|
||||||
|
$('#snapshot-error-' + itemData.repository_id).modal('show');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
|
@ -52,6 +52,7 @@ class MyModuleRepositorySnapshotsController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render json: {
|
render json: {
|
||||||
|
repository_id: @repository_snapshot.parent_id,
|
||||||
html: render_to_string(partial: 'my_modules/repositories/full_view_version',
|
html: render_to_string(partial: 'my_modules/repositories/full_view_version',
|
||||||
locals: { repository_snapshot: @repository_snapshot,
|
locals: { repository_snapshot: @repository_snapshot,
|
||||||
can_delete_snapshot: can_manage_my_module_repository_snapshots?(@my_module) })
|
can_delete_snapshot: can_manage_my_module_repository_snapshots?(@my_module) })
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
id: "snapshot-error",
|
id: "snapshot-error",
|
||||||
type: "error",
|
type: "error",
|
||||||
shown: true,
|
shown: true,
|
||||||
title: t("my_modules.modals.snapshot_error.title"),
|
title: t("my_modules.modals.transition_snapshot_error.title"),
|
||||||
body:
|
body:
|
||||||
t(
|
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
|
repository: Repository.find(flash["repository_snapshot_error"]["repository_id"]).name
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
|
|
|
@ -42,5 +42,16 @@
|
||||||
<tbody></tbody>
|
<tbody></tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1046,9 +1046,12 @@ en:
|
||||||
hidden_tasks: "No permission: There are %{size} tasks you can’t assign to."
|
hidden_tasks: "No permission: There are %{size} tasks you can’t assign to."
|
||||||
task: 'Assign to task'
|
task: 'Assign to task'
|
||||||
task_and_downstream: 'Assign to task & downstream'
|
task_and_downstream: 'Assign to task & downstream'
|
||||||
snapshot_error:
|
transition_snapshot_error:
|
||||||
title: "Cannot change status"
|
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."
|
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:
|
modules_list_partial:
|
||||||
private_tasks_html: 'Assigned to <strong>%{nr}</strong> private task(s)'
|
private_tasks_html: 'Assigned to <strong>%{nr}</strong> private task(s)'
|
||||||
no_results:
|
no_results:
|
||||||
|
|
Loading…
Add table
Reference in a new issue