Skip to content

Commit

Permalink
fix editing view filter operands
Browse files Browse the repository at this point in the history
  • Loading branch information
mimecorg committed Oct 19, 2020
1 parent 5416dfe commit 22ad5ea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/forms/types/EditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</DropdownScrollButton>
</div>
<div v-bind:class="'col-xs-12 col-sm-4' + ( filter.error != null ? ' form-group has-error' : '' )">
<ValueEditor v-bind:ref="'filter' + filter.id" v-bind:attribute="getAttributeForEditor( filter.column )" with-expressions v-model="filter.value"/>
<ValueEditor v-bind:ref="'filter' + filter.id" v-bind:attribute="getAttributeForEditor( filter )" with-expressions v-model="filter.value"/>
<p v-if="filter.error != null" class="help-block">{{ filter.error }}</p>
</div>
</div>
Expand Down Expand Up @@ -294,17 +294,20 @@ export default {
}
},
getAttributeForEditor( column ) {
const type = this.getColumnType( column );
getAttributeForEditor( filter ) {
const type = this.getColumnType( filter.column );
const result = { type };
if ( type == 'ENUM' ) {
const attribute = this.attributes.find( a => a.id == column - Column.UserDefined );
const attribute = this.attributes.find( a => a.id == filter.column - Column.UserDefined );
if ( attribute != null )
result.items = attribute.items;
}
if ( filter.operator == 'IN' )
result[ 'multi-select' ] = 1;
return result;
},
Expand Down Expand Up @@ -334,6 +337,9 @@ export default {
if ( filter.operator != 'EQ' && filter.operator != 'NEQ' )
result.required = 1;
if ( filter.operator == 'IN' )
result[ 'multi-select' ] = 1;
return result;
},
Expand Down

0 comments on commit 22ad5ea

Please sign in to comment.