Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Proof request attributes #1347

Merged
merged 22 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e250cbb
fix: fix: fixed sorting method for credential proofs
al-rosenthal Dec 2, 2024
43e18c8
refactor: refactoring credential card
al-rosenthal Dec 4, 2024
031b031
refactor: added support for errors in credential card
al-rosenthal Dec 4, 2024
729afd5
refactor: rewrote attribute render method
al-rosenthal Dec 5, 2024
d0adcd7
refactor: moved tags into error label component
al-rosenthal Dec 5, 2024
99b59d3
refactor: removed error prop
al-rosenthal Dec 5, 2024
910f2fc
refactor: removed predicate error from props
al-rosenthal Dec 5, 2024
80bba99
refactor: reogranized credential displays for proof
al-rosenthal Dec 6, 2024
db3edde
test: updated tests for credential cards
al-rosenthal Dec 6, 2024
9c84816
test: added more credential card tests
al-rosenthal Dec 9, 2024
8044bc4
Merge branch 'main' into feat/Refactor
al-rosenthal Dec 9, 2024
a8a98b1
test: fixed broken tests
al-rosenthal Dec 10, 2024
9525ad8
chore: fixed linting errors
al-rosenthal Dec 10, 2024
b4c84dd
test: added another test
al-rosenthal Dec 10, 2024
3e5d201
chore: fixing sonar cloud issues
al-rosenthal Dec 10, 2024
e8bd033
fix: fixing tests and updating header
al-rosenthal Dec 10, 2024
07b3a3c
chore: fixing sonar cloud issues
al-rosenthal Dec 10, 2024
4b7eff9
Merge branch 'main' into feat/Refactor
al-rosenthal Dec 10, 2024
954bbef
chore: shifted variables into props
al-rosenthal Dec 10, 2024
3a918df
chore: more sonar cloud issues
al-rosenthal Dec 10, 2024
74da805
fix: clean up, updated snapshots
al-rosenthal Dec 10, 2024
10cfc6e
Merge branch 'main' into feat/Refactor
al-rosenthal Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions packages/legacy/core/App/components/misc/CredentialCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useTheme } from '../../contexts/theme'
import { GenericFn } from '../../types/fn'

import CredentialCard10 from './CredentialCard10'
import CredentialCard11 from './CredentialCard11'
import CredentialCard11, { CredentialErrors } from './CredentialCard11'
import OpenIDCredentialCard from '../../modules/openid/components/OpenIDCredentialCard'
import { GenericCredentialExchangeRecord } from '../../types/credentials'

Expand All @@ -21,9 +21,8 @@ interface CredentialCardProps {
style?: ViewStyle
proof?: boolean
displayItems?: (Attribute | Predicate)[]
existsInWallet?: boolean
satisfiedPredicates?: boolean
hasAltCredentials?: boolean
credentialErrors?: CredentialErrors[]
handleAltCredChange?: () => void
}

Expand All @@ -34,12 +33,11 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
proof,
displayItems,
credName,
existsInWallet,
satisfiedPredicates,
hasAltCredentials,
handleAltCredChange,
style = {},
onPress = undefined,
credentialErrors,
}) => {
// add ability to reference credential by ID, allows us to get past react hook restrictions
const [bundleResolver] = useServices([TOKENS.UTIL_OCA_RESOLVER])
Expand All @@ -50,8 +48,6 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
<CredentialCard11
displayItems={displayItems}
style={{ backgroundColor: ColorPallet.brand.secondaryBackground }}
error={!existsInWallet}
predicateError={!satisfiedPredicates}
credName={credName}
credDefId={credDefId}
schemaId={schemaId}
Expand All @@ -60,6 +56,7 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
hasAltCredentials={hasAltCredentials}
proof
elevated
credentialErrors={credentialErrors ?? []}
/>
)
}
Expand All @@ -68,7 +65,14 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
if (type === BrandingOverlayType.Branding01) {
return <CredentialCard10 credential={credential as CredentialExchangeRecord} style={style} onPress={onPress} />
} else {
return <CredentialCard11 credential={credential as CredentialExchangeRecord} style={style} onPress={onPress} />
return (
<CredentialCard11
credential={credential as CredentialExchangeRecord}
style={style}
onPress={onPress}
credentialErrors={credentialErrors ?? []}
/>
)
}
} else {
return (
Expand All @@ -79,6 +83,7 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
displayItems={displayItems}
style={style}
onPress={onPress}
credentialErrors={credentialErrors ?? []}
/>
)
}
Expand Down
Loading