Merge: + client: add detailed date format for filters

Close #624

Squashed commit of the following:

commit 5a66d8ca350880abd0a7a146b75df385aa8f97b4
Author: Artem Baskal <a.baskal@adguard.com>
Date:   Mon Jan 20 19:16:27 2020 +0300

    update CellWrap logic

commit 072586493ef2cb73ba514a01d8b7f8904d4f5754
Author: Artem Baskal <a.baskal@adguard.com>
Date:   Mon Jan 20 15:37:26 2020 +0300

    fix invalid date case

commit bd2a21f2c788b2835485f4697dac1b797d5559c0
Author: Artem Baskal <a.baskal@adguard.com>
Date:   Fri Jan 17 18:44:23 2020 +0300

    + client: add detailed date format for filters
This commit is contained in:
Artem Baskal
2020-01-24 18:59:38 +03:00
parent ce7f1e231b
commit ac156b9612
8 changed files with 62 additions and 64 deletions

View File

@@ -4,7 +4,7 @@ import { withNamespaces } from 'react-i18next';
import ReactTable from 'react-table';
import Card from '../../ui/Card';
import WrapCell from './WrapCell';
import CellWrap from '../../ui/CellWrap';
import whoisCell from './whoisCell';
@@ -16,19 +16,19 @@ class AutoClients extends Component {
Header: this.props.t('table_client'),
accessor: 'ip',
minWidth: COLUMN_MIN_WIDTH,
Cell: WrapCell,
Cell: CellWrap,
},
{
Header: this.props.t('table_name'),
accessor: 'name',
minWidth: COLUMN_MIN_WIDTH,
Cell: WrapCell,
Cell: CellWrap,
},
{
Header: this.props.t('source_label'),
accessor: 'source',
minWidth: COLUMN_MIN_WIDTH,
Cell: WrapCell,
Cell: CellWrap,
},
{
Header: this.props.t('whois'),

View File

@@ -7,7 +7,7 @@ import { MODAL_TYPE } from '../../../helpers/constants';
import { normalizeTextarea } from '../../../helpers/helpers';
import Card from '../../ui/Card';
import Modal from './Modal';
import WrapCell from './WrapCell';
import CellWrap from '../../ui/CellWrap';
class ClientsTable extends Component {
handleFormAdd = (values) => {
@@ -94,7 +94,7 @@ class ClientsTable extends Component {
Header: this.props.t('table_name'),
accessor: 'name',
minWidth: 120,
Cell: WrapCell,
Cell: CellWrap,
},
{
Header: this.props.t('settings'),
@@ -166,21 +166,7 @@ class ClientsTable extends Component {
accessor: row => this.props.normalizedTopClients.configured[row.name] || 0,
sortMethod: (a, b) => b - a,
minWidth: 120,
Cell: (row) => {
const { value: clientStats } = row;
if (clientStats) {
return (
<div className="logs__row">
<div className="logs__text" title={clientStats}>
{clientStats}
</div>
</div>
);
}
return '';
},
Cell: CellWrap,
},
{
Header: this.props.t('actions_table_header'),

View File

@@ -1,16 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
const WrapCell = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value || ''}
</span>
</div>
);
WrapCell.propTypes = {
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
export default WrapCell;