bcgov / BC-Wallet-Demo

Demo of Verifiable Credentials Using the BC Wallet
https://digital.gov.bc.ca/digital-trust/showcase
Apache License 2.0
7 stars 13 forks source link

feat: added json config #185

Closed wadeking98 closed 1 year ago

wadeking98 commented 1 year ago

Added ability to load custom demos on the fly using a json file. The demo will load the custom character and add the schema/credDef to the ledger if needed. The new character will then be in the demo's state and the user can interact with it as needed. I refactored a lot of the existing code to make the existing characters more in line with JSON configs:

The json configurations are structured like so: Every character has the following attributes: name, type, image, description (optional), revocationInfo, progressBar, onboarding and useCases

image

progressBar:

The progress bar is use to track where the user currently is in the onboarding process. Here is the structure of the progressBar:

image

The name attribute serves as the progress id, the light and dark icons are what should be displayed in the light and dark mode of the demo. The onboardingStep attribute references the screenId of any of the onboarding screens. In this screenshot we are at the SETUP_START onboarding screen, so everything in the progress bar is highlighted up to that point:

image

onboarding:

The onboarding section is where the user goes through and receives credentials, it's also where the showcase educates the user about verifiable credentials and the business flow. Here is some of the onboarding structure:

image

The basic screen contains 4 key attributes: screenId (used to track the screen and perform various actions when the user is on a screen), title (the text to display as the page title), text (the main page text that describes what is going on in the business flow), and image (the main image)

Special onboarding screens:

There are 6 types of special onboarding screens. The type of screen is dictated by it's screenId

If the screen has any other screenId then it will just be treated as a regular screen without any special functionality

useCases:

The UseCase section is where the user proves things about themselves using the credentials they were given during onboarding. Like the onboarding section, the useCase section has a list of screens, the base screen object has 4 attributes: screenId, title, text, image. Here is some of the useCase structure:

image

useCase screens:

There are 6 different useCase screens, all of them have at least 4 attributes (screenId, title, text, image). Like the onboarding screens, the type of screen is dictated by the screenId.

revocationInfo:

The revocation info is mainly used to add wording and images to the revocation section of the demo. Here if the structure:

image