1. Fix for error message not showing up when you switched the parameter in the temporal vis & there happens to be no data available for that parameter for that organization.
This commit is contained in:
parent
ae43216396
commit
e76fb35492
3 changed files with 30 additions and 8 deletions
|
@ -71,7 +71,7 @@
|
|||
-->
|
||||
|
||||
<entry key="entity_comparison">
|
||||
<ref bean="entity_comparison"></ref>
|
||||
<ref bean="pub_temporal"></ref>
|
||||
</entry>
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
|||
</entry>
|
||||
|
||||
<entry key="entity_grant_count">
|
||||
<ref bean="entity_grant_count"></ref>
|
||||
<ref bean="grant_temporal"></ref>
|
||||
</entry>
|
||||
|
||||
<entry key="grant_temporal">
|
||||
|
|
|
@ -30,6 +30,8 @@ $(document).ready(function() {
|
|||
|
||||
var selectedDataURL;
|
||||
|
||||
var oldParameter = currentParameter;
|
||||
|
||||
$.each(COMPARISON_PARAMETERS_INFO, function(index, parameter) {
|
||||
|
||||
if (parameter.value === selectedValue) {
|
||||
|
@ -58,12 +60,30 @@ $(document).ready(function() {
|
|||
success: function (data) {
|
||||
|
||||
if (data.error) {
|
||||
options.bodyContainer.remove();
|
||||
options.bodyContainer.hide();
|
||||
|
||||
/*
|
||||
* When we reload data we would be reusing the already generated "error container" div.
|
||||
* So below is used to replace text taht is specific to the errors that would have caused
|
||||
* due to the original parameters.
|
||||
* */
|
||||
var alternateVisInfo = COMPARISON_PARAMETERS_INFO[currentParameter].value
|
||||
+ " Temporal Graph "
|
||||
+ '<span id="noPubsOrGrants-span">| '
|
||||
+ '<a href="' + COMPARISON_PARAMETERS_INFO[oldParameter].viewLink + '">'
|
||||
+ 'view ' + COMPARISON_PARAMETERS_INFO[oldParameter].pluralName + ' temporal graph</a></span>'
|
||||
|
||||
options.errorContainer.find("#alternative-vis-info").html(alternateVisInfo);
|
||||
|
||||
options.errorContainer
|
||||
.find("#comparison-parameter-unavailable-label")
|
||||
.text(COMPARISON_PARAMETERS_INFO[currentParameter].pluralName);
|
||||
|
||||
options.errorContainer.show();
|
||||
options.responseContainer.unblock();
|
||||
} else {
|
||||
options.bodyContainer.show();
|
||||
options.errorContainer.remove();
|
||||
options.errorContainer.hide();
|
||||
temporalGraphProcessor.redoTemporalGraphRenderProcess(graphContainer, data);
|
||||
options.responseContainer.unblock();
|
||||
}
|
||||
|
@ -342,12 +362,12 @@ function getTemporalGraphData(temporalGraphDataURL,
|
|||
success: function (data) {
|
||||
|
||||
if (data.error) {
|
||||
graphBodyDIV.remove();
|
||||
graphBodyDIV.hide();
|
||||
errorBodyDIV.show();
|
||||
visContainerDIV.unblock();
|
||||
} else {
|
||||
graphBodyDIV.show();
|
||||
errorBodyDIV.remove();
|
||||
errorBodyDIV.hide();
|
||||
temporalGraphProcessor.initiateTemporalGraphRenderProcess(graphContainer, data);
|
||||
visContainerDIV.unblock();
|
||||
}
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
|
||||
<h1 id="noPubsOrGrants-header">${organizationLabel}</h1>
|
||||
|
||||
<h3>${textForCurrentEntityComparisonType?capitalize} Temporal Graph
|
||||
<h3 id="alternative-vis-info">${textForCurrentEntityComparisonType?capitalize} Temporal Graph
|
||||
<span id="noPubsOrGrants-span">| <a href="${temporalGraphURL}">view ${textForOtherEntityComparisonType} temporal graph</a></span>
|
||||
</h3>
|
||||
<div id="error-body">
|
||||
<p>This organization has neither sub-organizations nor people with ${textForCurrentEntityComparisonType} in the system. Please visit the full ${organizationLabel} <a href="${organizationVivoProfileURL}">profile page</a> for a more complete overview.</p>
|
||||
<p>This organization has neither sub-organizations nor people with
|
||||
<span id="comparison-parameter-unavailable-label">${textForCurrentEntityComparisonType}</span> in the system.
|
||||
Please visit the full ${organizationLabel} <a href="${organizationVivoProfileURL}">profile page</a> for a more complete overview.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue