Skip to content

Commit

Permalink
add customer page
Browse files Browse the repository at this point in the history
  • Loading branch information
Bienfait-ijambo committed Aug 12, 2024
1 parent 5d1b14c commit 3f3e585
Show file tree
Hide file tree
Showing 19 changed files with 357 additions and 30 deletions.
218 changes: 218 additions & 0 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"apexcharts": "^3.49.1",
"axios": "^1.7.2",
"bootstrap-icons": "^1.11.3",
"js-cookie": "^3.0.5",
Expand All @@ -25,9 +26,8 @@
"vue-router": "^4.3.3",
"vue-sweetalert2": "^5.0.10",
"vue-toast-notification": "^3.1.2",
"vue3-google-signin": "^1.3.5",
"apexcharts": "^3.49.1",
"vue3-apexcharts": "^1.5.3"
"vue3-apexcharts": "^1.5.3",
"vue3-google-signin": "^1.3.5"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.8.0",
Expand All @@ -46,6 +46,7 @@
"prettier": "^3.2.5",
"typescript": "~5.4.0",
"vite": "^5.3.1",
"vite-plugin-mkcert": "^1.17.5",
"vite-plugin-pwa": "^0.20.1",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.21"
Expand Down
1 change: 1 addition & 0 deletions src/components/__tests__/CreateIncomeOrExpenseForm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('CreateIncomeOrExpenseForm', () => {
userId: 1
}


const form = mount(CreateIncomeOrExpenseForm, {
props: { loading: false },
global: {
Expand Down
9 changes: 9 additions & 0 deletions src/helper/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@


export type userAccountStatusType='Active'|'Inactive'

export type LoginResponseType = {

user?: {
name?: string
email: string
Expand All @@ -12,6 +17,10 @@ export type LoginResponseType = {
accessToken: string
refreshToken: string
}
userAccount:{
leftDays:string
account_status:userAccountStatusType
}
}

export enum UserRole{
Expand Down
6 changes: 3 additions & 3 deletions src/helper/sweetAlert.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import Swal from 'sweetalert2/dist/sweetalert2.js'

export function confirmDelation() {
export function confirmDelation(message?: string) {
return new Promise((resolve, reject) => {
Swal.fire({
title: 'Are you sure?',
text: 'do you want to delete this ',
text: typeof message === undefined ? 'do you want to delete this ' :message,
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
confirmButtonText: 'Confirm'
}).then((result) => {
if (result.isConfirmed) {
resolve(result.isConfirmed)
Expand Down
5 changes: 5 additions & 0 deletions src/helper/toastnotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { useToast } from 'vue-toast-notification'
const toast = useToast()

export function showError(message: string) {

if(message==='Not authenticated'){
window.location.href = '/';
localStorage.clear()
}
toast.error(message, {
position: 'bottom-right',
duration: 4000,
Expand Down
3 changes: 2 additions & 1 deletion src/views/pages/admin/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const emit = defineEmits<{
</a>
<br/>
{{ userData?.user?.role }}

<br/>
LeftDays : {{ userData?.userAccount?.leftDays }} - <span class="badge bg-success"> {{ userData?.userAccount?.account_status }}</span>
</div>
<br />
<h6
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/admin/payment/PaymentPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ await getPayments()

<template>
<div class="container">
<h1>My payments</h1>
<h4>My payments</h4>
<div class="row">
<div class="col-md-12">
<paymentTable :payments="serverData?.data"/>
Expand Down
Loading

0 comments on commit 3f3e585

Please sign in to comment.