Skip to content

Commit d44306c

Browse files
author
sat01a
committed
Changes to embargo feature #1201
Introduced new embargo settings for ALA admin Added apiKey to indexing call. Increased data tab map height
1 parent 3275f77 commit d44306c

File tree

7 files changed

+28
-10
lines changed

7 files changed

+28
-10
lines changed

grails-app/assets/javascripts/projectActivity.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,9 @@ var SurveyVisibilityViewModel = function (visibility) {
833833
}
834834

835835
self.embargoOption = ko.observable(visibility.embargoOption ? visibility.embargoOption : 'NONE'); // 'NONE', 'DAYS', 'DATE' -> See au.org.ala.ecodata.EmbargoOptions in Ecodata
836-
837836
self.embargoForDays = ko.observable(visibility.embargoForDays ? visibility.embargoForDays : 10).extend({numeric:0}); // 1 - 180 days
838837
self.embargoUntil = ko.observable(visibility.embargoUntil).extend({simpleDate: true});
838+
self.alaAdminEnforcedEmbargo = ko.observable(visibility.alaAdminEnforcedEmbargo);
839839
};
840840

841841
var AlertViewModel = function (alert) {

grails-app/controllers/au/org/ala/biocollect/BioActivityController.groovy

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class BioActivityController {
9898
def photoPoints = postBody.remove('photoPoints')
9999
postBody.projectActivityId = pActivity.projectActivityId
100100
postBody.userId = userId
101+
pActivity?.visibility?.alaAdminEnforcedEmbargo ? postBody.embargoed = true : null
101102

102103
result = activityService.update(id, postBody)
103104

grails-app/i18n/messages.properties

+6
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ facets.isDataManagementPolicyDocumented.no=No
271271
facets.isDataManagementPolicyDocumented.T=Yes
272272
facets.isDataManagementPolicyDocumented.F=No
273273

274+
facets.embargoed.yes=Yes
275+
facets.embargoed.no=No
276+
facets.embargoed.T=Yes
277+
facets.embargoed.F=No
278+
279+
274280
facets.spatialAccuracy.high=High
275281
facets.spatialAccuracy.moderate=Moderate
276282
facets.spatialAccuracy.low=Low

grails-app/services/au/org/ala/biocollect/merit/AdminService.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AdminService {
2121
* Triggers a full site re-index.
2222
*/
2323
def reIndexAll() {
24-
webService.getJson(grailsApplication.config.ecodata.service.url + '/admin/reIndexAll')
24+
webService.getJson(grailsApplication.config.ecodata.service.url + '/admin/reIndexAll', 50000, true)
2525
}
2626

2727
static outputDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ")

grails-app/views/bioActivity/_activities.gsp

+6-4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<div>
165165
<!-- ko if: $parents[1].embargoed() -->
166166
<a href="#" class="helphover"
167-
data-bind="popover: {title:'Only project members can access the record.', content:'Embargoed until : ' + moment($parents[1].embargoUntil()).format('DD/MM/YYYY')}">
167+
data-bind="popover: {title:'Embargoed', content:'Indicates that only project members can access the record'}">
168168
<span class="fa fa-lock"></span>
169169
</a>
170170
<!--/ko -->
@@ -269,10 +269,10 @@
269269
<!-- ko if: type == 'symbols' -->
270270
<td>
271271
<div>
272+
<span data-bind="text: $parent.embargoed()"></span>
272273
<!-- ko if: $parent.embargoed() -->
273274
<a href="#" class="helphover"
274-
data-bind="popover: {title:'Indicates that only project members can access the record.', content:'Embargoed until : ' + moment($parent.embargoUntil()).format('DD/MM/YYYY')}">
275-
<span class="fa fa-lock"></span>
275+
data-bind="popover: {title:'Embargoed.', content:'Indicates that only project members can access the record'}">
276276
</a>
277277
<!--/ko -->
278278
</div>
@@ -376,9 +376,11 @@
376376
<span data-bind="if: !transients.loading()">No Results</span>
377377
</span>
378378
</span>
379+
379380
<span data-bind="visible: transients.totalPoints() > 0 && !transients.loadingMap() ">
380-
<m:map id="recordOrActivityMap" width="100%"/>
381+
<m:map height="650px" width="auto" id="recordOrActivityMap" />
381382
</span>
383+
382384
</div>
383385
<!-- ko stopBinding:true -->
384386
<div class="tab-pane" id="imageGallery">
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<span>
22
<div class="row-fluid">
3-
<div class="span4 text-right"></div>
4-
<div class="span8 text-right">
5-
<div class="margin-top-2"></div>
6-
<small class="text-muted">Note: Changes made to this tab will be reflected in search results after 24 hours</small>
3+
<div class="span12 text-left">
4+
<span class="text-muted">Note: Changes made to this tab will be reflected in search results after 24 hours</span>
75
</div>
86
</div>
97
</span>

grails-app/views/projectActivity/_visibility.gsp

+11
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@
3636
</label>
3737
</div>
3838

39+
3940
</div>
41+
42+
<g:if test="${fc.userIsAlaOrFcAdmin()}">
43+
<hr>
44+
<h4>ALA ADMIN Only: </h4>
45+
<input type="checkbox" data-bind="checked: visibility.alaAdminEnforcedEmbargo"/> Embargo all new records/activities
46+
<hr>
47+
</g:if>
48+
<!-- ko if: visibility.alaAdminEnforcedEmbargo() -->
49+
<span class="text-muted">Important: All new records will be embargoed for this survey. Project Moderator/Admin can release records via "Data tab". For more information please contact us at <a href='${grailsApplication.config.biocollect.support.email.address}'>${grailsApplication.config.biocollect.support.email.address}</a></span>
50+
<!-- /ko -->
4051
<g:render template="../projectActivity/indexingNote"/>
4152
<!-- /ko -->
4253
<!-- /ko -->

0 commit comments

Comments
 (0)