kaze 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kaze/commands/install_command.rb +18 -4
- data/lib/kaze/commands/installs_hotwire_stack.rb +5 -2
- data/lib/kaze/commands/installs_inertia_stacks.rb +13 -3
- data/lib/kaze/version.rb +1 -1
- data/stubs/default/app/forms/auth/login_form.rb +2 -8
- data/stubs/default/app/forms/update_profile_information_form.rb +1 -1
- data/stubs/default/app/models/auth.rb +57 -0
- data/stubs/default/app/models/current.rb +1 -1
- data/stubs/default/app/validators/current_password_validator.rb +1 -1
- data/stubs/default/app/views/layouts/mailer.html.erb +367 -372
- data/stubs/default/app/views/layouts/mailer.text.erb +1 -4
- data/stubs/default/app/views/user_mailer/reset_password.html.erb +21 -26
- data/stubs/default/test/factories/users.rb +7 -0
- data/stubs/default/test/integration/auth/authentication_test.rb +43 -0
- data/stubs/default/test/integration/auth/password_reset_test.rb +41 -0
- data/stubs/default/test/integration/auth/registration_test.rb +21 -0
- data/stubs/default/test/integration/password_update_test.rb +28 -0
- data/stubs/default/test/integration/profile_test.rb +51 -0
- data/stubs/default/test/test_helper.rb +38 -0
- data/stubs/hotwire/app/components/dropdown_component.html.erb +17 -18
- data/stubs/hotwire/app/components/modal_component.html.erb +55 -59
- data/stubs/hotwire/app/controllers/application_controller.rb +1 -0
- data/stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb +10 -7
- data/stubs/hotwire/app/controllers/auth/new_password_controller.rb +3 -1
- data/stubs/hotwire/app/controllers/auth/password_reset_link_controller.rb +3 -1
- data/stubs/hotwire/app/controllers/auth/registered_user_controller.rb +4 -2
- data/stubs/hotwire/app/controllers/concerns/authenticate.rb +5 -20
- data/stubs/hotwire/app/controllers/concerns/redirect_if_authenticated.rb +19 -0
- data/stubs/hotwire/app/controllers/concerns/set_current_auth.rb +9 -0
- data/stubs/hotwire/app/controllers/password_controller.rb +1 -1
- data/stubs/hotwire/app/controllers/profile_controller.rb +6 -4
- data/stubs/hotwire/app/controllers/welcome_controller.rb +1 -1
- data/stubs/hotwire/app/javascript/application.js +3 -3
- data/stubs/hotwire/app/views/auth/forgot_password.html.erb +12 -17
- data/stubs/hotwire/app/views/auth/login.html.erb +0 -9
- data/stubs/hotwire/app/views/auth/register.html.erb +0 -13
- data/stubs/hotwire/app/views/auth/reset_password.html.erb +0 -7
- data/stubs/hotwire/app/views/dashboard/index.html.erb +9 -10
- data/stubs/hotwire/app/views/layouts/_navigation.html.erb +77 -87
- data/stubs/hotwire/app/views/layouts/application.html.erb +0 -9
- data/stubs/hotwire/app/views/layouts/guest.html.erb +0 -6
- data/stubs/hotwire/app/views/profile/edit.html.erb +19 -22
- data/stubs/hotwire/app/views/profile/partials/_delete_user_form.html.erb +32 -42
- data/stubs/hotwire/app/views/profile/partials/_update_password_form.html.erb +42 -55
- data/stubs/hotwire/app/views/profile/partials/_update_profile_information_form.html.erb +36 -46
- data/stubs/hotwire/app/views/welcome/index.html.erb +34 -46
- data/stubs/hotwire/config/tailwind.config.js +2 -2
- data/stubs/inertia-common/app/controllers/application_controller.rb +1 -0
- data/stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb +10 -7
- data/stubs/inertia-common/app/controllers/auth/new_password_controller.rb +3 -1
- data/stubs/inertia-common/app/controllers/auth/password_reset_link_controller.rb +3 -1
- data/stubs/inertia-common/app/controllers/auth/registered_user_controller.rb +4 -2
- data/stubs/inertia-common/app/controllers/concerns/authenticate.rb +5 -20
- data/stubs/inertia-common/app/controllers/concerns/handle_inertia_requests.rb +1 -1
- data/stubs/inertia-common/app/controllers/concerns/redirect_if_authenticated.rb +19 -0
- data/stubs/inertia-common/app/controllers/concerns/set_current_auth.rb +9 -0
- data/stubs/inertia-common/app/controllers/password_controller.rb +1 -1
- data/stubs/inertia-common/app/controllers/profile_controller.rb +5 -3
- data/stubs/inertia-common/app/controllers/welcome_controller.rb +1 -1
- data/stubs/inertia-common/test/integration/password_update_test.rb +28 -0
- data/stubs/inertia-common/test/integration/profile_test.rb +51 -0
- data/stubs/inertia-react-ts/app/javascript/Components/ApplicationLogo.tsx +13 -9
- data/stubs/inertia-react-ts/app/javascript/Components/Checkbox.tsx +12 -12
- data/stubs/inertia-react-ts/app/javascript/Components/DangerButton.tsx +20 -15
- data/stubs/inertia-react-ts/app/javascript/Components/Dropdown.tsx +115 -88
- data/stubs/inertia-react-ts/app/javascript/Components/InputError.tsx +14 -7
- data/stubs/inertia-react-ts/app/javascript/Components/InputLabel.tsx +15 -7
- data/stubs/inertia-react-ts/app/javascript/Components/Modal.tsx +60 -60
- data/stubs/inertia-react-ts/app/javascript/Components/NavLink.tsx +21 -16
- data/stubs/inertia-react-ts/app/javascript/Components/PrimaryButton.tsx +20 -15
- data/stubs/inertia-react-ts/app/javascript/Components/ResponsiveNavLink.tsx +19 -14
- data/stubs/inertia-react-ts/app/javascript/Components/SecondaryButton.tsx +22 -16
- data/stubs/inertia-react-ts/app/javascript/Components/TextInput.tsx +32 -24
- data/stubs/inertia-react-ts/app/javascript/Layouts/AuthenticatedLayout.tsx +157 -117
- data/stubs/inertia-react-ts/app/javascript/Layouts/GuestLayout.tsx +15 -15
- data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx +52 -49
- data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Login.tsx +90 -82
- data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Register.tsx +118 -115
- data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ResetPassword.tsx +63 -60
- data/stubs/inertia-react-ts/app/javascript/Pages/Dashboard.tsx +23 -17
- data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Edit.tsx +31 -27
- data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.tsx +109 -99
- data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdatePasswordForm.tsx +121 -113
- data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.tsx +76 -69
- data/stubs/inertia-react-ts/app/javascript/Pages/Welcome.tsx +87 -63
- data/stubs/inertia-react-ts/app/javascript/entrypoints/application.tsx +32 -25
- data/stubs/inertia-react-ts/app/views/layouts/application.html.erb +0 -4
- data/stubs/inertia-react-ts/config/tailwind.config.js +2 -2
- data/stubs/inertia-react-ts/vite.config.ts +2 -5
- data/stubs/inertia-vue-ts/app/javascript/Components/ApplicationLogo.vue +10 -6
- data/stubs/inertia-vue-ts/app/javascript/Components/Checkbox.vue +18 -18
- data/stubs/inertia-vue-ts/app/javascript/Components/DangerButton.vue +5 -5
- data/stubs/inertia-vue-ts/app/javascript/Components/Dropdown.vue +60 -57
- data/stubs/inertia-vue-ts/app/javascript/Components/DropdownLink.vue +9 -9
- data/stubs/inertia-vue-ts/app/javascript/Components/InputError.vue +7 -7
- data/stubs/inertia-vue-ts/app/javascript/Components/InputLabel.vue +6 -6
- data/stubs/inertia-vue-ts/app/javascript/Components/Modal.vue +84 -74
- data/stubs/inertia-vue-ts/app/javascript/Components/NavLink.vue +12 -12
- data/stubs/inertia-vue-ts/app/javascript/Components/PrimaryButton.vue +5 -5
- data/stubs/inertia-vue-ts/app/javascript/Components/ResponsiveNavLink.vue +12 -12
- data/stubs/inertia-vue-ts/app/javascript/Components/SecondaryButton.vue +13 -13
- data/stubs/inertia-vue-ts/app/javascript/Components/TextInput.vue +13 -13
- data/stubs/inertia-vue-ts/app/javascript/Layouts/AuthenticatedLayout.vue +168 -136
- data/stubs/inertia-vue-ts/app/javascript/Layouts/GuestLayout.vue +15 -13
- data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ForgotPassword.vue +56 -49
- data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Login.vue +78 -72
- data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Register.vue +101 -97
- data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ResetPassword.vue +71 -68
- data/stubs/inertia-vue-ts/app/javascript/Pages/Dashboard.vue +22 -14
- data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Edit.vue +34 -30
- data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.vue +87 -83
- data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdatePasswordForm.vue +105 -98
- data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.vue +69 -59
- data/stubs/inertia-vue-ts/app/javascript/Pages/Welcome.vue +74 -47
- data/stubs/inertia-vue-ts/app/views/layouts/application.html.erb +0 -4
- data/stubs/inertia-vue-ts/config/tailwind.config.js +2 -2
- data/stubs/inertia-vue-ts/vite.config.ts +2 -5
- metadata +18 -6
- data/stubs/hotwire/bin/vite +0 -27
- data/stubs/inertia-common/Procfile.dev +0 -3
- /data/stubs/{hotwire → default}/Procfile.dev +0 -0
- /data/stubs/hotwire/app/javascript/{alpinejs.js → alpinejs.stub} +0 -0
@@ -1,42 +1,46 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
3
|
-
import DeleteUserForm from './Partials/DeleteUserForm.vue'
|
4
|
-
import UpdatePasswordForm from './Partials/UpdatePasswordForm.vue'
|
5
|
-
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm.vue'
|
6
|
-
import { Head } from '@inertiajs/vue3'
|
2
|
+
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
|
3
|
+
import DeleteUserForm from './Partials/DeleteUserForm.vue'
|
4
|
+
import UpdatePasswordForm from './Partials/UpdatePasswordForm.vue'
|
5
|
+
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm.vue'
|
6
|
+
import { Head } from '@inertiajs/vue3'
|
7
7
|
|
8
8
|
defineProps<{
|
9
|
-
|
10
|
-
|
11
|
-
}>()
|
9
|
+
mustVerifyEmail?: boolean
|
10
|
+
status?: string
|
11
|
+
}>()
|
12
12
|
</script>
|
13
13
|
|
14
14
|
<template>
|
15
|
-
|
15
|
+
<Head title="Profile" />
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<AuthenticatedLayout>
|
18
|
+
<template #header>
|
19
|
+
<h2
|
20
|
+
class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight"
|
21
|
+
>
|
22
|
+
Profile
|
23
|
+
</h2>
|
24
|
+
</template>
|
21
25
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
<div class="py-12">
|
27
|
+
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
|
28
|
+
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
29
|
+
<UpdateProfileInformationForm
|
30
|
+
:must-verify-email="mustVerifyEmail"
|
31
|
+
:status="status"
|
32
|
+
class="max-w-xl"
|
33
|
+
/>
|
34
|
+
</div>
|
31
35
|
|
32
|
-
|
33
|
-
|
34
|
-
|
36
|
+
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
37
|
+
<UpdatePasswordForm class="max-w-xl" />
|
38
|
+
</div>
|
35
39
|
|
36
|
-
|
37
|
-
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
+
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
41
|
+
<DeleteUserForm class="max-w-xl" />
|
40
42
|
</div>
|
41
|
-
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</AuthenticatedLayout>
|
42
46
|
</template>
|
@@ -1,98 +1,102 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import DangerButton from '@/Components/DangerButton.vue'
|
3
|
-
import InputError from '@/Components/InputError.vue'
|
4
|
-
import InputLabel from '@/Components/InputLabel.vue'
|
5
|
-
import Modal from '@/Components/Modal.vue'
|
6
|
-
import SecondaryButton from '@/Components/SecondaryButton.vue'
|
7
|
-
import TextInput from '@/Components/TextInput.vue'
|
8
|
-
import { useForm } from '@inertiajs/vue3'
|
9
|
-
import { nextTick, ref } from 'vue'
|
10
|
-
import { profile_destroy_path } from '@/routes'
|
11
|
-
|
12
|
-
const confirmingUserDeletion = ref(false)
|
13
|
-
const passwordInput = ref<HTMLInputElement | null>(null)
|
2
|
+
import DangerButton from '@/Components/DangerButton.vue'
|
3
|
+
import InputError from '@/Components/InputError.vue'
|
4
|
+
import InputLabel from '@/Components/InputLabel.vue'
|
5
|
+
import Modal from '@/Components/Modal.vue'
|
6
|
+
import SecondaryButton from '@/Components/SecondaryButton.vue'
|
7
|
+
import TextInput from '@/Components/TextInput.vue'
|
8
|
+
import { useForm } from '@inertiajs/vue3'
|
9
|
+
import { nextTick, ref } from 'vue'
|
10
|
+
import { profile_destroy_path } from '@/routes'
|
11
|
+
|
12
|
+
const confirmingUserDeletion = ref(false)
|
13
|
+
const passwordInput = ref<HTMLInputElement | null>(null)
|
14
14
|
|
15
15
|
const form = useForm({
|
16
|
-
|
17
|
-
})
|
16
|
+
password: '',
|
17
|
+
})
|
18
18
|
|
19
19
|
const confirmUserDeletion = () => {
|
20
|
-
|
20
|
+
confirmingUserDeletion.value = true
|
21
21
|
|
22
|
-
|
23
|
-
}
|
22
|
+
nextTick(() => passwordInput.value?.focus())
|
23
|
+
}
|
24
24
|
|
25
25
|
const deleteUser = () => {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
26
|
+
form.delete(profile_destroy_path(), {
|
27
|
+
preserveScroll: true,
|
28
|
+
onSuccess: () => closeModal(),
|
29
|
+
onError: () => passwordInput.value?.focus(),
|
30
|
+
onFinish: () => {
|
31
|
+
form.reset()
|
32
|
+
},
|
33
|
+
})
|
34
|
+
}
|
35
35
|
|
36
36
|
const closeModal = () => {
|
37
|
-
|
37
|
+
confirmingUserDeletion.value = false
|
38
38
|
|
39
|
-
|
40
|
-
}
|
39
|
+
form.reset()
|
40
|
+
}
|
41
41
|
</script>
|
42
42
|
|
43
43
|
<template>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
44
|
+
<section class="space-y-6">
|
45
|
+
<header>
|
46
|
+
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
47
|
+
Delete Account
|
48
|
+
</h2>
|
49
|
+
|
50
|
+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
51
|
+
Once your account is deleted, all of its resources and data will be
|
52
|
+
permanently deleted. Before deleting your account, please download any
|
53
|
+
data or information that you wish to retain.
|
54
|
+
</p>
|
55
|
+
</header>
|
56
|
+
|
57
|
+
<DangerButton @click="confirmUserDeletion">Delete Account</DangerButton>
|
58
|
+
|
59
|
+
<Modal :show="confirmingUserDeletion" @close="closeModal">
|
60
|
+
<div class="p-6">
|
61
|
+
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
62
|
+
Are you sure you want to delete your account?
|
63
|
+
</h2>
|
64
|
+
|
65
|
+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
66
|
+
Once your account is deleted, all of its resources and data will be
|
67
|
+
permanently deleted. Please enter your password to confirm you would
|
68
|
+
like to permanently delete your account.
|
69
|
+
</p>
|
70
|
+
|
71
|
+
<div class="mt-6">
|
72
|
+
<InputLabel for="password" value="Password" class="sr-only" />
|
73
|
+
|
74
|
+
<TextInput
|
75
|
+
id="password"
|
76
|
+
ref="passwordInput"
|
77
|
+
v-model="form.password"
|
78
|
+
type="password"
|
79
|
+
class="mt-1 block w-3/4"
|
80
|
+
placeholder="Password"
|
81
|
+
@keyup.enter="deleteUser"
|
82
|
+
/>
|
83
|
+
|
84
|
+
<InputError :message="form.errors.password" class="mt-2" />
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div class="mt-6 flex justify-end">
|
88
|
+
<SecondaryButton @click="closeModal"> Cancel </SecondaryButton>
|
89
|
+
|
90
|
+
<DangerButton
|
91
|
+
class="ms-3"
|
92
|
+
:class="{ 'opacity-25': form.processing }"
|
93
|
+
:disabled="form.processing"
|
94
|
+
@click="deleteUser"
|
95
|
+
>
|
96
|
+
Delete Account
|
97
|
+
</DangerButton>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
</Modal>
|
101
|
+
</section>
|
98
102
|
</template>
|
@@ -1,108 +1,115 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import InputError from '@/Components/InputError.vue'
|
3
|
-
import InputLabel from '@/Components/InputLabel.vue'
|
4
|
-
import PrimaryButton from '@/Components/PrimaryButton.vue'
|
5
|
-
import TextInput from '@/Components/TextInput.vue'
|
6
|
-
import { useForm } from '@inertiajs/vue3'
|
7
|
-
import { ref } from 'vue'
|
8
|
-
import { password_update_path } from '@/routes'
|
2
|
+
import InputError from '@/Components/InputError.vue'
|
3
|
+
import InputLabel from '@/Components/InputLabel.vue'
|
4
|
+
import PrimaryButton from '@/Components/PrimaryButton.vue'
|
5
|
+
import TextInput from '@/Components/TextInput.vue'
|
6
|
+
import { useForm } from '@inertiajs/vue3'
|
7
|
+
import { ref } from 'vue'
|
8
|
+
import { password_update_path } from '@/routes'
|
9
9
|
|
10
|
-
const passwordInput = ref<HTMLInputElement | null>(null)
|
11
|
-
const currentPasswordInput = ref<HTMLInputElement | null>(null)
|
10
|
+
const passwordInput = ref<HTMLInputElement | null>(null)
|
11
|
+
const currentPasswordInput = ref<HTMLInputElement | null>(null)
|
12
12
|
|
13
13
|
const form = useForm({
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
})
|
14
|
+
current_password: '',
|
15
|
+
password: '',
|
16
|
+
password_confirmation: '',
|
17
|
+
})
|
18
18
|
|
19
19
|
const updatePassword = () => {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
20
|
+
form.put(password_update_path(), {
|
21
|
+
preserveScroll: true,
|
22
|
+
onSuccess: () => {
|
23
|
+
form.reset()
|
24
|
+
},
|
25
|
+
onError: () => {
|
26
|
+
if (form.errors.password) {
|
27
|
+
form.reset('password', 'password_confirmation')
|
28
|
+
passwordInput.value?.focus()
|
29
|
+
}
|
30
|
+
if (form.errors.current_password) {
|
31
|
+
form.reset('current_password')
|
32
|
+
currentPasswordInput.value?.focus()
|
33
|
+
}
|
34
|
+
},
|
35
|
+
})
|
36
|
+
}
|
37
37
|
</script>
|
38
38
|
|
39
39
|
<template>
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
40
|
+
<section>
|
41
|
+
<header>
|
42
|
+
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
43
|
+
Update Password
|
44
|
+
</h2>
|
45
|
+
|
46
|
+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
47
|
+
Ensure your account is using a long, random password to stay secure.
|
48
|
+
</p>
|
49
|
+
</header>
|
50
|
+
|
51
|
+
<form @submit.prevent="updatePassword" class="mt-6 space-y-6">
|
52
|
+
<div>
|
53
|
+
<InputLabel for="current_password" value="Current Password" />
|
54
|
+
|
55
|
+
<TextInput
|
56
|
+
id="current_password"
|
57
|
+
ref="currentPasswordInput"
|
58
|
+
v-model="form.current_password"
|
59
|
+
type="password"
|
60
|
+
class="mt-1 block w-full"
|
61
|
+
autocomplete="current-password"
|
62
|
+
/>
|
63
|
+
|
64
|
+
<InputError :message="form.errors.current_password" class="mt-2" />
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div>
|
68
|
+
<InputLabel for="password" value="New Password" />
|
69
|
+
|
70
|
+
<TextInput
|
71
|
+
id="password"
|
72
|
+
ref="passwordInput"
|
73
|
+
v-model="form.password"
|
74
|
+
type="password"
|
75
|
+
class="mt-1 block w-full"
|
76
|
+
autocomplete="new-password"
|
77
|
+
/>
|
78
|
+
|
79
|
+
<InputError :message="form.errors.password" class="mt-2" />
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div>
|
83
|
+
<InputLabel for="password_confirmation" value="Confirm Password" />
|
84
|
+
|
85
|
+
<TextInput
|
86
|
+
id="password_confirmation"
|
87
|
+
v-model="form.password_confirmation"
|
88
|
+
type="password"
|
89
|
+
class="mt-1 block w-full"
|
90
|
+
autocomplete="new-password"
|
91
|
+
/>
|
92
|
+
|
93
|
+
<InputError :message="form.errors.password_confirmation" class="mt-2" />
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<div class="flex items-center gap-4">
|
97
|
+
<PrimaryButton :disabled="form.processing">Save</PrimaryButton>
|
98
|
+
|
99
|
+
<Transition
|
100
|
+
enter-active-class="transition ease-in-out"
|
101
|
+
enter-from-class="opacity-0"
|
102
|
+
leave-active-class="transition ease-in-out"
|
103
|
+
leave-to-class="opacity-0"
|
104
|
+
>
|
105
|
+
<p
|
106
|
+
v-if="form.recentlySuccessful"
|
107
|
+
class="text-sm text-gray-600 dark:text-gray-400"
|
108
|
+
>
|
109
|
+
Saved.
|
110
|
+
</p>
|
111
|
+
</Transition>
|
112
|
+
</div>
|
113
|
+
</form>
|
114
|
+
</section>
|
108
115
|
</template>
|
data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.vue
CHANGED
@@ -1,78 +1,88 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import InputError from '@/Components/InputError.vue'
|
3
|
-
import InputLabel from '@/Components/InputLabel.vue'
|
4
|
-
import PrimaryButton from '@/Components/PrimaryButton.vue'
|
5
|
-
import TextInput from '@/Components/TextInput.vue'
|
6
|
-
import {
|
7
|
-
import { profile_update_path } from '@/routes'
|
2
|
+
import InputError from '@/Components/InputError.vue'
|
3
|
+
import InputLabel from '@/Components/InputLabel.vue'
|
4
|
+
import PrimaryButton from '@/Components/PrimaryButton.vue'
|
5
|
+
import TextInput from '@/Components/TextInput.vue'
|
6
|
+
import { useForm, usePage } from '@inertiajs/vue3'
|
7
|
+
import { profile_update_path } from '@/routes'
|
8
8
|
|
9
9
|
defineProps<{
|
10
|
-
|
11
|
-
|
12
|
-
}>()
|
10
|
+
mustVerifyEmail?: Boolean
|
11
|
+
status?: String
|
12
|
+
}>()
|
13
13
|
|
14
|
-
const user = usePage().props.auth.user
|
14
|
+
const user = usePage().props.auth.user
|
15
15
|
|
16
16
|
const form = useForm({
|
17
|
-
|
18
|
-
|
19
|
-
})
|
17
|
+
name: user.name,
|
18
|
+
email: user.email,
|
19
|
+
})
|
20
20
|
</script>
|
21
21
|
|
22
22
|
<template>
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
<section>
|
24
|
+
<header>
|
25
|
+
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
26
|
+
Profile Information
|
27
|
+
</h2>
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
30
|
+
Update your account's profile information and email address.
|
31
|
+
</p>
|
32
|
+
</header>
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
<form
|
35
|
+
@submit.prevent="form.patch(profile_update_path())"
|
36
|
+
class="mt-6 space-y-6"
|
37
|
+
>
|
38
|
+
<div>
|
39
|
+
<InputLabel for="name" value="Name" />
|
35
40
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
<TextInput
|
42
|
+
id="name"
|
43
|
+
type="text"
|
44
|
+
class="mt-1 block w-full"
|
45
|
+
v-model="form.name"
|
46
|
+
required
|
47
|
+
autofocus
|
48
|
+
autocomplete="name"
|
49
|
+
/>
|
45
50
|
|
46
|
-
|
47
|
-
|
51
|
+
<InputError class="mt-2" :message="form.errors.name" />
|
52
|
+
</div>
|
48
53
|
|
49
|
-
|
50
|
-
|
54
|
+
<div>
|
55
|
+
<InputLabel for="email" value="Email" />
|
51
56
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
<TextInput
|
58
|
+
id="email"
|
59
|
+
type="email"
|
60
|
+
class="mt-1 block w-full"
|
61
|
+
v-model="form.email"
|
62
|
+
required
|
63
|
+
autocomplete="username"
|
64
|
+
/>
|
60
65
|
|
61
|
-
|
62
|
-
|
66
|
+
<InputError class="mt-2" :message="form.errors.email" />
|
67
|
+
</div>
|
63
68
|
|
64
|
-
|
65
|
-
|
69
|
+
<div class="flex items-center gap-4">
|
70
|
+
<PrimaryButton :disabled="form.processing">Save</PrimaryButton>
|
66
71
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
<Transition
|
73
|
+
enter-active-class="transition ease-in-out"
|
74
|
+
enter-from-class="opacity-0"
|
75
|
+
leave-active-class="transition ease-in-out"
|
76
|
+
leave-to-class="opacity-0"
|
77
|
+
>
|
78
|
+
<p
|
79
|
+
v-if="form.recentlySuccessful"
|
80
|
+
class="text-sm text-gray-600 dark:text-gray-400"
|
81
|
+
>
|
82
|
+
Saved.
|
83
|
+
</p>
|
84
|
+
</Transition>
|
85
|
+
</div>
|
86
|
+
</form>
|
87
|
+
</section>
|
78
88
|
</template>
|