Skip to content

Commit

Permalink
Phan js changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CamilleBeau committed Jan 15, 2024
1 parent 05d1420 commit 409c5c0
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 12 deletions.
12 changes: 7 additions & 5 deletions modules/consent/jsx/consentIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ class ConsentIndex extends Component {
</TriggerableModal>
);
return (
<div class="action-cell">
<div className="action-cell">
<td>{editButton}</td>
<td>{shareButton}</td>
<td>{expireButton}</td>
</div>
);
} else {
return (
<div class="action-cell">
<div className="action-cell">
<td>{editButton}</td>
<td>{shareButton}</td>
</div>
Expand All @@ -197,15 +197,15 @@ class ConsentIndex extends Component {
</TriggerableModal>
);
return (
<div class="action-cell">
<div className="action-cell">
<td>{editButton}</td>
<td>{addEConsentButton}</td>
</div>
);
} else {
// Add only editButton if not eConsent compatible
return (
<div class="action-cell">
<div className="action-cell">
<td>{editButton}</td>
</div>
);
Expand Down Expand Up @@ -304,7 +304,7 @@ class ConsentIndex extends Component {
* @param {array} consentGroupName
* @param {string} CandID
*
* @return {bool} - true if compatible
* @return {boolean} - true if compatible
*/
eConsentCompatible(consentGroupName, CandID) {
// Get Candidate CenterID
Expand Down Expand Up @@ -412,6 +412,8 @@ class ConsentIndex extends Component {

ConsentIndex.propTypes = {
dataURL: PropTypes.string.isRequired,
BaseURL: PropTypes.string.isRequired,
submitURL: PropTypes.string.isRequired,
hasPermission: PropTypes.func.isRequired,
};

Expand Down
9 changes: 9 additions & 0 deletions modules/consent/jsx/consent_index_forms/addConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,13 @@ class AddConsentForm extends Component {
}
}


AddConsentForm.propTypes = {
submitData: PropTypes.string.isRequired,
closeAddForm: PropTypes.func,
eConsentCompatible: PropTypes.func,
openAddConsent: PropTypes.func,
data: PropTypes.object,
};

export default AddConsentForm;
5 changes: 5 additions & 0 deletions modules/consent/jsx/consent_index_forms/addEConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,9 @@ class AddEConsentForm extends Component {
}
}

AddEConsentForm.propTypes = {
submitData: PropTypes.string.isRequired,
data: PropTypes.object,
};

export default AddEConsentForm;
5 changes: 5 additions & 0 deletions modules/consent/jsx/consent_index_forms/expireConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,9 @@ class ExpireConsentForm extends Component {
}
}

ExpireConsentForm.propTypes = {
submitData: PropTypes.string.isRequired,
data: PropTypes.object,
};

export default ExpireConsentForm;
6 changes: 6 additions & 0 deletions modules/consent/jsx/consent_index_forms/shareConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,10 @@ class ShareConsentForm extends Component {
}
}

ShareConsentForm.propTypes = {
submitData: PropTypes.string.isRequired,
BaseURL: PropTypes.string.isRequired,
data: PropTypes.object,
};

export default ShareConsentForm;
7 changes: 7 additions & 0 deletions modules/consent/jsx/e_consent/basicConsentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,11 @@ class BasicPage extends React.Component {
}
}

BasicPage.propTypes = {
data_url: PropTypes.string.isRequired,
submit: PropTypes.func.isRequired,
requestStatus: PropTypes.string,
consentData: PropTypes.object,
};

export default BasicPage;
11 changes: 9 additions & 2 deletions modules/consent/jsx/e_consent/sendConfirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ class sendConfirmation extends Component {
name="fire_away"
label={
<div>
<span className="glyphicon glyphicon-envelope"/> Send Confirmation
<span
className="glyphicon glyphicon-envelope"
/> Send Confirmation
</div>
}
type="submit"
Expand All @@ -186,4 +188,9 @@ class sendConfirmation extends Component {
}
}

export default sendConfirmation;
sendConfirmation.propTypes = {
dataURL: PropTypes.string.isRequired,
openSendConfirmation: PropTypes.func.isRequired,
};

export default sendConfirmation;
15 changes: 12 additions & 3 deletions modules/consent/jsx/e_consent/trainingConsentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class TrainingPage extends React.Component {
/**
* Determines whether given section has consent questions
*
* @param {int} sectionIndex
* @param {number} sectionIndex
* @return {boolean}
*/
sectionHasConsent(sectionIndex) {
Expand Down Expand Up @@ -290,7 +290,7 @@ class TrainingPage extends React.Component {
/**
* Determines whether a section has all pages complete
*
* @param {int} sectionIndex
* @param {number} sectionIndex
* @return {boolean}
*/
sectionDone(sectionIndex) {
Expand Down Expand Up @@ -671,11 +671,14 @@ class TrainingPage extends React.Component {
}(() => this.changePage(this.getNextPage()));
} else {
customSwal = function(pageFn) {
let thankYouText = 'Thank you for completing the eConsent Form! ' +
'Please click "Send Confirmation" below to receive a ' +
'confirmation email.';
return function() {
swal.fire({
type: 'success',
title: 'Success!',
text: 'Thank you for completing the eConsent Form! Please click "Send Confirmation" below to receive a confirmation email.',
text: thankYouText,
showCancelButton: true,
confirmButtonText: 'Send Confirmation',
}).then((result) => {
Expand Down Expand Up @@ -816,4 +819,10 @@ class TrainingPage extends React.Component {
}
}

TrainingPage.propTypes = {
consentData: PropTypes.object,
data_url: PropTypes.string.isRequired,
submit: PropTypes.func.isRequired,
};

export default TrainingPage;
10 changes: 8 additions & 2 deletions php/libraries/Candidate.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,14 @@ class Candidate implements \LORIS\StudyEntities\AccessibleResource,

$candID = $this->getCandID();

$query = "SELECT cc.ConsentID, c.Name, cc.Status, cc.DateGiven,
cc.DateWithdrawn, c.Label, cc.Comment
$query = "SELECT
ConsentID,
Name,
Status,
DateGiven,
DateWithdrawn,
Label,
Comment
FROM candidate_consent_rel cc JOIN consent c USING (ConsentID)
WHERE CandidateID=:cid";
$where = ['cid' => $candID];
Expand Down

0 comments on commit 409c5c0

Please sign in to comment.