-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from bcgov/tasks/ECER-652
- Loading branch information
Showing
21 changed files
with
447 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.prettierignore
This file was deleted.
Oops, something went wrong.
5 changes: 4 additions & 1 deletion
5
src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/.prettierrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
{ "printWidth": 160 } | ||
{ | ||
"printWidth": 160, | ||
"htmlWhitespaceSensitivity": "ignore" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 30 additions & 3 deletions
33
src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/api/user.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,36 @@ | ||
import axios from "axios"; | ||
|
||
import { getClient } from "@/api/client"; | ||
import type { Components } from "@/types/openapi"; | ||
|
||
const getUserInfo = async (): Promise<Components.Schemas.UserProfile | null> => { | ||
const client = await getClient(); | ||
return (await client.GetUserInfo()).data?.userInfo ?? null; | ||
try { | ||
const client = await getClient(); | ||
const response = await client.GetUserInfo(); | ||
|
||
// Check if the response has data and userInfo property | ||
return response?.data?.userInfo ?? null; | ||
} catch (error) { | ||
if (axios.isAxiosError(error)) { | ||
if (error.response?.status === 404) { | ||
console.log("User not found:", error); | ||
} else { | ||
console.log("Error fetching user info:", error); | ||
} | ||
} | ||
return null; | ||
} | ||
}; | ||
|
||
const createUser = async (user: Components.Schemas.NewUserRequest): Promise<boolean> => { | ||
try { | ||
const client = await getClient(); | ||
const response = await client.CreateUserInfo({}, user); | ||
return response.status === 200; | ||
} catch (error) { | ||
console.log("Error creating user:", error); | ||
return false; | ||
} | ||
}; | ||
|
||
export { getUserInfo }; | ||
export { createUser, getUserInfo }; |
8 changes: 4 additions & 4 deletions
8
src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Footer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lients.RegistryPortal/ecer.clients.registryportal.client/src/components/FormContainer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
<div :style="{ 'max-width': '600px' }" class="px-2"> | ||
<slot> </slot> | ||
<slot></slot> | ||
</div> | ||
</template> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lients.RegistryPortal/ecer.clients.registryportal.client/src/components/PageContainer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
<v-container class="my-6"> | ||
<slot> </slot> | ||
<slot></slot> | ||
</v-container> | ||
</template> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,14 @@ | |
<v-app> | ||
<v-navigation-drawer v-model="drawer" floating class="bg-white"> | ||
<v-list> | ||
<v-list-item prepend-icon="mdi-account-edit " title="Sandra Adams" subtitle="[email protected]"> | ||
<v-list-item prepend-icon="mdi-account-edit " :title="userStore.fullName" subtitle="[email protected]"> | ||
<template #subtitle> | ||
<v-list-item-title><p class="small">[email protected]</p></v-list-item-title> | ||
<v-list-item-title | ||
><p class="small">{{ formatPhoneNumber("1231231234") }}</p></v-list-item-title | ||
> | ||
<v-list-item-title> | ||
<p class="small">{{ userStore.email }}</p> | ||
</v-list-item-title> | ||
<v-list-item-title> | ||
<p class="small">{{ formatPhoneNumber(userStore.phoneNumber) }}</p> | ||
</v-list-item-title> | ||
</template> | ||
</v-list-item> | ||
</v-list> | ||
|
@@ -36,7 +38,7 @@ | |
<v-col cols="12" md="8" lg="8" xl="8"> | ||
<v-card class="rounded-lg fill-height" flat color="white"> | ||
<v-card-item class="ma-4"> | ||
<h3>Welcome Jane Doe</h3> | ||
<h3>Welcome {{ userStore.fullName }}</h3> | ||
<p class="small">Complete and submit your application for certification in early childhood education.</p> | ||
</v-card-item> | ||
<v-card-actions class="ma-4"> | ||
|
@@ -55,9 +57,12 @@ | |
</v-card> | ||
</v-col> | ||
<v-col cols="12" class="order-first order-lg-last order-xl-last"> | ||
<v-card class="rounded-lg" flat color="white" | ||
><v-card-item> <router-view></router-view> </v-card-item></v-card | ||
></v-col> | ||
<v-card class="rounded-lg" flat color="white"> | ||
<v-card-item> | ||
<router-view></router-view> | ||
</v-card-item> | ||
</v-card> | ||
</v-col> | ||
</v-row> | ||
</v-container> | ||
</v-main> | ||
|
@@ -67,10 +72,16 @@ | |
<script lang="ts"> | ||
import { defineComponent } from "vue"; | ||
import { useUserStore } from "@/store/user"; | ||
import { formatPhoneNumber } from "@/utils/format"; | ||
export default defineComponent({ | ||
name: "Dashboard", | ||
setup() { | ||
const userStore = useUserStore(); | ||
return { userStore }; | ||
}, | ||
data: () => ({ | ||
navigationOptions: [ | ||
{ name: "My Certifications", path: "/my-certifications", icon: "mdi-folder" }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.