Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacug committed Jun 10, 2020
2 parents 7e459d5 + 4fd060b commit 7682e48
Show file tree
Hide file tree
Showing 41 changed files with 1,480 additions and 190 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### 1.4.0

**EU Opinions**

* Add new EU decision type (called SRG Referral)
* Change the name of current no opinion iii) to SRG Referral;
* Add new entity SRG History
* Change the name of current no opinion ii) to In consultation and changing it from an official EU decision to a non-opinion/notification for information only (SRG History)
* Add a second new SRG History, called Discussed at SRG (no decision taken)
* Add the new column SRG History to the EU decisions table in the Species+ public site
* Include validation on the BE so that if the decision_type is blank then the srg_history field should be populated
* On the download checkbox, new radio button to switch between EU decision type filters and "In consultation", and when the latter will be selected all the other filters disappear
* Exclude from the download the EU opinions with EU decision type = blank
or srg history = "Discussed at SRG referral"


### 1.3.0

**CITES ID Manual**
Expand Down
5 changes: 4 additions & 1 deletion app/assets/javascripts/admin/taxon_concept.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ $(document).ready ->
.focus(-> $(@).animate(height: "15em", 500))
.blur(-> $(@).animate(height: "4em", 500))

$('.select2').select2()
$('.select2').select2({
placeholder: "Choose an option",
allowClear: true
})

$(".datepicker").datepicker(
format: "dd/mm/yyyy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ Species.DownloadsForEuDecisionsController = Ember.Controller.extend
selectedTaxonConcepts: []
timeScope: 'current'
timeScopeIsCurrent: ( ->
@get('timeScope') == 'current'
current = @get('timeScope') == 'current'
if current
@set('selectedYears', [])
current
).property('timeScope')
years: [1975..new Date().getFullYear()]
selectedYears: []
positiveOpinions: true
negativeOpinions: true
noOpinions: true
srgReferral: true
suspensions: true
euDecisionFilter: 'Default'
euDecisionFilterIsDefault: ( ->
@get('euDecisionFilter') == 'Default'
).property('euDecisionFilter')

autoCompleteTaxonConcepts: ( ->
if @get('taxonConceptQuery') && @get('taxonConceptQuery').length > 0
Expand All @@ -37,7 +45,7 @@ Species.DownloadsForEuDecisionsController = Ember.Controller.extend
}
).filter((e) ->
e.taxonConcepts.length > 0
)
)
else
@get('higherTaxaController.contentByRank')
).property('higherTaxaController.contentByRank.@each', 'taxonConceptQuery')
Expand Down Expand Up @@ -71,27 +79,56 @@ Species.DownloadsForEuDecisionsController = Ember.Controller.extend
).property('selectedTaxonConcepts.@each')

