mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Remove delete molecule activities [SCI-5999]
This commit is contained in:
parent
56576960b0
commit
5cc966e11e
6 changed files with 5 additions and 32 deletions
|
@ -46,21 +46,6 @@ class BioEddieAssetsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
asset = current_team.assets.find(bio_eddie_params[:id])
|
||||
|
||||
if asset
|
||||
create_delete_bio_eddie_activity(asset, current_user)
|
||||
if asset.destroy
|
||||
render json: { flash: I18n.t('assets.file_deleted', file_name: asset.file_name) }
|
||||
else
|
||||
render json: {}, status: :unprocessable_entity
|
||||
end
|
||||
else
|
||||
render json: { error: t('bio_eddie.no_molecules_found') }, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
def license
|
||||
license_file_path = Rails.root.join('data/bioeddie/license.cxl')
|
||||
if File.file?(license_file_path)
|
||||
|
|
|
@ -23,12 +23,6 @@ module BioEddieActions
|
|||
bio_eddie_find_target_object(asset, current_user, 'create')
|
||||
end
|
||||
|
||||
def create_delete_bio_eddie_activity(asset, current_user)
|
||||
return unless bio_eddie_asset_validation(asset)
|
||||
|
||||
bio_eddie_find_target_object(asset, current_user, 'delete')
|
||||
end
|
||||
|
||||
def create_register_bio_eddie_activity(asset, current_user)
|
||||
return unless bio_eddie_asset_validation(asset)
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<% if deletable %>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<a class="delete-asset" href="<%= asset.bio_eddie? ? bio_eddie_asset_path(asset) : asset_destroy_path(asset) %>" data-file-name="<%= asset.render_file_name %>">
|
||||
<a class="delete-asset" href="<%= asset_destroy_path(asset) %>" data-file-name="<%= asset.render_file_name %>">
|
||||
<i class="fas fa-trash"></i>
|
||||
<%= t("assets.context_menu.delete") %>
|
||||
</a>
|
||||
|
|
|
@ -316,9 +316,6 @@ class Extends
|
|||
create_molecule_on_step: 171,
|
||||
create_molecule_on_result: 172,
|
||||
create_molecule_on_step_in_repository: 173,
|
||||
delete_molecule_on_step: 174,
|
||||
delete_molecule_on_result: 175,
|
||||
delete_molecule_on_step_in_repository: 176,
|
||||
register_molecule_on_step: 177,
|
||||
register_molecule_on_result: 178,
|
||||
register_molecule_on_step_in_repository: 179
|
||||
|
@ -326,17 +323,17 @@ class Extends
|
|||
|
||||
ACTIVITY_GROUPS = {
|
||||
projects: [*0..7, 32, 33, 34, 95, 108, 65, 109, *158..162],
|
||||
task_results: [23, 26, 25, 42, 24, 40, 41, 99, 110, 122, 116, 128, 169, 172, 175, 178],
|
||||
task_results: [23, 26, 25, 42, 24, 40, 41, 99, 110, 122, 116, 128, 169, 172, 178],
|
||||
task: [8, 58, 9, 59, *10..14, 35, 36, 37, 53, 54, *60..63, 138, 139, 140, 64, 66, 106, 126, 120, 132,
|
||||
*146..148, 168],
|
||||
task_protocol: [15, 22, 16, 18, 19, 20, 21, 17, 38, 39, 100, 111, 45, 46, 47, 121, 124, 115, 118, 127, 130, 137,
|
||||
171, 174, 177],
|
||||
171, 177],
|
||||
task_inventory: [55, 56, 146, 147],
|
||||
experiment: [*27..31, 57],
|
||||
reports: [48, 50, 49, 163, 164],
|
||||
inventories: [70, 71, 105, 144, 145, 72, 73, 74, 102, 142, 143, 75, 76, 77, 78, 96, 107, 113, 114, *133..136],
|
||||
protocol_repository: [80, 103, 89, 87, 79, 90, 91, 88, 85, 86, 84, 81, 82,
|
||||
83, 101, 112, 123, 125, 117, 119, 129, 131, 170, 173, 176, 179],
|
||||
83, 101, 112, 123, 125, 117, 119, 129, 131, 170, 173, 179],
|
||||
team: [92, 94, 93, 97, 104]
|
||||
}
|
||||
|
||||
|
|
|
@ -357,9 +357,6 @@ en:
|
|||
create_molecule_on_step: "Molecule on task step created"
|
||||
create_molecule_on_result: "Molecule on result created"
|
||||
create_molecule_on_step_in_repository: "Molecule on step created"
|
||||
delete_molecule_on_step: "Molecule on task step deleted"
|
||||
delete_molecule_on_result: "Molecule on result deleted"
|
||||
delete_molecule_on_step_in_repository: "Molecule on step deleted"
|
||||
register_molecule_on_step: "Molecule on task step registered"
|
||||
register_molecule_on_result: "Molecule on result registered"
|
||||
register_molecule_on_step_in_repository: "Molecule on step registered"
|
||||
|
|
|
@ -770,7 +770,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :bio_eddie_assets, only: %i(create update destroy) do
|
||||
resources :bio_eddie_assets, only: %i(create update) do
|
||||
collection do
|
||||
get :license
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue