Skip to content

Commit

Permalink
fix: remove button credential detail (#243)
Browse files Browse the repository at this point in the history
- **fix: update credential fields**
- **fix: remove button in credential detail**

---------

Co-authored-by: Puria Nafisi Azizi <[email protected]>
  • Loading branch information
phoebus-84 and puria committed Apr 9, 2024
1 parent 632ba88 commit 05553af
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/organisms/scanner/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export type Data =

const allowedDomains = [
'http://oracle1.zenswarm.forkbomb.eu:3366/verify-credential',
'https://beta.signroom.io'
'https://beta.signroom.io',
'https://dashboard.didroom.com'
];

function isUrlAllowed(url: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/preferences/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type Credential = {
id: number;
configuration_ids: string[];
sdJwt: string;
credential_issuer: string;
issuer: string;
display_name: string;
description: string;
expirationDate: string;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[[lang]]/(auth)/login/_lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { setUser } from '$lib/preferences/user';

const slangroom = new Slangroom(pocketbase);

const pb_address: string = 'https://admin.signroom.io';
const pb_address: string = 'https://admin.didroom.com';
const password = 'CiccioLiam12345!'

export const userEmailStore = writable<{email:string | undefined, registration:boolean}>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Header from '$lib/components/molecules/Header.svelte';
import { r } from '$lib/i18n';
import ScanButton from '$lib/components/molecules/ScanButton.svelte';
export let data: any;
const { credential, credentials } = data;
import { register } from 'swiper/element/bundle';
Expand Down Expand Up @@ -31,14 +31,12 @@
class="mt-8"
>
{#each credentials as credential}
<swiper-slide id={getIndex(credential.id)}
><d-credential-card
<swiper-slide id={getIndex(credential.id)}>
<d-credential-card
{...credential}
name={credential.display_name}
logoSrc={credential.logo.url}
description=""
issuer={credential.credential_issuer.length > 18
? credential.credential_issuer.slice(0, 18) + '...'
: credential.credential_issuer}
/>
</swiper-slide>
{/each}
Expand All @@ -47,9 +45,10 @@
<d-credential-detail
{...detailCredential}
description={detailCredential.description}
name={detailCredential.display_name}
logoSrc={detailCredential.logo.url}
>
<d-button color="accent" href={r('/scan/')} expand>SCAN FOR VERIFICATION</d-button>
</d-credential-detail>
</div>
<ScanButton />
</ion-content>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
setTimeout(async () => {
const savedCredential = await setCredentialPreference({
configuration_ids: parsedService.credential_configuration_ids,
name: qrToWellKnown.credential_requested.display[0].name,
display_name: qrToWellKnown.credential_requested.display[0].name,
sdJwt: serviceResponse.credential,
issuer: parsedService.credential_issuer,
description: qrToWellKnown.credential_requested.display[0].description,
Expand Down Expand Up @@ -123,9 +123,11 @@
<div class="flex w-full justify-around">
<ion-icon icon={thumbsUpOutline} class="mx-auto my-6 text-9xl text-green-400"
></ion-icon>
<pre>
{JSON.stringify(serviceResponse, null, 2)}
</pre>
<div class="flex flex-col gap-2 ion-padding">
<d-text class="break-words">credential: {serviceResponse.credential}</d-text>
<d-text class="break-words">c_nonce: {serviceResponse.c_nonce}</d-text>
<d-text class="break-words">c_nonce_expires_in: {serviceResponse.c_nonce_expires_in}</d-text>
</div>
</div>
{/if}
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/routes/[[lang]]/(protected)/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//@ts-ignore
const { method, id: fullId } = parse(did.result.didDocument.id)!;
const [submethod, id] = fullId.split(':');
log(orgs, did);
</script>

<TabPage tab="profile" title="PROFILE">
Expand All @@ -33,7 +32,7 @@
<div class="mx-auto mt-8 flex w-3/5 flex-wrap items-center justify-between gap-8">
{#each orgs as org}
<d-avatar
src={`https://admin.signroom.io/api/files/${org.collectionId}/${org.id}/${org.avatar}`}
src={`https://admin.didroom.com/api/files/${org.collectionId}/${org.id}/${org.avatar}`}
alt={org.name}
size="xl"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[[lang]]/(protected)/profile/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const organizations = async (k = '1') => {
const user = await getUser();
if (!user) return;
const data: { pb_address: ServerUrl; list_parameters: ListParameters } = {
pb_address: 'https://admin.signroom.io/',
pb_address: 'https://admin.didroom.com/',
list_parameters: {
type: 'all',
collection: 'orgJoinRequests',
Expand Down
5 changes: 0 additions & 5 deletions src/routes/[[lang]]/(protected)/wallet/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import ScanButton from '$lib/components/molecules/ScanButton.svelte';
import { m, r } from '$lib/i18n';
import { getCredentialsPreference } from '$lib/preferences/credentials';
import TabPage from '$lib/tabs/TabPage.svelte';
Expand Down Expand Up @@ -72,9 +71,6 @@
<d-credential-card
{...credential}
name={credential.display_name}
issuer={credential.credential_issuer.length > 18
? credential.credential_issuer.slice(0, 18) + '...'
: credential.credential_issuer}
logoSrc={credential.logo.url}
/>
</a>
Expand All @@ -87,5 +83,4 @@
<d-text size="l" class="pb-4">{error.message}</d-text>
</div>
{/await}
<ScanButton />
</TabPage>

0 comments on commit 05553af

Please sign in to comment.