toParams: ( ->
{
data_type: 'EuDecisions'
filters:
designation: @get('designation')
geo_entities_ids: @get('selectedGeoEntitiesIds')
taxon_concepts_ids: @get('selectedTaxonConceptsIds')
set: @get('timeScope')
years: @get('selectedYears')
decision_types:
{
positiveOpinions: @get('positiveOpinions')
# IF EU DECISION FILTER IS "IN CONSULTATION" - DON'T APPLY ALL FILTERS
if @get('euDecisionFilter').toUpperCase() == 'IN CONSULTATION'
{
data_type: 'EuDecisions'
filters: {
designation: @get('designation')
csv_separator: @get('controllers.downloads.csvSeparator')
eu_decision_filter: @get('euDecisionFilter')
}
}
else
{
data_type: 'EuDecisions'
filters: {
####################################################
########## DEFAULT EU DECISION FILTERS #############
####################################################
designation: @get('designation')
csv_separator: @get('controllers.downloads.csvSeparator')
eu_decision_filter: @get('euDecisionFilter')
####################################################
geo_entities_ids: @get('selectedGeoEntitiesIds')
set: @get('timeScope')
taxon_concepts_ids: @get('selectedTaxonConceptsIds')
years: @get('selectedYears')
decision_types: {
negativeOpinions: @get('negativeOpinions')
noOpinions: @get('noOpinions')
positiveOpinions: @get('positiveOpinions')
srgReferral: @get('srgReferral')
suspensions: @get('suspensions')
}
csv_separator: @get('controllers.downloads.csvSeparator')
}
####################################################
####################################################
####################################################
}
}

).property(
'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each',
'timeScope', 'selectedYears.@each', 'positiveOpinions', 'negativeOpinions',
'noOpinions', 'suspensions', 'controllers.downloads.csvSeparator'
'controllers.downloads.csvSeparator',
'euDecisionFilter',
'negativeOpinions',
'noOpinions',
'positiveOpinions',
'selectedGeoEntitiesIds.@each',
'selectedTaxonConceptsIds.@each',
'selectedYears.@each',
'srgReferral',
'suspensions',
'timeScope'
)

downloadUrl: ( ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ Species.TaxonConceptController = Ember.ObjectController.extend Species.SearchCon
Species.SignedInStatus,
needs: ['search', 'taxonConceptDocuments']
searchContext: 'species'
legalHeadings: [
{ id: 'cites_listings', name: 'CITES Listing', class: 'first' },
{ id: 'cites_quotas', name: 'CITES Quotas' },
{ id: 'cites_suspensions', name: 'CITES Suspensions' },
{ id: 'eu_listings', name: 'EU Listing' },
{ id: 'eu_decisions', name: 'EU Decisions', class: 'last' }
]

actions: {
scrollIntoView: (id) ->
event.preventDefault()
document.getElementById(id).scrollIntoView({ behavior: 'smooth' })
}

isCms: ( ->
if @get('taxonomy') != undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Species.TaxonConceptLegalController = Ember.ArrayController.extend
citesQuotasExpanded: false
euDecisionsExpanded: false


actions:
expandList: (id, flag) ->
this.set(flag, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Species.TaxonConcept = DS.Model.extend
cmsInstruments: DS.attr("array")
euListings: DS.attr("array")
euDecisions: DS.attr("array")
srgHistory: DS.attr("array")
distributionReferences: DS.attr("array")
taxonomy: DS.attr("string")
nomenclatureNoteEn: DS.attr("string")
Expand Down
136 changes: 82 additions & 54 deletions app/assets/javascripts/species/templates/downloads_for_eu.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -77,82 +77,110 @@
isVisibleBinding="controller.legislationIsEuDecisions"
controllerBinding="controllers.downloadsForEuDecisions"
}}
<div class="doc-type">
<strong class="heading">DOCUMENT TYPE</strong>
<div class="typy-columns">
<div class="col">
<div class="row">



<div class="bs-container p-3">
<div class="bs-row mb-3">
<div class="bs-col-auto p-3">
<div class="sub-heading">
<label>
{{view Ember.Checkbox checkedBinding="negativeOpinions"}}
SRG Negative Opinions
{{view Ember.RadioButton name="in_consultation" selectionBinding="euDecisionFilter" value="Default"}}
EU Decision Types
</label>
</div>
<div class="row">
</div>
<div class="bs-col-auto p-3 bs-border-left">
<div class="sub-heading">
<label>
{{view Ember.Checkbox checkedBinding="noOpinions"}}
SRG No Opinions
{{view Ember.RadioButton name="in_consultation" selectionBinding="euDecisionFilter" value="In consultation"}}
In Consultation
</label>
</div>
</div>
<div class="col">
<div class="row">
</div>
{{#if euDecisionFilterIsDefault }}
<div class="mb-4">
<div>
<label>
{{view Ember.Checkbox checkedBinding="negativeOpinions"}}
SRG Negative Opinions
</label>
</div>
<div>
<label>
{{view Ember.Checkbox checkedBinding="positiveOpinions"}}
SRG Positive Opinions
</label>
</div>
<div class="row">
<div>
<label>
{{view Ember.Checkbox checkedBinding="srgReferral"}}
SRG Referral
</label>
</div>
<div>
<label>
{{view Ember.Checkbox checkedBinding="suspensions"}}
Suspensions
</label>
</div>
<div>
<label>
{{view Ember.Checkbox checkedBinding="noOpinions"}}
SRG Historic No Opinions
</label>
</div>
</div>
</div>
</div>
<div class="info-columns">
<div class="col">
<ul class="tab-link">
<li>
{{#view Species.ToggleButton option="current" valueBinding="controller.timeScope"}}
CURRENT
{{/view}}
</li>
<li class="last-child">
{{#view Species.ToggleButton option="all" valueBinding="controller.timeScope"}}
ALL
{{/view}}
</li>
</ul>
</div>
<div class="col">
{{#if timeScopeIsCurrent}}
Only current data has<br />been selected.
{{else}}
<div class="popup-area">
{{view Species.YearSearchButton selectedYearsBinding="controller.selectedYears"}}
{{view Species.YearSearchDropdown controllerBinding="controller"}}

<div class="info-columns">
<div class="col">
<ul class="tab-link">
<li>
{{#view Species.ToggleButton option="current" valueBinding="controller.timeScope"}}
CURRENT
{{/view}}
</li>
<li class="last-child">
{{#view Species.ToggleButton option="all" valueBinding="controller.timeScope"}}
ALL
{{/view}}
</li>
</ul>
</div>
<div class="col">
{{#if timeScopeIsCurrent}}
Only current data has<br />been selected.
{{else}}
<div class="popup-area">
{{view Species.YearSearchButton selectedYearsBinding="controller.selectedYears"}}
{{view Species.YearSearchDropdown controllerBinding="controller"}}
</div>
{{/if}}
</div>
{{/if}}
</div>
</div>
<div class="bottom-columns">
<div class="col">
<div class="popup-area">
{{view Species.HigherTaxaSearchButton controllerBinding="controller"}}
{{view Species.HigherTaxaSearchDropdown controllerBinding="controller"}}
</div>
</div>
<div class="col">
<div class="popup-area">
{{view Species.GeoEntitiesSearchButton
selectedGeoEntitiesBinding="controller.selectedGeoEntities"
loadedBinding="controller.loaded"
}}
{{view Species.GeoEntitiesSearchDropdown controllerBinding="controller"}}
<div class="bottom-columns">
<div class="col">
<div class="popup-area">
{{view Species.HigherTaxaSearchButton controllerBinding="controller"}}
{{view Species.HigherTaxaSearchDropdown controllerBinding="controller"}}
</div>
</div>
<div class="col">
<div class="popup-area">
{{view Species.GeoEntitiesSearchButton
selectedGeoEntitiesBinding="controller.selectedGeoEntities"
loadedBinding="controller.loaded"
}}
{{view Species.GeoEntitiesSearchDropdown controllerBinding="controller"}}
</div>
</div>
</div>
</div>
{{/if}}
</div>



<div class="btn-holder">
{{view Species.StartDownloadButton controllerBinding="controller"}}
<div class="message-area">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
<li>{{#linkTo 'taxonConcept.legal'}}LEGAL{{/linkTo}}
<ul>
{{#unless isCms }}
<li class="first"><a href="#cites_listings" class="scroll-to">CITES Listing</a></li>
<li><a href="#cites_quotas" class="scroll-to">CITES Quotas</a></li>
<li><a href="#cites_suspensions" class="scroll-to">CITES Suspensions</a></li>
<li><a href="#eu_listings" class="scroll-to">EU Listing</a></li>
<li class="last"><a href="#eu_decisions" class="scroll-to">EU Decisions</a></li>
{{#each heading in this.legalHeadings }}
<li {{bind-attr class="heading.class"}}>
<a href=#{{unbound heading.id}} class="scroll-to" {{action 'scrollIntoView' heading.id}}>
{{ heading.name }}
</a>
</li>
{{/each}}
{{/unless}}
</ul>
</li>
Expand Down
Loading

0 comments on commit 7682e48

Please sign in to comment.