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

251 collections page progress bar #252

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public.show.rt.des05=can be accessed through the {0}
public.show.rt.des06=Click to view all records for the
public.show.rt.des07=No database records for this collection can be accessed through the {0}
public.show.rt.des08=events
public.show.setprogress.01=There is no estimate of the total number of {0} in this collection.
public.show.setprogress.01=Specimen record count is not available to show the progress bar for records
public.show.setprogress.02=No records are available for viewing in the {0}
public.show.setprogress.accessions=accessions
public.show.setprogress.cultures=cultures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,22 @@ class ExternalIdentifierService {

if (uid[0..1] == 'co') {
Collection c = Collection.findByUid(uid)
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
c.externalIdentifiers.add(ext)
Collection.withTransaction { c.save(flush: true) }
} else if (uid[0..1] == 'in') {
Institution c = Institution.findByUid(uid)
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
c.externalIdentifiers.add(ext)
Institution.withTransaction { c.save(flush: true) }
} else if (uid[0..1] == 'dp') {
DataProvider c = DataProvider.findByUid(uid)
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
c.externalIdentifiers.add(ext)
DataProvider.withTransaction { c.save(flush: true) }
} else if (uid[0..1] == 'dr') {
DataResource c = DataResource.findByUid(uid)
if (c.externalIdentifiers == null) c.externalIdentifiers = new HashSet<>();
c.externalIdentifiers.add(ext)
DataResource.withTransaction { c.save(flush: true) }
}
Expand Down
6 changes: 5 additions & 1 deletion grails-app/views/public/_progress.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ function setPercentAgeNumbers(totalBiocacheRecords, totalRecords) {
setProgress(percent);
} else {
// the progress bar doesn't make sense if there is no estimated speciemens count
$('#progress').hide();
$('#progressBarItem').hide();

// change the display text for the lack of metadata
$('#speedoCaption').hide();
$('#speedoCaptionMissingMetadata').show();
}
}

Expand Down
7 changes: 5 additions & 2 deletions grails-app/views/public/showCollection.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,13 @@
</div>
<div class="col-md-4">
<div id="progress" class="well">
<div class="progress">
<div class="progress" id="progressBarItem">
<div id="progressBar" class="progress-bar progress-bar-success" style="width: 0%;"></div>
</div>
<p class="caption"><span id="speedoCaption"><g:message code="public.show.setprogress.02" args="${[grailsApplication.config.skin.orgNameShort]}" />.</span></p>
<p class="caption">
<span id="speedoCaption"><g:message code="public.show.setprogress.02" args="${[grailsApplication.config.skin.orgNameShort]}" />.</span>
<span id="speedoCaptionMissingMetadata" style="display: none;"><g:message code="public.show.setprogress.01" args="${[grailsApplication.config.skin.orgNameShort]}" />.</span>
</p>
</div>
</div>

Expand Down