diff --git a/webapp/src/components/dialog.scss b/webapp/src/components/dialog.scss index ac40fc6af..2aaabf258 100644 --- a/webapp/src/components/dialog.scss +++ b/webapp/src/components/dialog.scss @@ -48,13 +48,6 @@ flex-direction: row; height: 30px; margin: 10px; - - > .IconButton:first-child { - /* Hide close button on larger screens */ - @media not screen and (max-width: 975px) { - display: none; - } - } } > .content { display: flex; @@ -71,5 +64,12 @@ > .content.fullwidth { padding: 10px 0 10px 0; } + + .hideOnWidescreen { + /* Hide controls (e.g. close button) on larger screens */ + @media not screen and (max-width: 975px) { + display: none; + } + } } } diff --git a/webapp/src/components/dialog.tsx b/webapp/src/components/dialog.tsx index 4c5371177..b90ae0008 100644 --- a/webapp/src/components/dialog.tsx +++ b/webapp/src/components/dialog.tsx @@ -53,6 +53,7 @@ export default class Dialog extends React.PureComponent { onClick={this.closeClicked} icon={} title={'Close dialog'} + className='hideOnWidescreen' />
diff --git a/webapp/src/components/filterComponent.scss b/webapp/src/components/filterComponent.scss index 601e9b9d0..9431900d2 100644 --- a/webapp/src/components/filterComponent.scss +++ b/webapp/src/components/filterComponent.scss @@ -9,6 +9,27 @@ background-color: rgb(var(--main-bg)); padding: 10px; + @media screen and (max-width: 420px) { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + min-width: 0; + } + + .hideOnWidescreen { + /* Hide controls (e.g. close button) on larger screens */ + @media not screen and (max-width: 420px) { + display: none !important; + } + } + > .toolbar { + display: flex; + flex-direction: row; + height: 30px; + margin-bottom: 10px; + } .octo-filterclause { display: flex; flex-direction: row; diff --git a/webapp/src/components/filterComponent.tsx b/webapp/src/components/filterComponent.tsx index cb0dc7204..e5e1d67bc 100644 --- a/webapp/src/components/filterComponent.tsx +++ b/webapp/src/components/filterComponent.tsx @@ -1,20 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react' -import {FormattedMessage, IntlShape, injectIntl} from 'react-intl' +import {FormattedMessage, injectIntl, IntlShape} from 'react-intl' import {IPropertyTemplate} from '../blocks/board' - -import {BoardTree} from '../viewModel/boardTree' import {FilterClause, FilterCondition} from '../filterClause' import {FilterGroup} from '../filterGroup' import mutator from '../mutator' import {Utils} from '../utils' - -import MenuWrapper from '../widgets/menuWrapper' -import Menu from '../widgets/menu' +import {BoardTree} from '../viewModel/boardTree' import Button from '../widgets/buttons/button' - +import IconButton from '../widgets/buttons/iconButton' +import CloseIcon from '../widgets/icons/close' +import Menu from '../widgets/menu' +import MenuWrapper from '../widgets/menuWrapper' import './filterComponent.scss' type Props = { @@ -80,11 +79,18 @@ class FilterComponent extends React.Component { className='FilterComponent' ref={this.node} > +
+ } + title={'Close dialog'} + /> +
+ {filters.map((filter) => { const template = board.cardProperties.find((o) => o.id === filter.propertyId) const propertyName = template ? template.name : '(unknown)' // TODO: Handle error const key = `${filter.propertyId}-${filter.condition}-${filter.values.join(',')}` - Utils.log(`FilterClause key: ${key}`) return (
{ return undefined } + private closeClicked = () => { + this.props.onClose() + } + private deleteClicked(filter: FilterClause) { const {boardTree} = this.props const {activeView: view} = boardTree diff --git a/webapp/src/components/viewHeader.tsx b/webapp/src/components/viewHeader.tsx index 0086fcac5..d5c45ac12 100644 --- a/webapp/src/components/viewHeader.tsx +++ b/webapp/src/components/viewHeader.tsx @@ -65,11 +65,11 @@ class ViewHeader extends React.Component { } } - private filterClicked = () => { + private showFilterDialog = () => { this.setState({showFilter: true}) } - private hideFilter = () => { + private hideFilterDialog = () => { this.setState({showFilter: false}) } @@ -235,18 +235,18 @@ class ViewHeader extends React.Component {
+ {this.state.showFilter && + }