Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vue-unistra
formbuilder
Commits
6db5e900
Commit
6db5e900
authored
Oct 07, 2021
by
MARCO Jonathan
Browse files
✨
Can use the autocompletion with the renderer
Ref di/vue-formbuilder#58
parent
6f0d39fb
Pipeline
#61784
passed with stage
in 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/formrenderer/UsfRenderer/UsfRenderer.vue
View file @
6db5e900
...
...
@@ -4,8 +4,13 @@
lazy-validation
@
submit.prevent=
"submitForm"
>
<v-btn
v-if=
"isHybridForm"
@
click=
"onActiveAutoCompletion"
>
{{
_uct
(
'
builder.renderer.autoCompletion.button
'
)
}}
<v-btn
color=
"primary"
v-if=
"isHybridForm && !autoCompletionIsActive"
@
click=
"onActiveAutoCompletion"
>
<span
v-if=
"userIsConnected"
>
{{
_uct
(
'
builder.renderer.autoCompletion.button
'
)
}}
</span>
<span
v-else
>
{{
_uct
(
'
builder.renderer.autoCompletion.connection
'
)
}}
</span>
</v-btn>
<usf-field
...
...
@@ -27,7 +32,7 @@
</
template
>
<
script
lang=
"ts"
>
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
UsfField
}
from
'
../../fields
'
;
import
Vue
,
{
PropType
}
from
'
vue
'
;
import
{
Field
}
from
'
#form-plugin/models/form
'
;
...
...
@@ -89,9 +94,14 @@ export default Vue.extend({
computed
:
{
...
mapState
(
'
form
'
,
[
'
root
'
]),
...
mapGetters
(
'
form
'
,
[
'
autoCompletionIsActive
'
]),
...
mapGetters
(
'
user
'
,
[
'
getUser
'
]),
...
mapState
(
'
submission
'
,
{
submission
:
(
state
)
=>
state
,
}),
userIsConnected
():
boolean
{
return
!!
Object
.
keys
(
this
.
getUser
).
length
;
},
},
watch
:
{
...
...
@@ -136,6 +146,7 @@ export default Vue.extend({
...
mapActions
(
'
form
'
,
[
'
setAutoCompletionStatus
'
]),
submitForm
():
void
{
if
(
this
.
$refs
.
form
.
validate
())
{
this
.
setAutoCompletionStatus
(
false
);
this
.
$emit
(
'
submit-form
'
,
this
.
submission
);
}
},
...
...
@@ -146,3 +157,9 @@ export default Vue.extend({
},
});
</
script
>
<
style
>
p
{
color
:
#ff0000
;
}
</
style
>
src/locales/fr.ts
View file @
6db5e900
...
...
@@ -244,7 +244,8 @@ export const fr: AppMessages = {
},
renderer
:
{
autoCompletion
:
{
button
:
'
Charger mes données
'
connection
:
'
Me connecter pour préremplir le formulaire
'
,
button
:
'
Préremplir le formulaire
'
}
}
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment