");
- new BMDResult(self, el, type, true, showURL);
+ new BMDResult(self, el, type, showURL);
return el;
},
getTaglist = function(tags, assessment_id) {
diff --git a/frontend/animal/EndpointCriticalDose.js b/frontend/animal/EndpointCriticalDose.js
index ac2c670f6b..121fde53bf 100644
--- a/frontend/animal/EndpointCriticalDose.js
+++ b/frontend/animal/EndpointCriticalDose.js
@@ -1,40 +1,28 @@
-import PropTypes from "prop-types";
-import React from "react";
-import ReactDOM from "react-dom";
+import _ from "lodash";
import h from "shared/utils/helpers";
-const Renderer = function(props) {
- return (
-
- {props.dose} {props.units}
-
- );
-};
-
class EndpointCriticalDose {
- constructor(endpoint, span, type, show_units) {
+ constructor(endpoint, span, type) {
// custom field to observe dose changes and respond based on selected dose
endpoint.addObserver(this);
this.endpoint = endpoint;
this.span = span;
this.type = type;
this.critical_effect_idx = endpoint.data[type];
- this.show_units = show_units;
this.update();
}
update() {
- const ep = this.endpoint,
- dose = h.ff(ep.data.groups[this.critical_effect_idx].dose),
- units = this.show_units ? ep.doseUnits.activeUnit.name : "";
-
- ReactDOM.render(
, this.span[0]);
+ const dose_group_id = this.critical_effect_idx,
+ dose_units_id = this.endpoint.doseUnits.activeUnit.id,
+ group = _.find(this.endpoint.data.animal_group.dosing_regime.doses, el => {
+ return el.dose_group_id === dose_group_id && el.dose_units.id === dose_units_id;
+ }),
+ dose = group ? h.ff(group.dose) : "",
+ units = group ? group.dose_units.name : "",
+ text = `${dose} ${units}`;
+ this.span.text(text);
}
}
-Renderer.propTypes = {
- dose: PropTypes.string,
- units: PropTypes.string,
-};
-
export default EndpointCriticalDose;