Skip to content

Commit

Permalink
Update Account Page & Component directory structure, just like Admin
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Jan 17, 2025
1 parent 6ab3acc commit 5a5c0da
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import NavBarDropdown from './NavBarDropdown.vue'
import FormLogin from '../Content/FormLogin.vue'
import FormLogin from '../Pages/Account/FormLogin.vue'
</script>

<template>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import FormForgotPassword from './FormForgotPassword.vue'
import FormLogin from './FormLogin.vue'
import FormRegister from './FormRegister.vue'
import FormResendVerification from './FormResendVerification.vue'

export { FormForgotPassword, FormLogin, FormRegister, FormResendVerification }
6 changes: 3 additions & 3 deletions packages/theme-pink-cupcake/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import CardBoxBig from './Content/CardBoxBig.vue'
import MainContent from './Content/MainContent.vue'
import HeaderPage from './Content/HeaderPage.vue'
import FooterContent from './Content/FooterContent.vue'
import FormLogin from './Content/FormLogin.vue'
import FormRegister from './Content/FormRegister.vue'
import FormForgotPassword from './Content/FormForgotPassword.vue'
import FormLogin from './Pages/Account/FormLogin.vue'
import FormRegister from './Pages/Account/FormRegister.vue'
import FormForgotPassword from './Pages/Account/FormForgotPassword.vue'
import NavBar from './NavBar/NavBar.vue'
import NavBarDropdown from './NavBar/NavBarDropdown.vue'
import NavBarDropdownSeparator from './NavBar/NavBarDropdownSeparator.vue'
Expand Down
4 changes: 2 additions & 2 deletions packages/theme-pink-cupcake/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { App } from 'vue'

// Import sub-plugins
import PinkCupcakeComponents from './plugins/components'
import PinkCupcakeViews from './plugins/views'
import AdminSprinkle from './plugins/admin'
import AccountSprinkle from './plugins/account'
import FontAwesome from './plugins/font-awesome'

// Init UIkit
Expand All @@ -15,8 +15,8 @@ UIkit.use(Icons)
export default {
install: (app: App) => {
app.use(PinkCupcakeComponents)
app.use(PinkCupcakeViews)
app.use(AdminSprinkle) // TODO : Add option to disable this or load on demand
app.use(AccountSprinkle) // TODO : Add option to disable this or load on demand
app.use(FontAwesome)
}
}
43 changes: 43 additions & 0 deletions packages/theme-pink-cupcake/src/plugins/account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Register every admin components & views globally
* See : https://vuejs.org/guide/components/registration
*/
import type { App } from 'vue'
import {
PageLogin,
PageRegister,
PageForgotPassword,
PageResendVerification
} from '../views/Account'
import {
FormLogin,
FormRegister,
FormForgotPassword,
FormResendVerification
} from '../components/Pages/Account'

export default {
install: (app: App) => {
app.component('UFFormLogin', FormLogin)
.component('UFFormRegister', FormRegister)
.component('UFFormForgotPassword', FormForgotPassword)
.component('UFFormResendVerification', FormResendVerification)
.component('UFPageLogin', PageLogin)
.component('UFPageRegister', PageRegister)
.component('UFPageForgotPassword', PageForgotPassword)
.component('UFPageResendVerification', PageResendVerification)
}
}

