diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index f3b87e4e0..2e346334a 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -17,7 +17,6 @@ class SearchController < ApplicationController search_protocols if @search_category == :protocols search_steps if @search_category == :steps search_checklists if @search_category == :checklists - search_samples if @search_category == :samples if @search_category == :repositories && params[:repository] search_repository end @@ -254,12 +253,6 @@ class SearchController < ApplicationController @search_count = @checklist_search_count end - def search_samples - @sample_results = [] - @sample_results = search_by_name(Sample) if @sample_search_count > 0 - @search_count = @sample_search_count - end - def search_repository @repository = Repository.find_by_id(params[:repository]) render_403 unless can_read_team?(@repository.team) diff --git a/app/views/canvas/full_zoom/_my_module.html.erb b/app/views/canvas/full_zoom/_my_module.html.erb index e78b4f3dc..ccea08365 100644 --- a/app/views/canvas/full_zoom/_my_module.html.erb +++ b/app/views/canvas/full_zoom/_my_module.html.erb @@ -64,14 +64,6 @@ -
  • - - - <% if my_module.samples.count.positive? %> - <%= my_module.samples.count %> - <% end %> - -
  • <% end %> @@ -82,7 +74,6 @@
    -
    <% end %> diff --git a/app/views/experiments/samples.html.erb b/app/views/experiments/samples.html.erb index 56ed7977b..91aac71b2 100644 --- a/app/views/experiments/samples.html.erb +++ b/app/views/experiments/samples.html.erb @@ -3,5 +3,5 @@ <%= render partial: "shared/secondary_navigation" %>
    - <%= render partial: "shared/samples" %> + <%#= render partial: "shared/samples" %>
    diff --git a/app/views/my_modules/samples.html.erb b/app/views/my_modules/samples.html.erb index 277a40e8f..a730ff0b5 100644 --- a/app/views/my_modules/samples.html.erb +++ b/app/views/my_modules/samples.html.erb @@ -3,5 +3,5 @@ <%= render partial: "shared/secondary_navigation" %>
    - <%= render partial: "shared/samples" %> + <%#= render partial: "shared/samples" %>
    diff --git a/app/views/projects/samples.html.erb b/app/views/projects/samples.html.erb index f9f95b874..1c876140f 100644 --- a/app/views/projects/samples.html.erb +++ b/app/views/projects/samples.html.erb @@ -3,5 +3,5 @@ <%= render partial: "shared/secondary_navigation" %>
    - <%= render partial: "shared/samples" %> + <%#= render partial: "shared/samples" %>
    diff --git a/app/views/reports/new/modal/_module_contents_inner.html.erb b/app/views/reports/new/modal/_module_contents_inner.html.erb index a970fbdca..5574084ce 100644 --- a/app/views/reports/new/modal/_module_contents_inner.html.erb +++ b/app/views/reports/new/modal/_module_contents_inner.html.erb @@ -66,9 +66,6 @@
  • <%= form.check_box :module_activity, label: t("projects.reports.elements.modals.module_contents_inner.activity") %>
  • -
  • - <%= form.check_box :module_samples, label: t("projects.reports.elements.modals.module_contents_inner.samples") %> -
  • <% # List all repositories, no matter whether rows are assigned or not %> <% Repository.where(team: @project.team).order(created_at: :asc).select(:id, :name).find_each do |repository| %>
  • diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index b692eaa22..f4af835a4 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -170,20 +170,6 @@ <%= t'Checklists' %>
  • - -
  • "> - "> - - - -
  • "> "> @@ -52,14 +44,6 @@
  • -
  • "> - "> - - - -
  • <% end %> <% if can_read_project?(@experiment.project) %>
  • "> @@ -94,17 +78,6 @@ <% end %>
  • - - <% if can_read_experiment?(@my_module.experiment) %> -
  • "> - "> - - - -
  • - <% end %> <% if can_read_team?(@my_module.experiment.project.team) && @my_module.experiment.project.team.repositories.exists? %>
  • "> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index d1ddf604b..48ab1309f 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -41,10 +41,10 @@ Rails.application.config.assets.precompile += %w(jquery.ui.touch-punch.min.js) Rails.application.config.assets.precompile += %w(bootstrap-colorselector.js) Rails.application.config.assets.precompile += %w(eventPause-min.js) Rails.application.config.assets.precompile += %w(sidebar.js) -Rails.application.config.assets.precompile += %w(samples/samples.js) -Rails.application.config.assets.precompile += %w(samples/sample_datatable.js) +# Rails.application.config.assets.precompile += %w(samples/samples.js) +# Rails.application.config.assets.precompile += %w(samples/sample_datatable.js) Rails.application.config.assets.precompile += %w(projects/index.js) -Rails.application.config.assets.precompile += %w(samples/samples_importer.js) +# Rails.application.config.assets.precompile += %w(samples/samples_importer.js) Rails.application.config.assets.precompile += %w(projects/canvas.js) Rails.application.config.assets.precompile += %w(experiments/dropdown_actions.js) @@ -73,7 +73,7 @@ Rails.application.config.assets.precompile += %w(comments.js) Rails.application.config.assets.precompile += %w(projects/show.js) Rails.application.config.assets.precompile += %w(notifications.js) Rails.application.config.assets.precompile += %w(users/invite_users_modal.js) -Rails.application.config.assets.precompile += %w(samples/sample_types_groups.js) +# Rails.application.config.assets.precompile += %w(samples/sample_types_groups.js) Rails.application.config.assets.precompile += %w(highlightjs-github-theme.css) Rails.application.config.assets.precompile += %w(search.js) Rails.application.config.assets.precompile += %w(repositories/index.js) diff --git a/config/initializers/extends/report_extends.rb b/config/initializers/extends/report_extends.rb index 1c2c16233..2a9d65340 100644 --- a/config/initializers/extends/report_extends.rb +++ b/config/initializers/extends/report_extends.rb @@ -94,10 +94,6 @@ module ReportExtends :activity, false, %i(my_module order)), - ModuleElement.new([:samples], - :samples, - false, - %i(my_module order)), ModuleElement.new([:repository], :repository, false, @@ -113,14 +109,12 @@ module ReportExtends # adds :order local to listed elements views # ADD REPORT ELEMENT TYPE WHICH YOU WANT TO PASS 'ORDER' LOCAL IN THE PARTIAL SORTED_ELEMENTS = %w(my_module_activity - my_module_samples my_module_repository step_comments result_comments) # sets local :my_module to the listed my_module child elements MY_MODULE_ELEMENTS = %w(my_module my_module_activity - my_module_samples my_module_repository) # sets local name to first element of the listed elements diff --git a/config/routes.rb b/config/routes.rb index 9f8a4d384..8d751e9a1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,15 +27,15 @@ Rails.application.routes.draw do # end # Save sample table state - post '/state_save/:team_id/:user_id', - to: 'user_samples#save_samples_table_status', - as: 'save_samples_table_status', - defaults: { format: 'json' } - - post '/state_load/:team_id/:user_id', - to: 'user_samples#load_samples_table_status', - as: 'load_samples_table_status', - defaults: { format: 'json' } + # post '/state_save/:team_id/:user_id', + # to: 'user_samples#save_samples_table_status', + # as: 'save_samples_table_status', + # defaults: { format: 'json' } + # + # post '/state_load/:team_id/:user_id', + # to: 'user_samples#load_samples_table_status', + # as: 'load_samples_table_status', + # defaults: { format: 'json' } resources :activities, only: [:index] @@ -156,22 +156,22 @@ Rails.application.routes.draw do post 'copy', to: 'repositories#copy', defaults: { format: 'json' } end - resources :samples, only: [:new, :create] - resources :sample_types, except: [:show, :new] do - get 'sample_type_element', to: 'sample_types#sample_type_element' - get 'destroy_confirmation', to: 'sample_types#destroy_confirmation' - end - resources :sample_groups, except: [:show, :new] do - get 'sample_group_element', to: 'sample_groups#sample_group_element' - get 'destroy_confirmation', to: 'sample_groups#destroy_confirmation' - end - resources :custom_fields, only: [:create, :edit, :update, :destroy] do - get 'destroy_html' - end + # resources :samples, only: [:new, :create] + # resources :sample_types, except: [:show, :new] do + # get 'sample_type_element', to: 'sample_types#sample_type_element' + # get 'destroy_confirmation', to: 'sample_types#destroy_confirmation' + # end + # resources :sample_groups, except: [:show, :new] do + # get 'sample_group_element', to: 'sample_groups#sample_group_element' + # get 'destroy_confirmation', to: 'sample_groups#destroy_confirmation' + # end + # resources :custom_fields, only: [:create, :edit, :update, :destroy] do + # get 'destroy_html' + # end member do post 'parse_sheet', defaults: { format: 'json' } - post 'import_samples' - post 'export_samples' + # post 'import_samples' + # post 'export_samples' post 'export_repository', to: 'repositories#export_repository' # Used for atwho (smart annotations) get 'atwho_users', to: 'at_who#users' @@ -254,15 +254,15 @@ Rails.application.routes.draw do member do # Notifications popup for individual project in projects index get 'notifications' - get 'samples' # Samples for single project + # get 'samples' # Samples for single project # Renders sample datatable for single project (ajax action) - post 'samples_index' + # post 'samples_index' get 'experiment_archive' # Experiment archive for single project - post :delete_samples, - constraints: CommitParamRouting.new( - ProjectsController::DELETE_SAMPLES - ), - action: :delete_samples + # post :delete_samples, + # constraints: CommitParamRouting.new( + # ProjectsController::DELETE_SAMPLES + # ), + # action: :delete_samples end # This route is defined outside of member block @@ -286,16 +286,16 @@ Rails.application.routes.draw do post 'clone' # clone experiment get 'move_modal' # return modal with move options post 'move' # move experiment - get 'samples' # Samples for single project + # get 'samples' # Samples for single project get 'updated_img' # Checks if the workflow image is updated get 'fetch_workflow_img' # Get udated workflow img # Renders sample datatable for single project (ajax action) - post 'samples_index' - post :delete_samples, - constraints: CommitParamRouting.new( - ExperimentsController::DELETE_SAMPLES - ), - action: :delete_samples + # post 'samples_index' + # post :delete_samples, + # constraints: CommitParamRouting.new( + # ExperimentsController::DELETE_SAMPLES + # ), + # action: :delete_samples end end @@ -308,7 +308,7 @@ Rails.application.routes.draw do resources :my_module_comments, path: '/comments', only: [:index, :create, :edit, :update, :destroy] - resources :sample_my_modules, path: '/samples_index', only: [:index] + # resources :sample_my_modules, path: '/samples_index', only: [:index] resources :result_texts, only: [:new, :create] resources :result_assets, only: [:new, :create] resources :result_tables, only: [:new, :create] @@ -321,7 +321,7 @@ Rails.application.routes.draw do get 'due_date' get 'protocols' # Protocols view for single module get 'results' # Results view for single module - get 'samples' # Samples view for single module + # get 'samples' # Samples view for single module # Repository view for single module get 'repository/:repository_id', to: 'my_modules#repository', @@ -339,22 +339,22 @@ Rails.application.routes.draw do get 'complete_my_module' post 'toggle_task_state' # Renders sample datatable for single module (ajax action) - post 'samples_index' - post :assign_samples, - constraints: CommitParamRouting.new( - MyModulesController::ASSIGN_SAMPLES - ), - action: :assign_samples - post :assign_samples, - constraints: CommitParamRouting.new( - MyModulesController::UNASSIGN_SAMPLES - ), - action: :unassign_samples - post :assign_samples, - constraints: CommitParamRouting.new( - MyModulesController::DELETE_SAMPLES - ), - action: :delete_samples + # post 'samples_index' + # post :assign_samples, + # constraints: CommitParamRouting.new( + # MyModulesController::ASSIGN_SAMPLES + # ), + # action: :assign_samples + # post :assign_samples, + # constraints: CommitParamRouting.new( + # MyModulesController::UNASSIGN_SAMPLES + # ), + # action: :unassign_samples + # post :assign_samples, + # constraints: CommitParamRouting.new( + # MyModulesController::DELETE_SAMPLES + # ), + # action: :delete_samples end # Those routes are defined outside of member block @@ -384,8 +384,8 @@ Rails.application.routes.draw do only: [:create, :index, :edit, :update, :destroy] end - resources :samples, only: [:edit, :update, :destroy] - get 'samples/:id', to: 'samples#show' + # resources :samples, only: [:edit, :update, :destroy] + # get 'samples/:id', to: 'samples#show' resources :result_texts, only: [:edit, :update, :destroy] get 'result_texts/:id/download' => 'result_texts#download', @@ -521,7 +521,7 @@ Rails.application.routes.draw do post 'auth/token', to: 'api#authenticate' scope '20170715', module: 'v20170715' do get 'tasks/tree', to: 'core_api#tasks_tree' - get 'tasks/:task_id/samples', to: 'core_api#task_samples' + # get 'tasks/:task_id/samples', to: 'core_api#task_samples' end end end diff --git a/spec/controllers/api/v20170715/core_api_controller_spec.rb b/spec/controllers/api/v20170715/core_api_controller_spec.rb index ee513ff53..1d4fbe55b 100644 --- a/spec/controllers/api/v20170715/core_api_controller_spec.rb +++ b/spec/controllers/api/v20170715/core_api_controller_spec.rb @@ -12,66 +12,6 @@ describe Api::V20170715::CoreApiController, type: :controller do UserProject.create!(user: user, project: task.experiment.project, role: 0) end - describe 'GET #task_samples' do - context 'When valid request' do - before do - request.headers['HTTP_ACCEPT'] = 'application/json' - request.headers['Authorization'] = 'Bearer ' + generate_token(user.id) - get :task_samples, params: { task_id: task.id } - end - - it 'Returns HTTP success' do - expect(response).to have_http_status(200) - end - - it 'Returns JSON body containing expected Samples' do - hash_body = nil - expect { hash_body = json }.not_to raise_exception - expect(hash_body).to match( - [{ 'sample_id' => sample1.id.to_s, 'name' => sample1.name }, - { 'sample_id' => sample2.id.to_s, 'name' => sample2.name }, - { 'sample_id' => sample3.id.to_s, 'name' => sample3.name }] - ) - end - end - - context 'When invalid request' do - context 'When invalid token' do - before do - request.headers['HTTP_ACCEPT'] = 'application/json' - request.headers['Authorization'] = 'Bearer WroNgToken' - get :task_samples, params: { task_id: task.id } - end - - it 'Returns HTTP unauthorized' do - expect(response).to have_http_status(401) - end - end - - context 'When valid token, but invalid request' do - before do - request.headers['HTTP_ACCEPT'] = 'application/json' - request.headers['Authorization'] = 'Bearer ' + generate_token(user.id) - end - - it 'Returns HTTP not found' do - get :task_samples, params: { task_id: 1000 } - expect(response).to have_http_status(404) - expect(json).to match({}) - end - - it 'Returns HTTP access denied' do - UserProject.where(user: user, project: task.experiment.project) - .first - .destroy! - get :task_samples, params: { task_id: task.id } - expect(response).to have_http_status(403) - expect(json).to match({}) - end - end - end - end - describe 'GET #tasks_tree' do let!(:user_team) { create :user_team, team: team, user: user } context 'When valid request' do