1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-23 18:34:02 +02:00

add class name

This commit is contained in:
Scott Bishel 2023-01-11 14:54:55 -07:00
parent 5e2a36f18d
commit fec9308812
3 changed files with 18 additions and 0 deletions

View File

@ -128,6 +128,7 @@ function DateFilter(props: Props): JSX.Element {
buttonText = intl.formatMessage({id: 'DateFilter.empty', defaultMessage: 'Empty'})
}
const className = 'DateFilter'
return (
<div className={`DateFilter ${displayValue ? '' : 'empty'} `}>
<Button

View File

@ -76,6 +76,7 @@ const FilterEntry = (props: Props): JSX.Element => {
Utils.assert(newFilter, `No filter at index ${filterIndex}`)
if (newFilter.propertyId !== optionId) {
newFilter.propertyId = optionId
newFilter.condition = OctoUtils.filterConditionDefault(propsRegistry.get(o.type).filterValueType)
newFilter.values = []
mutator.changeViewFilter(props.board.id, view.id, view.fields.filter, filterGroup)
}

View File

@ -3,6 +3,8 @@
import {IntlShape} from 'react-intl'
import {FilterValueType} from './properties/types'
import {Block, createBlock} from './blocks/block'
import {BoardView, createBoardView} from './blocks/boardView'
import {Card, createCard} from './blocks/card'
@ -152,6 +154,20 @@ class OctoUtils {
return '(unknown)'
}
}
static filterConditionDefault(filterValueType: FilterValueType): FilterCondition {
if (filterValueType === 'options') {
return 'includes'
} else if (filterValueType === 'boolean') {
return 'isSet'
} else if (filterValueType === 'text') {
return 'is'
} else if (filterValueType === 'date') {
return 'is'
}
Utils.assertFailure()
return 'includes'
}
}
export {OctoUtils}