-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - feat: add RevenueByLocationMap.vue * - feat: add revenue reports with chart - feat: add YearlyBreakup.vue * - feat: add base ProjectTable.vue * - feat: add DataSection.vue * - feat: update Dashboard.vue * raw: dashboard first row * fix: move Crimea to Ukraine * chore(dashboard): cleanup * chore(dashboard): add cards * chore(dashboard): refactor --------- Co-authored-by: Maksim Nedoshev <[email protected]>
- Loading branch information
1 parent
c7ccdb3
commit 77383bd
Showing
35 changed files
with
44,379 additions
and
813 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<template> | ||
<tr class="va-timeline-item"> | ||
<td class="va-timeline-item__icon-cell"> | ||
<div class="va-timeline-item__icon"> | ||
<VaIcon name="schedule" size="22px" color="backgroundBorder" /> | ||
</div> | ||
</td> | ||
<td class="va-timeline-item__content-cell"> | ||
<div class="va-timeline-item__content"> | ||
<slot /> | ||
</div> | ||
</td> | ||
<td class="va-timeline-item__date-cell"> | ||
<slot name="date"> | ||
{{ $props.date }} | ||
</slot> | ||
</td> | ||
</tr> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineProps({ | ||
date: { | ||
type: String, | ||
default: '', | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.va-timeline-item { | ||
display: table-row; | ||
&__icon-cell { | ||
vertical-align: top; | ||
height: 1px; | ||
padding-right: 1rem; | ||
} | ||
&__icon { | ||
width: 24px; | ||
position: relative; | ||
display: inline-flex; | ||
justify-content: center; | ||
flex-direction: column; | ||
align-items: center; | ||
height: 100%; | ||
&::after { | ||
content: ''; | ||
width: 2px; | ||
height: 100%; | ||
background: var(--va-background-border); | ||
} | ||
} | ||
&__content { | ||
margin-bottom: 1rem; | ||
} | ||
&__date-cell { | ||
vertical-align: top; | ||
color: var(--va-secondary); | ||
text-wrap: nowrap; | ||
padding-left: 0.5rem; | ||
} | ||
&:last-child { | ||
.va-timeline-item__icon { | ||
&::after { | ||
background: transparent; | ||
} | ||
} | ||
} | ||
} | ||
</style> |
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,12 +1,16 @@ | ||
import { TDoughnutChartData } from '../types' | ||
|
||
export const profitBackground = '#ECF0F1' | ||
export const expensesBackground = '#fff' | ||
export const earningsBackground = '#154EC1' | ||
|
||
export const doughnutChartData: TDoughnutChartData = { | ||
labels: ['North America', 'South America', 'Australia'], | ||
labels: ['Profit', 'Expenses', 'Earnings'], | ||
datasets: [ | ||
{ | ||
label: 'Population (millions)', | ||
backgroundColor: ['danger', 'info', 'primary'], | ||
data: [2478, 5267, 734], | ||
label: 'Yearly Breakdown', | ||
backgroundColor: [earningsBackground, profitBackground, expensesBackground], | ||
data: [400, 200, 200], | ||
}, | ||
], | ||
} |
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,44 +1,12 @@ | ||
import { TLineChartData } from '../types' | ||
|
||
const months = [ | ||
'January', | ||
'February', | ||
'March', | ||
'April', | ||
'May', | ||
'June', | ||
'July', | ||
'August', | ||
'September', | ||
'October', | ||
'November', | ||
'December', | ||
] | ||
|
||
const getSize = (minSize = 5) => Math.max(minSize, new Date().getMonth()) | ||
const size = getSize() | ||
|
||
const generateValue = () => Math.floor(Math.random() * 100) | ||
const generateArray = (length: number) => Array.from(Array(length), generateValue) | ||
|
||
const generateYLabels = () => { | ||
const flip = !!Math.floor(Math.random() * 2) | ||
return flip ? ['Debit', 'Credit'] : ['Credit', 'Debit'] | ||
} | ||
const yLabels = generateYLabels() | ||
|
||
export const lineChartData: TLineChartData = { | ||
labels: months.slice(0, size), | ||
labels: ['January', 'February', 'March', 'April', 'May', 'June'], | ||
datasets: [ | ||
{ | ||
label: yLabels[0], | ||
backgroundColor: 'primary', | ||
data: generateArray(size), | ||
}, | ||
{ | ||
label: yLabels[1], | ||
backgroundColor: 'secondary', | ||
data: generateArray(size), | ||
label: 'Monthly Earnings', | ||
backgroundColor: 'rgba(75,192,192,0.4)', | ||
data: [65, 59, 80, 81, 56, 55, 40], // Random values | ||
}, | ||
], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export const earningsColor = '#49A8FF' | ||
export const expensesColor = '#154EC1' | ||
|
||
export const months: string[] = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | ||
|
||
export type Revenues = { | ||
month: string | ||
earning: number | ||
expenses: number | ||
} | ||
|
||
export const generateRevenues = (months: string[]): Revenues[] => { | ||
return months.map((month: string) => { | ||
const earning = Math.floor(Math.random() * 100000 + 10000) | ||
return { | ||
month, | ||
earning, | ||
expenses: Math.floor(earning * Math.random()), | ||
} | ||
}) | ||
} | ||
|
||
export const getRevenuePerMonth = (month: string, revenues: Revenues[]): Revenues => { | ||
const revenue = revenues.find((revenue) => revenue.month === month) | ||
return revenue || { month, earning: 0, expenses: 0 } | ||
} | ||
|
||
export const formatMoney = (amount: number, currency = 'USD'): string => { | ||
return new Intl.NumberFormat('en-US', { | ||
style: 'currency', | ||
currency, | ||
}).format(amount) | ||
} |
Oops, something went wrong.