Skip to content

Commit 5c92872

Browse files
committed
Merge remote-tracking branch 'origin/release-1.13.0'
2 parents 1baddf0 + 7ab0d62 commit 5c92872

45 files changed

Lines changed: 2627 additions & 120 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2+
3+
# Ignore git directory.
4+
/.git/
5+
6+
# Ignore bundler config.
7+
/.bundle
8+
9+
# Ignore all environment files (except templates).
10+
/.env*
11+
!/.env*.erb
12+
13+
# Ignore all default key files.
14+
/config/master.key
15+
/config/credentials/*.key
16+
17+
# Ignore all logfiles and tempfiles.
18+
/log/*
19+
/tmp/*
20+
!/log/.keep
21+
!/tmp/.keep
22+
23+
# Ignore pidfiles, but keep the directory.
24+
/tmp/pids/*
25+
!/tmp/pids/.keep
26+
27+
# Ignore storage (uploaded files in development and any SQLite databases).
28+
/storage/*
29+
!/storage/.keep
30+
/tmp/storage/*
31+
!/tmp/storage/.keep

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
### 1.13.0
2+
**Species+**
3+
* Fix security issue
4+
* Remove .spp suffix from Hybrids
5+
* Add CITES RST download from the public interface
6+
* Add new Identification materials documents (csv and pdf)
7+
* Fix GA missing functions on develop and staging envs
8+
* Include non standard (EN, ES, FR) languages to autocomplete mview
9+
* Fix commission notes documents loading
10+
* Allow matches anywhere in trade permit number string, instead of just the start
11+
* Add Chinese common names
12+
* Add first draft of dockerizing the app
13+
14+
**Trade Monitoring Tool**
15+
* Update csvs
16+
* Fix downloads when no appendix is submitted
17+
18+
**Checklist**
19+
* Include EU(Regions) to the geo entity types
20+
121
### 1.12.0
222
* Allow intersessional decisions to be created without start events or documents
323

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Dockerfile
2+
FROM ruby:2.3.1
3+
4+
# The ruby:2.3.1 image is ancient, based of debian jessie which no longer
5+
# receives active security updates. Therefore we must declare the debian
6+
# archive as a source instead.
7+
RUN rm /etc/apt/sources.list && \
8+
echo "deb http://archive.debian.org/debian-security jessie/updates main" \
9+
>> /etc/apt/sources.list.d/jessie.list && \
10+
echo "deb http://archive.debian.org/debian jessie main" \
11+
>> /etc/apt/sources.list.d/jessie.list \
12+
;
13+
14+
# Rails and SAPI has some additional dependencies, e.g. rake requires a JS
15+
# runtime, so attempt to get these from apt, where possible
16+
RUN apt-get update && apt-get install -y --force-yes \
17+
libsodium-dev libgmp3-dev libssl-dev \
18+
libpq-dev postgresql-client \
19+
nodejs \
20+
texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra \
21+
;
22+
# NB: Postgres client from Debian is 9.4 - not sure if this is acceptable
23+
24+
RUN mkdir /SAPI
25+
WORKDIR /SAPI
26+
27+
COPY Gemfile /SAPI/Gemfile
28+
COPY Gemfile.lock /SAPI/Gemfile.lock
29+
RUN gem install bundler -v 1.17.3
30+
RUN bundle install
31+
32+
COPY . /SAPI
33+
34+
EXPOSE 3000
35+
CMD ["rails", "server", "-b", "0.0.0.0"]

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ group :development do
116116
gem 'jslint_on_rails'
117117
gem 'git_pretty_accept'
118118
gem 'rubocop', '~> 0.40.0', require: false
119-
gem 'letter_opener'
120119
gem 'rbnacl', '>= 3.2', '< 5.0'
121120
gem 'rbnacl-libsodium'
122121
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'

Gemfile.lock

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ GEM
265265
activesupport (>= 3.0.0)
266266
launchy (2.4.3)
267267
addressable (~> 2.3)
268-
letter_opener (1.4.1)
269-
launchy (~> 2.2)
270268
listen (0.7.2)
271269
lumberjack (1.0.2)
272270
mail (2.5.5)
@@ -573,7 +571,6 @@ DEPENDENCIES
573571
json_spec (= 1.1.5)
574572
kaminari
575573
launchy
576-
letter_opener
577574
memcache-client
578575
nested-hstore
579576
nested_form (~> 0.3.2)

app/assets/javascripts/cites_trade/application.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -786,15 +786,12 @@ $(document).ready(function(){
786786
$.cookie('cites_trade.csv_separator', csv_separator)
787787
query += '&filters[csv_separator]=' + csv_separator;
788788

789-
// google analytics function only defined on production
790-
if (typeof(ga) === 'function') {
791-
ga('send', {
792-
hitType: 'event',
793-
eventCategory: 'Downloads: ' + report_type,
794-
eventAction: 'Format: CSV',
795-
eventLabel: csv_separator
796-
});
797-
}
789+
ga('send', {
790+
hitType: 'event',
791+
eventCategory: 'Downloads: ' + report_type,
792+
eventAction: 'Format: CSV',
793+
eventLabel: csv_separator
794+
});
798795
downloadResults( decodeURIComponent( query ) );
799796
return
800797
}

app/assets/javascripts/species/controllers/downloads_controller.js.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Species.DownloadsController = Ember.Controller.extend Species.Spinner,
22
needs: [
33
'downloadsForCmsListings',
4-
'downloadsForCitesListings', 'downloadsForCitesRestrictions',
4+
'downloadsForCitesListings', 'downloadsForCitesRestrictions', 'downloadsForCitesProcesses',
55
'downloadsForEuListings', 'downloadsForEuDecisions'
66
]
77
downloadsPopupVisible: false
@@ -23,6 +23,9 @@ Species.DownloadsController = Ember.Controller.extend Species.Spinner,
2323
legislationIsCitesRestrictions: ( ->
2424
@get('citesLegislation') == 'restrictions'
2525
).property('citesLegislation')
26+
legislationIsCitesProcesses: ( ->
27+
@get('citesLegislation') == 'processes'
28+
).property('citesLegislation')
2629
legislationIsEuListings: ( ->
2730
@get('euLegislation') == 'listings'
2831
).property('euLegislation')

app/assets/javascripts/species/controllers/downloads_for_cites_listings_controller.js.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Species.DownloadsForCitesListingsController = Ember.Controller.extend
2525
}
2626
).filter((e) ->
2727
e.taxonConcepts.length > 0
28-
)
28+
)
2929
else
3030
@get('higherTaxaController.contentByRank')
3131
).property('higherTaxaController.contentByRank.@each', 'taxonConceptQuery')
@@ -103,4 +103,4 @@ Species.DownloadsForCitesListingsController = Ember.Controller.extend
103103
@set('selectedTaxonConcepts', [])
104104

105105
deleteGeoEntitySelection: (context) ->
106-
@get('selectedGeoEntities').removeObject(context)
106+
@get('selectedGeoEntities').removeObject(context)
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
Species.DownloadsForCitesProcessesController = Ember.Controller.extend
2+
designation: 'cites'
3+
4+
needs: ['geoEntities','higherTaxaCitesEu', 'downloads']
5+
6+
higherTaxaController: ( ->
7+
@get('controllers.higherTaxaCitesEu')
8+
).property()
9+
10+
geoEntityQuery: null
11+
taxonConceptQuery: null
12+
selectedGeoEntities: []
13+
selectedTaxonConcepts: []
14+
timeScope: 'current'
15+
timeScopeIsCurrent: ( ->
16+
@get('timeScope') == 'current'
17+
).property('timeScope')
18+
years: [1975..new Date().getFullYear()]
19+
selectedYears: []
20+
processType: 'Both'
21+
documentTypeIsCitesSuspensions: ( ->
22+
@get('documentType') == 'CitesSuspensions'
23+
).property('documentType')
24+
25+
autoCompleteTaxonConcepts: ( ->
26+
if @get('taxonConceptQuery') && @get('taxonConceptQuery').length > 0
27+
re = new RegExp("^"+@get('taxonConceptQuery'),"i")
28+
@get('higherTaxaController.contentByRank')
29+
.map((e) =>
30+
{
31+
rankName: e.rankName
32+
taxonConcepts: e.taxonConcepts.filter((item) =>
33+
re.test item.get('fullName')
34+
)
35+
}
36+
).filter((e) ->
37+
e.taxonConcepts.length > 0
38+
)
39+
else
40+
@get('higherTaxaController.contentByRank')
41+
).property('higherTaxaController.contentByRank.@each', 'taxonConceptQuery')
42+
43+
autoCompleteRegions: ( ->
44+
if @get('geoEntityQuery') && @get('geoEntityQuery').length > 0
45+
re = new RegExp("(^|\\(| )"+@get('geoEntityQuery'),"i")
46+
@get('controllers.geoEntities.regions')
47+
.filter (item, index, enumerable) =>
48+
re.test item.get('name')
49+
else
50+
@get('controllers.geoEntities.regions')
51+
).property('controllers.geoEntities.regions.@each', 'geoEntityQuery')
52+
53+
autoCompleteCountries: ( ->
54+
if @get('geoEntityQuery') && @get('geoEntityQuery').length > 0
55+
re = new RegExp("(^|\\(| )"+@get('geoEntityQuery'),"i")
56+
@get('controllers.geoEntities.countries')
57+
.filter (item, index, enumerable) =>
58+
re.test item.get('name')
59+
else
60+
@get('controllers.geoEntities.countries')
61+
).property('controllers.geoEntities.countries.@each', 'geoEntityQuery')
62+
63+
selectedGeoEntitiesIds: ( ->
64+
@get('selectedGeoEntities').mapProperty('id')
65+
).property('selectedGeoEntities.@each')
66+
67+
selectedTaxonConceptsIds: ( ->
68+
@get('selectedTaxonConcepts').mapProperty('id')
69+
).property('selectedTaxonConcepts.@each')
70+
71+
toParams: ( ->
72+
{
73+
data_type: 'Processes'
74+
filters:
75+
process_type: @get('processType')
76+
designation: @get('designation')
77+
geo_entities_ids: @get('selectedGeoEntitiesIds')
78+
taxon_concepts_ids: @get('selectedTaxonConceptsIds')
79+
set: @get('timeScope')
80+
years: @get('selectedYears')
81+
csv_separator: @get('controllers.downloads.csvSeparator')
82+
}
83+
).property(
84+
'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each',
85+
'timeScope', 'selectedYears.@each', 'processType', 'controllers.downloads.csvSeparator'
86+
)
87+
88+
downloadUrl: ( ->
89+
'/species/exports/download?' + $.param(@get('toParams'))
90+
).property('toParams')
91+
92+
actions:
93+
startDownload: () ->
94+
@set('downloadInProgress', true)
95+
@set('downloadMessage', 'Downloading...')
96+
$.ajax({
97+
type: 'GET'
98+
dataType: 'json'
99+
url: @get('downloadUrl')
100+
}).done((data) =>
101+
@set('downloadInProgress', false)
102+
if data.total > 0
103+
@set('downloadMessage', null)
104+
ga('send', {
105+
hitType: 'event',
106+
eventCategory: 'Downloads: ' + @get('processType'),
107+
eventAction: 'Format: CSV',
108+
eventLabel: @get('controllers.downloads.csvSeparator')
109+
})
110+
window.location = @get('downloadUrl')
111+
return
112+
else
113+
@set('downloadMessage', 'No results')
114+
)
115+
116+
deleteTaxonConceptSelection: (context) ->
117+
@set('selectedTaxonConcepts', [])
118+
119+
deleteGeoEntitySelection: (context) ->
120+
@get('selectedGeoEntities').removeObject(context)
121+
122+
deleteYearSelection: (context) ->
123+
@get('selectedYears').removeObject(Number(context))

app/assets/javascripts/species/controllers/elibrary_search_controller.js.coffee

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Species.ElibrarySearchController = Ember.Controller.extend Species.Spinner,
3333
allDocumentTypes = @get('controllers.events.documentTypes')
3434
.concat @get('controllers.events.interSessionalDocumentTypes')
3535
.concat @get('controllers.events.identificationDocumentTypes')
36-
36+
if @get('isSignedIn')
37+
allDocumentTypes = allDocumentTypes.concat(@get('controllers.events.interSessionalNonPublicDocumentTypes'))
3738
@set('selectedDocumentType', allDocumentTypes.findBy('id', filtersHash.document_type))
3839

3940
general_subtype_type = @get_general_subtype_type(filtersHash)
@@ -71,10 +72,10 @@ Species.ElibrarySearchController = Ember.Controller.extend Species.Spinner,
7172
general_subtype: isGeneralSubType
7273
}
7374

74-
getDocTypeParam: ->
75+
getDocTypeParam: ->
7576
id = @get('selectedDocumentType.id')
7677

77-
if id != '__all__' then id else null
78+
if id != '__all__' then id else null
7879

7980
filteredDocumentTypes: ( ->
8081
if @get('selectedEventType')

0 commit comments

Comments
 (0)