Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused FileSetController and other methods #1771

Merged
merged 1 commit into from
Apr 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/controllers/concerns/sufia/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Sufia::Controller
# Adds Hydra behaviors into the application controller
include Hydra::Controller::ControllerBehavior

# TODO: this makes everything slower. Move this to an Async call.
before_action :notifications_number
end

Expand All @@ -19,12 +20,12 @@ def render_500(exception)

def notifications_number
@notify_number = 0
@upload_sets = []
@processed_works = []
return if action_name == "index" && controller_name == "mailbox"
return unless user_signed_in?
@notify_number = current_user.mailbox.inbox(unread: true).count
# Extract the ids of the upload sets that have completed batch processing
@upload_sets = current_user.mailbox.inbox.map { |msg| msg.last_message.body[/<span id="(.*)"><a (href=|data-content=|data-toggle=)(.*)/, 1] }.select { |val| !val.blank? }
@processed_works = current_user.mailbox.inbox.map { |msg| msg.last_message.body[/<span id="(.*)"><a (href=|data-content=|data-toggle=)(.*)/, 1] }.select { |val| !val.blank? }
end

# Override Devise method to redirect to dashboard after signing in
Expand Down

This file was deleted.

38 changes: 1 addition & 37 deletions app/controllers/concerns/sufia/file_sets_controller_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ module Sufia
module FileSetsController
extend ActiveSupport::Autoload
autoload :BrowseEverything
autoload :UploadCompleteBehavior
end

module FileSetsControllerBehavior
extend ActiveSupport::Concern
include Sufia::Breadcrumbs

included do
include Blacklight::Configurable
include Sufia::FileSetsController::BrowseEverything
extend Sufia::FileSetsController::UploadCompleteBehavior

layout "sufia-one-column"

Expand All @@ -28,10 +27,6 @@ module FileSetsControllerBehavior
self.form_class = Sufia::Forms::FileSetEditForm
end

def new
@upload_set_id = SecureRandom.uuid
end

# routed to /files/:id/stats
def stats
@stats = FileUsage.new(params[:id])
Expand Down Expand Up @@ -73,37 +68,6 @@ def version_list
CurationConcerns::VersionListPresenter.new(versions)
end

def process_file(file)
if terms_accepted?
super(file)
else
json_error "You must accept the terms of service!", file.original_filename
end
end

# override this method if you want to change how the terms are accepted on upload.
def terms_accepted?
params[:terms_of_service] == '1'
end

# overrides Curation Concerns method
def file_set_params
return {} if params[:file_set].blank?
super
end

def find_parent_by_id
return default_work_from_params unless parent_id.present?
super
end

# If the user is creating a bunch of files, and not in a work context,
# create a work for each file.
def default_work_from_params
title = params[:file_set][:files].first.original_filename
DefaultWorkService.create(params[:upload_set_id], title, current_user)
end

def actor
@actor ||= CurationConcerns::FileSetActor.new(@file_set, current_user)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ module UploadSetsControllerBehavior
self.edit_form_class = Sufia::UploadSetForm
end

def edit
# TODO: redlock this line so that two processes don't attempt to create at the same time.
@upload_set = UploadSet.find_or_create(params[:id])
@form = edit_form
end

def update
authenticate_user!
@upload_set = UploadSet.find(params[:id])
Expand Down
12 changes: 0 additions & 12 deletions app/services/sufia/default_work_service.rb

This file was deleted.

18 changes: 0 additions & 18 deletions app/services/sufia/import_local_file_failure_service.rb

This file was deleted.

23 changes: 0 additions & 23 deletions app/services/sufia/import_local_file_success_service.rb

This file was deleted.

51 changes: 0 additions & 51 deletions app/services/sufia/ingest_local_file_service.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<%= render 'curation_concerns/file_sets/upload/agreement' %>
<div class="alert alert-success">
<%= t("sufia.upload.cloud_timeout_message", contact_href: link_to(t("sufia.upload.alert.contact_href_text"), sufia.contact_form_index_path)) %>
</div>
<div class="well">
<%= form_tag(sufia.new_curation_concerns_file_set_path, id: 'browse_everything_form', method: 'post') do %>
<%= render 'curation_concerns/file_sets/upload/tos_checkbox' %>
<%= form_tag(sufia.uploads_path, id: 'browse_everything_form', method: 'post') do %>
<%= hidden_field_tag(:upload_set_id, @upload_set_id) %>
<%= button_tag(t('sufia.upload.browse_everything.browse_files_button'), type: 'button', class: 'btn btn-lg btn-success', id: "browse-btn",
'data-toggle' => 'browse-everything', 'data-route' => browse_everything_engine.root_path,
Expand Down
9 changes: 8 additions & 1 deletion app/views/curation_concerns/base/_form_progress.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
<div class="list-group-item">
<%= render 'form_visibility_component', f: f %>
</div>

<% unless current_user.can_make_deposits_for.empty? %>
<div class="list-group-item">
<div class="controls">
<%= label_tag :on_behalf_of, 'On Behalf of' %>
<%= select_tag :on_behalf_of, options_for_select(current_user.can_make_deposits_for), prompt: "Yourself" %>
</div>
</div>
<% end %>
<div class="panel-footer text-center">
<% if Sufia::Engine.config.active_deposit_agreement_acceptance %>
<label>
Expand Down

This file was deleted.

31 changes: 0 additions & 31 deletions app/views/curation_concerns/file_sets/new.html.erb

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions app/views/curation_concerns/file_sets/upload/_alerts.html.erb

This file was deleted.

15 changes: 0 additions & 15 deletions app/views/curation_concerns/file_sets/upload/_form.html.erb

This file was deleted.

47 changes: 0 additions & 47 deletions app/views/curation_concerns/file_sets/upload/_form_fields.html.erb

This file was deleted.

This file was deleted.

This file was deleted.

Loading