Skip to content

Commit

Permalink
Updated evidence gdrive file picker and modals text align left.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Thomas committed Feb 9, 2022
1 parent 1c3a8c8 commit f56f7cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
15 changes: 10 additions & 5 deletions js/pages/results_form_PC/components/EvidenceFields.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, {useState, useEffect } from 'react';
import { HelpText } from '../components/HelpText.js'

const EvidenceFields = ({ evidenceFieldsInput, setEvidenceFieldsInput, formErrors, setFormErrors, readOnly, setWasUpdated }) => {
Expand Down Expand Up @@ -27,11 +27,16 @@ const EvidenceFields = ({ evidenceFieldsInput, setEvidenceFieldsInput, formError
setFormErrors(detectedErrors);
}

// Trigger validation when a the file picker is used
const [filePicked, setFilePicked] = useState(false);
useEffect(() => {
handleValdation();
}, [filePicked])

// File picker callback function for after file was picked
function pcFilePickerCallback(fileName, url) {
document.getElementById('id_evidence_url--pc').value = url;
document.getElementById('id_record_name--pc').value = fileName;
// validateEvidence()
// setViewButtonDisabledState();
setEvidenceFieldsInput({...evidenceFieldsInput, evidence_url: url, record_name: fileName})
setFilePicked(!filePicked);
}

let handleGDrive = (e) => {
Expand Down
4 changes: 4 additions & 0 deletions scss/_mc_tola_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,8 @@ a.helptext:hover {
.result-form__heading--pc {
display: flex;
justify-content: space-between;
}

#pc-result-modal-form {
text-align: left;
}

0 comments on commit f56f7cf

Please sign in to comment.