88 mdiAsterisk ,
99 mdiFormTextboxPassword ,
1010 mdiArrowLeftBoldOutline ,
11+ mdiAlertBoxOutline ,
1112} from " @mdi/js" ;
1213import SectionMain from " @/Components/SectionMain.vue" ;
1314import CardBox from " @/Components/CardBox.vue" ;
@@ -16,7 +17,8 @@ import FormField from "@/Components/FormField.vue";
1617import FormControl from " @/Components/FormControl.vue" ;
1718import BaseButton from " @/Components/BaseButton.vue" ;
1819import 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" ;
2022import SectionTitleLineWithButton from " @/Components/SectionTitleLineWithButton.vue" ;
2123
2224const props = defineProps ({
@@ -31,9 +33,9 @@ const profileForm = useForm({
3133 email: props .user .email ,
3234});
3335const passwordForm = useForm ({
34- old_password: " " ,
35- new_password: " " ,
36- confirm_password: " " ,
36+ old_password: null ,
37+ new_password: null ,
38+ confirm_password: null ,
3739});
3840 </script >
3941
@@ -50,7 +52,13 @@ const passwordForm = useForm({
5052 small
5153 />
5254 </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 >
5462 <div class =" grid grid-cols-1 lg:grid-cols-2 gap-6" >
5563 <CardBox
5664 title =" Edit Profile"
@@ -70,9 +78,9 @@ const passwordForm = useForm({
7078 required
7179 :error =" profileForm.errors.name"
7280 >
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 >
7684 </FormControl >
7785 </FormField >
7886 <FormField
@@ -88,9 +96,9 @@ const passwordForm = useForm({
8896 required
8997 :error =" profileForm.errors.email"
9098 >
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 >
94102 </FormControl >
95103 </FormField >
96104
@@ -106,7 +114,10 @@ const passwordForm = useForm({
106114 :icon =" mdiLock"
107115 form
108116 @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+ })
110121 "
111122 >
112123 <FormField
@@ -122,9 +133,12 @@ const passwordForm = useForm({
122133 required
123134 :error =" passwordForm.errors.old_password"
124135 >
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 >
128142 </FormControl >
129143 </FormField >
130144
@@ -143,9 +157,12 @@ const passwordForm = useForm({
143157 required
144158 :error =" passwordForm.errors.new_password"
145159 >
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 >
149166 </FormControl >
150167 </FormField >
151168
@@ -162,9 +179,12 @@ const passwordForm = useForm({
162179 required
163180 :error =" passwordForm.errors.confirm_password"
164181 >
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 >
168188 </FormControl >
169189 </FormField >
170190
0 commit comments