New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new select types to Select field #1301
Conversation
<b-form-checkbox | ||
v-if="f.options.selectType !== 'multiple'" | ||
v-if="shouldAllowDuplicates" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checkbox needs to be moved out of the form group, and same for User and Record selector
@@ -152,10 +151,11 @@ export default { | |||
data () { | |||
return { | |||
newOption: { value: undefined, text: undefined, new: true }, | |||
selectOptions: [ | |||
selectOptionss: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two ss?
@@ -184,6 +184,23 @@ export default { | |||
isNew () { | |||
return this.module.moduleID === NoID || this.field.fieldID === NoID | |||
}, | |||
|
|||
selectOptions () { | |||
const options = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why redefine it if you have it already defined in the data.
Instead of filtering like this, which then needs to be amended if a new option is added, do a property on the option object that will indicate if its only usable if multi. And then you can filter by that always.
}, | ||
|
||
shouldAllowDuplicates () { | ||
return this.f.options.selectType !== 'multiple' && this.f.isMulti && this.f.options.selectType !== 'list' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make this more readable, you can add a property to the option that will indicate if it supports duplicates.
if (!this.f.isMulti) return false
const { duplicates = false } = this.options.find(({ value }) => value === this.f.options.selectType) || {}
return duplicates
@@ -92,6 +105,14 @@ | |||
</option> | |||
</template> | |||
</b-form-select> | |||
|
|||
<b-form-radio-group | |||
v-else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it the other way around, if its list view display that, otherwise(v-else) the default.
@@ -30,7 +30,16 @@ | |||
</template> | |||
|
|||
<template v-if="field.isMulti"> | |||
<template v-if="field.options.selectType === 'list'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need an extra template?
35933db
to
58cc602
Compare
LGTM |
58cc602
to
a8e32a2
Compare
The following changes are implemented
TODO: Summary
Changes in the user interface:
TODO: Add screenshots, recordings or remove this section
Checklist when submitting a final (!draft) PR
Closes #1272