Skip to content

Commit

Permalink
chore: fix merge conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <32586431+bryce-mcmath@users.noreply.github.com>
  • Loading branch information
bryce-mcmath committed Feb 18, 2023
2 parents dd12200 + 10d89d7 commit 5f07b8c
Show file tree
Hide file tree
Showing 21 changed files with 126 additions and 151 deletions.
2 changes: 1 addition & 1 deletion app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = {
plugins: ['@typescript-eslint', 'import'],
rules: {
'no-console': 'error',
'@typescript-eslint/no-unused-vars': 'error',
// Because of early development, we only warn on ts-ignore. In future we want to move to error
'@typescript-eslint/ban-ts-comment': 'warn',
// Aries protocol defines attributes with snake case.
Expand All @@ -34,6 +33,7 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
'import/order': [
'error',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/assets/branding/best-bc-header-logo.png
Binary file not shown.
Binary file added app/src/assets/branding/best-bc-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/assets/branding/best-bc-student-card.png
Binary file not shown.
212 changes: 101 additions & 111 deletions app/src/assets/branding/credential-branding.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import { types } from 'aries-bifold'

type CardLayoutOverlay10 = types.oca.CardLayoutOverlay10
type CardLayoutOverlay11 = types.oca.CardLayoutOverlay11
type MetaOverlay = types.oca.MetaOverlay
type FormatOverlay = types.oca.FormatOverlay
type LabelOverlay = types.oca.LabelOverlay
type CaptureBaseOverlay = types.oca.CaptureBaseOverlay

export enum CREDENTIALS {
LSBC_TEST = 'AuJrigKQGRLJajKAebTgWu:3:CL:209526:default',
LSBC_PROD = '4xE68b6S5VRFrKMMG1U95M:3:CL:59232:default',
Expand All @@ -21,121 +30,168 @@ export enum CREDENTIALS {
BC_DIGITAL_ID_PROD = 'RGjWbW1eycP7FrMf4QJvX8:3:CL:13:Person',
}

const demoMemberCardOverlay = {
imageSource: require('./lsbc-member-card-demo.png'),
const digitalIdInvitationCardOverlay: CardLayoutOverlay10 = {
captureBase: '',
type: 'spec/overlays/card_layout/1.0',
imageSource: require('./invitation-card.png'),
header: {
imageSource: require('./lsbc-header-logo.png'),
backgroundColor: '#00698C',
hideIssuer: true,
imageSource: require('./service-bc-header-logo.png'),
color: '#FFFFFF',
},
footer: { color: '#FFFFFF' },
}

const memberCardOverlay = {
imageSource: require('./lsbc-member-card.png'),
header: {
imageSource: require('./lsbc-header-logo.png'),
backgroundColor: '#00698C',
hideIssuer: true,
const studentCardOverlay11: CardLayoutOverlay11 = {
captureBase: '',
type: 'spec/overlays/card_layout/1.1',
logo: {
src: require('./best-bc-logo.png'),
},
backgroundImageSlice: {
src: require('./best-bc-background-image-slice.png'),
},
primaryBackgroundColor: '#32674e',
}

const studentCardOverlay = {
imageSource: require('./best-bc-student-card.png'),
header: {
imageSource: require('./best-bc-header-logo.png'),
color: '#FFFFFF',
const memberCardOverlay11: CardLayoutOverlay11 = {
captureBase: '',
type: 'spec/overlays/card_layout/1.1',
logo: {
src: require('./lsbc-logo.png'),
},
primaryBackgroundColor: '#00698c',
secondaryBackgroundColor: '#1a2930',
backgroundImage: {
src: require('./lsbc-background-image.jpg'),
},
footer: { color: '#FFFFFF' },
}

const digitalIdInvitationCardOverlay = {
imageSource: require('./invitation-card.png'),
header: {
imageSource: require('./service-bc-header-logo.png'),
color: '#FFFFFF',
footer: { color: '#FFFFFF' },
},
const digitalIdInvitationCardBundle = {
captureBase: {} as CaptureBaseOverlay,
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Pilot Invitation',
issuerName: 'DITP',
} as MetaOverlay,
digitalIdInvitationCardOverlay,
],
}

const studentCardBundle11 = {
captureBase: {} as CaptureBaseOverlay,
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Student',
issuerName: 'BestBC College',
} as MetaOverlay,
studentCardOverlay11,
],
}

const createPersonCredentialBundle = (backgroundImageSource: any, verified = true) => {
const metaOverlays = []
const memberCardBundle11 = {
captureBase: {} as CaptureBaseOverlay,
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Member Card',
issuerName: 'Law Society of BC',
} as MetaOverlay,
memberCardOverlay11,
],
}

const createPersonCredentialBundle = (backgroundImageSource: string, verified = true) => {
const metaOverlays: MetaOverlay[] = []
if (verified) {
metaOverlays.push({
captureBase: '',
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Person',
issuerName: 'Service BC',
})
metaOverlays.push({
captureBase: '',
type: 'spec/overlays/meta/1.0',
language: 'fr',
name: 'Personne',
issuerName: 'Service BC',
})
} else {
metaOverlays.push({
captureBase: '',
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Unverified Person',
issuerName: 'DITP',
})
metaOverlays.push({
captureBase: '',
type: 'spec/overlays/meta/1.0',
language: 'fr',
name: 'Unverified Personne',
issuerName: 'DITP',
})
}
return {
capture_base: {
captureBase: {
captureBase: '',
type: 'spec/overlays/capture_base/1.0',
attributes: {
postal_code: 'Text',
//picture: 'Text',
given_names: 'Text',
family_name: 'Text',
locality: 'Text',
region: 'Text',
street_address: 'Text',
country: 'Text',
//expiry_date_dateint: 'Text',
birthdate_dateint: 'DateInt',
},
},
} as CaptureBaseOverlay,
overlays: [
...metaOverlays,
{
captureBase: '',
type: 'spec/overlays/card_layout/1.0',
imageSource: backgroundImageSource,
header: {
imageSource: require('./service-bc-header-logo.png'),
color: '#FFFFFF',
},
footer: { color: '#FFFFFF' },
},
} as CardLayoutOverlay10,
{
captureBase: '',
type: 'spec/overlays/format/1.0',
language: 'en',
attr_formats: {
attributeFormats: {
birthdate_dateint: 'YYYYMMDD',
},
},
} as FormatOverlay,
{
captureBase: '',
type: 'spec/overlays/label/1.0',
language: 'en',
attr_labels: {
attributeLabels: {
given_names: 'Given Name',
family_name: 'Family Name',
birthdate_dateint: 'Date of Birth',
},
},
} as LabelOverlay,
{
captureBase: '',
type: 'spec/overlays/label/1.0',
language: 'fr',
attr_labels: {
attributeLabels: {
given_names: 'Prénoms',
family_name: 'Nom de famille',
},
},
} as LabelOverlay,
],
}
}
Expand All @@ -149,83 +205,17 @@ const digitalIdCardBundle = createPersonCredentialBundle(require('./service-bc-i
// eslint-disable-next-line @typescript-eslint/no-var-requires
const testDigitalIdCardBundle = createPersonCredentialBundle(require('./service-bc-id-card-test.png'))

const demoMemberCardBundle = {
capture_base: {},
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Member Card',
issuerName: 'Law Society of BC',
},
{
type: 'spec/overlays/card_layout/1.0',
...demoMemberCardOverlay,
},
],
}

const memberCardBundle = {
capture_base: {},
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Member Card',
issuerName: 'Law Society of BC',
},
{
type: 'spec/overlays/card_layout/1.0',
...memberCardOverlay,
},
],
}

const studentCardBundle = {
capture_base: {},
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Student',
issuerName: 'BestBC College',
},
{
type: 'spec/overlays/card_layout/1.0',
...studentCardOverlay,
},
],
}

