Fix linting

This commit is contained in:
Chen-I Lim 2020-11-12 14:17:13 -08:00
parent 951aba1a4d
commit f0afce4197
6 changed files with 25 additions and 25 deletions

View file

@ -90,17 +90,17 @@ class CardFilter {
result[property.id] = property.value
}
return result
} else {
// And: Need to meet all clauses
const result: Record<string, string> = {}
filters.forEach((filterClause) => {
const property = this.propertyThatMeetsFilterClause(filterClause as FilterClause, templates)
if (property.value) {
result[property.id] = property.value
}
})
return result
}
// And: Need to meet all clauses
const result: Record<string, string> = {}
filters.forEach((filterClause) => {
const property = this.propertyThatMeetsFilterClause(filterClause as FilterClause, templates)
if (property.value) {
result[property.id] = property.value
}
})
return result
}
static propertyThatMeetsFilterClause(filterClause: FilterClause, templates: readonly IPropertyTemplate[]): { id: string, value?: string } {
@ -125,10 +125,10 @@ class CardFilter {
const option = template.options.find((o) => !filterClause.values.includes(o.id))
if (option) {
return {id: filterClause.propertyId, value: option.id}
} else {
// No other options exist
return {id: filterClause.propertyId}
}
// No other options exist
return {id: filterClause.propertyId}
}
// TODO: Handle non-select types

View file

@ -3,8 +3,6 @@
import React from 'react'
import {injectIntl, IntlShape} from 'react-intl'
import {MutableBlock} from '../blocks/block'
import {IPropertyTemplate} from '../blocks/board'
import {Card} from '../blocks/card'
import mutator from '../mutator'
@ -69,17 +67,17 @@ class BoardCard extends React.Component<BoardCardProps, BoardCardState> {
this.props.onDragEnd(e)
}}
onDragOver={(e) => {
onDragOver={() => {
if (!this.state.isDragOver) {
this.setState({isDragOver: true})
}
}}
onDragEnter={(e) => {
onDragEnter={() => {
if (!this.state.isDragOver) {
this.setState({isDragOver: true})
}
}}
onDragLeave={(e) => {
onDragLeave={() => {
this.setState({isDragOver: false})
}}
onDrop={(e) => {

View file

@ -232,9 +232,9 @@ class MutableBoardTree implements BoardTree {
}
} else {
// Empty group
const emptyGroupCards = this.cards.filter((o) => {
const optionId = o.properties[groupByProperty.id]
return !optionId || !groupByProperty.options.find((option) => option.id === optionId)
const emptyGroupCards = this.cards.filter((card) => {
const groupByOptionId = card.properties[groupByProperty.id]
return !groupByOptionId || !groupByProperty.options.find((option) => option.id === groupByOptionId)
})
const group: Group = {
option: {id: '', value: `No ${groupByProperty.name}`, color: ''},

View file

@ -6,5 +6,5 @@ import React from 'react'
export type MenuOptionProps = {
id: string,
name: string,
onClick?: (id: string) => void,
onClick: (id: string) => void,
}

View file

@ -8,7 +8,9 @@ import {MenuOptionProps} from './menuItem'
import './subMenuOption.scss'
type SubMenuOptionProps = MenuOptionProps & {
type SubMenuOptionProps = {
id: string,
name: string,
position?: 'bottom' | 'top'
icon?: React.ReactNode
}

View file

@ -31,8 +31,8 @@ export default class PropertyMenu extends React.PureComponent<Props, State> {
}
public componentDidMount(): void {
this.nameTextbox.current.focus()
document.execCommand('selectAll', false, null)
this.nameTextbox.current?.focus()
document.execCommand('selectAll', false, undefined)
}
private typeDisplayName(type: PropertyType): string {