mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 15:14:33 +08:00
clean up linked protocol
This commit is contained in:
parent
6b17385f3a
commit
852fe499fb
5 changed files with 26 additions and 15 deletions
|
@ -333,10 +333,18 @@ function importProtocolFromFile(
|
||||||
// Check for confirmation first
|
// Check for confirmation first
|
||||||
if (importIntoProtocol && !confirm(I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm"))) {
|
if (importIntoProtocol && !confirm(I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm"))) {
|
||||||
importModal.modal("hide");
|
importModal.modal("hide");
|
||||||
|
} else {
|
||||||
|
|
||||||
|
var path = new RegExp("modules");
|
||||||
|
if( path.test( window.location.href ) ){
|
||||||
|
importSingleProtocol(currentProtocol, false, function(data) {
|
||||||
|
importModal.find("[data-role='preview-container']").html("");
|
||||||
|
afterImportCallback([data]);
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Show spinner
|
// Show spinner
|
||||||
animateSpinner(importModal);
|
animateSpinner(importModal);
|
||||||
|
|
||||||
importSingleProtocol(currentProtocol, false, function(data) {
|
importSingleProtocol(currentProtocol, false, function(data) {
|
||||||
animateSpinner(importModal, false);
|
animateSpinner(importModal, false);
|
||||||
importModal.find("[data-role='preview-container']").html("");
|
importModal.find("[data-role='preview-container']").html("");
|
||||||
|
@ -345,6 +353,7 @@ function importProtocolFromFile(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function importAllProtocols() {
|
function importAllProtocols() {
|
||||||
var nrOfImportedProtocols = 0;
|
var nrOfImportedProtocols = 0;
|
||||||
|
|
|
@ -36,7 +36,9 @@ module ProtocolsImporter
|
||||||
populate_protocol(protocol, protocol_json, user)
|
populate_protocol(protocol, protocol_json, user)
|
||||||
protocol.reload
|
protocol.reload
|
||||||
|
|
||||||
return protocol
|
# Unlink the protocol
|
||||||
|
protocol.unlink
|
||||||
|
protocol
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -578,7 +578,7 @@ en:
|
||||||
load_protocol_from_repository: "from repository"
|
load_protocol_from_repository: "from repository"
|
||||||
load_protocol_from_file: "from file"
|
load_protocol_from_file: "from file"
|
||||||
export: "Export protocol"
|
export: "Export protocol"
|
||||||
copy_to_repository: "Copy protocol to repository"
|
copy_to_repository: "Save to protocol repository"
|
||||||
confirm_link_update_modal:
|
confirm_link_update_modal:
|
||||||
unlink_title: "Unlink protocol"
|
unlink_title: "Unlink protocol"
|
||||||
unlink_message: "Are you sure you want to unlink the task protocol from the repository version? This will stop any tracking of changes."
|
unlink_message: "Are you sure you want to unlink the task protocol from the repository version? This will stop any tracking of changes."
|
||||||
|
|
Loading…
Add table
Reference in a new issue