Skip to content

Commit

Permalink
Remove software_version from Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Sep 20, 2023
1 parent d20b718 commit 0349edc
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion app/controllers/dispatch_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def api_retract
retraction_paper.body = "Retraction notice for: #{paper.title}"
retraction_paper.authors = "Editorial Board"
retraction_paper.repository_url = paper.repository_url
retraction_paper.software_version = paper.software_version
retraction_paper.track_id = paper.track_id
retraction_paper.citation_string = params[:citation_string]
retraction_paper.submission_kind = "replication"
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/papers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ def lookup
doi: paper.doi,
state: paper.state,
review_issue_id: paper.review_issue_id,
software_version: paper.software_version,
repository_url: paper.repository_url,
submitted: paper.created_at.strftime('%d %B %Y'),
accepted: accepted_at,
Expand Down Expand Up @@ -328,7 +327,7 @@ def status
private

def paper_params
params.require(:paper).permit(:title, :repository_url, :git_branch, :software_version, :body, :kind, :submission_kind, :suggested_subject, :track_id)
params.require(:paper).permit(:title, :repository_url, :git_branch, :body, :kind, :submission_kind, :suggested_subject, :track_id)
end

def can_see_hidden_paper?(paper)
Expand Down
1 change: 0 additions & 1 deletion app/models/paper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class Paper < ApplicationRecord

validates_presence_of :title, message: "The paper must have a title"
validates_presence_of :repository_url, message: "Repository address can't be blank"
validates_presence_of :software_version, message: "Version can't be blank"
validates_presence_of :body, message: "Description can't be blank"
validates_presence_of :track_id, on: :create, message: "You must select a valid subject for the paper", if: Proc.new { JournalFeatures.tracks? }
validates :kind, inclusion: { in: Rails.application.settings["paper_types"] }, allow_nil: true
Expand Down
2 changes: 0 additions & 2 deletions app/views/papers/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
<%= f.text_field :git_branch, placeholder: "Leave blank if paper.md is in the default branch", class: "form-control" %>
</div>
<div class="col">
<%= f.label "Software Version" %>
<%= f.text_field :software_version, placeholder: "e.g. v1.0.0", class: "form-control" %>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion app/views/papers/index.atom.builder
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ atom_feed do |feed|
entry.title(paper.title)
entry.content(type: "application/xml") do |content|
entry.state(paper.state)
entry.software_version(paper.software_version)
entry.submitted_at(paper.created_at)
if paper.accepted?
entry.issue paper.issue
Expand Down
1 change: 0 additions & 1 deletion app/views/shared/meta_view_body.text.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**Submitting author:** <!--author-handle--><%= paper.submitting_author.github_username %><!--end-author-handle--> (<%= link_to paper.submitting_author.name, paper.submitting_author.orcid_url %>)
**Repository:** <!--target-repository--><%= paper.repository_url %><!--end-target-repository-->
**Branch with paper.md** (empty if default branch): <!--branch--><%= paper.git_branch %><!--end-branch-->
**Version:** <!--version--><%= paper.software_version %><!--end-version-->
**Editor:** <!--editor-->Pending<!--end-editor-->
**Reviewers:** <!--reviewers-list-->Pending<!--end-reviewers-list-->
**Managing EiC:** <%= eic_name %>
Expand Down
1 change: 0 additions & 1 deletion app/views/shared/review_body.text.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**Submitting author:** <!--author-handle--><%= paper.submitting_author.github_username %><!--end-author-handle--> (<%= link_to paper.submitting_author.name, paper.submitting_author.orcid_url %>)
**Repository:** <!--target-repository--><%= paper.repository_url %><!--end-target-repository-->
**Branch with paper.md** (empty if default branch): <!--branch--><%= branch.to_s %><!--end-branch-->
**Version:** <!--version--><%= paper.software_version %><!--end-version-->
**Editor:** <!--editor--><%= editor %><!--end-editor-->
**Reviewers:** <!--reviewers-list--><%= reviewers.join(', ') %><!--end-reviewers-list-->
**Archive:** <!--archive-->Pending<!--end-archive-->
Expand Down
6 changes: 2 additions & 4 deletions spec/controllers/papers_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
body: "something",
repository_url: "https://github.com/openjournals/joss",
git_branch: "joss-paper",
software_version: "v1.0.1",
submission_kind: "replication",
suggested_subject: "Astronomy & astrophysics",
track_id: create(:track).id
Expand Down Expand Up @@ -161,7 +160,7 @@
paper_count = Paper.count
request.env["HTTP_REFERER"] = new_paper_path

