@evoke-platform/ui-components 1.0.0-dev.221 → 1.0.0-dev.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Box } from '../../layout';
|
3
|
-
import { Button, Checkbox, MenuItem, Select, Typography } from '../../core';
|
4
1
|
import { SwapVert } from '@mui/icons-material';
|
5
2
|
import { isArray, startCase } from 'lodash';
|
3
|
+
import React from 'react';
|
4
|
+
import { Button, Checkbox, MenuItem, Select, Typography } from '../../core';
|
5
|
+
import { Box } from '../../layout';
|
6
6
|
const HistoryFilter = (props) => {
|
7
7
|
const { order, setOrder, filter, setFilter, object } = props;
|
8
8
|
return (React.createElement(Box, { sx: { display: 'flex', width: '100%' } },
|
@@ -21,7 +21,7 @@ const HistoryFilter = (props) => {
|
|
21
21
|
borderRadius: '8px',
|
22
22
|
margin: '0 4px 16px 0',
|
23
23
|
maxWidth: '400px',
|
24
|
-
'@media (min-width: 600px)': { width: '
|
24
|
+
'@media (min-width: 600px)': { width: '70%' },
|
25
25
|
}, MenuProps: {
|
26
26
|
PaperProps: {
|
27
27
|
sx: {
|
@@ -45,7 +45,7 @@ const HistoryFilter = (props) => {
|
|
45
45
|
border: '1px solid #cbcbcb',
|
46
46
|
maxWidth: '135px',
|
47
47
|
'@media (min-width: 600px)': {
|
48
|
-
width: '
|
48
|
+
width: '30%',
|
49
49
|
},
|
50
50
|
}, onClick: () => (order === 'asc' ? setOrder('desc') : setOrder('asc')) },
|
51
51
|
React.createElement(Box, { display: 'flex', alignItems: 'center' },
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { Box, Typography } from '../../../index';
|
2
1
|
import { Circle } from '@mui/icons-material';
|
3
2
|
import { DateTime } from 'luxon';
|
4
3
|
import React, { useEffect, useState } from 'react';
|
4
|
+
import Typography from '../../core/Typography';
|
5
|
+
import Box from '../../layout/Box';
|
5
6
|
import HistoryFilter from './Filter';
|
6
7
|
import HistoricalData from './HistoryData';
|
7
8
|
import HistoryLoading from './HistoryLoading';
|
@@ -16,13 +17,12 @@ const { format } = require('small-date');
|
|
16
17
|
* @returns {JSX.Element} A timeline view representing the instance's history.
|
17
18
|
*/
|
18
19
|
export const HistoryLog = (props) => {
|
19
|
-
const { object, history, loading
|
20
|
+
const { object, history, loading, title } = props;
|
20
21
|
const [historyMap, setHistoryMap] = useState({});
|
21
22
|
const [documentHistory, setDocumentHistory] = useState({});
|
22
23
|
const [filteredHistory, setFilteredHistory] = useState({});
|
23
24
|
const [filter, setFilter] = useState([]);
|
24
25
|
const [order, setOrder] = useState('desc');
|
25
|
-
const [loading, setLoading] = useState(initialLoading !== null && initialLoading !== void 0 ? initialLoading : true);
|
26
26
|
const sortHistoryByTimestamp = (historicalData, order) => {
|
27
27
|
return historicalData.sort((a, b) => order === 'desc' ? b.timestamp.localeCompare(a.timestamp) : a.timestamp.localeCompare(b.timestamp));
|
28
28
|
};
|
@@ -45,7 +45,6 @@ export const HistoryLog = (props) => {
|
|
45
45
|
setHistoryMap(sortGroupedHistoryByDate(groupedHistory, 'desc'));
|
46
46
|
setFilteredHistory(sortGroupedHistoryByDate(groupedHistory, 'desc'));
|
47
47
|
setDocumentHistory(sortGroupedHistoryByDate(documentHistory, 'asc'));
|
48
|
-
setLoading(false);
|
49
48
|
}, [history]);
|
50
49
|
useEffect(() => {
|
51
50
|
if (!filter.length) {
|