Skip to content

Commit dbd6bb7

Browse files
authored
Merge pull request #252 from AtlasOfLivingAustralia/251-collections-page-progress-bar
251 collections page progress bar
2 parents 1cc1d4f + 940e7a1 commit dbd6bb7

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

grails-app/i18n/messages.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public.show.rt.des05=can be accessed through the {0}
143143
public.show.rt.des06=Click to view all records for the
144144
public.show.rt.des07=No database records for this collection can be accessed through the {0}
145145
public.show.rt.des08=events
146-
public.show.setprogress.01=There is no estimate of the total number of {0} in this collection.
146+
public.show.setprogress.01=Specimen record count is not available to show the progress bar for records
147147
public.show.setprogress.02=No records are available for viewing in the {0}
148148
public.show.setprogress.accessions=accessions
149149
public.show.setprogress.cultures=cultures

grails-app/services/au/org/ala/collectory/ExternalIdentifierService.groovy

+4
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,22 @@ class ExternalIdentifierService {
4040

4141
if (uid[0..1] == 'co') {
4242
Collection c = Collection.findByUid(uid)
43+
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
4344
c.externalIdentifiers.add(ext)
4445
Collection.withTransaction { c.save(flush: true) }
4546
} else if (uid[0..1] == 'in') {
4647
Institution c = Institution.findByUid(uid)
48+
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
4749
c.externalIdentifiers.add(ext)
4850
Institution.withTransaction { c.save(flush: true) }
4951
} else if (uid[0..1] == 'dp') {
5052
DataProvider c = DataProvider.findByUid(uid)
53+
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
5154
c.externalIdentifiers.add(ext)
5255
DataProvider.withTransaction { c.save(flush: true) }
5356
} else if (uid[0..1] == 'dr') {
5457
DataResource c = DataResource.findByUid(uid)
58+
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
5559
c.externalIdentifiers.add(ext)
5660
DataResource.withTransaction { c.save(flush: true) }
5761
}

grails-app/views/public/_progress.gsp

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ function setPercentAgeNumbers(totalBiocacheRecords, totalRecords) {
3434
setProgress(percent);
3535
} else {
3636
// the progress bar doesn't make sense if there is no estimated speciemens count
37-
$('#progress').hide();
37+
$('#progressBarItem').hide();
38+
39+
// change the display text for the lack of metadata
40+
$('#speedoCaption').hide();
41+
$('#speedoCaptionMissingMetadata').show();
3842
}
3943
}
4044

grails-app/views/public/showCollection.gsp

+5-2
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,13 @@
158158
</div>
159159
<div class="col-md-4">
160160
<div id="progress" class="well">
161-
<div class="progress">
161+
<div class="progress" id="progressBarItem">
162162
<div id="progressBar" class="progress-bar progress-bar-success" style="width: 0%;"></div>
163163
</div>
164-
<p class="caption"><span id="speedoCaption"><g:message code="public.show.setprogress.02" args="${[grailsApplication.config.skin.orgNameShort]}" />.</span></p>
164+
<p class="caption">
165+
<span id="speedoCaption"><g:message code="public.show.setprogress.02" args="${[grailsApplication.config.skin.orgNameShort]}" />.</span>
166+
<span id="speedoCaptionMissingMetadata" style="display: none;"><g:message code="public.show.setprogress.01" args="${[grailsApplication.config.skin.orgNameShort]}" />.</span>
167+
</p>
165168
</div>
166169
</div>
167170

0 commit comments

Comments
 (0)