Skip to content

Commit

Permalink
Feature/trueth usa redirect modal (#4045)
Browse files Browse the repository at this point in the history
* TN-2837 Truenth USA redirect modal

* update verbiage based on feedback

* initial query bug fix

* minor verbiage change

* add new lines per feedback

Co-authored-by: Amy Chen <clone@cesium.cirg.washington.edu>
  • Loading branch information
2 people authored and ivan-c committed Apr 8, 2021
1 parent 090e665 commit f846793
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
13 changes: 13 additions & 0 deletions portal/gil/templates/gil/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ <h4 class="icon-box__head">{{_("Symptom Tracker")}}</h4><span class="icon-box__l
</div>
</div>
</main>
<div class="modal fade" id="naModal">
<div class="modal-dialog" role="document">
<div class="modal-content box-modal">
<div class="box-modal__inner">
<p class="box-modal__copy text-left">{{_("This site is no longer available. You can now find information, tools and support to help you navigate your prostate cancer journey at our new website <a href='http://truenorth.movember.com.'>http://truenorth.movember.com</a>.")}}</p>
<br/>
<p class="box-modal__copy text-left">{{_("Registered users, please login to your account from <a href='/user/sign-in'>here</a> (available until April 30, 2021).")}}</p>
<br/>
<p class="box-modal__copy text-left">{{_("Please feel free to reach out to us at <a href='mailto:contact@truenth.org'>contact@truenth.org</a> if you have any questions or need any support.")}}</p>
</div>
</div>
</div>
</div>
{% endblock %}
{% block document_ready %}
<script src="{{url_for('static', filename='js/dist/gilIndex.bundle.js')}}"></script>
Expand Down
4 changes: 4 additions & 0 deletions portal/static/js/src/gilIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ $(document).ready(function() {
/ipad/i.test(String(navigator.userAgent))) {
window.kp_Browser_clearCookies();
}
$("#naModal").modal({
show: true,
backdrop: "static"
});
});

25 changes: 16 additions & 9 deletions portal/static/js/src/initialQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Consent from "./modules/Consent.js";
this.roleRequired = false;
this.userRoles = [];
this.CONFIG_REQUIRED_CORE_DATA = null;
this.DEFAULT_REQUIRED_CORE_DATA = [];
this.preselectClinic = "";
this.defaultSections = {};
this.mainSections = {};
Expand Down Expand Up @@ -213,8 +214,13 @@ import Consent from "./modules/Consent.js";

FieldsChecker.prototype.initConfig = function(callback) {
var self = this, tnthAjax = self.__getDependency("tnthAjax");
tnthAjax.getStillNeededCoreData(self.userId, true, function(data) {
self.setConfig(data, callback);
tnthAjax.getConfigurationByKey("REQUIRED_CORE_DATA", "", function(data) {
//this will get the default required core data array from config
self.DEFAULT_REQUIRED_CORE_DATA = data["REQUIRED_CORE_DATA"];
tnthAjax.getStillNeededCoreData(self.userId, true, function(data) {
//gather still needed data
self.setConfig(data, callback);
});
});
};

Expand All @@ -224,13 +230,10 @@ import Consent from "./modules/Consent.js";
}
dataArray = dataArray || this.CONFIG_REQUIRED_CORE_DATA;
if (!dataArray || dataArray.length === 0) { return false; }
var found = false;
var ma = configMatch.split(",");
ma.forEach(function(item) {
if (found) { return true; } /* IMPORTANT, immediately return true. without checking this item, this is in the context of the loop, the sequence matters here, loop still continues*/
found = dataArray.indexOf(item) !== -1;
});
return found;
return ma.filter(item => {
return dataArray.indexOf(item) !== -1;
}).length;
};

FieldsChecker.prototype.getConfig = function() {
Expand Down Expand Up @@ -321,7 +324,12 @@ import Consent from "./modules/Consent.js";
var availableSections = 0;
for (var section in self.mainSections) {
var sectionConfigs = self.getSectionConfigs(section);
//do not draw section in progressbar if it is terms of use && it is not part of the default required core data
if (section !== "topTerms" && !self.inConfig(sectionConfigs, self.DEFAULT_REQUIRED_CORE_DATA)) {
continue;
}
var active = (section === "topTerms" && !self.inConfig(sectionConfigs)) || (self.roleRequired && !self.inConfig(sectionConfigs));

$("#progressbar").append("<li sectionId='" + section + "' " + (active ? " class='active'" : "") + ">" + self.mainSections[section].display + "</li>");
availableSections++;
}
Expand Down Expand Up @@ -1040,4 +1048,3 @@ import Consent from "./modules/Consent.js";
}
});
})();

0 comments on commit f846793

Please sign in to comment.