From 21b385dcd15e9e28f88f6ce33284695bf15f51c0 Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Thu, 24 Jun 2021 18:18:38 +0300 Subject: [PATCH 1/3] Changing the sorting buttons --- apps/spreadsheeteditor/mobile/locale/en.json | 2 ++ .../mobile/src/controller/FilterOptions.jsx | 8 +++++-- .../mobile/src/view/FilterOptions.jsx | 22 +++++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 02681d4f8a..bc32045061 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -412,6 +412,8 @@ "textInvalidRange": "Invalid cells range", "txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"", "textFilterOptions": "Filter Options", + "txtSortLow2High": "Sort Lowest to Highest", + "txtSortHigh2Low": "Sort Highest to Lowest", "textClearFilter": "Clear Filter", "textDeleteFilter": "Delete Filter", "textSelectAll": "Select All", diff --git a/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx b/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx index 6e8b153e88..79b2e36a14 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx @@ -10,7 +10,8 @@ const FilterOptionsController = () => { const [configFilter, setConfig] = useState(null); const [listVal, setListValue] = useState([]); - const [isValid, setIsValid] = useState(null) + const [isValid, setIsValid] = useState(null); + const [checkSort, setCheckSort] = useState(null); useEffect(() => { function onDocumentReady() { @@ -36,6 +37,9 @@ const FilterOptionsController = () => { setConfig(config); setClearDisable(config); + const sort = config.asc_getSortState(); + sort == Asc.c_oAscSortOptions.Ascending ? setCheckSort(true) : setCheckSort(false); + if (Device.phone) { f7.sheet.open('.picker__sheet'); } else { @@ -128,7 +132,7 @@ const FilterOptionsController = () => { }; return ( - ) }; diff --git a/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx b/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx index e5d3073799..ffdf7ba1f0 100644 --- a/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx @@ -6,6 +6,7 @@ import { Device } from '../../../../common/mobile/utils/device'; const FilterOptions = (props) => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); + const isAndroid = Device.android; useEffect(() => { const is_all_checked = props.listVal.every(item => item.check); @@ -33,15 +34,18 @@ const FilterOptions = (props) => { } - - - props.onSort('sortdown')}> - - - props.onSort('sortup')}> - - - + props.onSort('sortdown')} + after={isAndroid ? : null}> + {!isAndroid ? + : null + } + + + props.onSort('sortup')} + after={isAndroid ? : null}> + {!isAndroid ? + : null + } From b8cbd5cfb71137123e7cd3069c03fa6b0aed4334 Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Mon, 28 Jun 2021 11:11:29 +0300 Subject: [PATCH 2/3] [SSE] Fix Bug 47151 --- .../mobile/src/controller/FilterOptions.jsx | 4 ++-- .../mobile/src/less/icons-ios.less | 4 ++-- .../mobile/src/less/icons-material.less | 4 ++-- .../mobile/src/view/FilterOptions.jsx | 24 +++++++++---------- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx b/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx index 79b2e36a14..d1c950bb6a 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx @@ -37,8 +37,8 @@ const FilterOptionsController = () => { setConfig(config); setClearDisable(config); - const sort = config.asc_getSortState(); - sort == Asc.c_oAscSortOptions.Ascending ? setCheckSort(true) : setCheckSort(false); + setCheckSort((config.asc_getSortState() === Asc.c_oAscSortOptions.Ascending ? 'down' : '') || + (config.asc_getSortState() === Asc.c_oAscSortOptions.Descending ? 'up' : '')); if (Device.phone) { f7.sheet.open('.picker__sheet'); diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less index 1a908bcff5..719610da71 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less @@ -299,12 +299,12 @@ &.sortdown { width: 22px; height: 22px; - .encoded-svg-background(''); + .encoded-svg-mask(''); } &.sortup { width: 22px; height: 22px; - .encoded-svg-background(''); + .encoded-svg-mask(''); } // Formats diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-material.less b/apps/spreadsheeteditor/mobile/src/less/icons-material.less index 8c80a42f05..74821ae318 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-material.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-material.less @@ -278,12 +278,12 @@ &.sortdown { width: 22px; height: 22px; - .encoded-svg-background(''); + .encoded-svg-mask(''); } &.sortup { width: 22px; height: 22px; - .encoded-svg-background(''); + .encoded-svg-mask(''); } // Formats diff --git a/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx b/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx index ffdf7ba1f0..621b5afb92 100644 --- a/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/FilterOptions.jsx @@ -6,7 +6,6 @@ import { Device } from '../../../../common/mobile/utils/device'; const FilterOptions = (props) => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); - const isAndroid = Device.android; useEffect(() => { const is_all_checked = props.listVal.every(item => item.check); @@ -33,21 +32,20 @@ const FilterOptions = (props) => { } + - props.onSort('sortdown')} - after={isAndroid ? : null}> - {!isAndroid ? - : null - } - - - props.onSort('sortup')} - after={isAndroid ? : null}> - {!isAndroid ? - : null - } + + + props.onSort('sortdown')}> + + + props.onSort('sortup')}> + + + + {_t.textClearFilter} props.onDeleteFilter()} id="btn-delete-filter">{_t.textDeleteFilter} From 742af60274d34efada0d61be377a719011a5799c Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Mon, 28 Jun 2021 14:16:41 +0300 Subject: [PATCH 3/3] Correct icon android --- apps/common/mobile/resources/less/common-material.less | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/common/mobile/resources/less/common-material.less b/apps/common/mobile/resources/less/common-material.less index b2b44f5a94..604e5bcbfb 100644 --- a/apps/common/mobile/resources/less/common-material.less +++ b/apps/common/mobile/resources/less/common-material.less @@ -258,6 +258,9 @@ flex: 1; font-size: 17px; margin-left: 5px; + display: flex; + align-items: center; + justify-content: center; &:first-child { margin-left: 0; }