diff --git a/.eslintrc.json b/.eslintrc.json index dffe56163a0..2835d27efe8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,8 +18,7 @@ "rules": { "extends": ["eslint:recommended", "plugin:react/recommended", "google"], "max-len": [2, 80, 2, { - "ignoreComments": true, - "ignoreStrings": true + "ignoreComments": true }], "react/jsx-uses-react": "error", "react/jsx-uses-vars": "error", @@ -36,14 +35,6 @@ "allow": ["info", "warn", "error"] }] }, - "overrides": [ - { - "files": ["modules/**", "htdocs/**"], - "rules": { - "max-len": [1, 80, 2, {"ignoreComments": true}] - } - } - ], "globals": { "React": true, "ReactDOM": true, diff --git a/htdocs/js/helpHandler.js b/htdocs/js/helpHandler.js index db25385b53e..b9a846a3147 100644 --- a/htdocs/js/helpHandler.js +++ b/htdocs/js/helpHandler.js @@ -23,61 +23,73 @@ $(document).ready(function() { if (loris.Subtest !== '') { getParams.subtest = loris.Subtest; } - $.get(loris.BaseURL + '/help_editor/ajax/help.php', getParams, function(content) { - let div = document.createElement('div'); - let btn = document.createElement('BUTTON'); - let edit = document.createElement('BUTTON'); - let text = document.createTextNode('Edit'); - let button = document.createTextNode('Close'); - let wrap = document.createElement('div'); - let markdownContent = document.createElement('div'); + $.get( + loris.BaseURL + '/help_editor/ajax/help.php', + getParams, + function(content) { + let div = document.createElement('div'); + let btn = document.createElement('BUTTON'); + let edit = document.createElement('BUTTON'); + let text = document.createTextNode('Edit'); + let button = document.createTextNode('Close'); + let wrap = document.createElement('div'); + let markdownContent = document.createElement('div'); - // Render Markdown in wrap div. - // If help content is from Markdown helpfile. - if (content.format === 'markdown') { - ReactDOM.render(RMarkdown({content: content.content}), wrap); - } else { - // If help content is from DB. - wrap.innerHTML = '<hr id=\'help-separator\'>'; - if (content.topic) { - wrap.innerHTML = '<h3>' + content.topic + '</h3>'; + // Render Markdown in wrap div. + // If help content is from Markdown helpfile. + if (content.format === 'markdown') { + ReactDOM.render(RMarkdown({content: content.content}), wrap); + } else { + // If help content is from DB. + wrap.innerHTML = '<hr id=\'help-separator\'>'; + if (content.topic) { + wrap.innerHTML = '<h3>' + content.topic + '</h3>'; + } + ReactDOM.render( + RMarkdown({content: content.content}), + markdownContent + ); + wrap.appendChild(markdownContent); + if (content.updated) { + wrap.innerHTML = wrap.innerHTML + + '<hr>Last updated: ' + + content.updated; + } } - ReactDOM.render(RMarkdown({content: content.content}), markdownContent); - wrap.appendChild(markdownContent); - if (content.updated) { - wrap.innerHTML = wrap.innerHTML + '<hr>Last updated: ' + content.updated; - } - } - wrap.setAttribute('id', 'help-wrapper'); - btn.appendChild(button); - btn.className = 'btn btn-default'; - btn.setAttribute('id', 'helpclose'); - edit.appendChild(text); - edit.className = 'btn btn-default'; - edit.setAttribute('id', 'helpedit'); - div.appendChild(btn); + wrap.setAttribute('id', 'help-wrapper'); + btn.appendChild(button); + btn.className = 'btn btn-default'; + btn.setAttribute('id', 'helpclose'); + edit.appendChild(text); + edit.className = 'btn btn-default'; + edit.setAttribute('id', 'helpedit'); + div.appendChild(btn); - // If help content comes from DB `help` table and can - // be edited online. - if (loris.userHasPermission('context_help') && content.format !== 'markdown') { - div.appendChild(edit); - edit.addEventListener('click', function(e) { + // If help content comes from DB `help` table and can + // be edited online. + if (loris.userHasPermission('context_help') + && content.format !== 'markdown' + ) { + div.appendChild(edit); + edit.addEventListener('click', function(e) { + e.preventDefault(); + window.open(loris.BaseURL + + '/help_editor/edit_help_content/?section=' + + getParams.testName + '&subsection=' + getParams.subtest, '_self'); + }); + } + div.appendChild(wrap); + document.getElementById('wrap').appendChild(div); + div.setAttribute('class', 'help-content'); + $(div).addClass('visible'); + btn.addEventListener('click', function(e) { + $(div).hide(); + $('.help-button').removeClass('help-open'); e.preventDefault(); - window.open(loris.BaseURL + '/help_editor/edit_help_content/?section=' + - getParams.testName + '&subsection=' + getParams.subtest, '_self'); }); - } - div.appendChild(wrap); - document.getElementById('wrap').appendChild(div); - div.setAttribute('class', 'help-content'); - $(div).addClass('visible'); - btn.addEventListener('click', function(e) { - $(div).hide(); - $('.help-button').removeClass('help-open'); e.preventDefault(); - }); - e.preventDefault(); - }, 'json'); + }, + 'json'); }); $('.dynamictable').DynamicTable(); diff --git a/htdocs/js/instrument_form_control.js b/htdocs/js/instrument_form_control.js index 661cc8fa873..83111ef4ba2 100644 --- a/htdocs/js/instrument_form_control.js +++ b/htdocs/js/instrument_form_control.js @@ -11,7 +11,9 @@ function notAnswered() { } else { $('.' + name).prop('disabled', true); $(this).parent().addClass('has-warning'); - $(this).after('<div class="col-xs-12 warning" id="' + name + '">Any entered data will not be saved</div>'); + $(this).after('<div class="col-xs-12 warning" id="' + + name + + '">Any entered data will not be saved</div>'); } } else if (index === 0) { $('[name=' + name + ']').prop('disabled', false); @@ -20,7 +22,9 @@ function notAnswered() { } else { $('[name=' + name + ']').prop('disabled', true); $(this).parent().addClass('has-warning'); - $(this).after('<div class="col-xs-12 warning" id="' + name + '">Any entered data will not be saved</div>'); + $(this).after('<div class="col-xs-12 warning" id="' + + name + + '">Any entered data will not be saved</div>'); } } diff --git a/htdocs/js/invalid_form_scroll.js b/htdocs/js/invalid_form_scroll.js index 963052a7fe2..046cc86fcee 100644 --- a/htdocs/js/invalid_form_scroll.js +++ b/htdocs/js/invalid_form_scroll.js @@ -6,9 +6,12 @@ $(document).ready(function bindInvalidFormListeners() { // This will make sure that the flag indicating whether we scrolled // to an invalid element when the form is submitted is reset - document.getElementsByName('fire_away')[0].addEventListener('click', function() { - bindInvalidFormListeners.scrollingDone = false; - }); + document.getElementsByName('fire_away')[0].addEventListener( + 'click', + function() { + bindInvalidFormListeners.scrollingDone = false; + } + ); // Override default event handler for invalid input elements // This will make sure that the invalid element appears at the top diff --git a/htdocs/js/jquery.csv.js b/htdocs/js/jquery.csv.js index a48d588c3b8..0e1c87d6194 100644 --- a/htdocs/js/jquery.csv.js +++ b/htdocs/js/jquery.csv.js @@ -7,9 +7,15 @@ jQuery.extend({ csv: function(delim, quote, lined) { - delim = typeof delim === 'string' ? new RegExp('[' + (delim || ',') + ']') : typeof delim === 'undefined' ? ',' : delim; - quote = typeof quote === 'string' ? new RegExp('^[' + (quote || '"') + ']') : typeof quote === 'undefined' ? '"' : quote; - lined = typeof lined === 'string' ? new RegExp('[' + (lined || '\r\n') + ']+') : typeof lined === 'undefined' ? '\r\n' : lined; + delim = typeof delim === 'string' ? + new RegExp('[' + (delim || ',') + ']') : + typeof delim === 'undefined' ? ',' : delim; + quote = typeof quote === 'string' ? + new RegExp('^[' + (quote || '"') + ']') : + typeof quote === 'undefined' ? '"' : quote; + lined = typeof lined === 'string' ? + new RegExp('[' + (lined || '\r\n') + ']+') : + typeof lined === 'undefined' ? '\r\n' : lined; function splitline(v) { // Split the line using the delimitor diff --git a/htdocs/js/jquery.fileupload.js b/htdocs/js/jquery.fileupload.js index c0c4b906933..4d95b85a8d9 100644 --- a/htdocs/js/jquery.fileupload.js +++ b/htdocs/js/jquery.fileupload.js @@ -1,9 +1,16 @@ (function($) { let inputGroup = '<div class="input-group file-upload"></div>'; - let fileNameDisplay = '<div tabindex="-1" class="form-control file-caption kv-fileinput-caption" title=""><span class="glyphicon glyphicon-file kv-caption-icon" style="display: none;"></span><div class="file-caption-name"></div></div>'; + let fileNameDisplay = '<div tabindex="-1" ' + + 'class="form-control file-caption kv-fileinput-caption" ' + + 'title="">' + + '<span class="glyphicon glyphicon-file kv-caption-icon" ' + + 'style="display: none;"></span>' + + '<div class="file-caption-name"></div>' + + '</div>'; let inputButtonGroup = '<div class="input-group-btn"></div>'; let inputButton = '<div class="btn btn-primary btn-file"></div>'; - let buttonText = '<i class="glyphicon glyphicon-folder-open"></i> Browse …'; + let buttonText = '<i class="glyphicon glyphicon-folder-open"></i>' + + ' Browse …'; let wrapper = function(element) { $(element).wrap(inputGroup); $(element).before(fileNameDisplay); @@ -18,7 +25,9 @@ wrapper(element); $(element).change(function() { let filename = $(this).val().split('\\').pop(); - let placeHolder = $(this).parent().parent().parent().find('.file-caption-name'); + let placeHolder = $(this) + .parent().parent().parent() + .find('.file-caption-name'); $(placeHolder).html(filename); }); }); diff --git a/htdocs/js/util/queryString.js b/htdocs/js/util/queryString.js index f9ce8da24aa..4791fad3069 100644 --- a/htdocs/js/util/queryString.js +++ b/htdocs/js/util/queryString.js @@ -51,7 +51,8 @@ let QueryString = { let queryStringObj = JSON.parse(JSON.stringify(currentQuery)); // Make sure that key is of string type and value is of string or object type - if (typeof fieldName !== 'string' || (typeof fieldValue !== 'string' && typeof fieldValue !== 'object')) { + if (typeof fieldName !== 'string' + || (typeof fieldValue !== 'string' && typeof fieldValue !== 'object')) { console.error( 'Error in QueryString.set(): \n' + '\tfieldName must be of type string and' + diff --git a/jsx/Form.js b/jsx/Form.js index 91633ddbd91..9a89a602056 100644 --- a/jsx/Form.js +++ b/jsx/Form.js @@ -445,7 +445,9 @@ class SelectElement extends Component { } // Add error message - if (this.props.hasError || (this.props.required && this.props.value === '')) { + if (this.props.hasError + || (this.props.required && this.props.value === '') + ) { errorMessage = <span>{this.props.errorMessage}</span>; elementClass = 'row form-group has-error'; } @@ -905,7 +907,11 @@ class TextboxElement extends Component { } handleChange(e) { - this.props.onUserInput(this.props.name, e.target.value, e.target.id, 'textbox'); + this.props.onUserInput( + this.props.name, + e.target.value, + e.target.id, 'textbox', + ); } handleBlur(e) { @@ -1039,7 +1045,12 @@ class DateElement extends Component { } handleChange(e) { - this.props.onUserInput(this.props.name, e.target.value, e.target.id, 'date'); + this.props.onUserInput( + this.props.name, + e.target.value, + e.target.id, + 'date', + ); } render() { @@ -1168,7 +1179,8 @@ class TimeElement extends Component { required={required} disabled={disabled} pattern="([0-1][0-9]|2[0-4]|[1-9]):([0-5][0-9])(:([0-5][0-9]))?" - title="Input must be in one of the following formats: HH:MM or HH:MM:SS" + title={'Input must be in one of the following formats: ' + + 'HH:MM or HH:MM:SS'} /> </div> </div> diff --git a/modules/acknowledgements/jsx/acknowledgementsIndex.js b/modules/acknowledgements/jsx/acknowledgementsIndex.js index 8b87fc6493e..b579589b9ab 100644 --- a/modules/acknowledgements/jsx/acknowledgementsIndex.js +++ b/modules/acknowledgements/jsx/acknowledgementsIndex.js @@ -51,8 +51,10 @@ class AcknowledgementsIndex extends Component { dataEntry: 'Data Entry', databaseProgramming: 'Database Programming', imagingProcessingAndEvaluation: 'Imaging Processing and Evaluation', - geneticAnalysisAndBiochemicalAssays: 'Genetic Analysis and Biochemical Assays', - randomizationAndPharmacyAllocation: 'Randomization and Pharmacy Allocation', + geneticAnalysisAndBiochemicalAssays: 'Genetic Analysis ' + + 'and Biochemical Assays', + randomizationAndPharmacyAllocation: 'Randomization ' + + 'and Pharmacy Allocation', consultants: 'Consultants', lpCsfCollection: 'LP/CSF Collection', }, @@ -140,7 +142,11 @@ class AcknowledgementsIndex extends Component { }) .then((resp) => { if (resp.ok && resp.status === 200) { - swal.fire('Success!', 'Acknowledgement added.', 'success').then((result) => { + swal.fire( + 'Success!', + 'Acknowledgement added.', + 'success' + ).then((result) => { if (result.value) { this.closeModalForm(); this.fetchData(); @@ -312,7 +318,8 @@ class AcknowledgementsIndex extends Component { label='End date' value={this.state.formData.addEndDate} maxYear={this.state.data.maxYear} - minYear={this.state.formData.addStartDate || this.state.data.minYear} + minYear={this.state.formData.addStartDate + || this.state.data.minYear} disabled={disableEndDate} required={requireEndDate} onUserInput={this.setFormData} diff --git a/modules/behavioural_qc/jsx/behavioural_qc_module.js b/modules/behavioural_qc/jsx/behavioural_qc_module.js index 87edeef59b6..d3644329509 100644 --- a/modules/behavioural_qc/jsx/behavioural_qc_module.js +++ b/modules/behavioural_qc/jsx/behavioural_qc_module.js @@ -449,7 +449,15 @@ class BehaviouralQCGraphics extends Component { <div className='col-sm-12 col-md-5'> <div className='panel panel-primary'> <div className='panel-heading'> - At A Glance: {pscidStatus} - {visitStatus} - {instrumentStatus} - {siteStatus} -{projectStatus} + {'At A Glance: ' + + [ + pscidStatus, + visitStatus, + instrumentStatus, + siteStatus, + projectStatus, + ].join(' - ') + } </div> <div className='panel-body'> <div id='completedChart'/> diff --git a/modules/bvl_feedback/jsx/react.behavioural_feedback_panel.js b/modules/bvl_feedback/jsx/react.behavioural_feedback_panel.js index f7507b9125a..e0bbc2cd4e0 100644 --- a/modules/bvl_feedback/jsx/react.behavioural_feedback_panel.js +++ b/modules/bvl_feedback/jsx/react.behavioural_feedback_panel.js @@ -548,9 +548,11 @@ class FeedbackSummaryPanel extends Component { <tr key={key}> <td>{row.QC_Class}</td> <td> - <a href={loris.BaseURL + '/instruments/' + row.Instrument + '/?candID=' + - row.CandID + '&sessionID=' + row.SessionID + '&commentID=' + - row.CommentID} + <a href={loris.BaseURL + + '/instruments/' + row.Instrument + + '/?candID=' + row.CandID + + '&sessionID=' + row.SessionID + + '&commentID=' + row.CommentID} > {row.Instrument} </a> diff --git a/modules/candidate_list/jsx/candidateListIndex.js b/modules/candidate_list/jsx/candidateListIndex.js index 2e669a748c1..faaa3ff99a8 100644 --- a/modules/candidate_list/jsx/candidateListIndex.js +++ b/modules/candidate_list/jsx/candidateListIndex.js @@ -344,7 +344,9 @@ class CandidateListIndex extends Component { // FIXME: move toggle button in the filter component next to the clear button const actions = [ { - label: this.state.hideFilter ? 'Show Advanced Filters' : 'Hide Advanced Filters', + label: this.state.hideFilter ? + 'Show Advanced Filters' : + 'Hide Advanced Filters', action: this.toggleFilters, name: 'advanced', }, diff --git a/modules/candidate_list/jsx/openProfileForm.js b/modules/candidate_list/jsx/openProfileForm.js index bc3586dc64e..597a1c03565 100644 --- a/modules/candidate_list/jsx/openProfileForm.js +++ b/modules/candidate_list/jsx/openProfileForm.js @@ -70,7 +70,9 @@ class OpenProfileForm extends Component { className: 'alert alert-info text-center', }; if (this.props.betaProfileLink) { - window.location.href = loris.BaseURL + '/candidate_profile/' + state.CandID; + window.location.href = loris.BaseURL + + '/candidate_profile/' + + state.CandID; } else { window.location.href = loris.BaseURL + '/' + state.CandID; } diff --git a/modules/candidate_parameters/jsx/CandidateDOB.js b/modules/candidate_parameters/jsx/CandidateDOB.js index f46abba837a..0dde63fd908 100644 --- a/modules/candidate_parameters/jsx/CandidateDOB.js +++ b/modules/candidate_parameters/jsx/CandidateDOB.js @@ -76,7 +76,8 @@ class CandidateDOB extends Component { /> <StaticElement label='Disclaimer:' - text='Any changes to the date of birth requires an administrator to run the fix_candidate_age script.' + text={'Any changes to the date of birth requires an administrator ' + + 'to run the fix_candidate_age script.'} class='form-control-static text-danger bg-danger col-sm-10' /> <DateElement diff --git a/modules/candidate_parameters/jsx/CandidateParameters.js b/modules/candidate_parameters/jsx/CandidateParameters.js index f44806d7a51..cf16a2308d6 100644 --- a/modules/candidate_parameters/jsx/CandidateParameters.js +++ b/modules/candidate_parameters/jsx/CandidateParameters.js @@ -16,8 +16,12 @@ class CandidateParameters extends Component { } getTabPanes(tabList) { - const actionURL = `${loris.BaseURL}/candidate_parameters/ajax/formHandler.php`; - const dataURL = `${loris.BaseURL}/candidate_parameters/ajax/getData.php?candID=${this.props.candID}`; + const actionURL = loris.BaseURL + + '/candidate_parameters/ajax/formHandler.php'; + const dataURL = loris.BaseURL + + '/candidate_parameters/ajax/getData.php' + + '?candID=' + + this.props.candID; const tabPanes = Object.keys(tabList).map((key) => { const TabContent = tabList[key].component; return ( @@ -35,22 +39,50 @@ class CandidateParameters extends Component { render() { let tabList = [ - {id: 'candidateInfo', label: 'Candidate Information', component: CandidateInfo}, - {id: 'participantStatus', label: 'Participant Status', component: ParticipantStatus}, - {id: 'candidateDOB', label: 'Date of Birth', component: CandidateDOB}, - {id: 'candidateDOD', label: 'Date of Death', component: CandidateDOD}, + { + id: 'candidateInfo', + label: 'Candidate Information', + component: CandidateInfo, + }, + { + id: 'participantStatus', + label: 'Participant Status', + component: ParticipantStatus, + }, + { + id: 'candidateDOB', + label: 'Date of Birth', + component: CandidateDOB, + }, + { + id: 'candidateDOD', + label: 'Date of Death', + component: CandidateDOD, + }, ]; if (loris.config('useProband') === 'true') { - tabList.push({id: 'probandInfo', label: 'Proband Information', component: ProbandInfo}); + tabList.push({ + id: 'probandInfo', + label: 'Proband Information', + component: ProbandInfo, + }); } if (loris.config('useFamilyID') === 'true') { - tabList.push({id: 'familyInfo', label: 'Family Information', component: FamilyInfo}); + tabList.push({ + id: 'familyInfo', + label: 'Family Information', + component: FamilyInfo, + }); } if (loris.config('useConsent') === 'true') { - tabList.push({id: 'consentStatus', label: 'Consent Status', component: ConsentStatus}); + tabList.push({ + id: 'consentStatus', + label: 'Consent Status', + component: ConsentStatus, + }); } return ( @@ -89,6 +121,9 @@ window.addEventListener('load', () => { </div> ); - ReactDOM.render(candidateParameters, document.getElementById('lorisworkspace')); + ReactDOM.render( + candidateParameters, + document.getElementById('lorisworkspace') + ); }); diff --git a/modules/candidate_parameters/jsx/ConsentStatus.js b/modules/candidate_parameters/jsx/ConsentStatus.js index 52b21390193..5642689226c 100644 --- a/modules/candidate_parameters/jsx/ConsentStatus.js +++ b/modules/candidate_parameters/jsx/ConsentStatus.js @@ -45,17 +45,17 @@ class ConsentStatus extends Component { success: (data) => { let formData = {}; let consents = data.consents; - for (let consentStatus in consents) { - if (consents.hasOwnProperty(consentStatus)) { - let consentDate = consentStatus + '_date'; - let consentDate2 = consentStatus + '_date2'; - let consentWithdrawal = consentStatus + '_withdrawal'; - let consentWithdrawal2 = consentStatus + '_withdrawal2'; - formData[consentStatus] = data.consentStatuses[consentStatus]; - formData[consentDate] = data.consentDates[consentStatus]; - formData[consentDate2] = data.consentDates[consentStatus]; - formData[consentWithdrawal] = data.withdrawals[consentStatus]; - formData[consentWithdrawal2] = data.withdrawals[consentStatus]; + for (let cStatus in consents) { + if (consents.hasOwnProperty(cStatus)) { + let cDate = cStatus + '_date'; + let cDate2 = cStatus + '_date2'; + let cWithdrawal = cStatus + '_withdrawal'; + let cWithdrawal2 = cStatus + '_withdrawal2'; + formData[cStatus] = data.consentStatuses[cStatus]; + formData[cDate] = data.consentDates[cStatus]; + formData[cDate2] = data.consentDates[cStatus]; + formData[cWithdrawal] = data.withdrawals[cStatus]; + formData[cWithdrawal2] = data.withdrawals[cStatus]; } } this.setState({ @@ -155,7 +155,10 @@ class ConsentStatus extends Component { return; } if (date1 > today) { - alert(label + ' withdrawal date cannot be later than today!'); + alert( + label + + ' withdrawal date cannot be later than today!' + ); return; } } @@ -231,7 +234,8 @@ class ConsentStatus extends Component { dateRequired[i] = true; // If answer was previously 'yes' and consent is now being withdrawn, enable and require withdrawal date // If consent was previously withdrawn and stays withdrawn, enable and require withdrawal date - if (oldConsent === 'yes' || (oldConsent === 'no' && withdrawalDate)) { + if (oldConsent === 'yes' + || (oldConsent === 'no' && withdrawalDate)) { withdrawalDisabled[i] = false; withdrawalRequired[i] = true; } @@ -253,7 +257,8 @@ class ConsentStatus extends Component { let consentDate = consentStatus + '_date'; let consentDate2 = consentStatus + '_date2'; let consentDateLabel = 'Date of ' + statusLabel; - let consentDateConfirmationLabel = 'Confirmation Date of ' + statusLabel; + let consentDateConfirmationLabel = 'Confirmation Date of ' + + statusLabel; let consentWithdrawal = consentStatus + '_withdrawal'; let consentWithdrawal2 = consentStatus + '_withdrawal2'; let consentWithdrawalLabel = 'Date of Withdrawal of Consent'; @@ -321,14 +326,15 @@ class ConsentStatus extends Component { } let formattedHistory = []; - for (let consentKey in this.state.Data.history) { - if (this.state.Data.history.hasOwnProperty(consentKey)) { - let consentLabel = this.state.Data.history[consentKey].label; - let consentType = this.state.Data.history[consentKey].consentType; - for (let field in this.state.Data.history[consentKey]) { - if (this.state.Data.history[consentKey].hasOwnProperty(field)) { + const history = this.state.Data.history; + for (let consentKey in history) { + if (history.hasOwnProperty(consentKey)) { + let consentLabel = history[consentKey].label; + let consentType = history[consentKey].consentType; + for (let field in history[consentKey]) { + if (history[consentKey].hasOwnProperty(field)) { let line = ''; - let historyConsent = this.state.Data.history[consentKey][field]; + let historyConsent = history[consentKey][field]; for (let field2 in historyConsent) { if (historyConsent.hasOwnProperty(field2)) { let current = historyConsent[field2]; @@ -354,7 +360,8 @@ class ConsentStatus extends Component { line += ' '; break; case consentType + '_withdrawal': - line += 'Date of Consent Withdrawal: '; + line += 'Date of ' + + 'Consent Withdrawal: '; line += current; line += ' '; break; @@ -377,8 +384,14 @@ class ConsentStatus extends Component { ref="form" class="col-md-6" > - <StaticElement label="PSCID" text={this.state.Data.pscid} /> - <StaticElement label="DCCID" text={this.state.Data.candID} /> + <StaticElement + label="PSCID" + text={this.state.Data.pscid} + /> + <StaticElement + label="DCCID" + text={this.state.Data.candID} + /> {consents} {updateButton} {formattedHistory} diff --git a/modules/candidate_parameters/jsx/FamilyInfo.js b/modules/candidate_parameters/jsx/FamilyInfo.js index ab2b677e263..b6e3475ccca 100644 --- a/modules/candidate_parameters/jsx/FamilyInfo.js +++ b/modules/candidate_parameters/jsx/FamilyInfo.js @@ -84,7 +84,9 @@ class FamilyInfo extends Component { return ( <button className="btn-info has-spinner"> Loading - <span className="glyphicon glyphicon-refresh glyphicon-refresh-animate"> + <span + className="glyphicon glyphicon-refresh glyphicon-refresh-animate" + > </span> </button> ); @@ -127,7 +129,12 @@ class FamilyInfo extends Component { <ButtonElement label="Delete" type="button" - onUserInput={this.deleteFamilyMember.bind(null, candID, key, candidateList)} + onUserInput={this.deleteFamilyMember.bind( + null, + candID, + key, + candidateList + )} /> <hr/> </div> diff --git a/modules/candidate_parameters/jsx/ParticipantStatus.js b/modules/candidate_parameters/jsx/ParticipantStatus.js index c47f68aea93..e480d1d1ca5 100644 --- a/modules/candidate_parameters/jsx/ParticipantStatus.js +++ b/modules/candidate_parameters/jsx/ParticipantStatus.js @@ -123,7 +123,9 @@ class ParticipantStatus extends Component { if (this.state.Data.history.hasOwnProperty(statusKey)) { let line = ''; for (let field in this.state.Data.history[statusKey]) { - if (this.state.Data.history[statusKey].hasOwnProperty(field)) { + if (this.state.Data.history[statusKey] + .hasOwnProperty(field) + ) { let current = this.state.Data.history[statusKey][field]; if (current !== null) { switch (field) { @@ -169,7 +171,9 @@ class ParticipantStatus extends Component { } else if (this.state.updateResult === 'error') { let errorMessage = this.state.errorMessage; alertClass = 'alert alert-danger text-center'; - alertMessage = errorMessage ? errorMessage : 'Failed to update!'; + alertMessage = errorMessage ? + errorMessage : + 'Failed to update!'; } } diff --git a/modules/conflict_resolver/jsx/CandidateConflictsWidget.js b/modules/conflict_resolver/jsx/CandidateConflictsWidget.js index 8318b1f4764..3786c5e8853 100644 --- a/modules/conflict_resolver/jsx/CandidateConflictsWidget.js +++ b/modules/conflict_resolver/jsx/CandidateConflictsWidget.js @@ -63,8 +63,14 @@ function CandidateConflictsWidget(props) { return <div> <div id='conflictschart' /> <ul> - <li>Click on instrument in legend to visit conflict resolver for that instrument across all visits.</li> - <li>Click on bar in graph to visit conflict resolver for that visit and instrument combination.</li> + <li> + {'Click on instrument in legend to visit conflict resolver ' + + 'for that instrument across all visits.'} + </li> + <li> + {'Click on bar in graph to visit conflict resolver ' + + 'for that visit and instrument combination.'} + </li> </ul> </div>; } diff --git a/modules/conflict_resolver/jsx/conflictResolverIndex.js b/modules/conflict_resolver/jsx/conflictResolverIndex.js index c6d14507fe4..7dc8bb474d6 100644 --- a/modules/conflict_resolver/jsx/conflictResolverIndex.js +++ b/modules/conflict_resolver/jsx/conflictResolverIndex.js @@ -72,8 +72,16 @@ class UnresolvedConflictsPane extends Component { /> <div className='pull-right'> - <input className='btn btn-sm btn-primary' name='fire_away' value='Save' type='submit'/> - <input className='btn btn-sm btn-primary' value='Reset' type='reset' style={{marginLeft: 3 + 'px'}}/> + <input className='btn btn-sm btn-primary' + name='fire_away' + value='Save' + type='submit' + /> + <input className='btn btn-sm btn-primary' + value='Reset' + type='reset' + style={{marginLeft: 3 + 'px'}} + /> </div> </form> @@ -280,7 +288,8 @@ window.addEventListener('load', () => { base: loris.BaseURL, data: { unresolved: loris.BaseURL + '/conflict_resolver/?format=json', - resolved: loris.BaseURL + '/conflict_resolver/resolved_conflicts/?format=json', + resolved: loris.BaseURL + + '/conflict_resolver/resolved_conflicts/?format=json', }, }} />, @@ -291,7 +300,8 @@ window.addEventListener('load', () => { if (document.getElementById('tab-ResolvedConflicts')) { $('#tab-ResolvedConflicts').click(function(event) { event.preventDefault(); - window.location.href = loris.BaseURL + '/conflict_resolver/resolved_conflicts/'; + window.location.href = loris.BaseURL + + '/conflict_resolver/resolved_conflicts/'; return false; }); clearInterval(refresh); diff --git a/modules/conflict_resolver/jsx/resolvedConflictsIndex.js b/modules/conflict_resolver/jsx/resolvedConflictsIndex.js index ce128be1216..c36b6199544 100644 --- a/modules/conflict_resolver/jsx/resolvedConflictsIndex.js +++ b/modules/conflict_resolver/jsx/resolvedConflictsIndex.js @@ -278,7 +278,8 @@ window.addEventListener('load', () => { base: loris.BaseURL, data: { unresolved: loris.BaseURL + '/conflict_resolver/?format=json', - resolved: loris.BaseURL + '/conflict_resolver/resolved_conflicts/?format=json', + resolved: loris.BaseURL + + '/conflict_resolver/resolved_conflicts/?format=json', }, }} />, diff --git a/modules/data_release/jsx/addPermissionForm.js b/modules/data_release/jsx/addPermissionForm.js index 4dfd88686b0..b7904bce016 100644 --- a/modules/data_release/jsx/addPermissionForm.js +++ b/modules/data_release/jsx/addPermissionForm.js @@ -33,7 +33,12 @@ class AddPermissionForm extends Component { fetchData() { return fetch(this.props.DataURL, {credentials: 'same-origin'}) .then((resp) => resp.json()) - .then((data) => this.setState({data: data.Data, fieldOptions: data.fieldOptions})) + .then( + (data) => this.setState({ + data: data.Data, + fieldOptions: data.fieldOptions, + }) + ) .catch((error) => { this.setState({error: true}); console.error(error); @@ -165,7 +170,9 @@ class AddPermissionForm extends Component { }); this.props.fetchData(); } else { - let msg = response.statusText ? response.statusText : 'Submission Error!'; + let msg = response.statusText ? + response.statusText : + 'Submission Error!'; swal(msg, '', 'error'); console.error(msg); } diff --git a/modules/data_release/jsx/dataReleaseIndex.js b/modules/data_release/jsx/dataReleaseIndex.js index 69884e9612b..0ad666b8e96 100644 --- a/modules/data_release/jsx/dataReleaseIndex.js +++ b/modules/data_release/jsx/dataReleaseIndex.js @@ -88,8 +88,9 @@ class DataReleaseIndex extends Component { || this.props.hasPermission('data_release_view') || this.props.hasPermission('data_release_upload') || this.props.hasPermission('data_release_edit_file_access')) { - const downloadURL = loris.BaseURL + '/data_release/ajax/GetFile.php?File=' + - encodeURIComponent(row['File Name']); + const downloadURL = loris.BaseURL + + '/data_release/ajax/GetFile.php?File=' + + encodeURIComponent(row['File Name']); result = ( <td> <a @@ -152,8 +153,14 @@ class DataReleaseIndex extends Component { onClick={this.uploadFile} > <UploadFileForm - DataURL={`${loris.BaseURL}/data_release/ajax/FileUpload.php?action=getData`} - action={`${loris.BaseURL}/data_release/ajax/FileUpload.php?action=upload`} + DataURL={ + loris.BaseURL + + '/data_release/ajax/FileUpload.php?action=getData' + } + action={ + loris.BaseURL + + '/data_release/ajax/FileUpload.php?action=upload' + } fetchData={this.fetchData} /> </Modal> @@ -171,8 +178,14 @@ class DataReleaseIndex extends Component { onClick={this.addPermission} > <AddPermissionForm - DataURL={`${loris.BaseURL}/data_release/?format=json`} - action={`${loris.BaseURL}/data_release/ajax/AddPermission.php?action=addpermission`} + DataURL={ + loris.BaseURL + + '/data_release/?format=json' + } + action={ + loris.BaseURL + + '/data_release/ajax/AddPermission.php?action=addpermission' + } fetchData={this.fetchData} /> </Modal> @@ -182,8 +195,14 @@ class DataReleaseIndex extends Component { const managePermissionsForm = this.props.hasPermission('data_release_edit_file_access') && ( <ManagePermissionsForm - DataURL={`${loris.BaseURL}/data_release/ajax/AddPermission.php?action=getPermissions`} - action={`${loris.BaseURL}/data_release/ajax/AddPermission.php?action=managepermissions`} + DataURL={ + loris.BaseURL + + '/data_release/ajax/AddPermission.php?action=getPermissions' + } + action={ + loris.BaseURL + + '/data_release/ajax/AddPermission.php?action=managepermissions' + } options={this.state.data.fieldOptions} fetchData={this.fetchData} show={this.state.show.managePermissionsForm} diff --git a/modules/data_release/jsx/uploadFileForm.js b/modules/data_release/jsx/uploadFileForm.js index c7252d6de9d..e0e81bd486c 100644 --- a/modules/data_release/jsx/uploadFileForm.js +++ b/modules/data_release/jsx/uploadFileForm.js @@ -129,7 +129,9 @@ class UploadFileForm extends Component { let fileSize = formData.file ? Math.round((formData.file.size/1024)) : null; const maxSizeAllowed = this.state.data.maxUploadSize; if (parseInt(fileSize, 10) > parseInt(maxSizeAllowed, 10)*1024) { - let msg = 'File size exceeds the maximum allowed (' + maxSizeAllowed + ')'; + let msg = 'File size exceeds the maximum allowed (' + + maxSizeAllowed + + ')'; errorMessage['Filesize'] = msg; hasError['Filesize'] = true; swal({ @@ -180,7 +182,10 @@ class UploadFileForm extends Component { if (responseUrl.searchParams.has('duplicate')) { swal({ title: 'Are you sure?', - text: 'A file with this name already exists!\n Would you like to overwrite existing file?\n Note that the version associated with the file will also be overwritten.', + text: 'A file with this name already exists!\n ' + + 'Would you like to overwrite existing file?\n ' + + 'Note that the version associated with ' + + 'the file will also be overwritten.', type: 'warning', showCancelButton: true, confirmButtonText: 'Yes, I am sure!', diff --git a/modules/dicom_archive/jsx/dicom_archive.js b/modules/dicom_archive/jsx/dicom_archive.js index 8895bcd15a5..bf6bb318746 100644 --- a/modules/dicom_archive/jsx/dicom_archive.js +++ b/modules/dicom_archive/jsx/dicom_archive.js @@ -86,8 +86,9 @@ class DicomArchive extends Component { if (row.SessionID === null || row.SessionID === '') { result = <td> </td>; } else { - let mrlURL = loris.BaseURL + '/imaging_browser/viewSession/?sessionID=' + - row.SessionID; + let mrlURL = loris.BaseURL + + '/imaging_browser/viewSession/?sessionID=' + + row.SessionID; result = <td><a href={mrlURL}>{cell}</a></td>; } break; diff --git a/modules/document_repository/jsx/childTree.js b/modules/document_repository/jsx/childTree.js index 5be5fd7106b..0561df0fcfd 100644 --- a/modules/document_repository/jsx/childTree.js +++ b/modules/document_repository/jsx/childTree.js @@ -81,8 +81,9 @@ class ChildTree extends Component { </div> { Object.values(node)[2] !== null && - <div style={commentStyle} className="tip">{Object.values(node)[2]}</div> - + <div style={commentStyle} + className="tip">{Object.values(node)[2]} + </div> } </div> </td> diff --git a/modules/document_repository/jsx/docIndex.js b/modules/document_repository/jsx/docIndex.js index 7ecdea6d582..04d3a56f68f 100644 --- a/modules/document_repository/jsx/docIndex.js +++ b/modules/document_repository/jsx/docIndex.js @@ -126,11 +126,22 @@ class DocIndex extends React.Component { let result = <td>{cell}</td>; switch (column) { case 'File Name': - let downloadURL = loris.BaseURL + '/document_repository/Files/' + encodeURIComponent(row['File Name']); - result = <td><a href={downloadURL} target="_blank" download={row['File Name']}>{cell}</a></td>; + let downloadURL = loris.BaseURL + + '/document_repository/Files/' + + encodeURIComponent(row['File Name']); + result = <td> + <a + href={downloadURL} + target="_blank" + download={row['File Name']} + > + {cell} + </a> + </td>; break; case 'Edit': - let editURL = loris.BaseURL + '/document_repository/edit/' + row['Edit']; + let editURL = loris.BaseURL + + '/document_repository/edit/' + row['Edit']; result = <td><a href={editURL}>Edit</a></td>; break; case 'Delete File': @@ -159,7 +170,9 @@ class DocIndex extends React.Component { } ); } - result = <td><a style={{cursor: 'pointer'}} onClick={click}>Delete</a></td>; + result = <td> + <a style={{cursor: 'pointer'}} onClick={click}>Delete</a> + </td>; break; } return result; @@ -207,7 +220,11 @@ class DocIndex extends React.Component { }}, {label: 'Date Uploaded', show: true}, {label: 'Edit', show: true}, - {label: 'Delete File', show: this.props.hasPermission('superUser') || this.props.hasPermission('document_repository_delete')}, + { + label: 'Delete File', + show: this.props.hasPermission('superUser') + || this.props.hasPermission('document_repository_delete'), + }, {label: 'File Category', show: false}, {label: 'Category', show: false}, {label: 'Data Dir', show: false}, @@ -263,8 +280,10 @@ class DocIndex extends React.Component { /> </div> ); - const treeTable = (Object.keys(this.state.tableData.length).length === 0 - && Object.keys(this.state.childrenNode).length === 0) ? ( + const treeTable = ( + Object.keys(this.state.tableData.length).length === 0 + && Object.keys(this.state.childrenNode).length === 0 + ) ? ( <NullFilterableDataTable> <div> <CheckboxElement diff --git a/modules/document_repository/jsx/uploadForm.js b/modules/document_repository/jsx/uploadForm.js index 586b49bbdc4..265c40478de 100644 --- a/modules/document_repository/jsx/uploadForm.js +++ b/modules/document_repository/jsx/uploadForm.js @@ -172,7 +172,11 @@ class DocUploadForm extends Component { swal.fire('Could not upload file', data.error, 'error'); }).catch((error) => { console.error(error); - swal.fire('Unknown Error', 'Please report the issue or contact your administrator', 'error'); + swal.fire( + 'Unknown Error', + 'Please report the issue or contact your administrator', + 'error' + ); }); } }); diff --git a/modules/electrophysiology_browser/jsx/components/SidebarContent.js b/modules/electrophysiology_browser/jsx/components/SidebarContent.js index a599b53593c..c7c144f7912 100644 --- a/modules/electrophysiology_browser/jsx/components/SidebarContent.js +++ b/modules/electrophysiology_browser/jsx/components/SidebarContent.js @@ -57,7 +57,11 @@ const SidebarContent = (props) => { }> « Previous </a> - <a id={'nav_next'} href={props.next} target={'_self'} style={styles.sidebarLink}> + <a id={'nav_next'} + href={props.next} + target={'_self'} + style={styles.sidebarLink} + > Next » </a> </div> diff --git a/modules/electrophysiology_browser/jsx/components/electrophysiology_session_panels.js b/modules/electrophysiology_browser/jsx/components/electrophysiology_session_panels.js index d7b9935d5e8..8e123ab3c76 100644 --- a/modules/electrophysiology_browser/jsx/components/electrophysiology_session_panels.js +++ b/modules/electrophysiology_browser/jsx/components/electrophysiology_session_panels.js @@ -162,83 +162,170 @@ class FilePanel extends Component { <div className={'row'}> <div className={'col-sm-6'} style={stylesFile.div.container.table}> <table style={stylesFile.table.style}> - <caption style={stylesFile.table.caption}>Acquisition Summary</caption> + <caption style={stylesFile.table.caption}> + Acquisition Summary + </caption> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>Sampling Frequency</th> - <td style={stylesFile.table.data}>{this.state.data.task.frequency.sampling}</td> + <th scope='row' + style={stylesFile.table.header} + >Sampling Frequency</th> + <td style={stylesFile.table.data}> + {this.state.data.task.frequency.sampling} + </td> </tr> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>{this.state.data.task.channel[0].name}</th> - <td style={stylesFile.table.data}>{this.state.data.task.channel[0].value}</td> + <th scope='row' + style={stylesFile.table.header} + >{this.state.data.task.channel[0].name}</th> + <td style={stylesFile.table.data}> + {this.state.data.task.channel[0].value} + </td> </tr> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>{this.state.data.task.channel[1].name}</th> - <td style={stylesFile.table.data}>{this.state.data.task.channel[1].value}</td> + <th scope='row' + style={stylesFile.table.header} + >{this.state.data.task.channel[1].name}</th> + <td style={stylesFile.table.data}> + {this.state.data.task.channel[1].value} + </td> </tr> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>{this.state.data.task.channel[2].name}</th> - <td style={stylesFile.table.data}>{this.state.data.task.channel[2].value}</td> + <th scope='row' + style={stylesFile.table.header} + >{this.state.data.task.channel[2].name}</th> + <td style={stylesFile.table.data}> + {this.state.data.task.channel[2].value} + </td> </tr> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>{this.state.data.task.channel[3].name}</th> - <td style={stylesFile.table.data}>{this.state.data.task.channel[3].value}</td> + <th scope='row' + style={stylesFile.table.header} + >{this.state.data.task.channel[3].name}</th> + <td style={stylesFile.table.data}> + {this.state.data.task.channel[3].value} + </td> </tr> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>EEG Reference</th> - <td style={stylesFile.table.data}>{this.state.data.task.reference}</td> + <th scope='row' + style={stylesFile.table.header} + >EEG Reference</th> + <td style={stylesFile.table.data}> + {this.state.data.task.reference} + </td> </tr> <tr style={stylesFile.table.row}> - <th scope='row' style={stylesFile.table.header}>Powerline Frequency</th> - <td style={stylesFile.table.data}>{this.state.data.task.frequency.powerline}</td> + <th scope='row' + style={stylesFile.table.header} + >Powerline Frequency</th> + <td style={stylesFile.table.data}> + {this.state.data.task.frequency.powerline} + </td> </tr> </table> </div> - <div className={'col-sm-6'} style={stylesFile.div.container.download}> + <div className={'col-sm-6'} + style={stylesFile.div.container.download} + > <div className={'form-group row flex-v-center'}> - <div className={'col-xs-5'} style={stylesFile.div.element.download_title}>All Files</div> + <div className={'col-xs-5'} + style={stylesFile.div.element.download_title} + >All Files</div> <div className={'col-xs-2'}> - <a id='download_all_files' href={'/mri/jiv/get_file.php?file=' + this.state.data.downloads[4].file} target='_blank' download={this.state.data.downloads[0].file}> - <button id='btn_download_all_files' style={stylesFile.button.download}>Download</button> + <a id='download_all_files' + href={'/mri/jiv/get_file.php?file=' + + this.state.data.downloads[4].file} + target='_blank' + download={this.state.data.downloads[0].file} + > + <button id='btn_download_all_files' + style={stylesFile.button.download} + >Download</button> </a> </div> </div> <div className={'form-group row flex-v-center'}> - <div className={'col-xs-5'} style={stylesFile.div.element.download_title}>EEG File</div> + <div className={'col-xs-5'} + style={stylesFile.div.element.download_title} + >EEG File</div> <div className={'col-xs-2'}> - <a id='download_eeg_file' href={'/mri/jiv/get_file.php?file=' + this.state.data.downloads[0].file} target='_blank' download={this.state.data.downloads[0].file}> - <button id='btn_download_eeg_file' style={stylesFile.button.download}>Download</button> + <a id='download_eeg_file' + href={'/mri/jiv/get_file.php?file=' + + this.state.data.downloads[0].file} + target='_blank' + download={this.state.data.downloads[0].file} + > + <button id='btn_download_eeg_file' + style={stylesFile.button.download} + >Download</button> </a> </div> </div> <div className={'form-group row flex-v-center'}> - <div className={'col-xs-5'} style={stylesFile.div.element.download_title}>Electrode Info</div> + <div className={'col-xs-5'} + style={stylesFile.div.element.download_title} + >Electrode Info</div> <div className={'col-xs-2'}> - <a id='download_electrode_info' href={'/mri/jiv/get_file.php?file=' + this.state.data.downloads[1].file} target='_blank' download={this.state.data.downloads[0].file}> - <button id='btn_download_electrode_info' style={stylesFile.button.download}>Download</button> + <a id='download_electrode_info' + href={'/mri/jiv/get_file.php?file=' + + this.state.data.downloads[1].file} + target='_blank' + download={this.state.data.downloads[0].file} + > + <button id='btn_download_electrode_info' + style={stylesFile.button.download} + >Download</button> </a> </div> </div> <div className={'form-group row flex-v-center'}> - <div className={'col-xs-5'} style={stylesFile.div.element.download_title}>Channels Info</div> + <div className={'col-xs-5'} + style={stylesFile.div.element.download_title} + >Channels Info</div> <div className={'col-xs-2'}> - <a id='download_channels_info' href={'/mri/jiv/get_file.php?file=' + this.state.data.downloads[2].file} target='_blank' download={this.state.data.downloads[0].file}> - <button id='btn_download_channels_info' style={stylesFile.button.download}>Download</button> + <a id='download_channels_info' + href={'/mri/jiv/get_file.php?file=' + + this.state.data.downloads[2].file} + target='_blank' + download={this.state.data.downloads[0].file} + > + <button id='btn_download_channels_info' + style={stylesFile.button.download} + >Download</button> </a> </div> </div> <div className={'form-group row flex-v-center'}> - <div className={'col-xs-5'} style={stylesFile.div.element.download_title}>Events</div> + <div className={'col-xs-5'} + style={stylesFile.div.element.download_title} + >Events</div> <div className={'col-xs-2'}> - <a id='download_events' href={'/mri/jiv/get_file.php?file=' + this.state.data.downloads[3].file} target='_blank' download={this.state.data.downloads[0].file}> - <button id='btn_download_events' style={stylesFile.button.download}>Download</button> + <a id='download_events' + href={'/mri/jiv/get_file.php?file=' + + this.state.data.downloads[3].file} + target='_blank' + download={this.state.data.downloads[0].file} + > + <button id='btn_download_events' + style={stylesFile.button.download} + >Download</button> </a> </div> </div> <div className={'form-group row flex-v-center'}> - <div className={'col-xs-5'} id='fdt_title' style={stylesFile.div.element.download_title}>FDT File</div> + <div className={'col-xs-5'} + id='fdt_title' + style={stylesFile.div.element.download_title} + >FDT File</div> <div className={'col-xs-2'}> - <a id='download_fdt_file' href={'/mri/jiv/get_file.php?file=' + this.state.data.downloads[5].file} target='_blank' download={this.state.data.downloads[0].file}> - <button id='btn_download_fdt_file' style={stylesFile.button.download}>Download</button> + <a id='download_fdt_file' + href={'/mri/jiv/get_file.php?file=' + + this.state.data.downloads[5].file} + target='_blank' + download={this.state.data.downloads[0].file} + > + <button id='btn_download_fdt_file' + style={stylesFile.button.download} + >Download</button> </a> </div> </div> @@ -246,102 +333,191 @@ class FilePanel extends Component { </div> </div> - <Panel id={this.props.id + '_details'} title={'Acquisition Details for ' + this.props.title} style={stylesDetails.panel}> + <Panel id={this.props.id + '_details'} + title={'Acquisition Details for ' + this.props.title} + style={stylesDetails.panel} + > <div className={'container-fluid'}> <div className={'row'}> <div className={'col-xs-6'} style={stylesDetails.container.task}> <div className='table-responsive'> <table style={stylesDetails.table.style}> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Task Description</th> - <td style={stylesDetails.table.data}>{this.state.data.details.task.description}</td> + <th scope='row' + style={stylesDetails.table.header} + >Task Description</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.task.description} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Instructions</th> - <td style={stylesDetails.table.data}>{this.state.data.details.instructions}</td> + <th scope='row' + style={stylesDetails.table.header} + >Instructions</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.instructions} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>EEG Ground</th> - <td style={stylesDetails.table.data}>{this.state.data.details.eeg.ground}</td> + <th scope='row' + style={stylesDetails.table.header} + >EEG Ground</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.eeg.ground} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Trigger Count</th> - <td style={stylesDetails.table.data}>{this.state.data.details.trigger_count}</td> + <th scope='row' + style={stylesDetails.table.header} + >Trigger Count</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.trigger_count} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>EEG Placement Scheme</th> - <td style={stylesDetails.table.data}>{this.state.data.details.eeg.placement_scheme}</td> + <th scope='row' + style={stylesDetails.table.header} + >EEG Placement Scheme</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.eeg.placement_scheme} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Record Type</th> - <td style={stylesDetails.table.data}>{this.state.data.details.record_type}</td> + <th scope='row' + style={stylesDetails.table.header} + >Record Type</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.record_type} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>CogAtlas ID</th> - <td style={stylesDetails.table.data}>{this.state.data.details.cog.atlas_id}</td> + <th scope='row' + style={stylesDetails.table.header} + >CogAtlas ID</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.cog.atlas_id} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>CogPOID</th> - <td style={stylesDetails.table.data}>{this.state.data.details.cog.poid}</td> + <th scope='row' + style={stylesDetails.table.header} + >CogPOID</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.cog.poid} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Institution Name</th> - <td style={stylesDetails.table.data}>{this.state.data.details.institution.name}</td> + <th scope='row' + style={stylesDetails.table.header} + >Institution Name</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.institution.name} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Institution Address</th> - <td style={stylesDetails.table.data}>{this.state.data.details.institution.address}</td> + <th scope='row' + style={stylesDetails.table.header} + >Institution Address</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.institution.address} + </td> </tr> </table> </div> </div> - <div className={'col-xs-6'} style={stylesDetails.container.device}> + <div className={'col-xs-6'} + style={stylesDetails.container.device} + > <div className='table-responsive'> <table style={stylesDetails.table.style}> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Device Serial Number</th> - <td style={stylesDetails.table.data}>{this.state.data.details.device.serial_number}</td> + <th scope='row' + style={stylesDetails.table.header} + >Device Serial Number</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.device.serial_number} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Misc Channel Count</th> - <td style={stylesDetails.table.data}>{this.state.data.details.misc.channel_count}</td> + <th scope='row' + style={stylesDetails.table.header} + >Misc Channel Count</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.misc.channel_count} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Manufacturer</th> - <td style={stylesDetails.table.data}>{this.state.data.details.manufacturer.name}</td> + <th scope='row' + style={stylesDetails.table.header} + >Manufacturer</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.manufacturer.name} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Manufacturer Model Name</th> - <td style={stylesDetails.table.data}>{this.state.data.details.manufacturer.model_name}</td> + <th scope='row' + style={stylesDetails.table.header} + >Manufacturer Model Name</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.manufacturer.model_name} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Cap Manufacturer</th> - <td style={stylesDetails.table.data}>{this.state.data.details.cap.manufacturer}</td> + <th scope='row' + style={stylesDetails.table.header} + >Cap Manufacturer</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.cap.manufacturer} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Cap Model Name</th> - <td style={stylesDetails.table.data}>{this.state.data.details.cap.model_name}</td> + <th scope='row' + style={stylesDetails.table.header} + >Cap Model Name</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.cap.model_name} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Hardware Filters</th> - <td style={stylesDetails.table.data}>{this.state.data.details.hardware_filters}</td> + <th scope='row' + style={stylesDetails.table.header} + >Hardware Filters</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.hardware_filters} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Recording Duration</th> - <td style={stylesDetails.table.data}>{this.state.data.details.recording_duration}</td> + <th scope='row' + style={stylesDetails.table.header} + >Recording Duration</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.recording_duration} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Epoch Length</th> - <td style={stylesDetails.table.data}>{this.state.data.details.epoch_length}</td> + <th scope='row' + style={stylesDetails.table.header} + >Epoch Length</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.epoch_length} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Device Version</th> - <td style={stylesDetails.table.data}>{this.state.data.details.device.version}</td> + <th scope='row' + style={stylesDetails.table.header} + >Device Version</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.device.version} + </td> </tr> <tr style={stylesDetails.table.row}> - <th scope='row' style={stylesDetails.table.header}>Subject Artifact Description</th> - <td style={stylesDetails.table.data}>{this.state.data.details.subject_artifact_description}</td> + <th scope='row' + style={stylesDetails.table.header} + >Subject Artifact Description</th> + <td style={stylesDetails.table.data}> + {this.state.data.details.subject_artifact_description} + </td> </tr> </table> </div> diff --git a/modules/electrophysiology_browser/jsx/electrophysiologySessionView.js b/modules/electrophysiology_browser/jsx/electrophysiologySessionView.js index 913eae87108..4411be528a2 100644 --- a/modules/electrophysiology_browser/jsx/electrophysiologySessionView.js +++ b/modules/electrophysiology_browser/jsx/electrophysiologySessionView.js @@ -179,8 +179,10 @@ class ElectrophysiologySessionView extends Component { const dataURL = loris.BaseURL + '/electrophysiology_browser/sessions/'; const sessionID = this.props.sessionid; const outputTypeArg = '?outputType=' + this.state.url.params['outputType']; - return fetch(dataURL + sessionID + outputTypeArg, {credentials: 'same-origin'}) - .then((resp) => { + return fetch( + dataURL + sessionID + outputTypeArg, + {credentials: 'same-origin'} + ).then((resp) => { if (!resp.ok) { throw Error(resp.statusText); } @@ -196,8 +198,12 @@ class ElectrophysiologySessionView extends Component { } appState.database = database; this.setState(appState); - document.getElementById('nav_next').href = dataURL + data.nextSession + outputTypeArg; - document.getElementById('nav_previous').href = dataURL + data.prevSession + outputTypeArg; + document.getElementById( + 'nav_next' + ).href = dataURL + data.nextSession + outputTypeArg; + document.getElementById( + 'nav_previous' + ).href = dataURL + data.prevSession + outputTypeArg; if (data.prevSession !== '') { document.getElementById('nav_previous').style.display = 'block'; } diff --git a/modules/genomic_browser/jsx/FileUploadModal.js b/modules/genomic_browser/jsx/FileUploadModal.js index 670ace65381..599cb371c6a 100644 --- a/modules/genomic_browser/jsx/FileUploadModal.js +++ b/modules/genomic_browser/jsx/FileUploadModal.js @@ -62,7 +62,9 @@ class GenomicFileUploadModal extends Component { break; case 3: - let newResponse = xhr.responseText.substring(xhr.previousText.length); + let newResponse = xhr.responseText.substring( + xhr.previousText.length + ); let result = JSON.parse(newResponse); bar.innerHTML = String(result.message); bar.style.width = result.progress + '%'; @@ -85,7 +87,8 @@ class GenomicFileUploadModal extends Component { bar.style.width = '100%'; } }; - let url = this.props.baseURL + '/genomic_browser/ajax/genomic_file_upload.php'; + let url = this.props.baseURL + + '/genomic_browser/ajax/genomic_file_upload.php'; xhr.open('POST', url, true); xhr.send(formData); } @@ -94,24 +97,70 @@ class GenomicFileUploadModal extends Component { let footerButtons = []; if (this.state.submited) { - footerButtons.push(<button key="submited" className="btn btn-default" onClick={this.reloadPage} data-dismiss="modal">Ok</button>); + footerButtons.push( + <button + key="submited" + className="btn btn-default" + onClick={this.reloadPage} + data-dismiss="modal" + > + Ok + </button>); } else { if (this.state.readyForUpload) { - footerButtons.push(<button key="readyForUpload" className="btn btn-primary" onClick={this.handleUploadSubmit} role="button" aria-disabled="false">Upload</button>); + footerButtons.push( + <button + key="readyForUpload" + className="btn btn-primary" + onClick={this.handleUploadSubmit} + role="button" + aria-disabled="false" + > + Upload + </button>); } - footerButtons.push(<button key="cancel" className="btn btn-default" id="cancelButton" role="reset" type="reset" data-dismiss="modal">Cancel</button>); + footerButtons.push( + <button + key="cancel" + className="btn btn-default" + id="cancelButton" + role="reset" + type="reset" + data-dismiss="modal" + > + Cancel + </button>); } return ( - <div className="modal fade" id="fileUploadModal" tabIndex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div + className="modal fade" + id="fileUploadModal" + tabIndex="-1" + role="dialog" + aria-labelledby="myModalLabel" + aria-hidden="true" + > <div className="modal-dialog"> <div className="modal-content"> <div className="modal-header"> - <button type="button" className="close" data-dismiss="modal"><span aria-hidden="true">×</span><span className="sr-only">Close</span></button> - <h3 className="modal-title" id="myModalLabel">Upload File</h3> + <button + type="button" + className="close" + data-dismiss="modal" + > + <span aria-hidden="true">×</span> + <span className="sr-only">Close</span> + </button> + <h3 className="modal-title" id="myModalLabel"> + Upload File + </h3> </div> <div className="modal-body"> - <UploadForm baseURL={this.props.baseURL} validate={this.validateForm}/> + <UploadForm + baseURL={this.props.baseURL} + validate={this.validateForm} + /> </div> <div className="modal-footer"> {footerButtons} @@ -159,29 +208,80 @@ class UploadForm extends Component { let instructions = []; let inputs = []; - inputs.push(<FileTypeSelect key="fileType" baseURL={this.props.baseURL} multiple={false} onFileTypeChange={this.handleFileTypeChange} name="fileType" label="File type:"/>); + inputs.push( + <FileTypeSelect + key="fileType" + baseURL={this.props.baseURL} + multiple={false} + onFileTypeChange={this.handleFileTypeChange} + name="fileType" + label="File type:" + /> + ); switch (this.state.fileType) { case 'Methylation beta-values': inputs.push(<FileInput key="fileData" name="fileData" label="File :"/>); - inputs.push(<TextAreaInput key="description" name="description" label="Description :" />); + inputs.push( + <TextAreaInput + key="description" + name="description" + label="Description :" + /> + ); if (!this.state.useColumnHeaders) { - inputs.push(<FileInput key="fileMapping" name="fileMapping" label="Mapping :"/>); + inputs.push( + <FileInput + key="fileMapping" + name="fileMapping" + label="Mapping :" + /> + ); } - inputs.push(<CheckboxInput key="pscidColumn" handleChange={this.handleCheckboxChange} checked={this.state.useColumnHeaders} name="pscidColumn" />); - inputs.push(<ProgressBar key="progressbar" name="progressbar" label="Progress :" />); + inputs.push( + <CheckboxInput + key="pscidColumn" + handleChange={this.handleCheckboxChange} + checked={this.state.useColumnHeaders} + name="pscidColumn" + /> + ); + inputs.push( + <ProgressBar + key="progressbar" + name="progressbar" + label="Progress :" + /> + ); break; case 'Other': inputs.push(<FileInput key="fileData" name="fileData" label="File :"/>); - inputs.push(<TextAreaInput key="description" name="description" label="Description :" />); - inputs.push(<ProgressBar key="progressbar" name="progressbar" label="Progress :" />); + inputs.push( + <TextAreaInput + key="description" + name="description" + label="Description :" + /> + ); + inputs.push( + <ProgressBar + key="progressbar" + name="progressbar" + label="Progress :" + /> + ); break; default: // noop } return ( - <form name="uploadForm" id="uploadForm" encType="multipart/form-data" method="POST"> + <form + name="uploadForm" + id="uploadForm" + encType="multipart/form-data" + method="POST" + > <div className="row"> {instructions} {inputs} @@ -226,7 +326,10 @@ class FileTypeSelect extends Component { xhr.previousText = xhr.responseText; break; case 4: - let fileType = [{genomicFileType: ''}].concat(JSON.parse(xhr.responseText)); + let fileType = [{genomicFileType: ''}] + .concat( + JSON.parse(xhr.responseText) + ); self.setState({availableFileType: fileType}); break; default: @@ -236,22 +339,39 @@ class FileTypeSelect extends Component { console.error('Exception: ' + e); } }; - let url = this.props.baseURL + '/AjaxHelper.php?Module=genomic_browser&script=get_genomic_file_type.php'; + let url = this.props.baseURL + + '/AjaxHelper.php' + + '?Module=genomic_browser' + + '&script=get_genomic_file_type.php'; xhr.open('POST', url, true); xhr.send(); } render() { let options = this.state.availableFileType.map(function(e) { - return (<option key={e.genomicFileType} value={e.genomicFileType}>{e.genomicFileType}</option>); + return ( + <option key={e.genomicFileType} value={e.genomicFileType}> + {e.genomicFileType} + </option> + ); }); return ( <div className="col-xs-12 form-group"> - <label htmlFor={this.props.name} className="col-xs-3">{this.props.label}<font color="red"><sup> *</sup></font></label> + <label htmlFor={this.props.name} className="col-xs-3"> + {this.props.label} + <font color="red"> + <sup> *</sup> + </font> + </label> <div className="col-xs-9"> - <select name={this.props.name} id={this.props.name} className="form-fields form-control input-sm" onChange={this.props.onFileTypeChange}> - {options} + <select + name={this.props.name} + id={this.props.name} + className="form-fields form-control input-sm" + onChange={this.props.onFileTypeChange} + > + {options} </select> </div> </div> @@ -280,9 +400,17 @@ class FileInput extends Component { render() { return ( <div className="col-xs-12 form-group"> - <label className="col-xs-3" htmlFor={this.props.name}>{this.props.label}</label> + <label className="col-xs-3" htmlFor={this.props.name}> + {this.props.label} + </label> <div className="col-xs-9"> - <input type="file" name={this.props.name} id={this.props.name} onChange={this.handleChange} className="fileUpload"/> + <input + type="file" + name={this.props.name} + id={this.props.name} + onChange={this.handleChange} + className="fileUpload" + /> </div> </div> ); @@ -303,9 +431,19 @@ class TextAreaInput extends Component { render() { return ( <div className="col-xs-12 form-group"> - <label className="col-xs-3" htmlFor={this.props.name}>{this.props.label}</label> + <label className="col-xs-3" htmlFor={this.props.name}> + {this.props.label} + </label> <div className="col-xs-9"> - <textarea cols="20" rows="3" name={this.props.name} onChange={this.handleChange} id={this.props.name} style={{border: '2px inset'}} className="ui-corner-all form-fields form-control input-sm" /> + <textarea + cols="20" + rows="3" + name={this.props.name} + onChange={this.handleChange} + id={this.props.name} + style={{border: '2px inset'}} + className="ui-corner-all form-fields form-control input-sm" + /> </div> </div> ); @@ -330,7 +468,14 @@ class CheckboxInput extends Component { <div className="form-group col-sm-12"> <label className="col-xs-3"></label> <div className="col-xs-9"> - <input className="user-success" name={this.props.name} id={this.props.name} type="checkbox" defaultChecked="true" style={{marginRight: '1em'}} /> + <input + className="user-success" + name={this.props.name} + id={this.props.name} + type="checkbox" + defaultChecked="true" + style={{marginRight: '1em'}} + /> Use PSCID in column headers {this.props.label} </div> @@ -353,10 +498,19 @@ class ProgressBar extends Component { render() { return ( <div className="col-xs-12 form-group"> - <label className="col-xs-3" htmlFor={this.props.name}>{this.props.label}</label> + <label className="col-xs-3" htmlFor={this.props.name}> + {this.props.label} + </label> <div className="col-xs-9"> <div className="progress" style={{height: '20px'}}> - <div className="progress-bar progress-bar-success" id="progressBar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"/> + <div + className="progress-bar progress-bar-success" + id="progressBar" + role="progressbar" + aria-valuenow="0" + aria-valuemin="0" + aria-valuemax="100" + /> </div> </div> </div> diff --git a/modules/genomic_browser/jsx/profileColumnFormatter.js b/modules/genomic_browser/jsx/profileColumnFormatter.js index a3e3e1ec47f..d6a46fee96e 100644 --- a/modules/genomic_browser/jsx/profileColumnFormatter.js +++ b/modules/genomic_browser/jsx/profileColumnFormatter.js @@ -52,7 +52,8 @@ function formatColumn(column, cell, rowData, rowHeaders) { <a style={{cursor: 'pointer'}} onClick={loris.loadFilteredMenuClickHandler( - 'genomic_browser/' + column.toLowerCase() + '_browser/', {DCCID: rowData[1]} + 'genomic_browser/' + column.toLowerCase() + '_browser/', + {DCCID: rowData[1]} )} > {cell} diff --git a/modules/imaging_browser/jsx/CandidateScanQCSummaryWidget.js b/modules/imaging_browser/jsx/CandidateScanQCSummaryWidget.js index fe840c34e58..38f65d42da3 100644 --- a/modules/imaging_browser/jsx/CandidateScanQCSummaryWidget.js +++ b/modules/imaging_browser/jsx/CandidateScanQCSummaryWidget.js @@ -221,7 +221,13 @@ function getColorFuncs(modalities) { obj[mlabel] = 'rgb(' + (200 - (step*i)) + ', 20, 60)'; mlabel = modalities[i] + ' - Other'; - obj[mlabel] = 'rgb(' + (200 - (step*i)) + ', ' + (200 - (step*i)) + ', ' + (200 - (step*i)) + ')'; + obj[mlabel] = 'rgb(' + + (200 - (step*i)) + + ', ' + + (200 - (step*i)) + + ', ' + + (200 - (step*i)) + + ')'; } return obj; } diff --git a/modules/imaging_browser/jsx/ImagePanel.js b/modules/imaging_browser/jsx/ImagePanel.js index 4087262d060..e7487987060 100644 --- a/modules/imaging_browser/jsx/ImagePanel.js +++ b/modules/imaging_browser/jsx/ImagePanel.js @@ -31,11 +31,23 @@ class ImagePanelHeader extends Component { let arrow; if (this.props.Expanded) { arrow = <span onClick={this.props.onToggleBody} - className="pull-right clickable glyphicon arrow glyphicon-chevron-up"> + className=" + pull-right + clickable + glyphicon + arrow + glyphicon-chevron-up + "> </span>; } else { arrow = <span onClick={this.props.onToggleBody} - className="pull-right clickable glyphicon arrow glyphicon-chevron-down"> + className=" + pull-right + clickable + glyphicon + arrow + glyphicon-chevron-down + "> </span>; } let headerButton = ( @@ -57,7 +69,10 @@ class ImagePanelHeader extends Component { <div className="panel-heading clearfix"> <input type="checkbox" data-file-id={this.props.FileID} className="mripanel user-success"/> - <h3 className="panel-title" data-toggle="tooltip" title={this.props.Filename}> + <h3 className="panel-title" + data-toggle="tooltip" + title={this.props.Filename} + > {this.props.Filename} </h3> {QCStatusLabel} @@ -95,8 +110,14 @@ class ImagePanelHeadersTable extends Component { render() { return ( - <table className= - "table table-hover table-bordered header-info col-xs-12 dynamictable"> + <table className=" + table + table-hover + table-bordered + header-info + col-xs-12 + dynamictable + "> <tbody> <tr> <th className="info col-xs-2">Voxel Size</th> diff --git a/modules/imaging_qc/jsx/imagingQCIndex.js b/modules/imaging_qc/jsx/imagingQCIndex.js index d8759902088..78c8f16be9e 100644 --- a/modules/imaging_qc/jsx/imagingQCIndex.js +++ b/modules/imaging_qc/jsx/imagingQCIndex.js @@ -29,15 +29,20 @@ class ImagingQCIndex extends Component { switch (column) { case 'Scan Done in MRI PF': if (cell == 'Yes') { - let mpfURL = loris.BaseURL + '/instruments/mri_parameter_form/?commentID=' + - row.CommentID + '&sessionID=' + row['Session ID'] + - '&candID=' + row.DCCID; + let mpfURL = loris.BaseURL + + '/instruments/mri_parameter_form/?commentID=' + + row.CommentID + + '&sessionID=' + + row['Session ID'] + + '&candID=' + + row.DCCID; result = <td><a href={mpfURL}>{cell}</a></td>; } case 'Scan Location': if (cell == 'In Imaging Browser') { - let imgURL = loris.BaseURL + '/imaging_browser/viewSession/?sessionID=' + - row['Session ID']; + let imgURL = loris.BaseURL + + '/imaging_browser/viewSession/?sessionID=' + + row['Session ID']; result = <td><a href={imgURL}>{cell}</a></td>; } case 'Tarchive': diff --git a/modules/imaging_uploader/jsx/ImagingUploader.js b/modules/imaging_uploader/jsx/ImagingUploader.js index 4fb12b3a405..6834d360963 100644 --- a/modules/imaging_uploader/jsx/ImagingUploader.js +++ b/modules/imaging_uploader/jsx/ImagingUploader.js @@ -170,9 +170,11 @@ class ImagingUploader extends Component { row['Number Of MINC Created'] - row['Number Of MINC Inserted']; let patientName = row.PatientName; - violatedScans = <a onClick={this.openViolatedScans.bind(null, patientName)}> + violatedScans = <a + onClick={this.openViolatedScans.bind(null, patientName)} + > ({numViolatedScans} violated scans) - </a>; + </a>; } return ( @@ -225,7 +227,11 @@ class ImagingUploader extends Component { <TextboxElement {... this.state.data.form.candID} /> <TextboxElement {... this.state.data.form.pSCID} /> <SelectElement {... this.state.data.form.visitLabel} /> - <ButtonElement type='reset' label='Clear Filters' onUserInput={this.resetFilters}/> + <ButtonElement + type='reset' + label='Clear Filters' + onUserInput={this.resetFilters} + /> </FilterForm> </div> <div className='col-md-7'> @@ -247,7 +253,9 @@ class ImagingUploader extends Component { form={this.state.data.form} mriList={this.state.data.mriList} maxUploadSize={this.state.data.maxUploadSize} - imagingUploaderAutoLaunch={this.state.data.imagingUploaderAutoLaunch} + imagingUploaderAutoLaunch={ + this.state.data.imagingUploaderAutoLaunch + } /> </TabPane> </Tabs> diff --git a/modules/imaging_uploader/jsx/LogPanel.js b/modules/imaging_uploader/jsx/LogPanel.js index 688a5578ac0..1b1f79e6651 100644 --- a/modules/imaging_uploader/jsx/LogPanel.js +++ b/modules/imaging_uploader/jsx/LogPanel.js @@ -86,9 +86,9 @@ class LogPanel extends Component { this.setState({logText: uploadProgress.getProgressText()}); // If the pipeline is still running, start polling // If the pipeline is not running, end the polling (if any was started) - this.setServerPolling( - uploadProgress.getPipelineStatus() === UploadProgress.PIPELINE_STATUS_RUNNING - ); + const pipelineStatus = uploadProgress.getPipelineStatus(); + const pipelineStatusRunning = UploadProgress.PIPELINE_STATUS_RUNNING; + this.setServerPolling(pipelineStatus === pipelineStatusRunning); }.bind(this)); // post call } diff --git a/modules/imaging_uploader/jsx/UploadForm.js b/modules/imaging_uploader/jsx/UploadForm.js index a40e5e9e41f..3f7731cda6d 100644 --- a/modules/imaging_uploader/jsx/UploadForm.js +++ b/modules/imaging_uploader/jsx/UploadForm.js @@ -52,7 +52,8 @@ class UploadForm extends Component { delete formData.pSCID; delete formData.visitLabel; } else if (typeof formData.mriFile !== 'undefined') { - let patientName = formData.mriFile.name.replace(/\.[a-z]+\.?[a-z]+?$/i, ''); + let patientName = formData.mriFile.name + .replace(/\.[a-z]+\.?[a-z]+?$/i, ''); let ids = patientName.split('_'); formData.candID = ids[1]; formData.pSCID = ids[0]; @@ -104,7 +105,9 @@ class UploadForm extends Component { }); let errorMessage = { - mriFile: 'The file ' + fileName + ' must be of type .tgz, .tar.gz or .zip.', + mriFile: 'The file ' + + fileName + + ' must be of type .tgz, .tar.gz or .zip.', candID: undefined, pSCID: undefined, visitLabel: undefined, @@ -125,7 +128,8 @@ class UploadForm extends Component { if (!data.candID || !data.pSCID || !data.visitLabel) { swal({ title: 'Incorrect file name!', - text: 'Could not determine PSCID, CandID and Visit Label based on the filename!\n', + text: 'Could not determine PSCID, CandID and Visit Label ' + + 'based on the filename!\n', type: 'error', confirmButtonText: 'OK', }); @@ -148,7 +152,8 @@ class UploadForm extends Component { if (mriFile.status === 'Success') { swal({ title: 'File already exists!', - text: 'A file with this name has already successfully passed the MRI pipeline!\n', + text: 'A file with this name has already successfully passed ' + + 'the MRI pipeline!\n', type: 'error', confirmButtonText: 'OK', }); @@ -159,7 +164,8 @@ class UploadForm extends Component { if (mriFile.status === 'In Progress...') { swal({ title: 'File is currently processing!', - text: 'A file with this name is currently going through the MRI pipeline!\n', + text: 'A file with this name is currently going through ' + + 'the MRI pipeline!\n', type: 'error', confirmButtonText: 'OK', }); @@ -170,7 +176,8 @@ class UploadForm extends Component { if (mriFile.status === 'Failure') { swal({ title: 'Are you sure?', - text: 'A file with this name already exists!\n Would you like to overwrite the existing file?', + text: 'A file with this name already exists!\n ' + + 'Would you like to overwrite the existing file?', type: 'warning', showCancelButton: true, confirmButtonText: 'Yes, I am sure!', @@ -188,8 +195,9 @@ class UploadForm extends Component { if (mriFile.status === 'Not Started') { swal({ title: 'Are you sure?', - text: 'A file with this name has been uploaded but has not yet been processed by the MRI pipeline.' + - '\n Would you like to overwrite the existing file?', + text: 'A file with this name has been uploaded ' + + 'but has not yet been processed by the MRI pipeline.\n ' + + 'Would you like to overwrite the existing file?', type: 'warning', showCancelButton: true, confirmButtonText: 'Yes, I am sure!', @@ -258,8 +266,9 @@ class UploadForm extends Component { if (this.props.imagingUploaderAutoLaunch === 'true' || this.props.imagingUploaderAutoLaunch === '1' ) { - text = 'Processing of this file by the MRI pipeline has started\n' + - 'Select this upload in the result table to view the processing progress'; + text = 'Processing of this file by the MRI pipeline has started\n' + + 'Select this upload in the result table ' + + 'to view the processing progress'; } swal({ title: 'Upload Successful!', @@ -285,11 +294,17 @@ class UploadForm extends Component { }; } else if (error.status == 413) { errorMessage = { - 'mriFile': ['Please make sure files are not larger than ' + this.props.maxUploadSize], + 'mriFile': [ + 'Please make sure files are not larger than ' + + this.props.maxUploadSize, + ], }; } else { errorMessage = { - 'mriFile': ['Upload failed: received HTTP response code ' + error.status], + 'mriFile': [ + 'Upload failed: received HTTP response code ' + + error.status, + ], }; } for (let i in errorMessage) { @@ -308,7 +323,11 @@ class UploadForm extends Component { text: messageToPrint, type: 'error', }); - this.setState({uploadProgress: -1, errorMessage: errorMessage, hasError: hasError}); + this.setState({ + uploadProgress: -1, + errorMessage: errorMessage, + hasError: hasError, + }); }, }); } diff --git a/modules/instrument_builder/jsx/react.instrument_builder.js b/modules/instrument_builder/jsx/react.instrument_builder.js index 9525fbd87c5..453b3804102 100644 --- a/modules/instrument_builder/jsx/react.instrument_builder.js +++ b/modules/instrument_builder/jsx/react.instrument_builder.js @@ -103,7 +103,11 @@ class LoadPane extends Component { return ( <TabPane Title='Load Instrument' {...this.props}> <div className='col-sm-6 col-xs-12'> - <div id='load_alert' style={{display: alert.display}} className={alert.class} role='alert'> + <div id='load_alert' + style={{display: alert.display}} + className={alert.class} + role='alert' + > <button type='button' className='close' onClick={this.resetAlert}> <span aria-hidden='true'>×</span> </button> @@ -329,10 +333,14 @@ class DisplayElements extends Component { <LorisElement element={element}/> </td> <td style={colStyles}> - <button onClick={this.props.editElement.bind(null, i)} className="button"> + <button onClick={this.props.editElement.bind(null, i)} + className="button" + > Edit </button> - <button onClick={this.props.deleteElement.bind(null, i)} className="button"> + <button onClick={this.props.deleteElement.bind(null, i)} + className="button" + > Delete </button> </td> @@ -551,11 +559,19 @@ class BuildPane extends Component { return ( <TabPane Title='Build Instrument' {...this.props}> <div className='form-group col-xs-12'> - <label htmlFor='selected-input' className='col-xs-2 col-sm-1 control-label'>Page:</label> + <label htmlFor='selected-input' + className='col-xs-2 col-sm-1 control-label' + >Page:</label> <div className='col-sm-4'> <div className='btn-group'> - <button id='selected-input' type='button' className='btn btn-default dropdown-toggle' data-toggle='dropdown'> - <span id='search_concept'>{this.state.Elements[this.state.currentPage].Description}</span> + <button id='selected-input' + type='button' + className='btn btn-default dropdown-toggle' + data-toggle='dropdown' + > + <span id='search_concept'> + {this.state.Elements[this.state.currentPage].Description} + </span> <span className='caret'/> </button> <ul className='dropdown-menu' role='menu'> @@ -572,7 +588,10 @@ class BuildPane extends Component { draggable = {draggable} /> <div className='row'> - <AddElement updateQuestions={this.addQuestion} addPage={this.addPage}/> + <AddElement + updateQuestions={this.addQuestion} + addPage={this.addPage} + /> </div> </TabPane> ); @@ -598,7 +617,10 @@ class InstrumentBuilderApp extends Component { saveInstrument() { // Call to external function, passing it the save information and the elements // to save - Instrument.save(this.refs.savePane.state, this.refs.buildPane.state.Elements); + Instrument.save( + this.refs.savePane.state, + this.refs.buildPane.state.Elements + ); } // Load an instrument loadCallback(elements, info) { diff --git a/modules/instrument_builder/jsx/react.questions.js b/modules/instrument_builder/jsx/react.questions.js index c4fb7309424..5b4d4c722c7 100644 --- a/modules/instrument_builder/jsx/react.questions.js +++ b/modules/instrument_builder/jsx/react.questions.js @@ -104,12 +104,18 @@ class QuestionText extends Component { let errorClass = 'form-group'; if (this.props.element.error && this.props.element.error.questionText) { // If an error is present, display the error - errorMessage = (<font className="form-error">{this.props.element.error.questionText}</font>); + errorMessage = ( + <font className="form-error"> + {this.props.element.error.questionText} + </font> + ); errorClass += ' has-error'; } return ( <div className={errorClass}> - <label className="col-sm-2 control-label">{this.props.inputLabel}: </label> + <label className="col-sm-2 control-label"> + {this.props.inputLabel}: + </label> <div className="col-sm-6"> <input className="form-control col-xs-12" type="text" id="questionText" @@ -153,7 +159,11 @@ class BasicOptions extends Component { let errorClass = 'form-group'; if (this.props.element.error && this.props.element.error.questionName) { // If an error is present, display the error - errorMessage = (<font className="form-error">{this.props.element.error.questionName}</font>); + errorMessage = ( + <font className="form-error"> + {this.props.element.error.questionName} + </font> + ); errorClass += ' has-error'; } return ( @@ -290,7 +300,10 @@ class DropdownOptions extends Component { <div className="form-group"> <label className="col-sm-2 control-label">Preview: </label> <div className="col-sm-2"> - <select multiple={multi} id="selectOptions" className="form-control"> + <select multiple={multi} + id="selectOptions" + className="form-control" + > {Object.keys(options).map(function(option, key) { return (<option key={key}>{options[option]}</option>); })} @@ -346,7 +359,9 @@ class DateOptions extends Component { if (this.props.element.error && this.props.element.error.dateOption) { // If an error is present, display the error errorMessage = ( - <span className="form-error">{this.props.element.error.dateOption}</span> + <span className="form-error"> + {this.props.element.error.dateOption} + </span> ); dateOptionsClass += ' has-error'; } @@ -437,7 +452,11 @@ class NumericOptions extends Component { // If an error is present, display the error if (this.props.element.error && this.props.element.error.numeric) { - errorMessage = (<span className="form-error">{this.props.element.error.numeric}</span>); + errorMessage = ( + <span className="form-error"> + {this.props.element.error.numeric} + </span> + ); optionsClass += 'options form-group has-error'; } @@ -539,57 +558,144 @@ class ListElements extends Component { render() { return ( <div className="form-group"> - <label htmlFor="selected-input" className="col-sm-2 control-label">Question Type:</label> + <label htmlFor="selected-input" + className="col-sm-2 control-label" + >Question Type:</label> <div className="col-sm-4"> <div className="btn-group"> - <button id="selected-input" type="button" className="btn btn-default dropdown-toggle" data-toggle="dropdown"> + <button id="selected-input" + type="button" + className="btn btn-default dropdown-toggle" + data-toggle="dropdown" + > <span id="search_concept">{this.props.value} </span> <span className="caret"></span> </button> <ul className="dropdown-menu" role="menu"> <li> - <div className="col-sm-12"><h5 className="">Information</h5></div> + <div className="col-sm-12"> + <h5 className="">Information</h5> + </div> </li> - <li onClick={this.selectType.bind(this, 'header', 'Header')}> - <a id="header" className="option" title="Centered, header information">Header</a> + <li onClick={this.selectType.bind( + this, + 'header', + 'Header' + )}> + <a id="header" + className="option" + title="Centered, header information" + >Header</a> </li> - <li onClick={this.selectType.bind(this, 'label', 'Label')}> - <a id="label" className="option" title="Unemphasized display text">Label</a> + <li onClick={this.selectType.bind( + this, + 'label', + 'Label' + )}> + <a id="label" + className="option" + title="Unemphasized display text" + >Label</a> </li> - <li onClick={this.selectType.bind(this, 'score', 'Scored Field')}> - <a id="scored" className="option" title="Column which stores calculated data">Scored Field</a> + <li onClick={this.selectType.bind( + this, + 'score', + 'Scored Field' + )}> + <a id="scored" + className="option" + title="Column which stores calculated data" + >Scored Field</a> </li> <li className="divider"></li> <li> - <div className="col-sm-12"><h5 className="">Data entry</h5></div> + <div className="col-sm-12"> + <h5 className="">Data entry</h5> + </div> </li> - <li onClick={this.selectType.bind(this, 'textbox', 'Textbox')}> - <a id="textbox" className="option" title="Text box for user data entry">Textbox</a> + <li onClick={this.selectType.bind( + this, + 'textbox', + 'Textbox' + )}> + <a id="textbox" + className="option" + title="Text box for user data entry" + >Textbox</a> </li> - <li onClick={this.selectType.bind(this, 'textarea', 'Textarea')}> - <a id="textarea" className="option" title="Larger text area for data entry">Textarea</a> + <li onClick={this.selectType.bind( + this, + 'textarea', + 'Textarea' + )}> + <a id="textarea" + className="option" + title="Larger text area for data entry" + >Textarea</a> </li> - <li onClick={this.selectType.bind(this, 'dropdown', 'Dropdown')}> - <a id="dropdown" className="option" title="Dropdown menu for users to select data from">Dropdown</a> + <li onClick={this.selectType.bind( + this, + 'dropdown', + 'Dropdown' + )}> + <a id="dropdown" + className="option" + title={'Dropdown menu for users to select ' + + 'data from'} + >Dropdown</a> </li> - <li onClick={this.selectType.bind(this, 'multiselect', 'Multiselect')}> - <a id="multiselect" className="option" title="Data entry where multiple options may be selected">Multiselect</a> + <li onClick={this.selectType.bind( + this, + 'multiselect', + 'Multiselect' + )}> + <a id="multiselect" + className="option" + title={'Data entry where multiple options ' + + 'may be selected'} + >Multiselect</a> </li> - <li onClick={this.selectType.bind(this, 'date', 'Date')}> - <a id="date" className="option" title="User data entry of a date">Date</a> + <li onClick={this.selectType.bind( + this, + 'date', + 'Date' + )}> + <a id="date" + className="option" + title="User data entry of a date" + >Date</a> </li> - <li onClick={this.selectType.bind(this, 'numeric', 'Numeric')}> - <a id="numeric" className="option" title="User data entry of a number">Numeric</a> + <li onClick={ + this.selectType.bind(this, 'numeric', 'Numeric') + }> + <a id="numeric" + className="option" + title="User data entry of a number" + >Numeric</a> </li> <li className="divider"></li> <li> - <div className="col-sm-12"><h5 className="">Formatting</h5></div> + <div className="col-sm-12"> + <h5 className="">Formatting</h5> + </div> </li> - <li onClick={this.selectType.bind(this, 'line', 'Blank Line')}> - <a id="line" className="option" title="Empty line">Blank Line</a> + <li onClick={ + this.selectType.bind(this, 'line', 'Blank Line') + }> + <a id="line" + className="option" + title="Empty line" + >Blank Line</a> </li> - <li onClick={this.selectType.bind(this, 'page-break', 'Page Break')}> - <a id="page-break" className="option" title="Start a new page">Page Break</a> + <li onClick={this.selectType.bind( + this, + 'page-break', + 'Page Break' + )}> + <a id="page-break" + className="option" + title="Start a new page" + >Page Break</a> </li> </ul> </div> @@ -609,9 +715,15 @@ class AddElement extends Component { if (this.props !== undefined && this.props.element) { // Editing an element, set to elements state this.state = { - Options: Instrument.clone(this.props.element.Options === undefined ? {} : this.props.element.Options ), + Options: Instrument.clone(this.props.element.Options === undefined ? + {} : + this.props.element.Options + ), Description: Instrument.clone(this.props.element.Description), - Name: Instrument.clone(this.props.element.Name === undefined ? '' : this.props.element.Name), + Name: Instrument.clone(this.props.element.Name === undefined ? + '' : + this.props.element.Name + ), selected: Instrument.clone(this.props.element.selected), }; } else { @@ -679,10 +791,16 @@ class AddElement extends Component { }); hasError = true; } - if (minYear > 9999 || minYear < 1000 || maxYear > 9999 || maxYear < 1000) { + if (minYear > 9999 + || minYear < 1000 + || maxYear > 9999 + || maxYear < 1000 + ) { let temp = (this.state.error) ? this.state.error : {}; - temp.dateOption = 'The year must have exactly 4 digits. Please choose an integer number between 1000 and 9999.'; + temp.dateOption = 'The year must have exactly 4 digits. ' + + 'Please choose an integer number ' + + 'between 1000 and 9999.'; this.setState({ error: temp, }); @@ -832,7 +950,9 @@ class AddElement extends Component { // setting any values this.setState(function(state) { let temp = state.options; - let option = multi ? $('#newmultiSelectOption').val() : $('#newSelectOption').val(); + let option = multi ? + $('#newmultiSelectOption').val() : + $('#newSelectOption').val(); temp.push(option); return { options: temp, @@ -854,25 +974,44 @@ class AddElement extends Component { switch (this.state.selected.id) { case 'header': case 'label': - questionInput = <QuestionText updateState={this.updateState} element={this.state}/>; + questionInput = <QuestionText + updateState={this.updateState} + element={this.state} + />; break; case 'page-break': - questionInput = <QuestionText updateState={this.updateState} element={this.state} inputLabel={'Page Name'}/>; + questionInput = <QuestionText + updateState={this.updateState} + element={this.state} + inputLabel={'Page Name'} + />; break; case 'score': case 'textbox': case 'textarea': - questionInput = <BasicOptions updateState={this.updateState} element={this.state}/>; + questionInput = <BasicOptions + updateState={this.updateState} + element={this.state} + />; break; case 'multiselect': case 'dropdown': - questionInput = <DropdownOptions updateState={this.updateState} element={this.state}/>; + questionInput = <DropdownOptions + updateState={this.updateState} + element={this.state} + />; break; case 'date': - questionInput = <DateOptions updateState={this.updateState} element={this.state}/>; + questionInput = <DateOptions + updateState={this.updateState} + element={this.state} + />; break; case 'numeric': - questionInput = <NumericOptions updateState={this.updateState} element={this.state}/>; + questionInput = <NumericOptions + updateState={this.updateState} + element={this.state} + />; break; default: break; diff --git a/modules/instrument_manager/jsx/uploadForm.js b/modules/instrument_manager/jsx/uploadForm.js index 43f816b18e0..27e6995c282 100644 --- a/modules/instrument_manager/jsx/uploadForm.js +++ b/modules/instrument_manager/jsx/uploadForm.js @@ -79,7 +79,13 @@ class InstrumentUploadForm extends Component { onUserInput={this.fileSelected} value={this.state.selectedFile} /> - <button className="btn btn-default" onClick={this.upload} disabled={disabled()}>Install</button> + <button + className="btn btn-default" + onClick={this.upload} + disabled={disabled()} + > + Install + </button> </div> </div> </div> diff --git a/modules/instruments/jsx/VisitInstrumentList.js b/modules/instruments/jsx/VisitInstrumentList.js index cb798721cf4..5ab39a7fdab 100644 --- a/modules/instruments/jsx/VisitInstrumentList.js +++ b/modules/instruments/jsx/VisitInstrumentList.js @@ -185,16 +185,27 @@ class VisitInstrumentList extends Component { }); if (this.state.instruments.length === 0) { - instruments = <div>Visit has no registered instruments in test battery.</div>; + instruments = ( + <div> + {'Visit has no registered instruments in test battery.'} + </div> + ); } else { instruments = (<div> <h5>Instruments</h5> - <table className="table table-hover table-bordered" style={{width: '95%'}}> + <table + className="table table-hover table-bordered" + style={{width: '95%'}} + > <thead> <tr> <th>Instrument</th> - <th style={{textAlign: 'center'}}>Completion</th> - <th style={{textAlign: 'center'}}>Conflicts?</th> + <th style={{textAlign: 'center'}}> + Completion + </th> + <th style={{textAlign: 'center'}}> + Conflicts? + </th> </tr> </thead> <tbody> @@ -235,10 +246,13 @@ class VisitInstrumentList extends Component { padding: '1ex', }; - return (<div style={style} onClick={clickEnabled ? this.toggleExpanded : null} - onMouseEnter={this.toggleHover} - onMouseLeave={this.toggleHover} - > + return ( + <div + style={style} + onClick={clickEnabled ? this.toggleExpanded : null} + onMouseEnter={this.toggleHover} + onMouseLeave={this.toggleHover} + > <div style={flexcontainer}> <div style={{background: bg, width: '1%', height: '100%'}}> </div> diff --git a/modules/issue_tracker/jsx/CommentList.js b/modules/issue_tracker/jsx/CommentList.js index 016e0d6ad60..af89ffe61c8 100644 --- a/modules/issue_tracker/jsx/CommentList.js +++ b/modules/issue_tracker/jsx/CommentList.js @@ -37,7 +37,9 @@ class CommentList extends Component { const item = changes[key]; const textItems = Object.keys(item.data).map(function(index, j) { if (index == 'comment') { - comment = <div style={{marginTop: '1em'}}><Markdown content={item.data[index]} /></div>; + comment = <div style={{marginTop: '1em'}}> + <Markdown content={item.data[index]} /> + </div>; return; } return ( @@ -61,14 +63,18 @@ class CommentList extends Component { } else if (datediffSec < 60*60*24) { timestr = <span> {Math.round(datediffSec / (60*60))} hours ago</span>; } else { - timestr = <span> on {item.date.toLocaleDateString()} at {item.date.toTimeString()}</span>; + timestr = <span> + on {item.date.toLocaleDateString()} at {item.date.toTimeString()} + </span>; } return ( <div key={i}> <hr/> <div className='history-item-label'> - Updated by <span className="history-item-user">{item.user}</span>{timestr}: + Updated by + <span className="history-item-user">{item.user}</span> + {timestr}: </div> <ul className='history-item-changes'> {textItems} diff --git a/modules/issue_tracker/jsx/IssueForm.js b/modules/issue_tracker/jsx/IssueForm.js index 341aa37bb8d..332654a3358 100644 --- a/modules/issue_tracker/jsx/IssueForm.js +++ b/modules/issue_tracker/jsx/IssueForm.js @@ -37,7 +37,8 @@ class IssueForm extends Component { this.setFormData = this.setFormData.bind(this); this.isValidForm = this.isValidForm.bind(this); this.showAlertMessage = this.showAlertMessage.bind(this); - this.closeAttachmentUploadModal = this.closeAttachmentUploadModal.bind(this); + this.closeAttachmentUploadModal = this.closeAttachmentUploadModal + .bind(this); this.openAttachmentUploadModal = this.openAttachmentUploadModal.bind(this); } @@ -387,7 +388,9 @@ class IssueForm extends Component { processData: false, success: function(data) { let msgType = 'success'; - let message = this.state.isNewIssue ? 'You will be redirected to main page in 2 seconds!' : ''; + let message = this.state.isNewIssue ? + 'You will be redirected to main page in 2 seconds!' : + ''; this.showAlertMessage(msgType, message); this.setState({ submissionResult: 'success', diff --git a/modules/issue_tracker/jsx/attachments/attachmentsList.js b/modules/issue_tracker/jsx/attachments/attachmentsList.js index 74783a8b4d8..16c50f3a0ee 100644 --- a/modules/issue_tracker/jsx/attachments/attachmentsList.js +++ b/modules/issue_tracker/jsx/attachments/attachmentsList.js @@ -29,7 +29,8 @@ class AttachmentsList extends Component { }; this.deleteAttachment = this.deleteAttachment.bind(this); this.openModalAttachmentDelete = this.openModalAttachmentDelete.bind(this); - this.closeModalAttachmentDelete = this.closeModalAttachmentDelete.bind(this); + this.closeModalAttachmentDelete = this.closeModalAttachmentDelete + .bind(this); this.displayAttachmentOptions = this.displayAttachmentOptions.bind(this); } diff --git a/modules/issue_tracker/jsx/index.js b/modules/issue_tracker/jsx/index.js index e035bc903c9..2fd143ca6b2 100644 --- a/modules/issue_tracker/jsx/index.js +++ b/modules/issue_tracker/jsx/index.js @@ -8,8 +8,11 @@ window.addEventListener('load', () => { ReactDOM.render( <IssueForm Module='issue_tracker' - DataURL={`${loris.BaseURL}/issue_tracker/ajax/EditIssue.php?action=getData&issueID=${id}`} - action={`${loris.BaseURL}/issue_tracker/ajax/EditIssue.php?action=edit`} + DataURL={loris.BaseURL + + '/issue_tracker/ajax/EditIssue.php?action=getData&issueID=' + + id} + action={loris.BaseURL + + '/issue_tracker/ajax/EditIssue.php?action=edit'} issue={id} baseURL={loris.BaseURL} userHasPermission={loris.userHasPermission('issue_tracker_developer')} diff --git a/modules/issue_tracker/jsx/issueTrackerIndex.js b/modules/issue_tracker/jsx/issueTrackerIndex.js index 942e17e33e7..09cbc97caa5 100644 --- a/modules/issue_tracker/jsx/issueTrackerIndex.js +++ b/modules/issue_tracker/jsx/issueTrackerIndex.js @@ -207,10 +207,36 @@ class IssueTrackerIndex extends Component { ]; const filterPresets = [ - {label: 'All Issues', filter: {}}, - {label: 'Active Issues', filter: {status: {value: ['acknowledged', 'assigned', 'feedback', 'new', 'resolved']}}}, - {label: 'Closed Issues', filter: {status: {value: ['closed'], exactMatch: true}}}, - {label: 'My Issues', filter: {assignee: {value: this.state.data.fieldOptions.userID, exactMatch: true}}}, + { + label: 'All Issues', + filter: {}, + }, + { + label: 'Active Issues', + filter: { + status: { + value: ['acknowledged', 'assigned', 'feedback', 'new', 'resolved'], + }, + }, + }, + { + label: 'Closed Issues', + filter: { + status: { + value: ['closed'], + exactMatch: true, + }, + }, + }, + { + label: 'My Issues', + filter: { + assignee: { + value: this.state.data.fieldOptions.userID, + exactMatch: true, + }, + }, + }, ]; const addIssue = () => { diff --git a/modules/media/jsx/editFormIndex.js b/modules/media/jsx/editFormIndex.js index 5c18d905690..c63dfc782e4 100644 --- a/modules/media/jsx/editFormIndex.js +++ b/modules/media/jsx/editFormIndex.js @@ -9,8 +9,11 @@ $(function() { <div className="row"> <div className="col-md-9 col-lg-7"> <MediaEditForm - DataURL={`${loris.BaseURL}/media/ajax/FileUpload.php?action=getData&idMediaFile=${args.id}`} - action={`${loris.BaseURL}/media/ajax/FileUpload.php?action=edit`} + DataURL={loris.BaseURL + + '/media/ajax/FileUpload.php?action=getData&idMediaFile=' + + args.id} + action={loris.BaseURL + + '/media/ajax/FileUpload.php?action=edit'} /> </div> </div> diff --git a/modules/media/jsx/mediaIndex.js b/modules/media/jsx/mediaIndex.js index 3ea580f3a1d..6c2828edaf7 100644 --- a/modules/media/jsx/mediaIndex.js +++ b/modules/media/jsx/mediaIndex.js @@ -40,7 +40,10 @@ class MediaIndex extends Component { fetchData() { return fetch(this.props.dataURL, {credentials: 'same-origin'}) .then((resp) => resp.json()) - .then((data) => this.setState({data: data.Data, fieldOptions: data.fieldOptions})) + .then((data) => this.setState({ + data: data.Data, + fieldOptions: data.fieldOptions, + })) .catch((error) => { this.setState({error: true}); console.error(error); @@ -81,8 +84,9 @@ class MediaIndex extends Component { switch (column) { case 'File Name': if (this.props.hasPermission('media_write')) { - const downloadURL = loris.BaseURL + '/media/ajax/FileDownload.php?File=' + - encodeURIComponent(row['File Name']); + const downloadURL = loris.BaseURL + + '/media/ajax/FileDownload.php?File=' + + encodeURIComponent(row['File Name']); result = ( <td className={style}> <a href={downloadURL} target="_blank" download={row['File Name']}> @@ -103,7 +107,9 @@ class MediaIndex extends Component { result = <td className={style}>{cell}</td>; break; case 'Project': - result = <td className={style}>{this.state.fieldOptions.projects[cell]}</td>; + result = <td className={style}> + {this.state.fieldOptions.projects[cell]} + </td>; break; case 'Edit Metadata': if (!this.props.hasPermission('media_write')) { @@ -111,9 +117,13 @@ class MediaIndex extends Component { } const editButton = ( <TriggerableModal title="Edit Media File" label="Edit"> - <MediaEditForm - DataURL={`${loris.BaseURL}/media/ajax/FileUpload.php?action=getData&idMediaFile=${row['Edit Metadata']}`} - action={`${loris.BaseURL}/media/ajax/FileUpload.php?action=edit`} + <MediaEditForm + DataURL={loris.BaseURL + + '/media/ajax/FileUpload.php' + + '?action=getData&idMediaFile=' + + row['Edit Metadata']} + action={loris.BaseURL + + '/media/ajax/FileUpload.php?action=edit'} /* this should be passed to onSubmit function upon refactoring editForm.js*/ fetchData={this.fetchData } @@ -209,8 +219,10 @@ class MediaIndex extends Component { return ( <TabPane TabId={tabs[1].id}> <MediaUploadForm - DataURL={`${loris.BaseURL}/media/ajax/FileUpload.php?action=getData`} - action={`${loris.BaseURL}/media/ajax/FileUpload.php?action=upload`} + DataURL={loris.BaseURL + + '/media/ajax/FileUpload.php?action=getData'} + action={loris.BaseURL + + '/media/ajax/FileUpload.php?action=upload'} maxUploadSize={options.maxUploadSize} /> </TabPane> diff --git a/modules/media/jsx/uploadForm.js b/modules/media/jsx/uploadForm.js index 9de52d2a712..5348697d4de 100644 --- a/modules/media/jsx/uploadForm.js +++ b/modules/media/jsx/uploadForm.js @@ -86,8 +86,10 @@ class MediaUploadForm extends Component { const visits = this.state.formData.pscid ? this.state.Data.sessionData[this.state.formData.pscid].visits : {}; - const instruments = this.state.formData.pscid && this.state.formData.visitLabel ? - this.state.Data.sessionData[this.state.formData.pscid].instruments[this.state.formData.visitLabel] : + const instruments = this.state.formData.pscid + && this.state.formData.visitLabel ? + this.state.Data.sessionData[this.state.formData.pscid] + .instruments[this.state.formData.visitLabel] : {}; return ( <div className='row'> @@ -209,7 +211,9 @@ class MediaUploadForm extends Component { let formData = this.state.formData; let formRefs = this.refs; - let mediaFiles = this.state.Data.mediaFiles ? this.state.Data.mediaFiles : []; + let mediaFiles = this.state.Data.mediaFiles ? + this.state.Data.mediaFiles : + []; // Validate the form if (!this.isValidForm(formRefs, formData)) { @@ -218,7 +222,9 @@ class MediaUploadForm extends Component { // Validate uploaded file name let instrument = formData.instrument ? formData.instrument : null; - let fileName = formData.file ? formData.file.name.replace(/\s+/g, '_') : null; + let fileName = formData.file ? + formData.file.name.replace(/\s+/g, '_') : + null; let requiredFileName = this.getValidFileName( formData.pscid, formData.visitLabel, instrument ); @@ -236,7 +242,8 @@ class MediaUploadForm extends Component { if (isDuplicate >= 0) { swal({ title: 'Are you sure?', - text: 'A file with this name already exists!\n Would you like to override existing file?', + text: 'A file with this name already exists!\n ' + + 'Would you like to override existing file?', type: 'warning', showCancelButton: true, confirmButtonText: 'Yes, I am sure!', diff --git a/modules/module_manager/jsx/modulemanager.js b/modules/module_manager/jsx/modulemanager.js index 6a5ae397004..aca80a3c410 100644 --- a/modules/module_manager/jsx/modulemanager.js +++ b/modules/module_manager/jsx/modulemanager.js @@ -78,21 +78,27 @@ class ModuleManagerIndex extends Component { if (success === true) { swal.fire({ title: 'Success!', - text: 'Updated ' + id + ' status!' + - 'To apply changes the interface must be reloaded. proceed ?', + text: 'Updated ' + id + ' status! ' + + 'To apply changes the interface must be reloaded. ' + + 'Proceed ?', type: 'success', showCancelButton: true, confirmButtonText: 'Reload the page', cancelButtonText: 'Continue', }).then((status) => { if (status.value) { - window.location.href = this.props.BaseURL + '/module_manager'; + window.location.href = this.props.BaseURL + + '/module_manager'; } }); } else { // If we get here something went very wrong, because somehow // a module was toggled that isn't in the table. - swal.fire('Error!', 'Could not find module ' + id + '.', 'error'); + swal.fire( + 'Error!', + 'Could not find module ' + id + '.', + 'error' + ); } } }); diff --git a/modules/mri_violations/jsx/columnFormatterUnresolved.js b/modules/mri_violations/jsx/columnFormatterUnresolved.js index ad0dc88c4aa..ef7d8ba1fb9 100644 --- a/modules/mri_violations/jsx/columnFormatterUnresolved.js +++ b/modules/mri_violations/jsx/columnFormatterUnresolved.js @@ -65,7 +65,11 @@ function formatColumn(column, cell, rowData, rowHeaders) { hashName = 'resolvable[' + row.Hash + ']'; return ( <td> - <select name= {hashName} className="form-control input-sm" id="resolution-status"> + <select + name= {hashName} + className="form-control input-sm" + id="resolution-status" + > <option value="unresolved" >Unresolved</option> <option value="reran" >Reran</option> <option value="emailed" >Emailed site/pending</option> diff --git a/modules/new_profile/jsx/NewProfileIndex.js b/modules/new_profile/jsx/NewProfileIndex.js index b78075ad5f7..671ea8450bf 100644 --- a/modules/new_profile/jsx/NewProfileIndex.js +++ b/modules/new_profile/jsx/NewProfileIndex.js @@ -252,8 +252,12 @@ class NewProfileIndex extends React.Component { } else { profile = ( <div> - <p>New candidate created. DCCID: {this.state.newData.candID} PSCID: {this.state.newData.pscid} </p> - <p><a href = {'/' + this.state.newData.candID}> Access this candidate </a></p> + <p>{'New candidate created. ' + + 'DCCID: ' + this.state.newData.candID + ' ' + + 'PSCID: ' + this.state.newData.pscid + ' '}</p> + <p><a href = {'/' + this.state.newData.candID}> + Access this candidate + </a></p> <p><a href = "/new_profile/" > Recruit another candidate </a></p> </div> ); diff --git a/modules/publication/jsx/projectFields.js b/modules/publication/jsx/projectFields.js index 9d4f8c3d8e9..fa3180e34fd 100644 --- a/modules/publication/jsx/projectFields.js +++ b/modules/publication/jsx/projectFields.js @@ -111,7 +111,9 @@ class ProjectFormFields extends React.Component { }, function(willDelete) { if (willDelete) { - let url = loris.BaseURL + '/publication/ajax/FileDelete.php?uploadID=' + uploadID; + let url = loris.BaseURL + + '/publication/ajax/FileDelete.php?uploadID=' + + uploadID; $.ajax( url, { @@ -129,7 +131,9 @@ class ProjectFormFields extends React.Component { // Create download link & edit fields for existing files if (this.props.files) { this.props.files.forEach(function(f) { - let downloadURL = loris.BaseURL + '/publication/ajax/FileDownload.php?File=' + encodeURIComponent(f.Filename); + let downloadURL = loris.BaseURL + + '/publication/ajax/FileDownload.php?File=' + + encodeURIComponent(f.Filename); let link = ( <span> <a href={downloadURL}>{f.Filename}</a> @@ -142,9 +146,15 @@ class ProjectFormFields extends React.Component { </span> ); let existFileFlag = 'existingUpload_'; - let pubType = existFileFlag + 'publicationType_' + f.PublicationUploadID; - let pubCit = existFileFlag + 'publicationCitation_' + f.PublicationUploadID; - let pubVer = existFileFlag + 'publicationVersion_' + f.PublicationUploadID; + let pubType = existFileFlag + + 'publicationType_' + + f.PublicationUploadID; + let pubCit = existFileFlag + + 'publicationCitation_' + + f.PublicationUploadID; + let pubVer = existFileFlag + + 'publicationVersion_' + + f.PublicationUploadID; let pubTypeStr = this.props.uploadTypes[this.props.formData[pubType]]; fileFields.push( <div> @@ -225,7 +235,9 @@ class ProjectFormFields extends React.Component { collabEmails.push( <EmailElement name={name} - label={c.name + (c.name.slice(-1) === 's' ? '\'' : '\'s') + ' Email'} + label={c.name + (c.name.slice(-1) === 's' ? + '\'' : + '\'s') + ' Email'} onUserInput={this.setCollaboratorEmail} toggleEmailNotify={this.toggleEmailNotify} errorMessage={this.props.formErrors[name]} @@ -412,7 +424,9 @@ class ProjectFormFields extends React.Component { text={voiHelp} /> {fileFields} - <ButtonElement label={this.props.editMode ? 'Submit' : 'Propose Project'} + <ButtonElement label={this.props.editMode ? + 'Submit' : + 'Propose Project'} /> </div> ); diff --git a/modules/publication/jsx/publicationIndex.js b/modules/publication/jsx/publicationIndex.js index ec924b9567a..5c57a0ec8df 100644 --- a/modules/publication/jsx/publicationIndex.js +++ b/modules/publication/jsx/publicationIndex.js @@ -5,7 +5,13 @@ import PublicationUploadForm from './uploadForm.js'; class PublicationIndex extends React.Component { constructor() { super(); - loris.hiddenHeaders = ['Description', 'Keywords', 'Variables Of Interest', 'Publication ID', 'Collaborators']; + loris.hiddenHeaders = [ + 'Description', + 'Keywords', + 'Variables Of Interest', + 'Publication ID', + 'Collaborators', + ]; this.state = { isLoaded: false, filter: {}, @@ -72,8 +78,10 @@ class PublicationIndex extends React.Component { proposalTab = ( <TabPane TabId={tabList[1].id}> <PublicationUploadForm - DataURL={`${loris.BaseURL}/publication/ajax/getData.php?action=getData`} - action={`${loris.BaseURL}/publication/ajax/FileUpload.php?action=upload`} + DataURL={loris.BaseURL + +'/publication/ajax/getData.php?action=getData'} + action={loris.BaseURL + + '/publication/ajax/FileUpload.php?action=upload'} editMode={false} /> </TabPane> diff --git a/modules/publication/jsx/viewProject.js b/modules/publication/jsx/viewProject.js index 9dbd2f96e77..00c2d236547 100644 --- a/modules/publication/jsx/viewProject.js +++ b/modules/publication/jsx/viewProject.js @@ -92,9 +92,15 @@ class ViewProject extends React.Component { if (data.files) { data.files.forEach(function(f) { let existFileFlag = 'existingUpload_'; - let pubType = existFileFlag + 'publicationType_' + f.PublicationUploadID; - let pubCit = existFileFlag + 'publicationCitation_' + f.PublicationUploadID; - let pubVer = existFileFlag + 'publicationVersion_' + f.PublicationUploadID; + let pubType = existFileFlag + + 'publicationType_' + + f.PublicationUploadID; + let pubCit = existFileFlag + + 'publicationCitation_' + + f.PublicationUploadID; + let pubVer = existFileFlag + + 'publicationVersion_' + + f.PublicationUploadID; formData[pubType] = f.PublicationUploadTypeID; formData[pubCit] = f.Citation; formData[pubVer] = f.Version; @@ -131,7 +137,9 @@ class ViewProject extends React.Component { let files = this.state.files; let toReturn = []; files.forEach(function(f) { - let download = loris.BaseURL + '/publication/ajax/FileDownload.php?File=' + f.Filename; + let download = loris.BaseURL + + '/publication/ajax/FileDownload.php?File=' + + f.Filename; let link = <a href={download}>{f.Filename}</a>; let uploadType = this.state.uploadTypes[f.PublicationUploadTypeID]; toReturn.push( @@ -363,7 +371,9 @@ class ViewProject extends React.Component { } // Set review button only if user does not have edit permission // to avoid having 2 submit buttons - reviewBtn = this.state.userCanEdit ? undefined : <ButtonElement label="Submit" />; + reviewBtn = this.state.userCanEdit ? + undefined : + <ButtonElement label="Submit" />; } else { const statClassMap = { Pending: 'text-warning', diff --git a/modules/publication/jsx/viewProjectIndex.js b/modules/publication/jsx/viewProjectIndex.js index 97e15e0048d..0aa07124992 100644 --- a/modules/publication/jsx/viewProjectIndex.js +++ b/modules/publication/jsx/viewProjectIndex.js @@ -8,8 +8,12 @@ $(function() { <div className="row"> <div className="col-md-9 col-lg-7"> <ViewProject - DataURL={`${loris.BaseURL}/publication/ajax/getData.php?action=getProjectData&id=${args.id}`} - action={`${loris.BaseURL}/publication/ajax/FileUpload.php?action=editProject&id=${args.id}`} + DataURL={loris.BaseURL + + '/publication/ajax/getData.php?action=getProjectData&id=' + + args.id} + action={loris.BaseURL + + '/publication/ajax/FileUpload.php?action=editProject&id=' + + args.id} /> </div> </div> diff --git a/modules/user_accounts/jsx/userAccountsIndex.js b/modules/user_accounts/jsx/userAccountsIndex.js index 874800e0a76..9982021c8f1 100644 --- a/modules/user_accounts/jsx/userAccountsIndex.js +++ b/modules/user_accounts/jsx/userAccountsIndex.js @@ -81,9 +81,9 @@ class UserAccountsIndex extends Component { case 'Project': // If user has multiple projectss, join array of sites into string result = ( - <td>{cell - .map((projectId) => this.state.data.fieldOptions.projects[projectId]) - .join(', ')} + <td>{cell.map( + (projectId) => this.state.data.fieldOptions.projects[projectId] + ).join(', ')} </td> ); break; diff --git a/webpack.config.js b/webpack.config.js index 8c7eb76da02..9556f84dea7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -178,10 +178,17 @@ const config = [ }, // Modules lorisModule('media', ['CandidateMediaWidget', 'mediaIndex']), - lorisModule('issue_tracker', ['issueTrackerIndex', 'index', 'CandidateIssuesWidget']), + lorisModule('issue_tracker', [ + 'issueTrackerIndex', + 'index', + 'CandidateIssuesWidget', + ]), lorisModule('publication', ['publicationIndex', 'viewProjectIndex']), lorisModule('document_repository', ['docIndex', 'editFormIndex']), - lorisModule('candidate_parameters', ['CandidateParameters', 'ConsentWidget']), + lorisModule('candidate_parameters', [ + 'CandidateParameters', + 'ConsentWidget', + ]), lorisModule('configuration', ['SubprojectRelations']), lorisModule('conflict_resolver', [ 'CandidateConflictsWidget', @@ -215,7 +222,11 @@ const config = [ 'electrophysiologySessionView', ]), lorisModule('genomic_browser', ['profileColumnFormatter']), - lorisModule('imaging_browser', ['ImagePanel', 'imagingBrowserIndex', 'CandidateScanQCSummaryWidget']), + lorisModule('imaging_browser', [ + 'ImagePanel', + 'imagingBrowserIndex', + 'CandidateScanQCSummaryWidget', + ]), lorisModule('instrument_builder', [ 'react.instrument_builder', 'react.questions',