@procivis/one-react-native-components 0.3.86 → 0.3.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/credential/credential.js +2 -8
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js +3 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +10 -2
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -8
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -8
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -6
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +2 -6
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/fi.json +21 -0
- package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -0
- package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +4 -1
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +1 -7
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +3 -6
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +28 -37
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -12
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +4 -4
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +6 -6
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +9 -25
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/credential/credential.js +2 -8
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +3 -1
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +2 -1
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +10 -2
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js +2 -8
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -8
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js +3 -7
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js +3 -7
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/fi.json +21 -0
- package/lib/module/ui-components/accessibility/locale/index.js +2 -0
- package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +4 -1
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +1 -7
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +3 -6
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +26 -35
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/index.js +0 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +4 -4
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +6 -6
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +10 -26
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/ui-components/accessibility/locale/index.d.ts +21 -0
- package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +0 -3
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +7 -7
- package/lib/typescript/utils/index.d.ts +0 -1
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +2 -3
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +3 -4
- package/lib/typescript/utils/parsers/credential.d.ts +6 -10
- package/lib/typescript/utils/parsers/query.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/credential/credential.tsx +1 -5
- package/src/components/entity/entity-attributes.tsx +3 -0
- package/src/components/entity/entity-details-with-buttons.tsx +1 -0
- package/src/components/history/history-list-item-icon.tsx +9 -1
- package/src/components/proof-request/v1/select-credential.tsx +1 -5
- package/src/components/proof-request/v1/share-credential.tsx +1 -5
- package/src/components/proof-request/v2/select-credential-v2.tsx +2 -9
- package/src/components/proof-request/v2/share-credential-v2.tsx +2 -11
- package/src/ui-components/accessibility/locale/fi.json +21 -0
- package/src/ui-components/accessibility/locale/index.ts +2 -1
- package/src/utils/hooks/core/cache.ts +3 -0
- package/src/utils/hooks/core/credentials.ts +3 -2
- package/src/utils/hooks/core/proofs.ts +2 -8
- package/src/utils/hooks/core/wallet-unit.ts +31 -37
- package/src/utils/index.ts +0 -1
- package/src/utils/parsers/credential-sharing-v2.tsx +0 -5
- package/src/utils/parsers/credential-sharing.tsx +34 -35
- package/src/utils/parsers/credential.ts +3 -30
- package/src/utils/parsers/query.ts +2 -2
- package/lib/commonjs/utils/wallet-unit.js +0 -30
- package/lib/commonjs/utils/wallet-unit.js.map +0 -1
- package/lib/module/utils/wallet-unit.js +0 -22
- package/lib/module/utils/wallet-unit.js.map +0 -1
- package/lib/typescript/utils/wallet-unit.d.ts +0 -8
- package/src/utils/wallet-unit.ts +0 -30
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, IdentifierListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").CredentialListQueryExactColumnEnum[] | import("@procivis/react-native-one-core").CredentialRoleEnum[] | import("@procivis/react-native-one-core").CredentialStateEnum[] | import("@procivis/react-native-one-core").CredentialListIncludeEntityType[] | import("@procivis/react-native-one-core").CredentialListSearchType[] | undefined)[];
|
|
3
|
-
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | import("@procivis/react-native-one-core").HistoryListSearch | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
3
|
+
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").HistoryListSearch | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
4
4
|
export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactCredentialSchemaFilterColumnEnum[] | import("@procivis/react-native-one-core").CredentialSchemaListIncludeEntityType[] | undefined)[];
|
|
5
5
|
export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofSchemaFilterColumnEnum[] | undefined)[];
|
|
6
6
|
export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofFilterColumnEnum[] | import("@procivis/react-native-one-core").ProofStateEnum[] | import("@procivis/react-native-one-core").ProofRoleEnum[] | undefined)[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procivis/one-react-native-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.94",
|
|
4
4
|
"author": "Procivis AG (https://procivis.ch)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Common Procivis ONE UI components for react-native",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@babel/runtime": "^7.25.0",
|
|
52
52
|
"@commitlint/config-conventional": "^11.0.0",
|
|
53
53
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
54
|
-
"@procivis/react-native-one-core": "1.
|
|
54
|
+
"@procivis/react-native-one-core": "1.75319.0",
|
|
55
55
|
"@procivis/react-native-picker": "5.0.3",
|
|
56
56
|
"@react-native-async-storage/async-storage": "^1.17.3",
|
|
57
57
|
"@react-native-community/blur": "^4.4.0",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"vite": "^6.2.2"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@procivis/react-native-one-core": "^1.
|
|
143
|
+
"@procivis/react-native-one-core": "^1.75319.0",
|
|
144
144
|
"@procivis/react-native-picker": "*",
|
|
145
145
|
"@react-native-community/blur": "*",
|
|
146
146
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -293,4 +293,4 @@
|
|
|
293
293
|
"react-native-web": "patches/react-native-web.patch"
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
}
|
|
296
|
+
}
|
|
@@ -6,9 +6,7 @@ import { CredentialDetailsCardListItem, CredentialHeaderProps } from '../../ui-c
|
|
|
6
6
|
import { concatTestID } from '../../utils';
|
|
7
7
|
import { useCoreConfig } from '../../utils/hooks/core/core-config';
|
|
8
8
|
import { useCredentialDetail } from '../../utils/hooks/core/credentials';
|
|
9
|
-
import { useWalletUnitAttestation } from '../../utils/hooks/core/wallet-unit';
|
|
10
9
|
import { CardLabels, detailsCardFromCredentialWithClaims } from '../../utils/parsers/credential';
|
|
11
|
-
import { walletUnitAttestationState } from '../../utils/wallet-unit';
|
|
12
10
|
|
|
13
11
|
export interface CredentialDetailsProps {
|
|
14
12
|
claims?: Claim[];
|
|
@@ -33,10 +31,9 @@ export const CredentialDetails: FC<CredentialDetailsProps> = ({
|
|
|
33
31
|
}) => {
|
|
34
32
|
const { data: credential } = useCredentialDetail(credentialId);
|
|
35
33
|
const { data: config } = useCoreConfig();
|
|
36
|
-
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
37
34
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
38
35
|
|
|
39
|
-
if (!credential || !config
|
|
36
|
+
if (!credential || !config) {
|
|
40
37
|
return null;
|
|
41
38
|
}
|
|
42
39
|
const testID = concatTestID('Credential.credential', credential.id);
|
|
@@ -45,7 +42,6 @@ export const CredentialDetails: FC<CredentialDetailsProps> = ({
|
|
|
45
42
|
credential,
|
|
46
43
|
claims ?? credential.claims,
|
|
47
44
|
config,
|
|
48
|
-
walletUnitAttestationState(walletUnitAttestation),
|
|
49
45
|
testID,
|
|
50
46
|
labels,
|
|
51
47
|
);
|
|
@@ -14,6 +14,7 @@ interface EntityAttributesProps {
|
|
|
14
14
|
labels: AttributesLabels;
|
|
15
15
|
onCopyToClipboard: (value: string) => void;
|
|
16
16
|
entityType: EntityType;
|
|
17
|
+
testID?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
@@ -23,6 +24,7 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
23
24
|
trusted,
|
|
24
25
|
labels,
|
|
25
26
|
entityType,
|
|
27
|
+
testID,
|
|
26
28
|
onCopyToClipboard,
|
|
27
29
|
}) => {
|
|
28
30
|
const didSections = did?.split(':') ?? [];
|
|
@@ -62,6 +64,7 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
62
64
|
{...attribute}
|
|
63
65
|
labels={labels}
|
|
64
66
|
onCopyToClipboard={onCopyToClipboard}
|
|
67
|
+
testID={testID}
|
|
65
68
|
/>
|
|
66
69
|
))}
|
|
67
70
|
</View>
|
|
@@ -54,6 +54,8 @@ const defaultIcons: {
|
|
|
54
54
|
REACTIVATED: HistoryStatusAcceptedIcon,
|
|
55
55
|
CSR_GENERATED: HistoryStatusAcceptedIcon,
|
|
56
56
|
EXPIRED: HistoryStatusErrorIcon,
|
|
57
|
+
INTERACTION_CREATED: HistoryStatusAcceptedIcon,
|
|
58
|
+
INTERACTION_ERRORED: HistoryStatusErrorIcon,
|
|
57
59
|
},
|
|
58
60
|
entityTypes: {
|
|
59
61
|
BACKUP: HistoryRevokeIcon,
|
|
@@ -69,7 +71,13 @@ const defaultIcons: {
|
|
|
69
71
|
TRUST_ANCHOR: HistoryTrustAnchorIcon,
|
|
70
72
|
TRUST_ENTITY: HistoryTrustedEntityIcon,
|
|
71
73
|
WALLET_UNIT: HistoryTrustedEntityIcon,
|
|
72
|
-
|
|
74
|
+
WALLET_RELYING_PARTY: HistoryTrustedEntityIcon,
|
|
75
|
+
USER: HistoryIdentifierIcon,
|
|
76
|
+
PROVIDER: HistoryIdentifierIcon,
|
|
77
|
+
STS_ROLE: HistoryIdentifierIcon,
|
|
78
|
+
STS_ORGANISATION: HistoryOrganisationIcon,
|
|
79
|
+
STS_IAM_ROLE: HistoryIdentifierIcon,
|
|
80
|
+
STS_TOKEN: HistoryKeyIcon,
|
|
73
81
|
},
|
|
74
82
|
};
|
|
75
83
|
|
|
@@ -5,12 +5,10 @@ import { Dimensions, ImageSourcePropType } from 'react-native';
|
|
|
5
5
|
import { CredentialDetailsCardListItem } from '../../../ui-components';
|
|
6
6
|
import { useCoreConfig } from '../../../utils/hooks/core/core-config';
|
|
7
7
|
import { useCredentialDetail } from '../../../utils/hooks/core/credentials';
|
|
8
|
-
import { useWalletUnitAttestation } from '../../../utils/hooks/core/wallet-unit';
|
|
9
8
|
import {
|
|
10
9
|
selectCredentialCardFromCredential,
|
|
11
10
|
ShareCredentialCardLabels,
|
|
12
11
|
} from '../../../utils/parsers/credential-sharing';
|
|
13
|
-
import { walletUnitAttestationState } from '../../../utils/wallet-unit';
|
|
14
12
|
|
|
15
13
|
export const SelectCredential: FC<{
|
|
16
14
|
credentialId: string;
|
|
@@ -24,10 +22,9 @@ export const SelectCredential: FC<{
|
|
|
24
22
|
}> = ({ credentialId, labels, lastItem, onImagePreview, onPress, request, selected, testID }) => {
|
|
25
23
|
const { data: credential } = useCredentialDetail(credentialId);
|
|
26
24
|
const { data: config } = useCoreConfig();
|
|
27
|
-
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
28
25
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
29
26
|
|
|
30
|
-
if (!credential || !config
|
|
27
|
+
if (!credential || !config) {
|
|
31
28
|
return null;
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -36,7 +33,6 @@ export const SelectCredential: FC<{
|
|
|
36
33
|
selected,
|
|
37
34
|
request,
|
|
38
35
|
config,
|
|
39
|
-
walletUnitAttestationState(walletUnitAttestation),
|
|
40
36
|
testID,
|
|
41
37
|
labels,
|
|
42
38
|
);
|
|
@@ -11,13 +11,11 @@ import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } fro
|
|
|
11
11
|
import { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';
|
|
12
12
|
import { concatTestID } from '../../../utils';
|
|
13
13
|
import { useCoreConfig } from '../../../utils/hooks/core/core-config';
|
|
14
|
-
import { useWalletUnitAttestation } from '../../../utils/hooks/core/wallet-unit';
|
|
15
14
|
import { getValidityState, ValidityState } from '../../../utils/parsers/credential';
|
|
16
15
|
import {
|
|
17
16
|
shareCredentialCardFromCredential,
|
|
18
17
|
ShareCredentialCardLabels,
|
|
19
18
|
} from '../../../utils/parsers/credential-sharing';
|
|
20
|
-
import { walletUnitAttestationState } from '../../../utils/wallet-unit';
|
|
21
19
|
import { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';
|
|
22
20
|
import { ShareCredentialCardNotice } from '../share-credential-card-notice';
|
|
23
21
|
|
|
@@ -61,7 +59,6 @@ export const ShareCredential: FunctionComponent<{
|
|
|
61
59
|
const colorScheme = useAppColorScheme();
|
|
62
60
|
const credential = allCredentials.find((c) => c.id === selectedCredentialId);
|
|
63
61
|
const { data: config } = useCoreConfig();
|
|
64
|
-
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
65
62
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
66
63
|
|
|
67
64
|
const selectionOptions = useMemo(
|
|
@@ -131,7 +128,7 @@ export const ShareCredential: FunctionComponent<{
|
|
|
131
128
|
}
|
|
132
129
|
}, [expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);
|
|
133
130
|
|
|
134
|
-
if (!config
|
|
131
|
+
if (!config) {
|
|
135
132
|
return null;
|
|
136
133
|
}
|
|
137
134
|
|
|
@@ -143,7 +140,6 @@ export const ShareCredential: FunctionComponent<{
|
|
|
143
140
|
request,
|
|
144
141
|
selectedFields,
|
|
145
142
|
config,
|
|
146
|
-
walletUnitAttestationState(walletUnitAttestation),
|
|
147
143
|
testID,
|
|
148
144
|
labels,
|
|
149
145
|
);
|
|
@@ -3,12 +3,7 @@ import React, { FC, useCallback, useMemo } from 'react';
|
|
|
3
3
|
import { Dimensions, ImageSourcePropType } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { CredentialDetailsCardListItem } from '../../../ui-components';
|
|
6
|
-
import {
|
|
7
|
-
ShareCredentialCardLabels,
|
|
8
|
-
useCoreConfig,
|
|
9
|
-
useWalletUnitAttestation,
|
|
10
|
-
walletUnitAttestationState,
|
|
11
|
-
} from '../../../utils';
|
|
6
|
+
import { ShareCredentialCardLabels, useCoreConfig } from '../../../utils';
|
|
12
7
|
import { selectCredentialCardFromV2Credential } from '../../../utils/parsers/credential-sharing-v2';
|
|
13
8
|
|
|
14
9
|
export const SelectCredentialV2: FC<{
|
|
@@ -22,14 +17,13 @@ export const SelectCredentialV2: FC<{
|
|
|
22
17
|
testID: string;
|
|
23
18
|
}> = ({ credential, labels, lastItem, multiple, onImagePreview, onSelected, selected, testID }) => {
|
|
24
19
|
const { data: config } = useCoreConfig();
|
|
25
|
-
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
26
20
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
27
21
|
|
|
28
22
|
const onHeaderPress = useCallback(() => {
|
|
29
23
|
onSelected?.(credential.id, !selected);
|
|
30
24
|
}, [credential.id, onSelected, selected]);
|
|
31
25
|
|
|
32
|
-
if (!credential || !config
|
|
26
|
+
if (!credential || !config) {
|
|
33
27
|
return null;
|
|
34
28
|
}
|
|
35
29
|
|
|
@@ -38,7 +32,6 @@ export const SelectCredentialV2: FC<{
|
|
|
38
32
|
selected,
|
|
39
33
|
multiple,
|
|
40
34
|
config,
|
|
41
|
-
walletUnitAttestationState(walletUnitAttestation),
|
|
42
35
|
testID,
|
|
43
36
|
labels,
|
|
44
37
|
);
|
|
@@ -7,14 +7,7 @@ import React, { FunctionComponent, useCallback, useMemo } from 'react';
|
|
|
7
7
|
import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
8
8
|
|
|
9
9
|
import { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';
|
|
10
|
-
import {
|
|
11
|
-
concatTestID,
|
|
12
|
-
getValidityState,
|
|
13
|
-
useCoreConfig,
|
|
14
|
-
useWalletUnitAttestation,
|
|
15
|
-
ValidityState,
|
|
16
|
-
walletUnitAttestationState,
|
|
17
|
-
} from '../../../utils';
|
|
10
|
+
import { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';
|
|
18
11
|
import { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';
|
|
19
12
|
import { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';
|
|
20
13
|
import { ShareCredentialCardNotice } from '../share-credential-card-notice';
|
|
@@ -67,7 +60,6 @@ export const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({
|
|
|
67
60
|
const failureHint = 'failureHint' in credentialQuery ? credentialQuery.failureHint : undefined;
|
|
68
61
|
const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];
|
|
69
62
|
const { data: config } = useCoreConfig();
|
|
70
|
-
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
71
63
|
const cardWidth = useMemo(
|
|
72
64
|
() => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),
|
|
73
65
|
[grouped],
|
|
@@ -148,7 +140,7 @@ export const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({
|
|
|
148
140
|
[onSelectField, selectedCredentialId],
|
|
149
141
|
);
|
|
150
142
|
|
|
151
|
-
if (!config
|
|
143
|
+
if (!config) {
|
|
152
144
|
return null;
|
|
153
145
|
}
|
|
154
146
|
|
|
@@ -162,7 +154,6 @@ export const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({
|
|
|
162
154
|
multipleCredentialsAvailable,
|
|
163
155
|
selectedFields,
|
|
164
156
|
config,
|
|
165
|
-
walletUnitAttestationState(walletUnitAttestation),
|
|
166
157
|
testID,
|
|
167
158
|
labels,
|
|
168
159
|
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accessibility.control.combobox.expanded": "Laajennettu",
|
|
3
|
+
"accessibility.control.combobox.tapToSelect": "Kaksoisnapauta valitaksesi",
|
|
4
|
+
"accessibility.control.order": "{current} / {length}",
|
|
5
|
+
"accessibility.control.progress": "{current} / {length}",
|
|
6
|
+
"accessibility.control.checked": "valittu",
|
|
7
|
+
"accessibility.control.unchecked": "ei valittu",
|
|
8
|
+
"accessibility.control.clear": "tyhjennä",
|
|
9
|
+
"accessibility.control.delete": "poista",
|
|
10
|
+
"accessibility.control.list.moveDown": "Siirrä alas",
|
|
11
|
+
"accessibility.control.list.moveUp": "Siirrä ylös",
|
|
12
|
+
"accessibility.nav.back": "takaisin",
|
|
13
|
+
"accessibility.nav.close": "sulje",
|
|
14
|
+
"accessibility.nav.next": "seuraava",
|
|
15
|
+
"accessibility.icon.edit": "muokkaa",
|
|
16
|
+
"accessibility.icon.add": "lisää",
|
|
17
|
+
"accessibility.icon.filter": "suodata",
|
|
18
|
+
"accessibility.icon.scan": "skannaa",
|
|
19
|
+
"accessibility.key.faceId": "faceId",
|
|
20
|
+
"accessibility.key.fingerprint": "sormenjälki"
|
|
21
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import de from './de.json';
|
|
2
2
|
import en from './en.json';
|
|
3
|
+
import fi from './fi.json';
|
|
3
4
|
import fr from './fr.json';
|
|
4
5
|
import it from './it.json';
|
|
5
6
|
|
|
6
|
-
export const defaultLanguageFiles = { en, de, fr, it };
|
|
7
|
+
export const defaultLanguageFiles = { en, de, fi, fr, it };
|
|
7
8
|
|
|
8
9
|
export type SupportedAccessibilityLanguage = keyof typeof defaultLanguageFiles;
|
|
9
10
|
export type AccessibilityLanguageFile = typeof en;
|
|
@@ -16,6 +16,9 @@ const cacheTypeToQueryKeys: Record<CacheType, string[]> = {
|
|
|
16
16
|
[CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
17
17
|
[CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
|
|
18
18
|
[CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
|
|
19
|
+
[CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
20
|
+
[CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
21
|
+
[CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
export const useCacheClear = () => {
|
|
@@ -111,11 +111,12 @@ export const useCredentialAccept = () => {
|
|
|
111
111
|
interactionId: string;
|
|
112
112
|
keyId?: string;
|
|
113
113
|
txCode?: string;
|
|
114
|
+
holderWalletUnitId?: string;
|
|
114
115
|
};
|
|
115
116
|
|
|
116
117
|
return useMutation(
|
|
117
|
-
async (
|
|
118
|
-
core.holderAcceptCredential(
|
|
118
|
+
async (credentialAcceptHookParams: CredentialAcceptHookParams) =>
|
|
119
|
+
core.holderAcceptCredential(credentialAcceptHookParams),
|
|
119
120
|
{
|
|
120
121
|
onSuccess: async () => {
|
|
121
122
|
await queryClient.invalidateQueries(CREDENTIAL_LIST_QUERY_KEY);
|
|
@@ -58,7 +58,7 @@ export const useProofState = (proofId: string | undefined, isPolling: boolean) =
|
|
|
58
58
|
organisationId,
|
|
59
59
|
page: 0,
|
|
60
60
|
pageSize: 1,
|
|
61
|
-
|
|
61
|
+
entityIds: [proofId],
|
|
62
62
|
entityTypes: [HistoryEntityTypeEnum.PROOF],
|
|
63
63
|
actions: [HistoryActionEnum.ERRORED],
|
|
64
64
|
})
|
|
@@ -100,16 +100,10 @@ export const useProofAccept = () => {
|
|
|
100
100
|
async ({
|
|
101
101
|
interactionId,
|
|
102
102
|
credentials,
|
|
103
|
-
didId,
|
|
104
|
-
identifierId,
|
|
105
|
-
keyId,
|
|
106
103
|
}: {
|
|
107
104
|
credentials: Record<string, PresentationSubmitCredentialRequest>;
|
|
108
|
-
didId?: string;
|
|
109
|
-
identifierId?: string;
|
|
110
105
|
interactionId: string;
|
|
111
|
-
|
|
112
|
-
}) => core.holderSubmitProof(interactionId, credentials, didId, identifierId, keyId),
|
|
106
|
+
}) => core.holderSubmitProof(interactionId, credentials),
|
|
113
107
|
{
|
|
114
108
|
onError: async (err) => {
|
|
115
109
|
reportException(err, 'Proof submission failure');
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { WalletProvider,
|
|
1
|
+
import { HolderWalletUnitDetail, WalletProvider, WalletUnitStatus } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
4
4
|
|
|
5
5
|
import { reportException } from '../../reporting';
|
|
6
6
|
import { useONECore } from './core-context';
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const WALLET_UNIT_QUERY_KEY = 'wallet-unit';
|
|
9
9
|
|
|
10
|
-
export const
|
|
11
|
-
const { core
|
|
10
|
+
export const useWalletUnitDetail = (walletUnitId: HolderWalletUnitDetail['id'] | undefined, active = true) => {
|
|
11
|
+
const { core } = useONECore();
|
|
12
12
|
|
|
13
|
-
return useQuery(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
return useQuery(
|
|
14
|
+
[WALLET_UNIT_QUERY_KEY, walletUnitId],
|
|
15
|
+
() => (walletUnitId ? core.holderGetWalletUnit(walletUnitId) : undefined),
|
|
16
|
+
{
|
|
17
|
+
enabled: active && Boolean(walletUnitId),
|
|
18
|
+
keepPreviousData: true,
|
|
19
|
+
},
|
|
20
|
+
);
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const useRegisterWalletUnit = () => {
|
|
@@ -22,56 +25,47 @@ export const useRegisterWalletUnit = () => {
|
|
|
22
25
|
const { core, organisationId } = useONECore();
|
|
23
26
|
|
|
24
27
|
return useMutation(
|
|
25
|
-
async (walletProvider: WalletProvider) =>
|
|
26
|
-
|
|
28
|
+
async (walletProvider: WalletProvider) =>
|
|
29
|
+
core.holderRegisterWalletUnit({
|
|
27
30
|
keyType: 'ECDSA',
|
|
28
31
|
organisationId,
|
|
29
32
|
walletProvider,
|
|
30
|
-
})
|
|
33
|
+
}),
|
|
31
34
|
|
|
32
|
-
return result;
|
|
33
|
-
},
|
|
34
35
|
{
|
|
35
|
-
onSuccess: () => queryClient.invalidateQueries(
|
|
36
|
+
onSuccess: () => queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY),
|
|
36
37
|
},
|
|
37
38
|
);
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
export const
|
|
41
|
+
export const useWalletUnitStatus = () => {
|
|
41
42
|
const queryClient = useQueryClient();
|
|
42
|
-
const { core
|
|
43
|
+
const { core } = useONECore();
|
|
43
44
|
|
|
44
|
-
return useMutation(
|
|
45
|
-
async (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
organisationId,
|
|
49
|
-
}),
|
|
50
|
-
{
|
|
51
|
-
onError: async (err) => {
|
|
52
|
-
reportException(err, 'Refresh wallet unit failure');
|
|
53
|
-
await queryClient.invalidateQueries([ATTESTATION_QUERY_KEY, organisationId]);
|
|
54
|
-
},
|
|
55
|
-
onSuccess: () => queryClient.invalidateQueries([ATTESTATION_QUERY_KEY, organisationId]),
|
|
45
|
+
return useMutation(async (walletUnitId: HolderWalletUnitDetail['id']) => core.holderWalletUnitStatus(walletUnitId), {
|
|
46
|
+
onError: async (err) => {
|
|
47
|
+
reportException(err, 'Refresh wallet unit failure');
|
|
48
|
+
await queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY);
|
|
56
49
|
},
|
|
57
|
-
|
|
50
|
+
onSuccess: () => queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY),
|
|
51
|
+
});
|
|
58
52
|
};
|
|
59
53
|
|
|
60
|
-
export const useWalletUnitCheck = (
|
|
61
|
-
const { data:
|
|
62
|
-
const { mutateAsync: refreshWalletUnit, isLoading: isRefreshing, status: refreshStatus } =
|
|
54
|
+
export const useWalletUnitCheck = (walletUnitId: HolderWalletUnitDetail['id'] | undefined) => {
|
|
55
|
+
const { data: walletUnitDetail, isLoading } = useWalletUnitDetail(walletUnitId);
|
|
56
|
+
const { mutateAsync: refreshWalletUnit, isLoading: isRefreshing, status: refreshStatus } = useWalletUnitStatus();
|
|
63
57
|
|
|
64
58
|
useEffect(() => {
|
|
65
59
|
if (isLoading || refreshStatus !== 'idle') {
|
|
66
60
|
return;
|
|
67
61
|
}
|
|
68
|
-
if (
|
|
69
|
-
void refreshWalletUnit(
|
|
62
|
+
if (walletUnitId && walletUnitDetail?.status === WalletUnitStatus.ACTIVE) {
|
|
63
|
+
void refreshWalletUnit(walletUnitId);
|
|
70
64
|
}
|
|
71
|
-
}, [isLoading, refreshStatus,
|
|
65
|
+
}, [isLoading, refreshStatus, walletUnitDetail, refreshWalletUnit, walletUnitId]);
|
|
72
66
|
|
|
73
67
|
return {
|
|
74
68
|
isLoading: isLoading || isRefreshing,
|
|
75
|
-
|
|
69
|
+
walletUnitDetail: isLoading || isRefreshing ? undefined : walletUnitDetail,
|
|
76
70
|
};
|
|
77
71
|
};
|
package/src/utils/index.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
SelectorStatus,
|
|
20
20
|
} from '../../ui-components';
|
|
21
21
|
import { concatTestID } from '../testID';
|
|
22
|
-
import { WUAState } from '../wallet-unit';
|
|
23
22
|
import {
|
|
24
23
|
CredentialDetailsCardPropsWithoutWidth,
|
|
25
24
|
detailsCardAttributeFromClaim,
|
|
@@ -179,7 +178,6 @@ export const shareCredentialCardFromV2PresentationCredential = (
|
|
|
179
178
|
multipleCredentialsAvailable: boolean,
|
|
180
179
|
selectedFields: string[] | undefined,
|
|
181
180
|
config: Config,
|
|
182
|
-
wuaState: WUAState | undefined,
|
|
183
181
|
testID: string,
|
|
184
182
|
labels: ShareCredentialCardLabels,
|
|
185
183
|
): CredentialDetailsCardPropsWithoutWidth => {
|
|
@@ -205,7 +203,6 @@ export const shareCredentialCardFromV2PresentationCredential = (
|
|
|
205
203
|
expanded,
|
|
206
204
|
multipleCredentialsAvailable,
|
|
207
205
|
config,
|
|
208
|
-
wuaState,
|
|
209
206
|
notice,
|
|
210
207
|
cardTestId,
|
|
211
208
|
labels,
|
|
@@ -226,7 +223,6 @@ export const selectCredentialCardFromV2Credential = (
|
|
|
226
223
|
selected: boolean,
|
|
227
224
|
multiple: boolean,
|
|
228
225
|
config: Config,
|
|
229
|
-
wuaState: WUAState | undefined,
|
|
230
226
|
testID: string,
|
|
231
227
|
labels: ShareCredentialCardLabels,
|
|
232
228
|
): CredentialDetailsCardPropsWithoutWidth => {
|
|
@@ -250,7 +246,6 @@ export const selectCredentialCardFromV2Credential = (
|
|
|
250
246
|
},
|
|
251
247
|
credential.claims.map(v2PresentationClaimToClaim),
|
|
252
248
|
config,
|
|
253
|
-
wuaState,
|
|
254
249
|
notice,
|
|
255
250
|
testID,
|
|
256
251
|
labels,
|