Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit 28fca19

Browse files
committed
Testing basic tenant styling
1 parent 3a118d6 commit 28fca19

File tree

9 files changed

+89
-51
lines changed

9 files changed

+89
-51
lines changed

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ dependencies {
112112
implementation("org.jetbrains.exposed:exposed-dao:0.44.1")
113113
implementation("org.jetbrains.exposed:exposed-java-time:0.44.1")
114114
implementation("org.jetbrains.exposed:exposed-json:0.44.1")
115-
implementation("org.xerial:sqlite-jdbc:3.42.0.0")
115+
implementation("org.xerial:sqlite-jdbc:3.44.1.0")
116116
implementation("org.postgresql:postgresql:42.6.0")
117117
// migration
118118
implementation("org.flywaydb:flyway-core:9.22.2")

src/main/kotlin/id/walt/db/Db.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ object Db {
6161
Accounts,
6262
Web3Wallets
6363
)
64-
/*SchemaUtils.create(
64+
SchemaUtils.create(
6565
Web3Wallets,
6666
Accounts,
6767
//AccountWeb3WalletMappings,
@@ -72,9 +72,9 @@ object Db {
7272
WalletDids,
7373
WalletOperationHistories,
7474
Issuers
75-
)*/
75+
)
7676

77-
SchemaUtils.create(Web3Wallets)
77+
/*SchemaUtils.create(Web3Wallets)
7878
SchemaUtils.create(Accounts)
7979
//AccountWeb3WalletMappings,
8080
SchemaUtils.create(Wallets)
@@ -83,8 +83,7 @@ object Db {
8383
SchemaUtils.create(WalletKeys)
8484
SchemaUtils.create(WalletDids)
8585
SchemaUtils.create(WalletOperationHistories)
86-
SchemaUtils.create(Issuers)
87-
86+
SchemaUtils.create(Issuers)*/
8887

