@ -255,6 +255,40 @@
{ { t ( 'format' ) } }
< / label >
< / div >
< div
v - if = "availableAtsFields && availableAtsFields.length > 0"
class = "py-1.5 px-1 relative"
@ click . stop
>
< select
: placeholder = "t('ats_field')"
class = "select select-bordered select-xs font-normal w-full max-w-xs !h-7 !outline-0 bg-transparent"
data - testid = "ats-fields-dropdown"
@ change = "[field.prefill = $event.target.value || undefined, !field.prefill && delete field.prefill, save()]"
>
< option
value = ""
: selected = "!field.prefill"
>
{ { '' } }
< / option >
< option
v - for = "atsField in availableAtsFields"
: key = "atsField"
: value = "atsField"
: selected = "field.prefill === atsField"
>
{ { formatAtsFieldName ( atsField ) } }
< / option >
< / select >
< label
: style = "{ backgroundColor }"
class = "absolute -top-1 left-2.5 px-1 h-4"
style = "font-size: 8px"
>
{ { t ( 'ats_field' ) } }
< / label >
< / div >
< li
v - if = "withRequired && field.type !== 'phone' && field.type !== 'stamp' && field.type !== 'verification'"
@ click . stop
@ -492,6 +526,15 @@ export default {
}
} ,
computed : {
availableAtsFields ( ) {
return this . template . available _ats _fields || [ ]
} ,
availableAtsFieldsForType ( ) {
if ( ! this . template . ats _fields _by _type || ! this . field . type ) {
return [ ]
}
return this . template . ats _fields _by _type [ this . field . type ] || [ ]
} ,
schemaAttachmentsIndexes ( ) {
return ( this . template . schema || [ ] ) . reduce ( ( acc , item , index ) => {
acc [ item . attachment _uuid ] = index
@ -551,6 +594,13 @@ export default {
}
} ,
methods : {
formatAtsFieldName ( fieldName ) {
/ / C o n v e r t s n a k e _ c a s e t o T i t l e C a s e f o r d i s p l a y
return fieldName
. split ( '_' )
. map ( word => word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) )
. join ( ' ' )
} ,
onChangeValidation ( event ) {
if ( event . target . value === 'custom' ) {
this . field . validation = { pattern : '' }