Skip to content

Commit

Permalink
[cleanup] Removed obsolete comment, specified non-default button colo…
Browse files Browse the repository at this point in the history
…r, removed unnecessary array cloning
  • Loading branch information
marta- committed Oct 21, 2020
1 parent 7bc16dc commit 806b43a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions guids-generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
copyButtonSuccess: {
width: theme.spacing(17),
backgroundColor: theme.palette.success.light,
color: theme.palette.success.contrastText,
"&:hover,&:focus,&:visited,&": {
backgroundColor: theme.palette.success.main,
}
Expand Down Expand Up @@ -284,7 +285,6 @@
if (!formattedDOB) {
return {"error" : "The date of birth " + value + " appears to be invalid. Please enter a correct date of birth in the format " + dateFormat};
}
// Replace '\' and space with '-' before encryption
return formattedDOB;
}

Expand Down Expand Up @@ -336,14 +336,14 @@
// There should be 3 pieces per each line: Health card #, Province code, Date of birth
let countErr = checkInfoCount(info);
if (countErr) {
postProcessed.push({"index": index, "info" : info.filter((item)=>true), "value" : countErr, "isError": true});
postProcessed.push({"index": index, "info" : info, "value" : countErr, "isError": true});
continue;
}

// Validate DOB
let date = validateDOB(info[DOB]);
if (date.error) {
postProcessed.push({"index": index, "info" : info.filter((item)=>true), "value": date.error, "isError": true});
postProcessed.push({"index": index, "info" : info, "value": date.error, "isError": true});
continue;
} else {
info[DOB] = date;
Expand All @@ -352,7 +352,7 @@
// Validate Province code
let province = validateProvince(info[PROVINCE]);
if (province.error) {
postProcessed.push({"index": index, "info" : info.filter((item)=>true), "value": province.error, "isError": true});
postProcessed.push({"index": index, "info" : info, "value": province.error, "isError": true});
continue;
} else {
info[PROVINCE] = province;
Expand All @@ -361,7 +361,7 @@
// Validate Health card number y province
let healthCard = validateHealthCard(info[HC], info[PROVINCE], info[DOB]);
if (healthCard.error) {
postProcessed.push({"index": index, "info" : info.filter((item)=>true), "value": healthCard.error, "isError": true});
postProcessed.push({"index": index, "info" : info, "value": healthCard.error, "isError": true});
continue;
} else {
info[HC] = healthCard;
Expand All @@ -370,12 +370,12 @@
// Check duplicated <health card, province> pair
let duplicates = checkDuplicates(info, postProcessed);
if (duplicates.error) {
postProcessed.push({"index": index, "info" : info.filter((item)=>true), "value": duplicates.error, "isError": true});
postProcessed.push({"index": index, "info" : info, "value": duplicates.error, "isError": true});
continue;
}

// If the input is found valid, concatenate the post-processed health card number and date of birth and generate the GUID
postProcessed.push({"index": index, "info" : info.filter((item)=>true), "value": info[HC] + info[PROVINCE]});
postProcessed.push({"index": index, "info" : info, "value": info[HC] + info[PROVINCE]});
}

setValidatedData(postProcessed);
Expand Down

0 comments on commit 806b43a

Please sign in to comment.