Skip to content

Commit

Permalink
fix: make the dashboard reactive on org changes (#985)
Browse files Browse the repository at this point in the history
* fix: make the dashboard reactive on org changes

* fix: added reactive statements

---------

Co-authored-by: Giovanni Abbatepaolo <[email protected]>
  • Loading branch information
puria and bbtgnn authored Feb 19, 2025
1 parent 9fe4c92 commit 99436f4
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion webapp/client_zencode
1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"prismjs": "^1.29.0",
"qrcode-generator": "^1.4.4",
"slugify": "^1.6.6",
"sqlite3": "^5.1.7",
"svelte-boring-avatars": "^1.2.6",
"svelte-heros": "^6.0.3",
"svelte-persisted-store": "^0.9.1",
Expand Down
3 changes: 3 additions & 0 deletions webapp/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
//
export let data;
let { token } = data;
$: ({ token } = data);
let success = false;
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/routes/[[lang]]/(topbar)/pricing/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { ArrowLeft } from 'svelte-heros-v2';
export let data;
let { content } = data;
$: ({ content } = data);
</script>

<div class="mx-auto max-w-4xl p-4">
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/routes/[[lang]]/my/did/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { m } from '$lib/i18n';
export let data;
const did = JSON.stringify(data.did, null, 2);
$: did = JSON.stringify(data.did, null, 2);
</script>

<div class="space-y-4 p-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { addSignaturesToReflowSeal, verifySignedReflowSeal } from './logic.js';
export let data;
let { multisignature, seals } = data;
$: ({ multisignature, seals } = data);
let participants = seals.map((s) => s.expand?.owner.name);
let issuer = multisignature.expand?.coconut_credential_issuer;
let owner = multisignature.expand?.owner!;
$: participants = seals.map((s) => s.expand?.owner.name);
$: issuer = multisignature.expand?.coconut_credential_issuer;
$: owner = multisignature.expand?.owner!;
let missingSeals = seals.some((s) => s.status == MultisignatureSealsStatusOptions.pending);
let allGood = seals.every((s) => s.status == MultisignatureSealsStatusOptions.signed);
$: missingSeals = seals.some((s) => s.status == MultisignatureSealsStatusOptions.pending);
$: allGood = seals.every((s) => s.status == MultisignatureSealsStatusOptions.signed);
let verified = false;
async function completeMultisignature() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { getKeyringFromLocalStorage } from '$lib/keypairoom/keypair';
export let data;
let { seal, issuer, multisignature } = data;
$: ({ seal, issuer, multisignature } = data);
async function sign() {
try {
Expand Down
9 changes: 4 additions & 5 deletions webapp/src/routes/[[lang]]/my/organizations/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { Badge } from 'flowbite-svelte';
import { templatesColors } from '$lib/templates';
import MicroserviceBadge from '$lib/microservices/microserviceBadge.svelte';
import type { MicroserviceType } from '$lib/microservices';
export let data;
let {
$: base = (path: string) => `${$page.url.pathname}${path}`;
$: ({
organization,
membershipRequests,
microservices,
issuanceFlows,
verificationFlows,
templates
} = data;
$: base = (path: string) => `${$page.url.pathname}${path}`;
} = data);
</script>

<OrganizationLayout org={data.organization}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import Icon from '$lib/components/icon.svelte';
export let data;
let { organization } = data;
$: organization = data.organization;
const recordType = createTypeProp<ServicesResponse>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import SectionTitle from '$lib/components/sectionTitle.svelte';
import Icon from '$lib/components/icon.svelte';
import { page } from '$app/stores';
import { Avatar } from 'flowbite-svelte';
import { ProtectedOrgUI } from '$lib/organizations';
import TemplateSchemaDisplay from '$lib/components/templateSchemaDisplay.svelte';
import { assets } from '$app/paths';
//
export let data;
let { service, organization } = data;
let { credential_issuer, credential_template, authorization_server, authorization_template } =
service.expand!;
$: ({ service, organization } = data);
$: ({ credential_issuer, credential_template, authorization_server, authorization_template } =
service.expand!);
//
const issuanceFlowQr = generateQr(
$: issuanceFlowQr = generateQr(
createIntentUrl({
credential_configuration_ids: [service.type_name],
credential_issuer: credential_issuer.endpoint,
Expand All @@ -49,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
// downloadBlob(imgBlob, `credential-issuance-qr.png`);
// }
let microservicesTemplates = [
$: microservicesTemplates = [
{
label: m.Credential_template(),
name: credential_template?.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
//
export let data;
$: organization = data.organization;
$: userRole = data.userRole;
$: ({ organization, userRole } = data);
type AuthorizationWithUser = OrgAuthorizationsResponse<{
user: UsersResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
//
export let data;
let { organization } = data;
$: organization = data.organization;
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
//
export let data;
let { organization } = data;
$: organization = data.organization;
const recordType = createTypeProp<TemplatesResponse>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { ProtectedOrgUI } from '$lib/organizations/index.js';
export let data;
let { organization } = data;
$: organization = data.organization;
const recordType = createTypeProp<VerificationFlowsResponse>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ SPDX-License-Identifier: AGPL-3.0-or-later
export let data;
let { verificationFlow, organization } = data;
let { template, relying_party } = verificationFlow.expand!;
$: ({ verificationFlow, organization } = data);
$: ({ template, relying_party } = verificationFlow.expand!);
</script>

<PageTop>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/routes/[[lang]]/my/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import { ArrowUpRight } from 'svelte-heros-v2';
export let data;
let { publicKeys } = data;
$: ({ publicKeys } = data);
</script>

<div class="mx-auto max-w-xl space-y-8 p-8">
Expand Down

0 comments on commit 99436f4

Please sign in to comment.