Skip to content

Commit

Permalink
Merge pull request #709 from episphere/stage
Browse files Browse the repository at this point in the history
Stage -> Prod Sync (May 2024 Release)
  • Loading branch information
we-ai authored May 23, 2024
2 parents 3461684 + 9725ca6 commit f761f6c
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 118 deletions.
39 changes: 22 additions & 17 deletions src/dev/identityProvider.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
export const devSSOConfig = (tenantID, provider, inputValue) => {
if(/nih.gov/i.test(inputValue)) {
if (/nih.gov/i.test(inputValue)) {
tenantID = 'NIH-SSO-qfszp';
provider = 'saml.nih-sso';
};
if(/healthpartners.com/i.test(inputValue)) {
}
if (/healthpartners.com/i.test(inputValue)) {
tenantID = 'HP-SSO-wb1zb';
provider = 'saml.healthpartner';
};
if(/hfhs.org/i.test(inputValue)) {
}
if (/hfhs.org/i.test(inputValue)) {
tenantID = 'HFHS-SSO-ay0iz';
provider = 'saml.connect-hfhs';
};
if(/sanfordhealth.org/i.test(inputValue)) {
}
if (/sanfordhealth.org/i.test(inputValue)) {
tenantID = 'SFH-SSO-cgzpj';
provider = 'saml.connect-sanford';
};
if(/uchicago.edu/i.test(inputValue)) {
}
if (/uchicago.edu/i.test(inputValue)) {
tenantID = 'UCM-SSO-tovai';
provider = 'saml.connect-uchicago';
};
if(/norc.org/i.test(inputValue)) {
}
if (/norc.org/i.test(inputValue)) {
tenantID = 'NORC-SSO-dilvf';
provider = 'saml.connect-norc';
};
if(/kp.org/i.test(inputValue)) {
}
if (/kp.org/i.test(inputValue)) {
tenantID = 'KP-SSO-wulix';
provider = 'saml.connect-kp';
};
if(/marshfieldresearch.org/i.test(inputValue) || /marshfieldclinic.org/i.test(inputValue)) {
}
if (/marshfieldresearch.org/i.test(inputValue) || /marshfieldclinic.org/i.test(inputValue)) {
tenantID = 'MFC-SSO-fljvd';
provider = 'saml.connect-mfc'
};
return {tenantID, provider}
}
if (/bswhealth.org/i.test(inputValue)) {
tenantID = 'BSWH-SSO-y2jj3';
provider = 'saml.connect-bswh';
}

return { tenantID, provider }
}
4 changes: 2 additions & 2 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ const checkFormAndSave = async (participantData, biospecimenData, shouldNavigate
const inputFields = Array.from(document.getElementsByClassName('input-barcode-id'));
const isFormDataValid = inputFields.every(input => validateFormInputField(input, biospecimenData, true));

isFormDataValid ?
isFormDataValid || !shouldNavigateToReview ?
await collectionSubmission(participantData, biospecimenData, shouldNavigateToReview) :
showTimedNotifications({ title: 'Data Errors Exist!', body: 'Please correct data entry errors in red before saving.' });
} catch (error) {
Expand Down Expand Up @@ -1342,7 +1342,7 @@ const validateFormInputField = (inputTube, biospecimenData) => {
if (!isTubeIDEntryValid) {
const errorMessageText = isBagID ?
`Invalid entry. Bag ID must be ${validationID}` :
`Invalid entry. Specimen ID must be ${validationID}. Replacement labels 0050-0054 are valid.`;
`Invalid entry. Specimen ID must be ${validationID}.`;
errorMessage(inputTube.id, errorMessageText);
return false;
}
Expand Down
47 changes: 41 additions & 6 deletions src/pages/homeCollection/assignKits.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { homeCollectionNavbar } from "./homeCollectionNavbar.js";
import { getIdToken, showAnimation, hideAnimation, triggerErrorModal, triggerSuccessModal, baseAPI, processResponse, checkTrackingNumberSource, appState } from "../../shared.js";
import { getIdToken, showAnimation, hideAnimation, triggerErrorModal, triggerSuccessModal, baseAPI, processResponse, checkTrackingNumberSource, appState, numericInputValidator, errorMessage, removeAllErrors, autoTabAcrossArray } from "../../shared.js";
import { nonUserNavBar } from "./../../navbar.js";
import { activeHomeCollectionNavbar } from "./homeCollectionNavbar.js";
import { conceptIds } from '../../fieldToConceptIdMapping.js';
Expand Down Expand Up @@ -54,10 +54,16 @@ const assignKitsTemplate = async (name) => {
</div>
</div>
<div class="form-group row">
<label for="scannedBarcode" class="col-md-4 col-form-label">Tracking Number</label>
<div class="col-md-8">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode">
<span id="showMsg" style="font-size: 14px;"></span>
<label for="scannedBarcode" class="col-md-4 col-form-label">Supply Kit Tracking Number</label>
<div class="col-md-8">
<div class="form-group row">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode">
<span id="showMsg" style="font-size: 14px;"></span>
</div>
<div class="form-group row">
<label for="scannedBarcode2" class="sr-only">Confirm Supply Kit Tracking Number</label>
<input autocomplete="off" type="text" class="form-control" id="scannedBarcode2" placeholder="Re-Enter (scan/type) Barcode">
</div>
</div>
</div>
</form>
Expand All @@ -74,6 +80,26 @@ const assignKitsTemplate = async (name) => {

document.getElementById("navbarNavAltMarkup").innerHTML = nonUserNavBar(name);
contentBody.innerHTML = template;

const scannedBarcode2 = document.getElementById('scannedBarcode2');
scannedBarcode2.onpaste = e => e.preventDefault();
scannedBarcode2.addEventListener("input", (e) => {
const scannedBarcodeValue = document.getElementById('scannedBarcode').value.trim();
const scannedBarcode2Value = e.target.value.trim();

if(scannedBarcodeValue && scannedBarcode2Value && scannedBarcodeValue !== scannedBarcode2Value) {
const msg = 'Supply Kit Tracking Number doesn\'t match';
errorMessage('scannedBarcode2', msg, true, false, true);
} else {
removeAllErrors();
}
});

// Set up automatic tabbing between inputs upon scanning (assuming the scanner automatically inputs the enter key at the end)
autoTabAcrossArray(['fullName', 'address', 'Connect_ID', 'scanSupplyKit', 'scannedBarcode', 'scannedBarcode2']);

numericInputValidator(['scannedBarcode', 'scannedBarcode2']);

activeHomeCollectionNavbar();
appState.setState({ participants: response.data });
populateSidePaneRows();
Expand Down Expand Up @@ -129,10 +155,18 @@ const confirmAssignment = () => {
confirmAssignmentInAction = true;
try {
e.preventDefault();
removeAllErrors();
const scannedBarcode = document.getElementById('scannedBarcode').value.trim();
const scannedBarcode2 = document.getElementById('scannedBarcode2').value.trim();
if(scannedBarcode && scannedBarcode2 && scannedBarcode !== scannedBarcode2) {
const msg = 'Supply Kit Tracking Number doesn\'t match';
errorMessage('scannedBarcode2', msg, true, false);
throw new Error(msg);
}
let participantObj = {};
participantObj['fullName'] = document.getElementById('fullName').value;
participantObj['address'] = document.getElementById('address').value;
participantObj[conceptIds.supplyKitTrackingNum] = document.getElementById('scannedBarcode').value.trim();
participantObj[conceptIds.supplyKitTrackingNum] = scannedBarcode;
participantObj[conceptIds.supplyKitId] = document.getElementById('scanSupplyKit').value.trim();
participantObj['Connect_ID'] = document.getElementById('Connect_ID')?.value;
const assignmentStatus = await processConfirmedAssignment(participantObj);
Expand All @@ -142,6 +176,7 @@ const confirmAssignment = () => {
document.getElementById('address').value = ``;
document.getElementById('Connect_ID').value = ``;
document.getElementById('scannedBarcode').value = ``;
document.getElementById('scannedBarcode2').value = ``;
document.getElementById('scanSupplyKit').value = ``;
document.getElementById("showMsg").innerHTML = ``;

Expand Down
Loading

0 comments on commit f761f6c

Please sign in to comment.