• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / pdc_describe / 4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

07 Apr 2025 06:36PM UTC coverage: 1.283% (-94.6%) from 95.862%
4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

Pull #1994

circleci

hectorcorrea
Switched to use the autocomplete that we aleady use for ROR. Integrated it with the existing logic for creators
Pull Request #1994: Started adding auto complete to contributors

0 of 46 new or added lines in 2 files covered. (0.0%)

4806 existing lines in 74 files now uncovered.

65 of 5065 relevant lines covered (1.28%)

0.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/controllers/works_wizard_new_submission_controller.rb
1
# frozen_string_literal: true
2

UNCOV
3
require "nokogiri"
×
UNCOV
4
require "open-uri"
×
5

6
# Controller to handle the policy agreement acknowlegdement before the wizard is started
7
#
8
# The wizard flow is shown in the [mermaid diagram here](https://github.com/pulibrary/pdc_describe/blob/main/docs/wizard_flow.md).
9
#
UNCOV
10
class WorksWizardNewSubmissionController < ApplicationController
×
UNCOV
11
  before_action :load_work
×
UNCOV
12
  before_action :can_edit
×
13

14
  # get Renders the "step 0" information page before creating a new dataset
15
  # GET /works/1/new_submission
UNCOV
16
  def new_submission
×
UNCOV
17
    @work = WorkMetadataService.new(params:, current_user:).work_for_new_submission
×
UNCOV
18
    prepare_decorators_for_work_form(@work)
×
UNCOV
19
  end
×
20

21
  # Creates the new dataset or update the dataset is save only was done previously
22
  # POST /works/new_submission or POST /works/1/new_submission
UNCOV
23
  def new_submission_save
×
UNCOV
24
    @work = WorkMetadataService.new(params:, current_user:).new_submission
×
UNCOV
25
    @errors = @work.errors.to_a
×
UNCOV
26
    if @errors.count.positive?
×
UNCOV
27
      prepare_decorators_for_work_form(@work)
×
UNCOV
28
      render :new_submission
×
UNCOV
29
    else
×
UNCOV
30
      redirect_to edit_work_wizard_path(@work)
×
UNCOV
31
    end
×
UNCOV
32
  end
×
33

34
  # GET /works/1/new-submission-delete
UNCOV
35
  def new_submission_delete
×
UNCOV
36
    if @work.editable_by?(current_user) && @work.none?
×
UNCOV
37
      @work.destroy
×
UNCOV
38
    end
×
UNCOV
39
    redirect_to user_path(current_user)
×
UNCOV
40
  end
×
41

UNCOV
42
  private
×
43

UNCOV
44
    def load_work
×
UNCOV
45
      @work = Work.find(params[:id])
×
UNCOV
46
    end
×
47

UNCOV
48
    def can_edit
×
UNCOV
49
      return if @work.editable_by?(current_user)
×
50

UNCOV
51
      redirect_to user_path(current_user), notice: "You do not have permission to modify the work."
×
UNCOV
52
    end
×
UNCOV
53
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc