OpenCerts / opencerts-website

Apache License 2.0
21 stars 70 forks source link

Frameless_viewer feature not working #165

Closed curi0xus closed 5 years ago

curi0xus commented 5 years ago

https://opencerts.io/frameless-viewer/

If you visit the link here, you can see that the text input that was there initially is no longer appearing. I worked around it by removing type="hidden" from . However when I tried to render the a opencert.

{
  "id": "SERIAL-2018-08-01-112",
  "$template": "BLOCKCHAIN-ACADEMY-2018-001",
  "description": "This masters is awarded to developers who can blockchain",
  "issuedOn": "2018-08-01T00:00:00+08:00",
  "expiresOn": "2118-08-01T00:00:00+08:00",
  "name": "Master of Blockchain",
  "admissionDate": "2017-08-01T00:00:00+08:00",
  "graduationDate": "2018-08-01T00:00:00+08:00",
  "issuers": [
    {
      "name": "Blockchain Academy",
      "did": "DID:SG-UEN:U18274928E",
      "url": "https://blockchainacademy.com",
      "email": "registrar@blockchainacademy.com",
      "certificateStore": "0xd9580260be45c3c0c2fb259a82f219b513054012",
      "additionalProp": "0x0000000000000000000000000000000000000000000000000000000000000000"
    }, 
    {
      "name": "School of Crypto-economics",
      "url": "https://ceschool.sg",
      "certificateStore": "0xA33ddAEE02369D18A21E29dD2E7A12d65eE671d2"
    }
  ],
  "recipient": {
    "name": "Mr Blockchain",
    "did": "DID:SG-NRIC:S99999999A",
    "email": "mr-blockchain@gmail.com",
    "phone": "+65 88888888",
    "additionalProp": "0x0000000000000000000000000000000000000000000000000000000000000000"
  },
  "transcript": [
    {
      "name": "Bitcoin",
      "grade": "A+",
      "courseCredit": 3,
      "courseCode": "BTC-01",
      "examinationDate": "2018-08-01T00:00:00+08:00",
      "url": "https://blockchainacademy.com/subject/BTC-01",
      "description": "Everything and more about bitcoin!"
    },
    {
      "name": "Ethereum",
      "grade": "A+",
      "courseCredit": "3.5",
      "courseCode": "ETH-01",
      "examinationDate": "2018-08-01T00:00:00+08:00",
      "url": "https://blockchainacademy.com/subject/ETH-01",
      "description": "Everything and more about ethereum!"
    }
  ],
  "cumulativeScore": 3.9935,
  "additionalData": {
    "coCurricularActivities": [
      {
        "name": "Crypto-investment Club",
        "position": "Club President",
        "startDate": "2017-08-01T00:00:00+08:00",
        "endDate": "2018-08-01T00:00:00+08:00",
        "remarks": "Top trader (2018)"
      }
    ],
    "npfa": "silver",
    "images": {
      "signature1": {
        "name": "Mr Important",
        "designation": "President",
        "signature": "<-- Base64 Image -->"
      },
      "signature2": {
        "name": "Mr Not-So-Important",
        "designation": "Chairman, Blockchain Faculty",
        "signature": "<-- Base64 Image -->"
      }
    }
  }
}

I was thrown an error by the validateSchema method of the open-certificate library. image

rjchow commented 5 years ago

1) that is intended, you may use the bookmarklet mentioned here to ease this step 2) as mentioned previously, you need to call the issueCertificate method on your unsigned cert in order to get it to render

yehjxraymond commented 5 years ago

Unfortunately the data above is not a valid opencert file. Please see a sample at https://github.com/OpenCerts/opencerts-website/blob/master/src/components/CertificateTemplates/tlds/sg/edu/np/NP-AA2018-OPTION/NP_Certs_OPTION_2018.opencert.

You may want to use the CLI to format the cert, refer to the docs on that.

yehjxraymond commented 5 years ago

Hi, I'm in the midst of simplifying the api to use the frameless viewer, please hold on. In the meanwhile, the progress can be seen at https://github.com/OpenCerts/opencerts-website/pull/171

curi0xus commented 5 years ago

I got it to work! Thanks for your help guys! Looking forward to the frameless viewer api. Gonna close this for now.