@@ -3,14 +3,14 @@ import { inject, ref, useTemplateRef } from 'vue';
33import { useI18n } from ' vue-i18n' ;
44import { storeToRefs } from ' pinia' ;
55import { callKey , dayjsKey } from ' @/keys' ;
6- import { LinkButton , NoticeBar , NoticeBarTypes , PrimaryButton } from ' @thunderbirdops/services-ui' ;
6+ import { IconButton , LinkButton , NoticeBar , NoticeBarTypes , PrimaryButton } from ' @thunderbirdops/services-ui' ;
7+ import { PhX } from ' @phosphor-icons/vue' ;
78import { createAvailabilityStore } from ' @/stores/availability-store' ;
89import { createScheduleStore } from ' @/stores/schedule-store' ;
910import { useUserStore } from ' @/stores/user-store' ;
1011import { deepClone } from ' @/utils' ;
1112import { Alert , Availability } from ' @/models' ;
12- import { DateFormatStrings , AlertSchemes } from ' @/definitions' ;
13- import AlertBox from ' @/elements/AlertBox.vue' ;
13+ import { DateFormatStrings } from ' @/definitions' ;
1414
1515import AvailabilitySettings from ' ./components/AvailabilitySettings/index.vue' ;
1616import BookingPageDetails from ' ./components/BookingPageDetails/index.vue' ;
@@ -110,7 +110,13 @@ async function onSaveChanges() {
110110 })
111111}
112112
113+ function clearNotices() {
114+ validationError .value = null ;
115+ saveSuccess .value = null ;
116+ }
117+
113118function onRevertChanges() {
119+ clearNotices ();
114120 availabilityStore .revertChanges ();
115121}
116122 </script >
@@ -154,20 +160,41 @@ export default {
154160 </template >
155161 </notice-bar >
156162
157- <alert-box
158- class =" alert-box"
159- v-if =" validationError"
160- :alert =" validationError"
161- @close =" validationError = null"
162- />
163+ <notice-bar
164+ v-else-if =" validationError"
165+ :type =" NoticeBarTypes.Critical"
166+ class =" notice-bar"
167+ >
168+ {{ validationError.title }}
169+
170+ <template #cta >
171+ <icon-button
172+ @click =" clearNotices"
173+ :title =" t('label.close')"
174+ class =" btn-close"
175+ >
176+ <ph-x />
177+ </icon-button >
178+ </template >
179+ </notice-bar >
163180
164- <alert-box
165- class =" alert-box"
181+ <notice-bar
166182 v-else-if =" saveSuccess"
167- :alert =" saveSuccess"
168- :scheme =" AlertSchemes.Success"
169- @close =" saveSuccess = null"
170- />
183+ :type =" NoticeBarTypes.Success"
184+ class =" notice-bar"
185+ >
186+ {{ saveSuccess.title }}
187+
188+ <template #cta >
189+ <icon-button
190+ @click =" clearNotices"
191+ :title =" t('label.close')"
192+ class =" btn-close"
193+ >
194+ <ph-x />
195+ </icon-button >
196+ </template >
197+ </notice-bar >
171198
172199 <form ref =" availability-form" @submit.prevent >
173200 <div class =" page-content" >
@@ -223,6 +250,11 @@ export default {
223250 position : sticky ;
224251 top : 5rem ;
225252 z-index : 50 ;
253+
254+ .btn-close {
255+ height : 2.375rem ;
256+ width : 2.375rem ;
257+ }
226258}
227259
228260.page-content {
@@ -232,10 +264,6 @@ export default {
232264 margin-block-end : 2rem ;
233265}
234266
235- .alert-box {
236- margin-block-end : 2rem ;
237- }
238-
239267.page-content-right {
240268 display : grid ;
241269 gap : 2rem ;
0 commit comments