From 9032da28538d66031e9bf313d3609a3c57f6c61a Mon Sep 17 00:00:00 2001 From: Daniel Mader Date: Fri, 9 Aug 2024 11:41:02 +0200 Subject: [PATCH] chore: minor DX/UX improvements (#323) * refactor: minor improvements * refactor: remove loading spinner * chore: update script * fix: type error * fix: test value to match actual * docs: describe build steps * chore(deps): bump did_manager * docs: update Android build path * refactor: remove all mock scans --- README.md | 8 +++ .../reducers/ferris_static_profile.rs | 2 +- package-lock.json | 44 ------------ unime/package.json | 4 -- unime/src-tauri/gen-static/apply.sh | 7 ++ .../states/four_credentials_redirect_me.json | 4 +- unime/src/lib/components/ListItemCard.svelte | 2 +- .../components/navigation/TopNavBar.svelte | 4 +- unime/src/lib/icons/index.ts | 8 +-- unime/src/lib/stores.ts | 3 +- unime/src/routes/(app)/scan/+page@.svelte | 72 ++++--------------- unime/src/routes/+layout.svelte | 4 +- .../prompt/credential-offer/+page.svelte | 2 +- .../{password => }/completed/+page.svelte | 10 ++- .../welcome/password/confirm/+page.svelte | 2 +- unime/src/routes/welcome/utils.ts | 2 +- 16 files changed, 52 insertions(+), 126 deletions(-) create mode 100755 unime/src-tauri/gen-static/apply.sh rename unime/src/routes/welcome/{password => }/completed/+page.svelte (94%) diff --git a/README.md b/README.md index 8bd1eadeb..a03f46757 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,11 @@ rm -rf ~/.cargo/git/checkouts/* # Windows rd /s /q "%USERPROFILE%\.cargo\git\checkouts" ``` + +## Release a new version + +1. Search the entire project for the current version string (such as `0.6.2`) and replace them with the new version string. + Be **cautious** not to replace versions of any other dependencies (in `Cargo.toml`, `Cargo.lock`, `package.json`, `package-lock.json`). +2. Run the script in `unime/src-tauri/gen-static/apply.sh` which copies over the changed files into the (untracked) generated folders for Android and iOS. +3. Inside `unime/src-tauri` run `cargo tauri icon`. +4. Run `npm run tauri ios build` and `npm run tauri android build` to build the apps. The iOS build (`.ipa`) will be in `unime/src-tauri/gen/apple/build/arm64` and the Android builds (`.apk` and `.aab`) will be in `unime/src-tauri/gen/android/app/build/outputs/`. diff --git a/identity-wallet/src/state/dev_mode/reducers/ferris_static_profile.rs b/identity-wallet/src/state/dev_mode/reducers/ferris_static_profile.rs index 27d76cb82..2597e8335 100644 --- a/identity-wallet/src/state/dev_mode/reducers/ferris_static_profile.rs +++ b/identity-wallet/src/state/dev_mode/reducers/ferris_static_profile.rs @@ -35,7 +35,7 @@ lazy_static! { }; pub static ref DRIVERS_LICENSE_CREDENTIAL: VerifiableCredentialRecord = { let mut record = VerifiableCredentialRecord::try_from( - json!("eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2toUDQzTENTWGFqM1NRQm92eTF1RTJuWHZTQm5SUFdaMndoUExxblo4UGdEI3o2TWtraFA0M0xDU1hhajNTUUJvdnkxdUUyblh2U0JuUlBXWjJ3aFBMcW5aOFBnRCJ9.eyJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjEyNzo5MDkwLyIsInN1YiI6ImRpZDprZXk6ejZNa2cxWFhHVXFma2hBS1Uxa1ZkMVBtdzZVRWoxdnhpTGoxeGM5MU1CejVvd05ZIiwiZXhwIjo5OTk5OTk5OTk5LCJpYXQiOjAsInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIiwiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIkRyaXZlckxpY2Vuc2VDcmVkZW50aWFsIl0sImlzc3VlciI6Imh0dHA6Ly8xOTIuMTY4LjEuMTI3OjkwOTAvIiwiaXNzdWFuY2VEYXRlIjoiMjAyMi0wOC0xNVQwOTozMDowMFoiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMjctMDgtMTVUMjM6NTk6NTlaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQ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V5Ono2TWtnMVhYR1VxZmtoQUtVMWtWZDFQbXc2VUVqMXZ4aUxqMXhjOTFNQno1b3dOWSIsImxpY2Vuc2VDbGFzcyI6IkNsYXNzIEMiLCJpc3N1ZWRCeSI6IkNhbGlmb3JuaWEiLCJ2YWxpZGl0eSI6IlZhbGlkIn19fQ.OZCcZt5JTJcBhoLPIyrQuvZuc2dnVN65f8GvKQ3earAzJEgGMA9ZjKRNHEjI73wLwvG5MJBN7Zs_rWiNLEZ5Dg"), ).unwrap(); record.display_credential.display_name = "DriverLicenseCredential".to_string(); record diff --git a/package-lock.json b/package-lock.json index 2a2ee57c0..2451d187b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1121,36 +1121,6 @@ "@iconify/types": "*" } }, - "node_modules/@iconify-json/emojione": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/@iconify-json/emojione/-/emojione-1.1.10.tgz", - "integrity": "sha512-gzv5tbkbyoJFArWmmtGDmhvKjCcpa9a+qEFbW35IlKHc9LBL5lluRccP+BckCoYcoi5qi1VCPxzz6QL/UYW5VQ==", - "dev": true, - "license": "CC-BY-4.0", - "dependencies": { - "@iconify/types": "*" - } - }, - "node_modules/@iconify-json/heroicons": { - "version": "1.1.21", - "resolved": "https://registry.npmjs.org/@iconify-json/heroicons/-/heroicons-1.1.21.tgz", - "integrity": "sha512-A+3L4KN+TjH3V8fQ2N2dkOOnLLxMgMBzO8RDT0P9YL+YzvLMIbe/lkDLSB8NB8x0DKWmkvTimoo1l4DKMwi7Zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@iconify/types": "*" - } - }, - "node_modules/@iconify-json/lucide": { - "version": "1.1.198", - "resolved": "https://registry.npmjs.org/@iconify-json/lucide/-/lucide-1.1.198.tgz", - "integrity": "sha512-XFALR7z8cNMpoY6SGbw12GgqAdxhouAGE4KPYNUdwovcup6miwPZRrghyi2nSz15/E2xpwfZBpmwnUJUmdt6mQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@iconify/types": "*" - } - }, "node_modules/@iconify-json/ph": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/@iconify-json/ph/-/ph-1.1.13.tgz", @@ -1161,16 +1131,6 @@ "@iconify/types": "*" } }, - "node_modules/@iconify-json/svg-spinners": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@iconify-json/svg-spinners/-/svg-spinners-1.1.2.tgz", - "integrity": "sha512-Aab6SqkORaTJ1W+ooufn6C8BsBitrn3uk8iRQLPA6pjhyvQAhkKCGMctyXIL5ZjrycnoFVsZ4mx7KnwEMra8qg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@iconify/types": "*" - } - }, "node_modules/@iconify/types": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", @@ -9012,11 +8972,7 @@ }, "devDependencies": { "@iconify-json/circle-flags": "^1.1.46", - "@iconify-json/emojione": "^1.1.7", - "@iconify-json/heroicons": "^1.1.11", - "@iconify-json/lucide": "^1.1.112", "@iconify-json/ph": "^1.1.13", - "@iconify-json/svg-spinners": "^1.1.1", "@melt-ui/pp": "^0.3.0", "@melt-ui/svelte": "^0.76.0", "@sveltejs/adapter-static": "^3.0.0", diff --git a/unime/package.json b/unime/package.json index f070d69d3..026578d53 100644 --- a/unime/package.json +++ b/unime/package.json @@ -30,11 +30,7 @@ }, "devDependencies": { "@iconify-json/circle-flags": "^1.1.46", - "@iconify-json/emojione": "^1.1.7", - "@iconify-json/heroicons": "^1.1.11", - "@iconify-json/lucide": "^1.1.112", "@iconify-json/ph": "^1.1.13", - "@iconify-json/svg-spinners": "^1.1.1", "@melt-ui/pp": "^0.3.0", "@melt-ui/svelte": "^0.76.0", "@sveltejs/adapter-static": "^3.0.0", diff --git a/unime/src-tauri/gen-static/apply.sh b/unime/src-tauri/gen-static/apply.sh new file mode 100755 index 000000000..2e1866721 --- /dev/null +++ b/unime/src-tauri/gen-static/apply.sh @@ -0,0 +1,7 @@ +# Copies all files tracked by git (/gen-static) to the generated resources (/gen) + +cp -v ./android/app/build.gradle.kts ../gen/android/app/build.gradle.kts +cp -v ./android/app/proguard-rules.pro ../gen/android/app/proguard-rules.pro +cp -v ./android/app/src/main/AndroidManifest.xml ../gen/android/app/src/main/AndroidManifest.xml +cp -v ./apple/ExportOptions.plist ../gen/apple/ExportOptions.plist +cp -v ./apple/unime_iOS/Info.plist ../gen/apple/unime_iOS/Info.plist diff --git a/unime/src-tauri/tests/fixtures/states/four_credentials_redirect_me.json b/unime/src-tauri/tests/fixtures/states/four_credentials_redirect_me.json index d18a84318..bb7cf5cdb 100644 --- a/unime/src-tauri/tests/fixtures/states/four_credentials_redirect_me.json +++ b/unime/src-tauri/tests/fixtures/states/four_credentials_redirect_me.json @@ -52,7 +52,7 @@ "@context": ["https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1"], "type": ["VerifiableCredential", "DriverLicenseCredential"], "issuer": "http://192.168.1.127:9090/", - "issuanceDate": "2022-08-15T09:30:00Z", + "issuanceDate": "2004-02-08T08:14:08Z", "expirationDate": "2027-08-15T23:59:59Z", "credentialSubject": { "id": "did:key:z6Mkg1XXGUqfkhAKU1kVd1Pmw6UEj1vxiLj1xc91MBz5owNY", @@ -64,7 +64,7 @@ "metadata": { "is_favorite": false, "date_added": "", - "date_issued": "2022-08-15T09:30:00Z" + "date_issued": "2004-02-08T08:14:08Z" }, "display_name": "DriverLicenseCredential" }, diff --git a/unime/src/lib/components/ListItemCard.svelte b/unime/src/lib/components/ListItemCard.svelte index de36d69c9..d7f000524 100644 --- a/unime/src/lib/components/ListItemCard.svelte +++ b/unime/src/lib/components/ListItemCard.svelte @@ -41,7 +41,7 @@ Can be used for credentials, connections, etc. - +
{#if title}

diff --git a/unime/src/lib/icons/index.ts b/unime/src/lib/icons/index.ts index a64ad1b1c..a0156adcf 100644 --- a/unime/src/lib/icons/index.ts +++ b/unime/src/lib/icons/index.ts @@ -4,18 +4,16 @@ export { default as GBFlagIcon } from '~icons/circle-flags/gb'; export { default as NLFlagIcon } from '~icons/circle-flags/nl'; export { default as USFlagIcon } from '~icons/circle-flags/us'; -// Lucide icons: https://icon-sets.iconify.design/lucide/ -export { default as ChevronLeftIcon } from '~icons/lucide/chevron-left'; -export { default as ScrollTextIcon } from '~icons/lucide/scroll-text'; - // Phosphor icons: https://icon-sets.iconify.design/ph/ export { default as ArrowLeftRegularIcon } from '~icons/ph/arrow-left'; export { default as ArrowSquareOutBoldIcon } from '~icons/ph/arrow-square-out-bold'; export { default as BankLightIcon } from '~icons/ph/bank-light'; +export { default as BugRegularIcon } from '~icons/ph/bug'; export { default as CalendarCheckRegularIcon } from '~icons/ph/calendar-check'; export { default as CalendarPlusRegularIcon } from '~icons/ph/calendar-plus'; export { default as CameraSlashRegularIcon } from '~icons/ph/camera-slash'; export { default as CaretDownBoldIcon } from '~icons/ph/caret-down-bold'; +export { default as CaretLeftBoldIcon } from '~icons/ph/caret-left-bold'; export { default as CaretRightBoldIcon } from '~icons/ph/caret-right-bold'; export { default as CaretUpBoldIcon } from '~icons/ph/caret-up-bold'; export { default as CertificateLightIcon } from '~icons/ph/certificate-light'; @@ -25,6 +23,7 @@ export { default as CheckCircleRegularIcon } from '~icons/ph/check-circle'; export { default as CheckCircleFillIcon } from '~icons/ph/check-circle-fill'; export { default as CircleRegularIcon } from '~icons/ph/circle'; export { default as CodeBoldIcon } from '~icons/ph/code-bold'; +export { default as CodeRegularIcon } from '~icons/ph/code'; export { default as ConfettiFillIcon } from '~icons/ph/confetti-fill'; export { default as DownloadSimpleFillIcon } from '~icons/ph/download-simple-fill'; export { default as EnvelopeFillIcon } from '~icons/ph/envelope-fill'; @@ -68,5 +67,6 @@ export { default as UserLightIcon } from '~icons/ph/user-light'; export { default as VaultFillIcon } from '~icons/ph/vault-fill'; export { default as WarningRegularIcon } from '~icons/ph/warning'; export { default as WarningCircleFillIcon } from '~icons/ph/warning-circle-fill'; +export { default as WarningCircleRegularIcon } from '~icons/ph/warning-circle'; export { default as XRegularIcon } from '~icons/ph/x'; export { default as XBoldIcon } from '~icons/ph/x-bold'; diff --git a/unime/src/lib/stores.ts b/unime/src/lib/stores.ts index f368d95c4..4fa594562 100644 --- a/unime/src/lib/stores.ts +++ b/unime/src/lib/stores.ts @@ -36,7 +36,8 @@ const empty_state: AppState = { profile_settings: { locale: 'en-US', profile: null, - preferred_did_method: 'did:jwk', + preferred_did_methods: ['did:jwk'], + preferred_key_types: ['Ed25519'], sorting_preferences: { connections: { sort_method: 'name_az', diff --git a/unime/src/routes/(app)/scan/+page@.svelte b/unime/src/routes/(app)/scan/+page@.svelte index 6b50c8462..eea86f693 100644 --- a/unime/src/routes/(app)/scan/+page@.svelte +++ b/unime/src/routes/(app)/scan/+page@.svelte @@ -77,43 +77,6 @@ } } - const mockScanError = () => { - loading = true; - setTimeout(() => { - loading = false; - dispatch({ type: '[QR Code] Scanned', payload: { form_urlencoded: 'foobar' } }); - }, 1_000); - }; - - const mockSiopRequest = () => { - state.set({ - ...$state, - current_user_prompt: { - type: 'accept-connection', - client_name: 'Some other client', - logo_uri: undefined, - redirect_uri: 'https://demo.ngdil.com/auth/callback', - previously_connected: false, - domain_validation: { - status: 'Unknown', - message: 'DomainLinkageConfiguration could not be fetched', - }, - }, - }); - }; - - const mockShareRequest = () => { - state.set({ - ...$state, - current_user_prompt: { - type: 'share-credentials', - client_name: 'My Client Name', - logo_uri: undefined, - options: [$state.credentials[0].id], - }, - }); - }; - async function cancelScan() { await cancel(); scanning = false; @@ -155,30 +118,21 @@ {/if} - {#if $state?.dev_mode !== 'Off'} + {#if $state?.dev_mode !== 'Off' && !loading}

- -
-

Mock scans

-
+
+ +
- -
{/if} diff --git a/unime/src/routes/+layout.svelte b/unime/src/routes/+layout.svelte index e63354156..fd301f8eb 100644 --- a/unime/src/routes/+layout.svelte +++ b/unime/src/routes/+layout.svelte @@ -12,9 +12,9 @@ import { dispatch } from '$lib/dispatcher'; import { ArrowLeftRegularIcon, + BugRegularIcon, CaretDownBoldIcon, CaretUpBoldIcon, - ScrollTextIcon, TrashRegularIcon, } from '$lib/icons'; import { error, state } from '$lib/stores'; @@ -94,7 +94,7 @@ }; const debugButton: DevModeButton = { - icon: ScrollTextIcon, + icon: BugRegularIcon, onClick: () => (showDebugMessages = !showDebugMessages), }; diff --git a/unime/src/routes/prompt/credential-offer/+page.svelte b/unime/src/routes/prompt/credential-offer/+page.svelte index dfdbfc30a..ffcfebbd9 100644 --- a/unime/src/routes/prompt/credential-offer/+page.svelte +++ b/unime/src/routes/prompt/credential-offer/+page.svelte @@ -68,7 +68,7 @@ class="mt-3 w-full rounded-[20px] border border-slate-200 bg-white p-[10px] dark:border-slate-600 dark:bg-dark" > {#each Object.entries(credential_configurations) as [credential_configuration_id, credential_configuration]} - + - history.back()} title={$LL.ONBOARDING.PASSWORD.COMPLETED.NAVBAR_TITLE()} /> + history.back()} title={$LL.ONBOARDING.PASSWORD.COMPLETED.NAVBAR_TITLE()} disabled />
@@ -57,8 +59,8 @@
diff --git a/unime/src/routes/welcome/password/confirm/+page.svelte b/unime/src/routes/welcome/password/confirm/+page.svelte index a7619799d..4948d7280 100644 --- a/unime/src/routes/welcome/password/confirm/+page.svelte +++ b/unime/src/routes/welcome/password/confirm/+page.svelte @@ -102,5 +102,5 @@
-
diff --git a/unime/src/routes/welcome/utils.ts b/unime/src/routes/welcome/utils.ts index 316360b17..e3a75eb0b 100644 --- a/unime/src/routes/welcome/utils.ts +++ b/unime/src/routes/welcome/utils.ts @@ -5,5 +5,5 @@ export const routeOrder = [ '/welcome/customize/name', '/welcome/password', '/welcome/password/confirm', - '/welcome/password/completed', + '/welcome/completed', ];