8
8
mdiAsterisk ,
9
9
mdiFormTextboxPassword ,
10
10
mdiArrowLeftBoldOutline ,
11
+ mdiAlertBoxOutline ,
11
12
} from " @mdi/js" ;
12
13
import SectionMain from " @/Components/SectionMain.vue" ;
13
14
import CardBox from " @/Components/CardBox.vue" ;
@@ -16,7 +17,8 @@ import FormField from "@/Components/FormField.vue";
16
17
import FormControl from " @/Components/FormControl.vue" ;
17
18
import BaseButton from " @/Components/BaseButton.vue" ;
18
19
import BaseButtons from " @/Components/BaseButtons.vue" ;
19
- import LayoutAuthenticated from " @/layouts/LayoutAuthenticated.vue" ;
20
+ import NotificationBar from " @/Components/NotificationBar.vue" ;
21
+ import LayoutAuthenticated from " @/Layouts/LayoutAuthenticated.vue" ;
20
22
import SectionTitleLineWithButton from " @/Components/SectionTitleLineWithButton.vue" ;
21
23
22
24
const props = defineProps ({
@@ -31,9 +33,9 @@ const profileForm = useForm({
31
33
email: props .user .email ,
32
34
});
33
35
const passwordForm = useForm ({
34
- old_password: " " ,
35
- new_password: " " ,
36
- confirm_password: " " ,
36
+ old_password: null ,
37
+ new_password: null ,
38
+ confirm_password: null ,
37
39
});
38
40
</script >
39
41
@@ -50,7 +52,13 @@ const passwordForm = useForm({
50
52
small
51
53
/>
52
54
</SectionTitleLineWithButton >
53
-
55
+ <NotificationBar
56
+ v-if =" $page.props.flash.message"
57
+ color =" success"
58
+ :icon =" mdiAlertBoxOutline"
59
+ >
60
+ {{ $page.props.flash.message }}
61
+ </NotificationBar >
54
62
<div class =" grid grid-cols-1 lg:grid-cols-2 gap-6" >
55
63
<CardBox
56
64
title =" Edit Profile"
@@ -70,9 +78,9 @@ const passwordForm = useForm({
70
78
required
71
79
:error =" profileForm.errors.name"
72
80
>
73
- <div class =" text-red-400 text-sm" v-if =" profileForm.errors.name" >
74
- {{ profileForm.errors.name }}
75
- </div >
81
+ <div class =" text-red-400 text-sm" v-if =" profileForm.errors.name" >
82
+ {{ profileForm.errors.name }}
83
+ </div >
76
84
</FormControl >
77
85
</FormField >
78
86
<FormField
@@ -88,9 +96,9 @@ const passwordForm = useForm({
88
96
required
89
97
:error =" profileForm.errors.email"
90
98
>
91
- <div class =" text-red-400 text-sm" v-if =" profileForm.errors.email" >
92
- {{ profileForm.errors.email }}
93
- </div >
99
+ <div class =" text-red-400 text-sm" v-if =" profileForm.errors.email" >
100
+ {{ profileForm.errors.email }}
101
+ </div >
94
102
</FormControl >
95
103
</FormField >
96
104
@@ -106,7 +114,10 @@ const passwordForm = useForm({
106
114
:icon =" mdiLock"
107
115
form
108
116
@submit.prevent ="
109
- passwordForm.post(route('admin.account.password.store'))
117
+ passwordForm.post(route('admin.account.password.store'), {
118
+ preserveScroll: true,
119
+ onSuccess: () => passwordForm.reset(),
120
+ })
110
121
"
111
122
>
112
123
<FormField
@@ -122,9 +133,12 @@ const passwordForm = useForm({
122
133
required
123
134
:error =" passwordForm.errors.old_password"
124
135
>
125
- <div class =" text-red-400 text-sm" v-if =" passwordForm.errors.old_password" >
126
- {{ passwordForm.errors.old_password }}
127
- </div >
136
+ <div
137
+ class =" text-red-400 text-sm"
138
+ v-if =" passwordForm.errors.old_password"
139
+ >
140
+ {{ passwordForm.errors.old_password }}
141
+ </div >
128
142
</FormControl >
129
143
</FormField >
130
144
@@ -143,9 +157,12 @@ const passwordForm = useForm({
143
157
required
144
158
:error =" passwordForm.errors.new_password"
145
159
>
146
- <div class =" text-red-400 text-sm" v-if =" passwordForm.errors.new_password" >
147
- {{ passwordForm.errors.new_password }}
148
- </div >
160
+ <div
161
+ class =" text-red-400 text-sm"
162
+ v-if =" passwordForm.errors.new_password"
163
+ >
164
+ {{ passwordForm.errors.new_password }}
165
+ </div >
149
166
</FormControl >
150
167
</FormField >
151
168
@@ -162,9 +179,12 @@ const passwordForm = useForm({
162
179
required
163
180
:error =" passwordForm.errors.confirm_password"
164
181
>
165
- <div class =" text-red-400 text-sm" v-if =" passwordForm.errors.confirm_password" >
166
- {{ passwordForm.errors.confirm_password }}
167
- </div >
182
+ <div
183
+ class =" text-red-400 text-sm"
184
+ v-if =" passwordForm.errors.confirm_password"
185
+ >
186
+ {{ passwordForm.errors.confirm_password }}
187
+ </div >
168
188
</FormControl >
169
189
</FormField >
170
190
0 commit comments