mirror of
https://github.com/covidpass-org/covidpass.git
synced 2025-02-23 15:07:44 +01:00
1.9.2 - Date of Birth added to pass, commercial vaccine name in brackets
For pass and photos
This commit is contained in:
parent
67d56c942d
commit
088c2de84c
@ -292,22 +292,22 @@ function Form(): JSX.Element {
|
||||
|
||||
async function checkBrowserType() {
|
||||
|
||||
if (isIPad13) {
|
||||
setErrorMessage('Sorry. Apple does not support the use of Wallet on iPad. Please use iPhone/Safari.');
|
||||
document.getElementById('download').setAttribute('disabled','true');
|
||||
}
|
||||
// if (isIPad13) {
|
||||
// setErrorMessage('Sorry. Apple does not support the use of Wallet on iPad. Please use iPhone/Safari.');
|
||||
// document.getElementById('download').setAttribute('disabled','true');
|
||||
// }
|
||||
if (!isSafari && !isChrome) {
|
||||
setErrorMessage('Sorry. Apple Wallet pass can be added using Safari or Chrome only.');
|
||||
document.getElementById('download').setAttribute('disabled','true');
|
||||
}
|
||||
if (isIOS && (!osVersion.includes('13') && !osVersion.includes('14') && !osVersion.includes('15'))) {
|
||||
setErrorMessage('Sorry, iOS 13+ is needed for the Apple Wallet functionality to work')
|
||||
document.getElementById('download').setAttribute('disabled','true')
|
||||
}
|
||||
if (isIOS && !isSafari) {
|
||||
setErrorMessage('Sorry, only Safari can be used to add a Wallet Pass on iOS')
|
||||
document.getElementById('download').setAttribute('disabled','true')
|
||||
}
|
||||
// if (isIOS && (!osVersion.includes('13') && !osVersion.includes('14') && !osVersion.includes('15'))) {
|
||||
// setErrorMessage('Sorry, iOS 13+ is needed for the Apple Wallet functionality to work')
|
||||
// document.getElementById('download').setAttribute('disabled','true')
|
||||
// }
|
||||
// if (isIOS && !isSafari) {
|
||||
// setErrorMessage('Sorry, only Safari can be used to add a Wallet Pass on iOS')
|
||||
// document.getElementById('download').setAttribute('disabled','true')
|
||||
// }
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -34,7 +34,7 @@ function Page(props: PageProps): JSX.Element {
|
||||
<a href="https://github.com/billylo1/covidpass" className="underline">{t('common:gitHub')}</a>
|
||||
<a href="https://vaccine-ontario.ca" className="underline">{t('common:returnToMainSite')}</a>
|
||||
</nav>
|
||||
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-09-23 (v1.9)</div>
|
||||
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-09-23 (v1.9.2)</div>
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
@ -71,9 +71,11 @@ function Page(props: PageProps): JSX.Element {
|
||||
<tr style={{height: 20}}></tr>
|
||||
<tr>
|
||||
<td><b>NAME</b></td>
|
||||
<td><b>DATE OF BIRTH</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id='name' style={{fontSize: 16}}></td>
|
||||
<td id='name' style={{fontSize: 12}}></td>
|
||||
<td id='dob' style={{fontSize: 12}}></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -105,7 +105,7 @@ export class PassData {
|
||||
body: JSON.stringify(clonedReceipt) // body data type must match "Content-Type" header
|
||||
}
|
||||
|
||||
console.log('registering ' + JSON.stringify(clonedReceipt, null, 2));
|
||||
// console.log('registering ' + JSON.stringify(clonedReceipt, null, 2));
|
||||
const configResponse = await fetch('/api/config');
|
||||
|
||||
const configResponseJson = await configResponse.json();
|
||||
@ -118,7 +118,7 @@ export class PassData {
|
||||
functionSuffix = '';
|
||||
|
||||
const registerUrl = `${registrationHost}/register${functionSuffix}`;
|
||||
console.log(registerUrl);
|
||||
// console.log(registerUrl);
|
||||
|
||||
const response = await fetch(registerUrl, requestOptions);
|
||||
const responseJson = await response.json();
|
||||
@ -133,7 +133,7 @@ export class PassData {
|
||||
const encodedUri = encodeURI(`serialNumber=${payload.serialNumber}&vaccineName=${payload.receipt.vaccineName}&vaccinationDate=${payload.receipt.vaccinationDate}&organization=${payload.receipt.organization}&dose=${payload.receipt.numDoses}`);
|
||||
const qrCodeUrl = `${verifierHost}/verify?${encodedUri}`;
|
||||
|
||||
console.log(qrCodeUrl);
|
||||
// console.log(qrCodeUrl);
|
||||
|
||||
// Create QR Code Object
|
||||
const qrCode: QrCode = {
|
||||
@ -152,7 +152,7 @@ export class PassData {
|
||||
|
||||
// Adding required fields
|
||||
|
||||
console.log(pass);
|
||||
// console.log(pass);
|
||||
|
||||
// Create pass.json
|
||||
const passJson = JSON.stringify(pass);
|
||||
|
@ -49,8 +49,20 @@ export class Payload {
|
||||
const name = body.receipt.name;
|
||||
const dateOfBirth = body.receipt.dateOfBirth;
|
||||
const vaccineName = body.receipt.vaccineName;
|
||||
const vaccineNameProper = vaccineName.charAt(0) + vaccineName.substr(1).toLowerCase();
|
||||
const doseVaccine = "Dose " + String(body.receipt.numDoses) + ": " + vaccineNameProper;
|
||||
let vaccineNameProper = vaccineName.charAt(0) + vaccineName.substr(1).toLowerCase();
|
||||
|
||||
if (vaccineName.includes('PFIZER'))
|
||||
vaccineNameProper = 'Pfizer (Comirnaty)'
|
||||
|
||||
if (vaccineName.includes('MODERNA'))
|
||||
vaccineNameProper = 'Moderna (SpikeVax)'
|
||||
// vaccineNameProper = 'Pfizer (Comirnaty)'
|
||||
|
||||
if (vaccineName.includes('ASTRAZENECA'))
|
||||
vaccineNameProper = 'AstraZeneca (Vaxzevria)'
|
||||
|
||||
let doseVaccine = "#" + String(body.receipt.numDoses) + ": " + vaccineNameProper;
|
||||
|
||||
if (name == undefined) {
|
||||
throw new Error('nameMissing');
|
||||
}
|
||||
@ -88,16 +100,16 @@ export class Payload {
|
||||
key: "name",
|
||||
label: "Name",
|
||||
value: name
|
||||
},
|
||||
{
|
||||
key: "dob",
|
||||
label: "Date of Birth",
|
||||
value: dateOfBirth
|
||||
}
|
||||
],
|
||||
backFields: [
|
||||
|
||||
// {
|
||||
// key: "dob",
|
||||
// label: "Date of Birth",
|
||||
// value: body.receipt.dateOfBirth,
|
||||
// textAlignment: TextAlignment.right
|
||||
// }
|
||||
//TODO: add url link back to grassroots site
|
||||
|
||||
]
|
||||
}
|
||||
|
19
src/photo.ts
19
src/photo.ts
@ -94,14 +94,29 @@ export class Photo {
|
||||
else
|
||||
body.style.backgroundColor = 'orangered';
|
||||
|
||||
const name = payload.receipt.name;
|
||||
const dateOfBirth = payload.receipt.dateOfBirth;
|
||||
const vaccineName = payload.receipt.vaccineName;
|
||||
const vaccineNameProper = vaccineName.charAt(0) + vaccineName.substr(1).toLowerCase();
|
||||
const doseVaccine = "Dose " + String(payload.receipt.numDoses) + ": " + vaccineNameProper;
|
||||
let vaccineNameProper = vaccineName.charAt(0) + vaccineName.substr(1).toLowerCase();
|
||||
|
||||
if (vaccineName.includes('PFIZER'))
|
||||
vaccineNameProper = 'Pfizer (Comirnaty)'
|
||||
|
||||
if (vaccineName.includes('MODERNA'))
|
||||
vaccineNameProper = 'Moderna (SpikeVax)'
|
||||
// vaccineNameProper = 'Pfizer (Comirnaty)'
|
||||
|
||||
if (vaccineName.includes('ASTRAZENECA'))
|
||||
vaccineNameProper = 'AstraZeneca (Vaxzevria)'
|
||||
|
||||
let doseVaccine = "#" + String(payload.receipt.numDoses) + ": " + vaccineNameProper;
|
||||
|
||||
|
||||
document.getElementById('vaccineName').innerText = doseVaccine;
|
||||
document.getElementById('vaccinationDate').innerText = payload.receipt.vaccinationDate;
|
||||
document.getElementById('organization').innerText = payload.receipt.organization;
|
||||
document.getElementById('name').innerText = payload.receipt.name;
|
||||
document.getElementById('dob').innerText = payload.receipt.dateOfBirth;
|
||||
|
||||
const codeWriter = new BrowserQRCodeSvgWriter();
|
||||
const svg = codeWriter.write(qrCode.message,200,200);
|
||||
|
Loading…
x
Reference in New Issue
Block a user