From c6739e8556deda3019815fa48421ba24173400d9 Mon Sep 17 00:00:00 2001 From: Daniel Mader Date: Wed, 4 Dec 2024 00:46:03 +0100 Subject: [PATCH] feat: update custom trust list name --- .../resources/default_trust_list.json | 5 +-- identity-wallet/src/state/trust_list/mod.rs | 2 +- .../trust_list/reducers/edit_trust_list.rs | 7 ++- .../settings/app/trust-list/[id]/+page.svelte | 45 +++++++++++++++++-- 4 files changed, 50 insertions(+), 9 deletions(-) diff --git a/identity-wallet/resources/default_trust_list.json b/identity-wallet/resources/default_trust_list.json index 64a921f3..a1d0a501 100644 --- a/identity-wallet/resources/default_trust_list.json +++ b/identity-wallet/resources/default_trust_list.json @@ -1,8 +1,7 @@ { "id": "b01f4a74-3005-4749-a030-c5444bc4dab5", - "display_name": "Impierce (Development)", - "domains": [ - "https://agent-dev.impierce.com", + "display_name": "Impierce Demos", + "entries": [ "https://ngdil.com", "https://selv.iota.org", "https://thuiswinkel-agent.dev.impierce.com" diff --git a/identity-wallet/src/state/trust_list/mod.rs b/identity-wallet/src/state/trust_list/mod.rs index fcce2ae6..1229cd63 100644 --- a/identity-wallet/src/state/trust_list/mod.rs +++ b/identity-wallet/src/state/trust_list/mod.rs @@ -64,7 +64,7 @@ pub struct TrustList { /// Custom true: TrustList's can be created in dev mode at any time. #[serde(default)] pub custom: bool, - #[serde(alias = "domains", deserialize_with = "deserialize_domains")] + #[serde(deserialize_with = "deserialize_domains")] #[ts(type = "Record")] pub entries: HashMap, } diff --git a/identity-wallet/src/state/trust_list/reducers/edit_trust_list.rs b/identity-wallet/src/state/trust_list/reducers/edit_trust_list.rs index 709c4b1d..18327f64 100644 --- a/identity-wallet/src/state/trust_list/reducers/edit_trust_list.rs +++ b/identity-wallet/src/state/trust_list/reducers/edit_trust_list.rs @@ -14,9 +14,14 @@ pub async fn trust_list_edit(state: AppState, action: Action) -> Result `{}`", + display_name_before, action.new_display_name + ); return Ok(AppState { trust_lists, diff --git a/unime/src/routes/(app)/me/settings/app/trust-list/[id]/+page.svelte b/unime/src/routes/(app)/me/settings/app/trust-list/[id]/+page.svelte index a9cdc9ef..0375b85b 100644 --- a/unime/src/routes/(app)/me/settings/app/trust-list/[id]/+page.svelte +++ b/unime/src/routes/(app)/me/settings/app/trust-list/[id]/+page.svelte @@ -15,6 +15,7 @@ let newEntryInputElement: HTMLInputElement; let showNewEntry = false; let newEntryValue = ''; + $: updatedListName = trustList?.display_name; history.back()} title={trustList?.display_name ?? ''}> @@ -43,6 +44,30 @@
+ {#if trustList?.custom} +

Update list name

+
+ (updatedListName = e.target.value)} + /> +
+
+
+ {/if} +

Trusted issuers

-
+
+