declare module 'vue' {
export interface GlobalComponents {
UFFormLogin: typeof FormLogin
UFFormRegister: typeof FormRegister
UFFormForgotPassword: typeof FormForgotPassword
UFFormResendVerification: typeof FormResendVerification
UFPageLogin: typeof PageLogin
UFPageRegister: typeof PageRegister
UFPageForgotPassword: typeof PageForgotPassword
UFPageResendVerification: typeof PageResendVerification
}
}
9 changes: 0 additions & 9 deletions packages/theme-pink-cupcake/src/plugins/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ import {
MainContent,
HeaderPage,
FooterContent,
FormLogin,
FormRegister,
FormForgotPassword,
NavBar,
NavBarDropdown,
NavBarDropdownSeparator,
Expand Down Expand Up @@ -52,9 +49,6 @@ export default {
.component('UFMainContent', MainContent)
.component('UFHeaderPage', HeaderPage)
.component('UFFooterContent', FooterContent)
.component('UFFormLogin', FormLogin)
.component('UFFormRegister', FormRegister)
.component('UFFormForgotPassword', FormForgotPassword)
.component('UFNavBar', NavBar)
.component('UFNavBarDropdown', NavBarDropdown)
.component('UFNavBarDropdownSeparator', NavBarDropdownSeparator)
Expand Down Expand Up @@ -88,9 +82,6 @@ declare module 'vue' {
UFMainContent: typeof MainContent
UFHeaderPage: typeof HeaderPage
UFFooterContent: typeof FooterContent
UFFormLogin: typeof FormLogin
UFFormRegister: typeof FormRegister
UFFormForgotPassword: typeof FormForgotPassword
UFNavBar: typeof NavBar
UFNavBarDropdown: typeof NavBarDropdown
UFNavBarDropdownSeparator: typeof NavBarDropdownSeparator
Expand Down
24 changes: 0 additions & 24 deletions packages/theme-pink-cupcake/src/plugins/views.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount, config } from '@vue/test-utils'
import { describe, test, expect, vi, afterEach } from 'vitest'
import FormForgotPassword from '../../../components/Content/FormForgotPassword.vue'
import FormForgotPassword from '../../../components/Pages/Account/FormForgotPassword.vue'
import UFAlert from '../../../components/UFAlert.vue'
import { Severity, type AlertInterface } from '@userfrosting/sprinkle-core/interfaces'
import { forgotPassword } from '@userfrosting/sprinkle-account/composables'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount, config } from '@vue/test-utils'
import { describe, test, afterEach, expect, vi } from 'vitest'
import FormLogin from '../../../components/Content/FormLogin.vue'
import FormLogin from '../../../components/Pages/Account/FormLogin.vue'
import { useAuthStore } from '@userfrosting/sprinkle-account/stores'
import UFAlert from '../../../components/UFAlert.vue'
import UIkit from 'uikit'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount, config } from '@vue/test-utils'
import { describe, test, expect, vi, afterEach } from 'vitest'
import FormRegister from '../../../components/Content/FormRegister.vue'
import FormRegister from '../../../components/Pages/Account/FormRegister.vue'
import UFAlert from '../../../components/UFAlert.vue'
import UIkit from 'uikit'
import type { UserInterface, RegisterForm } from '@userfrosting/sprinkle-account/interfaces'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount, config } from '@vue/test-utils'
import { describe, test, expect, vi, afterEach } from 'vitest'
import FormResendVerification from '../../../components/Content/FormResendVerification.vue'
import FormResendVerification from '../../../components/Pages/Account/FormResendVerification.vue'
import UFAlert from '../../../components/UFAlert.vue'
import { Severity, type AlertInterface } from '@userfrosting/sprinkle-core/interfaces'
import { resendVerification } from '@userfrosting/sprinkle-account/composables'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import FormForgotPassword from '../components/Content/FormForgotPassword.vue'
import FormForgotPassword from '../../components/Pages/Account/FormForgotPassword.vue'
</script>

<template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import FormLogin from '../components/Content/FormLogin.vue'
import FormLogin from '../../components/Pages/Account/FormLogin.vue'
</script>

<template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import FormRegister from '../components/Content/FormRegister.vue'
import FormRegister from '../../components/Pages/Account/FormRegister.vue'
</script>

<template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import FormResendVerification from '../components/Content/FormResendVerification.vue'
import FormResendVerification from '../../components/Pages/Account/FormResendVerification.vue'
</script>

<template>
Expand Down

0 comments on commit 5a5c0da

Please sign in to comment.