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

release 5.1.0 #630

Merged
merged 28 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1022466
Update .zenodo.json
dlebauer Nov 2, 2018
64b9a5a
Update .zenodo.json
dlebauer Nov 2, 2018
032f1f0
Comment revisions only.
gsrohde Nov 9, 2018
3633d39
Implement feature requested in Issue #605: allow key-less API access …
gsrohde Nov 26, 2018
86a9e2c
Merge branch 'develop' into allow_keyless_guests
dlebauer Nov 26, 2018
1510660
Consider an invalid API key an error rather than defaulting to the gu…
gsrohde Nov 27, 2018
d0f8c05
Fixed incorrect login string. Got rid of redundant use of params[:key].
gsrohde Nov 27, 2018
ca34ddb
Add maps.js to the precompile list to fix issue 596.
gsrohde Nov 27, 2018
4ee935f
Merge pull request #607 from PecanProject/issue_596
dlebauer Nov 27, 2018
ff5a8ea
Merge branch 'develop' into allow_keyless_guests
dlebauer Nov 27, 2018
d8693a9
Merge pull request #606 from PecanProject/allow_keyless_guests
gsrohde Nov 28, 2018
221b608
Added a "type" attribute to the "Show" and "All Records" buttons on the
gsrohde Nov 29, 2018
bbd42c9
fix typo
dlebauer Nov 29, 2018
9e036d9
Merge pull request #608 from PecanProject/fix_covariate_page_issues
gsrohde Nov 30, 2018
a093409
Include "script.js" code to enable the "close" button in alert divs. …
gsrohde Dec 3, 2018
937d25a
Merge pull request #612 from PecanProject/issue_611
gsrohde Dec 3, 2018
c976994
Fix to make sure dbfiles have valid filename
robkooper Jan 11, 2019
b474ace
update CHANGELOG
robkooper Jan 11, 2019
b7774cf
Update app/models/db_file.rb
dlebauer Jan 11, 2019
c563c57
Fix for issue 618.
gsrohde Jan 11, 2019
dfaa14e
Merge branch 'develop' into issue_618_fix
gsrohde Jan 11, 2019
f5c8f69
Merge pull request #622 from PecanProject/issue_618_fix
dlebauer Jan 11, 2019
eed13ac
Merge branch 'develop' into dbfiles-bug
dlebauer Jan 11, 2019
1455e06
Update db_file.rb
dlebauer Jan 11, 2019
7035037
Additional changelog
robkooper Jan 11, 2019
0bb299a
Merge branch 'dbfiles-bug' of github.com:PEcAnProject/bety into dbfil…
robkooper Jan 11, 2019
000cb19
Merge pull request #620 from PecanProject/dbfiles-bug
robkooper Jan 14, 2019
7e6c58a
Set release
robkooper Jan 14, 2019
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
126 changes: 62 additions & 64 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,67 @@
{
"metadata": {
"access_right": "open",
"creators": [{
"affiliation": "University of Illinois",
"name": "Scott Rohde"
},
{
"name": "Carl Crott"
},
{
"affiliation": "University of Illinois",
"name": "David LeBauer"
},
{
"name": "Patrick Mulrooney"
},
{
"affiliation": "National Center for Supercomputing Applications",
"name": "Rob Kooper"
},
{
"name": "Jeremy Kemball"
},
{
"name": "Jimmy Chen"
},
{
"name": "Andrew Shirk"
},
{
"name": "Zhengqi Yang"
},
{
"affiliation": "National Center for Supercomputing Applications",
"name": "Max Burnette"
},
{
"name": "Haotian Jiang"
},
{
"name": "Yilin Dong"
},
{
"name": "Uday Saraf"
},
{
"affiliation": "Boston University",
"name": "Michael Dietze"
},
{
"name": "Chris Black"
}
],
"language": "eng",
"license": {
"id": "NCSA"
"access_right": "open",
"creators": [{
"affiliation": "University of Illinois",
"name": "Scott Rohde"
},
"references": [
"LeBauer, D., Kooper, R., Mulrooney, P., Rohde, S., Wang, D., Long, S. P., & Dietze, M. C. (2018). BETYdb: a yield, trait, and ecosystem service database applied to second\u2010generation bioenergy feedstock production. GCB Bioenergy, 10(1), 61-71",
"LeBauer, David, Michael Dietze, Rob Kooper, Steven Long, Patrick Mulrooney, Gareth Scott Rohde, Dan Wang (2010). Biofuel Ecophysiological Traits and Yields Database (BETYdb), Energy Biosciences Institute, University of Illinois at Urbana-Champaign. doi:10.13012/J8H41PB9"
],
"notes": "Development of BETYdb is supported by the National Science Foundation (ABI #1062547, ABI #1458021), the Department of Energy (ARPA-E awards #DE-AR0000594 and DE-AR0000598), and the Energy Biosciences Institute.",
"resource_type": {
"title": "Software",
"type": "software"
{
"name": "Carl Crott"
},
{
"affiliation": "University of Arizona",
"name": "David LeBauer"
},
{
"name": "Patrick Mulrooney"
},
{
"affiliation": "National Center for Supercomputing Applications",
"name": "Rob Kooper"
},
{
"name": "Jeremy Kemball"
},
{
"name": "Jimmy Chen"
},
{
"name": "Andrew Shirk"
},
{
"name": "Zhengqi Yang"
},
{
"affiliation": "National Center for Supercomputing Applications",
"name": "Max Burnette"
},
{
"name": "Haotian Jiang"
},
{
"name": "Yilin Dong"
},
{
"name": "Uday Saraf"
},
{
"affiliation": "Boston University",
"name": "Michael Dietze"
},
{
"name": "Chris Black"
}
],
"language": "eng",
"license": {
"id": "NCSA"
},
"references": [
"LeBauer, D., Kooper, R., Mulrooney, P., Rohde, S., Wang, D., Long, S. P., & Dietze, M. C. (2018). BETYdb: a yield, trait, and ecosystem service database applied to second\u2010generation bioenergy feedstock production. GCB Bioenergy, 10(1), 61-71",
"LeBauer, David, Michael Dietze, Rob Kooper, Steven Long, Patrick Mulrooney, Gareth Scott Rohde, Dan Wang (2010). Biofuel Ecophysiological Traits and Yields Database (BETYdb), Energy Biosciences Institute, University of Illinois at Urbana-Champaign. doi:10.13012/J8H41PB9"
],
"notes": "Development of BETYdb is supported by the National Science Foundation (ABI #1062547, ABI #1458021), the Department of Energy (ARPA-E awards #DE-AR0000594 and DE-AR0000598), and the Energy Biosciences Institute.",
"resource_type": {
"title": "Software",
"type": "software"
}
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ section for the next release.

For more information about this file see also [Keep a Changelog](http://keepachangelog.com/) .

## [5.1.0] - 2019-01-14

### Fixes

- #611 : could not close alerts
- #585 : Pressing "Show" on the Covariates Edit page attempts an update
- #621 : A fix for a critical vulnerability reported by Danny Rosseau at Carve Systems (www.carvesystems.com).
- #596 : Crop Model Maps links are broken
- #605 : Allow for keyless API access (using guestuser access)
- #618 : Can not download results of search as csv

## [5.0.5] - 2018-10-23

Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
// defines showHide
//= require min

// enables close button in "alert" divs:
//= require script

//= require lazy/simple_search
//= require lazy/application
4 changes: 4 additions & 0 deletions app/controllers/covariates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def index
def show
@covariate = Covariate.find(params[:id])

if @covariate.trait.nil?
flash[:error] = 'This covariate is not associated with a trait! Consider removing it.'
end

respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @covariate }
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def index
end

str = header + @results.to_comma
send_data str, type: Mime::CSV,
send_data str, type: :csv,
disposition: "attachment; filename=search_results.csv"
end
format.json { render :json => @results }
Expand Down
12 changes: 8 additions & 4 deletions app/models/bulk_upload_data_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,12 @@ def insert_data
t.site_id = row['site_id']

# Modify each Trait class instance so that date strings are
# interpreted as being in the time zone of the trait site
# (or UTC, if the trait site time_zone column is null)
# interpreted as being in the time zone of the trait site (or UTC, if
# the trait site time_zone column is null). Note that in the Bulk
# Upload Wizard, the validation step will prevent reaching this code
# if a site without time zone is in the data file. But nothing
# prevents a site without time zone from being specified
# interactively.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsrohde you mean time zones aren't assigned automatically based on location?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dlebauer That is correct, unfortunately. When I added the time_zone column, I did create and use table of time-zone/location data to facilitate automatically populating the time_zone column for existing sites, but there is nothing built-in to do this when adding a new site.

class <<t
def date=(value)
date = Time.use_zone(Site.find(site_id).time_zone || 'UTC') do
Expand Down Expand Up @@ -1971,8 +1975,8 @@ def get_insertion_data
# dates are assumed always to be accurate to the day:
csv_row_as_hash["dateloc"] = 5

# bulk upload doesn't handles "date only" dates and dates with time to the
# second; determine which:
# bulk upload handles "date only" dates and dates with time to the
# second and no other cases; determine which:
if csv_row_as_hash["date"].length == 19
csv_row_as_hash["timeloc"] = 1
elsif csv_row_as_hash["date"].length == 10
Expand Down
5 changes: 5 additions & 0 deletions app/models/db_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def setup(user_id, upload, args = nil)
self[:created_user_id] = user_id
self[:updated_user_id] = user_id
if upload # Uploaded file
# check to see it is a valid filename
if upload.original_filename.match(/^[a-zA-Z0-9._\-]+$/).nil?
raise("Invalid filename \"#{upload.original_filename}\"; filenames can only contain letters, numbers, periods, underscores, and dashes.")
end

self[:file_name] = upload.original_filename
self[:md5] = Digest::MD5.file(upload.path).hexdigest

Expand Down
26 changes: 25 additions & 1 deletion app/services/api_authentication_system.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# coding: utf-8
module ApiAuthenticationSystem
include AuthenticatedSystem

# Override default access_denied action.
def access_denied
@errors = "authentication failed"
if @errors
@errors = "authentication failed: " + @errors
else
@errors = "authentication failed"
end
render status: 401
end

Expand All @@ -19,4 +24,23 @@ def permissions(action_name, resource)
end
end

# Override "login_from_api_key" so that if no key is given or the given key is
# invalid, the user is logged in as the guest user.
def login_from_api_key
key = params[:key]
if key.nil?
u = User.find_by_login('guestuser')
if u.nil?
@errors = "For key-less access to the API, you must set up the guest user account."
end
else
u = User.find_by_apikey(key)
if u.nil?
@errors = "Invalid API key. To access the API as a guest user, omit the “key” parameter."
end
end

return u
end

end
7 changes: 2 additions & 5 deletions app/views/covariates/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,14 @@
<%= f.label :statname %><br />
<%= f.select :statname, $statname_list %>
</p>
<p>
<%= f.submit 'Update' %>
</p>

<div class="form-actions">
<div class="button-group">
<%= link_to( covariates_path ) do %>
<button class="button"><i class="icon-arrow-left"></i> All Records</button>
<button class="button" type="button"><i class="icon-arrow-left"></i> All Records</button>
<% end %>
<%= link_to( @covariate ) do %>
<button class="button">Show</button>
<button class="button" type="button">Show</button>
<% end %>
</div>
<div class="button-group pull-right">
Expand Down
2 changes: 2 additions & 0 deletions app/views/covariates/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<dd><%= @covariate.stat %></dd>
<dt>Statname:</dt>
<dd><%= @covariate.statname %></dd>
<% if @covariate.trait %>
<dt>Associated Trait:</dt>
<dd>
<%= link_to_if @covariate.trait, @covariate.trait, @covariate.trait %>
Expand All @@ -32,6 +33,7 @@
<dd><%= link_to_if @covariate.trait.specie, @covariate.trait.specie, @covariate.trait.specie %></dd>
<dt>Citation:</dt>
<dd><%= link_to_if @covariate.trait.citation, @covariate.trait.citation, @covariate.trait.citation %></dd>
<% end %>
</dl>


Expand Down
2 changes: 2 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
lazy/feedback.js
lazy/autocomplete.js
lazy/bulk_upload.js

mylibs/maps.js
)

Rails.application.config.assets.paths <<
Expand Down