Skip to content

Commit

Permalink
fix: 🚑 fix google analytics failed call
Browse files Browse the repository at this point in the history
fix analytics direct call that prevent load app, update github icon, and resolve warnings
  • Loading branch information
doroudi committed Apr 11, 2024
1 parent 5cabb7b commit 83d8c8e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 18 deletions.
3 changes: 3 additions & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: Vue 3 Dashboard
direction: ltr
en: English
fa: Persian
English: English
Persian: Persian
menu:
dashboard: Dashboard
productManagement: Products Management
Expand Down Expand Up @@ -55,6 +57,7 @@ login:
haveNotAccount: Don't have an account?
createAccount: Create One!
failedMessage: Login Failed
successMessage: Logged In Successfully 🎉
validations:
userNameRequired: Enter username
passwordRequired: Password is required
Expand Down
1 change: 1 addition & 0 deletions locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ forgot:
login:
createAccount: یکی بسازید
failedMessage: خطا در ورود
successMessage: ورود موفق 🎉
forgetPassword: فراموشی رمز عبور
haveNotAccount: حساب کاربری ندارید؟
loginButton: ورود
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-demi": "^0.14.7",
"vue-github-button": "^3.1.0",
"vue-i18n": "^9.10.2",
"vue-router": "^4.3.0",
"vue3-apexcharts": "^1.5.2"
Expand Down
26 changes: 15 additions & 11 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
PanelLeftContract16Regular as CollapseIcon,
PanelLeftExpand20Regular as OpenIcon,
} from '@vicons/fluent'
import GithubButton from 'vue-github-button'
// import GithubButton from 'vue-github-button'
const layoutStore = useLayoutStore()
const { collapsed } = storeToRefs(layoutStore)
Expand All @@ -24,17 +25,20 @@ const { collapsed } = storeToRefs(layoutStore)
</template>
<template #extra>
<div class="flex items-center">
<ThemeSwitch mx-2 />
<a href="https://github.com/doroudi/yummyadmin" target="_blank">
<n-button text class="m-1">
<NIcon size="1.4rem">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32">
<path
d="M16 2a14 14 0 0 0-4.43 27.28c.7.13 1-.3 1-.67v-2.38c-3.89.84-4.71-1.88-4.71-1.88a3.71 3.71 0 0 0-1.62-2.05c-1.27-.86.1-.85.1-.85a2.94 2.94 0 0 1 2.14 1.45a3 3 0 0 0 4.08 1.16a2.93 2.93 0 0 1 .88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4 5.4 0 0 1 1.44-3.76a5 5 0 0 1 .14-3.7s1.17-.38 3.85 1.43a13.3 13.3 0 0 1 7 0c2.67-1.81 3.84-1.43 3.84-1.43a5 5 0 0 1 .14 3.7a5.4 5.4 0 0 1 1.44 3.76c0 5.38-3.27 6.56-6.39 6.91a3.33 3.33 0 0 1 .95 2.59v3.84c0 .46.25.81 1 .67A14 14 0 0 0 16 2z"
fill-rule="evenodd" fill="currentColor"
/>
</svg>
</NIcon>
</n-button>
</a>

<!-- Place this tag where you want the button to render. -->
<GithubButton
href="https://github.com/doroudi/YummyAdmin"
class="mx-1 mt-1"
data-color-scheme="no-preference: dark; light: light; dark: dark;" data-size="large"
aria-label="Star doroudi/YummyAdmin on GitHub"
>
GitHub
</GithubButton>
<ThemeSwitch mx-2 />
<LanguageSelect mx-2 />
<UserProfile mx-2 />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ router.beforeEach((to, from, next) => {

next()
})
enableMocking().then(() => app.mount('#app'))
app.mount('#app')
enableMocking()
2 changes: 1 addition & 1 deletion src/mocks/handlers/product.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function createFakeProductListItem(): ProductListDto {
id: faker.number.int().toString(),
code: faker.number.int({ min: 9999, max: 99999 }).toString(),
bestPrice: faker.commerce.price(),
rate: faker.number.float({ min: 1, max: 5, precision: 0.1 }),
rate: faker.number.float({ min: 1, max: 5, multipleOf: 0.1 }),
price: faker.commerce.price(),
name: faker.commerce.productName(),
status: faker.helpers.enumValue(ProductStatus),
Expand Down
4 changes: 1 addition & 3 deletions src/pages/Account/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ async function login() {
if (!errors) {
const loginSucceed = await accountStore.login(loginInfo.value)
if (loginSucceed) {
window.analytics.track('successful login')
useNotifyStore().success('Logged In Successfully 🎉')
useNotifyStore().success(t('login.successMessage'))
setTimeout(() => router.push('/'), 500)
}
else {
window.analytics.track('failed login')
loginFailed.value = true
setTimeout(() => {
loginFailed.value = false
Expand Down
1 change: 0 additions & 1 deletion src/pages/[...all].vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script setup lang="ts">
const { t } = useI18n()
onMounted(() => {
window.analytics.track('Not Found')
})
</script>

Expand Down

0 comments on commit 83d8c8e

Please sign in to comment.