const digitalIdInvitationCardBundle = {
capture_base: {},
overlays: [
{
type: 'spec/overlays/meta/1.0',
language: 'en',
name: 'Pilot Invitation',
issuerName: 'DITP',
},
{
type: 'spec/overlays/card_layout/1.0',
...digitalIdInvitationCardOverlay,
},
],
}

export default {
// ↓↓↓ https://github.com/bcgov/bc-wallet-mobile/discussions/370
/* LSBC (TEST) */
[CREDENTIALS.LSBC_TEST]: demoMemberCardBundle,
[CREDENTIALS.LSBC_PROD]: memberCardBundle /* LSBC (PROD) */,
[CREDENTIALS.LSBC_TEST]: memberCardBundle11 /* LSBC (TEST) */,
[CREDENTIALS.LSBC_PROD]: memberCardBundle11 /* LSBC (PROD) */,
// ↓↓↓ https://github.com/bcgov/BC-Wallet-Demo/discussions/59
[CREDENTIALS.SHOWCASE_LAWYER_DEV]: demoMemberCardBundle /* Showcase LSBC (DEV) */,
[CREDENTIALS.SHOWCASE_LAWYER_TEST]: demoMemberCardBundle /* Showcase LSBC (TEST) */,
[CREDENTIALS.SHOWCASE_LAWYER_PROD]: demoMemberCardBundle /* Showcase LSBC (PROD) */,
[CREDENTIALS.SHOWCASE_STUDENT_DEV]: studentCardBundle /* Showcase Student (DEV) */,
[CREDENTIALS.SHOWCASE_STUDENT_TEST]: studentCardBundle /* Showcase Student (TEST) */,
/* Showcase Student (PROD) */
[CREDENTIALS.SHOWCASE_STUDENT_PROD]: studentCardBundle,
[CREDENTIALS.SHOWCASE_LAWYER_DEV]: memberCardBundle11 /* Showcase LSBC (DEV) */,
[CREDENTIALS.SHOWCASE_LAWYER_TEST]: memberCardBundle11 /* Showcase LSBC (TEST) */,
[CREDENTIALS.SHOWCASE_LAWYER_PROD]: memberCardBundle11 /* Showcase LSBC (PROD) */,
[CREDENTIALS.SHOWCASE_STUDENT_DEV]: studentCardBundle11 /* Showcase Student (DEV) */,
[CREDENTIALS.SHOWCASE_STUDENT_TEST]: studentCardBundle11 /* Showcase Student (TEST) */,
[CREDENTIALS.SHOWCASE_STUDENT_PROD]: studentCardBundle11 /* Showcase Student (PROD) */,
// ↓↓↓ https://github.com/bcgov/bc-wallet-mobile/discussions/506
[CREDENTIALS.UNVERIFIED_PERSON_DEV]: unverifiedPersonCardBundle /* Unverified Person (DEV) */,
[CREDENTIALS.UNVERIFIED_PERSON_TEST]: unverifiedPersonCardBundle /* Unverified Person (TEST) */,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/assets/branding/lsbc-header-logo.png
Binary file not shown.
Binary file added app/src/assets/branding/lsbc-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/assets/branding/lsbc-member-card-demo.png
Binary file not shown.
Binary file removed app/src/assets/branding/lsbc-member-card.png
Binary file not shown.
20 changes: 11 additions & 9 deletions app/src/helpers/BCIDHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CredentialExchangeRecord as CredentialRecord,
CredentialMetadataKeys,
} from '@aries-framework/core'
import { BifoldError, DispatchAction, Agent } from 'aries-bifold'
import { BifoldError, /*DispatchAction,*/ Agent } from 'aries-bifold'
import React, { ReducerAction } from 'react'
import { TFunction } from 'react-i18next'
import { Linking, Platform } from 'react-native'
Expand Down Expand Up @@ -232,10 +232,11 @@ export const authenticateWithServiceCard = async (
code === ErrorCodes.CanceledByUser ? AuthenticationResultType.Cancel : AuthenticationResultType.Fail
)