paper_params = {title: "Yeah whateva", body: "something", repository_url: "https://github.com/foo/bar", software_version: "v1.0.1"}
paper_params = {title: "Yeah whateva", body: "something", repository_url: "https://github.com/foo/bar"}
post :create, params: {paper: paper_params}
expect(response).to be_redirect # as it's redirected us
expect(Paper.count).to eq(paper_count)
Expand Down Expand Up @@ -279,14 +278,13 @@

it "should return paper's info" do
track = create(:track, name: "Test track", short_name: "Testtr")
paper = create(:under_review_paper, title: "Testing paper lookup", software_version: "3.3", track: track, meta_review_issue_id: 123)
paper = create(:under_review_paper, title: "Testing paper lookup", track: track, meta_review_issue_id: 123)

get :lookup, params: {id: 123}
expect(JSON.parse(response.body)['title']).to eq("Testing paper lookup")
expect(JSON.parse(response.body)['doi']).to eq(nil)
expect(JSON.parse(response.body)['state']).to eq("under_review")
expect(JSON.parse(response.body)['review_issue_id']).to eq(101)
expect(JSON.parse(response.body)['software_version']).to eq("3.3")
expect(JSON.parse(response.body)['repository_url']).to eq("http://github.com/arfon/fidgit")
end

Expand Down
1 change: 0 additions & 1 deletion spec/factories/papers_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
body { 'An ungodly union of GitHub and Figshare http://fidgit.arfon.org' }
repository_url { 'http://github.com/arfon/fidgit' }
archive_doi { 'https://doi.org/10.0001/zenodo.12345' }
software_version { 'v1.0.0' }
submitting_author { create(:user) }
submission_kind { 'replication' }
track { create(:track) }
Expand Down
2 changes: 0 additions & 2 deletions spec/models/paper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
no_track_params = { title: 'Test paper',
body: 'A test paper description',
repository_url: 'http://github.com/arfon/fidgit',
software_version: 'v1.0.0',
submitting_author: create(:user),
submission_kind: 'replication' }

Expand All @@ -72,7 +71,6 @@
no_track_params = { title: 'Test paper',
body: 'A test paper description',
repository_url: 'http://github.com/arfon/fidgit',
software_version: 'v1.0.0',
submitting_author: create(:user),
submission_kind: 'replication' }

Expand Down
2 changes: 0 additions & 2 deletions spec/views/papers/new.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
assert_select "input#paper_title[name=?]", "paper[title]"
assert_select "input#paper_repository_url[name=?]", "paper[repository_url]"
assert_select "input#paper_git_branch[name=?]", "paper[git_branch]"
assert_select "input#paper_software_version[name=?]", "paper[software_version]"
assert_select "select#paper_submission_kind[name=?]", "paper[submission_kind]"
assert_select "input#paper_track_id[name=?]", "paper[track_id]"
assert_select "input#paper_suggested_subject[name=?]", "paper[suggested_subject]"
Expand All @@ -47,7 +46,6 @@
assert_select "input#paper_title[name=?]", "paper[title]"
assert_select "input#paper_repository_url[name=?]", "paper[repository_url]"
assert_select "input#paper_git_branch[name=?]", "paper[git_branch]"
assert_select "input#paper_software_version[name=?]", "paper[software_version]"
assert_select "select#paper_submission_kind[name=?]", "paper[submission_kind]"
assert_select "input#paper_track_id[name=?]", "paper[track_id]"
assert_select "input#paper_suggested_subject[name=?]", "paper[suggested_subject]"
Expand Down

0 comments on commit 0349edc

Please sign in to comment.