[SSE mobile] Fix Bug 59964
This commit is contained in:
parent
e749085682
commit
1be5ed94e7
|
@ -2,10 +2,13 @@ import React, {useEffect, useState} from 'react';
|
||||||
import {f7, List, Popover, Sheet, ListItem, Icon, Row, Button, ListButton, Page, Navbar, Segmented, BlockTitle, NavRight, Link, Toggle,View} from 'framework7-react';
|
import {f7, List, Popover, Sheet, ListItem, Icon, Row, Button, ListButton, Page, Navbar, Segmented, BlockTitle, NavRight, Link, Toggle,View} from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Device } from '../../../../common/mobile/utils/device';
|
import { Device } from '../../../../common/mobile/utils/device';
|
||||||
|
import {observer, inject} from "mobx-react";
|
||||||
|
|
||||||
const FilterOptions = (props) => {
|
const FilterOptions = inject('storeAppOptions')(observer(props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('View.Edit', {returnObjects: true});
|
const _t = t('View.Edit', {returnObjects: true});
|
||||||
|
const storeAppOptions = props.storeAppOptions;
|
||||||
|
const canModifyFilter = storeAppOptions.canModifyFilter;
|
||||||
let is_all_checked = props.listVal.every(item => item.check);
|
let is_all_checked = props.listVal.every(item => item.check);
|
||||||
|
|
||||||
const HandleClearFilter = () => {
|
const HandleClearFilter = () => {
|
||||||
|
@ -40,34 +43,48 @@ const FilterOptions = (props) => {
|
||||||
</NavRight>
|
</NavRight>
|
||||||
}
|
}
|
||||||
</Navbar>
|
</Navbar>
|
||||||
|
|
||||||
<List>
|
<List>
|
||||||
<ListItem className='buttons'>
|
<ListItem className='buttons'>
|
||||||
<Row>
|
<Row>
|
||||||
<a className={'button' + (props.checkSort === 'down' ? ' active' : '')} onClick={() => {props.onSort('sortdown'); onValidChecked();}}>
|
<a className={'button' + (props.checkSort === 'down' ? ' active' : '')} onClick={() => {
|
||||||
|
props.onSort('sortdown');
|
||||||
|
onValidChecked();
|
||||||
|
}}>
|
||||||
<Icon slot="media" icon="sortdown"/>
|
<Icon slot="media" icon="sortdown"/>
|
||||||
</a>
|
</a>
|
||||||
<a className={'button' + (props.checkSort === 'up' ? ' active' : '')} onClick={() => {props.onSort('sortup'); onValidChecked();}}>
|
<a className={'button' + (props.checkSort === 'up' ? ' active' : '')} onClick={() => {
|
||||||
|
props.onSort('sortup');
|
||||||
|
onValidChecked();
|
||||||
|
}}>
|
||||||
<Icon slot="media" icon="sortup"/>
|
<Icon slot="media" icon="sortup"/>
|
||||||
</a>
|
</a>
|
||||||
</Row>
|
</Row>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
|
||||||
<List>
|
<List>
|
||||||
<ListButton className={props.isValid || is_all_checked ? 'disabled' : ''} onClick={HandleClearFilter}>{_t.textClearFilter}</ListButton>
|
<ListButton className={props.isValid || is_all_checked ? 'disabled' : ''}
|
||||||
<ListButton color="red" onClick={() => props.onDeleteFilter()} id="btn-delete-filter">{_t.textDeleteFilter}</ListButton>
|
onClick={HandleClearFilter}>{_t.textClearFilter}</ListButton>
|
||||||
|
<ListButton color="red" className={!canModifyFilter ? 'disabled' : ''}
|
||||||
|
onClick={() => props.onDeleteFilter()}
|
||||||
|
id="btn-delete-filter">{_t.textDeleteFilter}</ListButton>
|
||||||
</List>
|
</List>
|
||||||
<List>
|
<List>
|
||||||
<ListItem className='radio-checkbox-item' onChange={e => {props.onUpdateCell('all', e.target.checked); onValidChecked();}} name='filter-cellAll' checkbox checked={is_all_checked}>{_t.textSelectAll}</ListItem>
|
<ListItem className='radio-checkbox-item' onChange={e => {
|
||||||
|
props.onUpdateCell('all', e.target.checked);
|
||||||
|
onValidChecked();
|
||||||
|
}} name='filter-cellAll' checkbox checked={is_all_checked}>{_t.textSelectAll}</ListItem>
|
||||||
{props.listVal.map((value) =>
|
{props.listVal.map((value) =>
|
||||||
<ListItem className='radio-checkbox-item' onChange={e => {props.onUpdateCell(value.id, e.target.checked); onValidChecked();}} key={value.value} name='filter-cell' value={value.value} title={value.cellvalue} checkbox checked={value.check} />
|
<ListItem className='radio-checkbox-item' onChange={e => {
|
||||||
|
props.onUpdateCell(value.id, e.target.checked);
|
||||||
|
onValidChecked();
|
||||||
|
}} key={value.value} name='filter-cell' value={value.value} title={value.cellvalue} checkbox
|
||||||
|
checked={value.check}/>
|
||||||
)}
|
)}
|
||||||
</List>
|
</List>
|
||||||
</Page>
|
</Page>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
};
|
}));
|
||||||
|
|
||||||
const FilterView = (props) => {
|
const FilterView = (props) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -3,10 +3,12 @@ import { inject, observer } from 'mobx-react';
|
||||||
import {List, ListItem, Icon} from 'framework7-react';
|
import {List, ListItem, Icon} from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const AddOther = inject("storeFocusObjects")(observer(props => {
|
const AddOther = inject("storeFocusObjects", "storeAppOptions")(observer(props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('View.Add', {returnObjects: true});
|
const _t = t('View.Add', {returnObjects: true});
|
||||||
const storeFocusObjects = props.storeFocusObjects;
|
const storeFocusObjects = props.storeFocusObjects;
|
||||||
|
const storeAppOptions = props.storeAppOptions;
|
||||||
|
const canModifyFilter = storeAppOptions.canModifyFilter;
|
||||||
const isHyperLink = storeFocusObjects.selections.indexOf('hyperlink') > -1;
|
const isHyperLink = storeFocusObjects.selections.indexOf('hyperlink') > -1;
|
||||||
const hideAddComment = props.hideAddComment();
|
const hideAddComment = props.hideAddComment();
|
||||||
const wsProps = props.wsProps;
|
const wsProps = props.wsProps;
|
||||||
|
@ -22,7 +24,7 @@ const AddOther = inject("storeFocusObjects")(observer(props => {
|
||||||
}}>
|
}}>
|
||||||
<Icon slot="media" icon="icon-insert-comment"></Icon>
|
<Icon slot="media" icon="icon-insert-comment"></Icon>
|
||||||
</ListItem>}
|
</ListItem>}
|
||||||
<ListItem title={_t.textSortAndFilter} className={wsProps.Sort && 'disabled'} link={'/add-sort-and-filter/'}>
|
<ListItem title={_t.textSortAndFilter} className={wsProps.Sort || !canModifyFilter ? 'disabled' : ''} link={'/add-sort-and-filter/'}>
|
||||||
<Icon slot="media" icon="icon-sort"></Icon>
|
<Icon slot="media" icon="icon-sort"></Icon>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem title={_t.textLink} className={wsProps.InsertHyperlinks && 'disabled'} link={isHyperLink ? '/edit-link/' : '/add-link/'} routeProps={{
|
<ListItem title={_t.textLink} className={wsProps.InsertHyperlinks && 'disabled'} link={isHyperLink ? '/edit-link/' : '/add-link/'} routeProps={{
|
||||||
|
|
Loading…
Reference in a new issue