Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
frontend
libraries
form-generator
Commits
082d990c
Commit
082d990c
authored
Jun 02, 2020
by
Benedikt Heinrichs
Browse files
Fix single and multiselect interaction (coscine/issues#795)
parent
42b2bb73
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/InputCombobox.vue
View file @
082d990c
...
...
@@ -3,8 +3,7 @@
:id=
"cssId"
:options=
"selectableOptions"
v-model=
"selectedOptions"
:multiple=
"!maxMode"
:hide-selected=
"true"
:multiple=
"!noMaxMode"
label=
"name"
track-by=
"name"
:placeholder=
"$t('multiselectPlaceholder')"
...
...
@@ -27,14 +26,14 @@ import { MetadataApi, defaultOnCatch } from '@coscine/api-connection';
export
default
Vue
.
extend
({
name
:
'
InputCombobox
'
,
beforeMount
()
{
this
.
m
axMode
=
this
.
noM
axMode
=
this
.
checkField
(
this
.
formFieldInformation
,
'
http://www.w3.org/ns/shacl#maxCount
'
)
&&
this
.
formFieldInformation
[
'
http://www.w3.org/ns/shacl#maxCount
'
][
0
][
parseInt
(
this
.
formFieldInformation
[
'
http://www.w3.org/ns/shacl#maxCount
'
][
0
][
'
value
'
]
===
1
;
]
)
===
1
;
// set the datatype
this
.
$set
(
this
.
formData
[
this
.
nodeName
][
0
],
'
type
'
,
'
uri
'
);
...
...
@@ -73,7 +72,7 @@ export default Vue.extend({
},
data
()
{
return
{
m
axMode
:
fals
e
,
noM
axMode
:
tru
e
,
selectableOptions
:
[]
as
object
[],
selectedOptions
:
[]
as
object
[],
maxNumberOfSelectedObjects
:
10000
,
...
...
@@ -81,7 +80,7 @@ export default Vue.extend({
},
methods
:
{
getMax
()
{
if
(
this
.
m
axMode
)
{
if
(
!
this
.
noM
axMode
)
{
return
this
.
formFieldInformation
[
'
http://www.w3.org/ns/shacl#maxCount
'
]
!==
undefined
&&
...
...
@@ -98,7 +97,7 @@ export default Vue.extend({
)
:
this
.
maxNumberOfSelectedObjects
;
}
return
undefined
;
return
false
;
},
input
()
{
const
array
=
[];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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