8988
runBlocking {
9089
AccountsService.register(EmailAccountRequest("Max Mustermann", "[email protected]", "string"))

src/main/kotlin/id/walt/service/SSIKit2WalletService.kt

+9-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import id.walt.db.models.WalletKeys
1010
import id.walt.db.models.WalletOperationHistories
1111
import id.walt.db.models.WalletOperationHistory
1212
import id.walt.did.dids.DidService
13+
import id.walt.did.dids.registrar.LocalRegistrar
1314
import id.walt.did.dids.registrar.dids.DidCheqdCreateOptions
1415
import id.walt.did.dids.registrar.dids.DidJwkCreateOptions
1516
import id.walt.did.dids.registrar.dids.DidKeyCreateOptions
1617
import id.walt.did.dids.registrar.dids.DidWebCreateOptions
17-
import id.walt.did.helpers.WaltidServices
18+
import id.walt.did.dids.resolver.LocalResolver
1819
import id.walt.did.utils.EnumUtils.enumValueIgnoreCase
1920
import id.walt.oid4vc.data.GrantType
2021
import id.walt.oid4vc.data.OpenIDProviderMetadata
@@ -63,7 +64,13 @@ class SSIKit2WalletService(accountId: UUID, walletId: UUID) : WalletService(acco
6364
companion object {
6465
init {
6566
runBlocking {
66-
WaltidServices.init()
67+
//WaltidServices.init()
68+
DidService.apply {
69+
registerResolver(LocalResolver())
70+
updateResolversForMethods()
71+
registerRegistrar(LocalRegistrar())
72+
updateRegistrarsForMethods()
73+
}
6774
}
6875
}
6976
}

web/src/app.vue

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
<script lang="ts" setup>
2-
import { InitApp } from "~/utils/initApp";
3-
import ModalBase from "~/components/modals/ModalBase.vue";
4-
5-
InitApp();
6-
const locale = useState<string>("locale.i18n");
7-
</script>
8-
91
<template>
102
<Html :lang="locale" class="h-full">
113
<Head>
12-
<Link href="/svg/walt-s.svg" rel="icon" type="text/xml" />
4+
<Link :href="logoImg" rel="icon" type="text/xml" />
135
</Head>
146
<!--<head>
157
<link rel="icon" type="text/xml" href="/svg/walt-s.svg">
@@ -19,13 +11,30 @@ const locale = useState<string>("locale.i18n");
1911
<ModalBase />
2012
<VitePwaManifest />
2113
<NuxtLoadingIndicator />
14+
<!-- {{ tenant }}-->
2215
<NuxtLayout class="h-full">
2316
<NuxtPage class="h-full" />
2417
</NuxtLayout>
2518
</Body>
2619
</Html>
2720
</template>
2821

22+
<script lang="ts" setup>
23+
import { InitApp } from "~/utils/initApp";
24+
import ModalBase from "~/components/modals/ModalBase.vue";
25+
import { $fetch } from "ofetch";
26+
import { useTenant } from "~/composables/tenants";
27+
28+
InitApp();
29+
const locale = useState<string>("locale.i18n");
30+
31+
const tenant = await (useTenant()).value
32+
const bgImg = tenant?.bgImg
33+
const name = tenant?.name
34+
const logoImg = tenant?.logoImage
35+
const showWaltidLoadingSpinner = tenant?.showWaltidLoadingSpinner
36+
</script>
37+
2938
<style lang="postcss">
3039
/*body {
3140
@apply bg-gray-50 dark:bg-gray-800;

web/src/composables/tenants.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export function useTenant() {
2+
return useState("tenant-config", async () => {
3+
const baseTenantDomain = useRequestURL().host.replace(":3000", ":8080");
4+
console.log("Base tenant domain is: ", baseTenantDomain)
5+
6+
const { data , error } = await useFetch("http://" + baseTenantDomain + "/config/wallet");
7+
console.log("Tenant configuration: ", data.value)
8+
9+
if (error.value) {
10+
console.log("Tenant error: ", error.value.message)
11+
throw createError({
12+
statusCode: 404,
13+
statusMessage: "Tenant error: " + error.value?.data?.message,
14+
fatal: true
15+
})
16+
}
17+
18+
return data.value;
19+
});
20+
}

web/src/layouts/default-reduced-nav.vue

+8-13
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,7 @@
6060
</div>
6161
</TransitionChild>
6262
<div class="flex flex-shrink-0 items-center px-4">
63-
<svg class="h-14 w-auto border-white border-4 rounded-full" fill="none" height="141" viewBox="0 0 141 141" width="141" xmlns="http://www.w3.org/2000/svg">
64-
<circle cx="70.5" cy="70.5" fill="#2563EB" r="70.5" />
65-
<rect fill="#FFFFFF" height="8.67692" width="30.3692" x="39.0461" y="45.5538" />
66-
<path
67-
d="M112.8 74.8385L105.208 73.7538C99.7846 103.038 68.3308 103.038 68.3308 103.038L67.2462 111.715C100.218 112.583 111.354 87.4923 112.8 74.8385Z"
68-
fill="#FFFFFF"
69-
/>
70-
</svg>
63+
<img alt="" class="h-14 w-auto" :src="inWalletLogoImage" />
7164
</div>
7265

7366
<nav aria-label="Sidebar" class="mt-5 h-full flex-shrink-0 divide-y divide-blue-800 overflow-y-auto">
@@ -99,11 +92,7 @@
9992
<!-- Sidebar component, swap this element with another sidebar if you like -->
10093
<div class="flex flex-grow flex-col overflow-y-auto bg-blue-600 pb-4 pt-5" style="color: rgb(37, 99, 235)">
10194
<div class="flex flex-shrink-0 items-center px-4">
102-
<svg class="h-14 w-auto border-white rounded-full" fill="none" height="141" style="border-width: 0.225em" viewBox="0 0 141 141" width="141" xmlns="http://www.w3.org/2000/svg">
103-
<circle cx="70.5" cy="70.5" fill="#2563EB" r="70.5" />
104-
<rect fill="#FFFFFF" height="8.67692" width="30.3692" x="39.0461" y="45.5538" />
105-
<path d="M112.8 74.8385L105.208 73.7538C99.7846 103.038 68.3308 103.038 68.3308 103.038L67.2462 111.715C100.218 112.583 111.354 87.4923 112.8 74.8385Z" fill="#FFFFFF" />
106-
</svg>
95+
<img alt="" class="h-14 w-auto" :src="inWalletLogoImage" />
10796
</div>
10897
<nav aria-label="Sidebar" class="mt-5 flex flex-1 flex-col divide-y divide-blue-800 overflow-y-auto">
10998
<div class="mt-2 pt-2">
@@ -214,6 +203,12 @@ import { ChevronDownIcon, MagnifyingGlassIcon } from "@heroicons/vue/20/solid";
214203
import { useUserStore } from "~/stores/user";
215204
import { storeToRefs } from "pinia";
216205
import * as nearAPI from "near-api-js";
206+
import { useTenant } from "~/composables/tenants";
207+
208+
const tenant = await (useTenant()).value
209+
const name = tenant?.name
210+
const logoImg = tenant?.logoImage
211+
const inWalletLogoImage = tenant?.inWalletLogoImage
217212
218213
const userStore = useUserStore();
219214
const { user } = storeToRefs(userStore);

web/src/layouts/default.vue

+8-13
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,7 @@
6060
</div>
6161
</TransitionChild>
6262
<div class="flex flex-shrink-0 items-center px-4">
63-
<svg class="h-14 w-auto border-white border-4 rounded-full" fill="none" height="141" viewBox="0 0 141 141" width="141" xmlns="http://www.w3.org/2000/svg">
64-
<circle cx="70.5" cy="70.5" fill="#2563EB" r="70.5" />
65-
<rect fill="#FFFFFF" height="8.67692" width="30.3692" x="39.0461" y="45.5538" />
66-
<path
67-
d="M112.8 74.8385L105.208 73.7538C99.7846 103.038 68.3308 103.038 68.3308 103.038L67.2462 111.715C100.218 112.583 111.354 87.4923 112.8 74.8385Z"
68-
fill="#FFFFFF"
69-
/>
70-
</svg>
63+
<img alt="" class="h-14 w-auto" :src="inWalletLogoImage" />
7164
</div>
7265

7366
<nav aria-label="Sidebar" class="mt-5 h-full flex-shrink-0 divide-y divide-blue-800 overflow-y-auto">
@@ -112,11 +105,7 @@
112105
<!-- Sidebar component, swap this element with another sidebar if you like -->
113106
<div class="flex flex-grow flex-col overflow-y-auto bg-blue-600 pb-4 pt-5" style="color: rgb(37, 99, 235)">
114107
<div class="flex flex-shrink-0 items-center px-4">
115-
<svg class="h-14 w-auto border-white rounded-full" fill="none" height="141" style="border-width: 0.225em" viewBox="0 0 141 141" width="141" xmlns="http://www.w3.org/2000/svg">
116-
<circle cx="70.5" cy="70.5" fill="#2563EB" r="70.5" />
117-
<rect fill="#FFFFFF" height="8.67692" width="30.3692" x="39.0461" y="45.5538" />
118-
<path d="M112.8 74.8385L105.208 73.7538C99.7846 103.038 68.3308 103.038 68.3308 103.038L67.2462 111.715C100.218 112.583 111.354 87.4923 112.8 74.8385Z" fill="#FFFFFF" />
119-
</svg>
108+
<img alt="" class="h-14 w-auto" :src="inWalletLogoImage" />
120109
</div>
121110
<nav aria-label="Sidebar" class="mt-5 flex flex-1 flex-col divide-y divide-blue-800 overflow-y-auto">
122111
<div class="space-y-1 px-2">
@@ -242,6 +231,12 @@ import { useUserStore } from "~/stores/user";
242231
import { storeToRefs } from "pinia";
243232
import * as nearAPI from "near-api-js";
244233
import { useCurrentWallet } from "~/composables/accountWallet";
234+
import { useTenant } from "~/composables/tenants";
235+
236+
const tenant = await (useTenant()).value
237+
const name = tenant?.name
238+
const logoImg = tenant?.logoImage
239+
const inWalletLogoImage = tenant?.inWalletLogoImage
245240
246241
const userStore = useUserStore();
247242
const { user } = storeToRefs(userStore);

web/src/pages/login.vue

+11-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
<div class="flex flex-1 flex-col justify-center px-4 py-12 sm:px-6 lg:flex-none lg:px-20 xl:px-24 lg:bg-white lg:bg-opacity-50">
44
<div class="mx-auto w-full max-w-sm lg:w-96 p-3 lg:backdrop-blur-md lg:rounded-3xl lg:shadow lg:bg-neutral-100 lg:bg-opacity-40">
55
<div class="">
6-
<img alt="walt.id logo" class="h-24 lg:h-16 w-auto mx-auto mt-2" src="/svg/waltid.svg" />
6+
<img alt="walt.id logo" class="h-24 lg:h-16 w-auto mx-auto mt-2" :src="logoImg" />
77
<h2 class="mt-4 text-3xl font-bold tracking-tight text-gray-800">Sign in to your SSI wallet</h2>
88
<p class="mt-2 text-sm text-gray-600">
99
Or {{ " " }}
10-
<NuxtLink class="font-medium text-blue-600 hover:text-blue-500" to="/signup">sign up for your SSI wallet </NuxtLink>
11-
!
10+
<NuxtLink class="font-medium text-blue-600 hover:text-blue-500" to="/signup">sign up for your SSI wallet</NuxtLink>!
1211
</p>
1312
</div>
1413

@@ -129,7 +128,7 @@
129128
</div>
130129
</div>
131130
<div class="overflow-hidden max-h-screen absolute left-0 w-full h-full -z-10 hidden lg:block">
132-
<img ref="container" :class="[isLoggingIn ? 'zoom-in' : 'zoom-out']" alt="" class="absolute inset-0 h-full w-full object-cover hidden lg:block -z-10" src="/images/start-page-background.png" />
131+
<img ref="container" :class="[isLoggingIn ? 'zoom-in' : 'zoom-out']" alt="" class="absolute inset-0 h-full w-full object-cover hidden lg:block -z-10" :src="bgImg" />
133132
<!-- src="https://images.unsplash.com/photo-1529144415895-6aaf8be872fb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1980&q=80"/> -->
134133

135134
<!--<div class="relative hidden w-0 flex-1 lg:block">-->
@@ -139,7 +138,7 @@
139138
<!--</div>-->
140139
</div>
141140

142-
<div :class="[isLoggingIn ? 'animate-spin' : '']" :style="cardStyle" class="absolute bottom-3.5 right-3.5 w-10 lg:w-16 h-10 lg:h-16 overflow-hidden">
141+
<div v-if="showWaltidLoadingSpinner" :class="[isLoggingIn ? 'animate-spin' : '']" :style="cardStyle" class="absolute bottom-3.5 right-3.5 w-10 lg:w-16 h-10 lg:h-16 overflow-hidden">
143142
<img class="overflow-hidden" src="/svg/walt-s.svg" />
144143
</div>
145144

@@ -213,9 +212,16 @@ import ConnectWalletModal from "~/components/modals/ConnectWalletModal.vue";
213212
import useModalStore from "~/stores/useModalStore";
214213
import { useUserStore } from "~/stores/user";
215214
import { storeToRefs } from "pinia";
215+
import { useTenant } from "~/composables/tenants";
216216
217217
const store = useModalStore();
218218
219+
const tenant = await (useTenant()).value
220+
const bgImg = tenant?.bgImage
221+
const name = tenant?.name
222+
const logoImg = tenant?.logoImage
223+
const showWaltidLoadingSpinner = tenant?.showWaltidLoadingSpinner
224+
219225
const isLoggingIn = ref(false);
220226
const error = ref({});
221227
const success = ref(false);

web/src/pages/signup.vue

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="flex flex-1 flex-col justify-center px-4 py-12 sm:px-6 lg:flex-none lg:px-20 xl:px-24 lg:bg-white lg:bg-opacity-50">
44
<div class="mx-auto w-full max-w-sm lg:w-96 p-3 lg:backdrop-blur-md lg:rounded-3xl lg:shadow lg:bg-neutral-100 lg:bg-opacity-40">
55
<div class="">
6-
<img alt="walt.id logo" class="h-24 lg:h-16 w-auto mx-auto mt-2" src="/svg/waltid.svg" />
6+
<img alt="walt.id logo" class="h-24 lg:h-16 w-auto mx-auto mt-2" :src="logoImg" />
77
<h2 class="mt-4 text-3xl font-bold tracking-tight text-gray-800">Sign up for your SSI wallet</h2>
88
</div>
99

@@ -123,11 +123,11 @@
123123
:class="[isProgress ? 'zoom-in' : 'zoom-out']"
124124
alt=""
125125
class="absolute inset-0 h-full w-full object-cover hidden lg:block -z-10"
126-
src="/images/start-page-background.png"
126+
:src="bgImg"
127127
/>
128128
</div>
129129

130-
<div :class="[isProgress ? 'animate-spin' : '']" :style="cardStyle" class="absolute bottom-3.5 right-3.5 w-10 lg:w-16 h-10 lg:h-16 overflow-hidden">
130+
<div v-if="showWaltidLoadingSpinner" :class="[isProgress ? 'animate-spin' : '']" :style="cardStyle" class="absolute bottom-3.5 right-3.5 w-10 lg:w-16 h-10 lg:h-16 overflow-hidden">
131131
<img class="overflow-hidden" src="/svg/walt-s.svg" />
132132
</div>
133133
</div>
@@ -137,6 +137,13 @@
137137
import { ArrowRightOnRectangleIcon, EnvelopeIcon, IdentificationIcon, KeyIcon } from "@heroicons/vue/20/solid";
138138
import ActionResultModal from "~/components/modals/ActionResultModal.vue";
139139
import useModalStore from "~/stores/useModalStore";
140+
import { useTenant } from "~/composables/tenants";
141+
142+
const tenant = await (useTenant()).value
143+
const bgImg = tenant?.bgImage
144+
const name = tenant?.name
145+
const logoImg = tenant?.logoImage
146+
const showWaltidLoadingSpinner = tenant?.showWaltidLoadingSpinner
140147
141148
const isProgress = ref(false);
142149
const success = ref(false);

0 commit comments

Comments
 (0)