dispatch({
type: DispatchAction.ERROR_ADDED,
payload: [{ error }],
})
// FIXME: Disabled until even emitters have been updated
// dispatch({
// type: DispatchAction.ERROR_ADDED,
// payload: [{ error }],
// })
}
}

Expand Down Expand Up @@ -268,9 +269,10 @@ export const startFlow = async (
} catch (error: unknown) {
setWorkflowInFlight(false)

dispatch({
type: DispatchAction.ERROR_ADDED,
payload: [{ error }],
})
// FIXME: Disabled until even emitters have been updated
// dispatch({
// type: DispatchAction.ERROR_ADDED,
// payload: [{ error }],
// })
}
}
3 changes: 1 addition & 2 deletions app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
indyLedgers,
defaultConfiguration,
} from 'aries-bifold'
import { Bundles } from 'aries-bifold/lib/typescript/App/types/oca'
import merge from 'lodash.merge'
import { ReducerAction } from 'react'

Expand Down Expand Up @@ -38,7 +37,7 @@ const configuration: ConfigurationContext = {
credentialListOptions: AddCredentialSlider,
credentialEmptyList: EmptyList,
developer: Developer,
OCABundle: new types.oca.DefaultOCABundleResolver().loadBundles(bundles as unknown as Bundles),
OCABundleResolver: new types.oca.OCABundleResolver(bundles as unknown as types.oca.Bundles),
record: Record,
indyLedgers: selectedLedgers,
settings: [],
Expand Down
Loading

0 comments on commit 5f07b8c

Please sign in to comment.