File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 105105
106106 <template v-else >
107107 <p class =" no-bottom-margin smaller-front-size" >
108- <strong >{{ t(`appointmentTypes.${variantId}`) }}: </strong ><br />
108+ <strong >{{ t(`appointmentTypes.${variantId}`) }}</strong ><br />
109109 </p >
110- <p >{{ t(`locationVariantText.${ variantId}` ) }}</p >
110+ <p >{{ getVariantHint( variantId, t ) }}</p >
111111 </template >
112112 </div >
113113
@@ -316,7 +316,10 @@ import {
316316 SelectedTimeslotProvider ,
317317} from " @/types/ProvideInjectTypes" ;
318318import { calculateEstimatedDuration } from " @/utils/calculateEstimatedDuration" ;
319- import { getServiceBaseURL } from " @/utils/Constants" ;
319+ import {
320+ getServiceBaseURL ,
321+ getVariantHint ,
322+ } from " @/utils/Constants" ;
320323import { sanitizeHtml } from " @/utils/sanitizeHtml" ;
321324import { useReservationTimer } from " @/utils/useReservationTimer" ;
322325
Original file line number Diff line number Diff line change 6767 :id =" 'variant-' + variant.variantId"
6868 :value =" variant.variantId.toString()"
6969 :label =" t(`appointmentTypes.${variant.variantId}`)"
70- :hint ="
71- VARIANTS_WITH_LOCATION_HINTS.includes(variant.variantId)
72- ? t(`locationVariantText.${variant.variantId}`)
73- : undefined
74- "
70+ :hint =" getVariantHint(variant.variantId, t)"
7571 />
7672 </muc-radio-button-group >
7773 </div >
@@ -198,6 +194,7 @@ import {
198194 getServiceBaseURL ,
199195 MAX_SLOTS ,
200196 OFTEN_SEARCHED_SERVICES ,
197+ getVariantHint ,
201198} from " @/utils/Constants" ;
202199import {
203200 createErrorStates ,
@@ -206,8 +203,6 @@ import {
206203
207204const isCaptchaValid = ref <boolean >(false );
208205
209- const VARIANTS_WITH_LOCATION_HINTS = [1 , 2 , 3 ] as const ;
210-
211206const props = defineProps <{
212207 globalState: GlobalState ;
213208 preselectedServiceId: string | undefined ;
Original file line number Diff line number Diff line change @@ -64,6 +64,13 @@ function getRawApiBaseURL(baseUrl: string | undefined): string {
6464 }
6565}
6666
67+ export const VARIANTS_WITH_LOCATION_HINTS = [ 1 , 2 , 3 ] as const ;
68+ export const getVariantHint = ( variantId : number , t : ( key : string ) => string ) => {
69+ return VARIANTS_WITH_LOCATION_HINTS . includes ( variantId )
70+ ? t ( `locationVariantText.${ variantId } ` )
71+ : undefined ;
72+ } ;
73+
6774export function getAPIBaseURL (
6875 baseUrl : string | undefined ,
6976 authenticated : boolean
You can’t perform that action at this time.
0 commit comments