Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
adds mock values
Browse files Browse the repository at this point in the history
  • Loading branch information
Anisha Swain committed Feb 1, 2021
1 parent bee2f53 commit 8d39333
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 47 deletions.
50 changes: 27 additions & 23 deletions mock/overview.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,76 @@
export const expirationLimit = 20;
export const expirationLimit = 30;

// P.S: the key needs to be unique for this object
export const resultData = [
{
key: 1,
result: ['mock result -1', ' virtual506.virt.lab.eng.bos.redhat.com'],
result: ['mock result -1', 'example.lab.eng.com'],
end: '2020-09-10T 11:52:34.552478',
deletion: '2020-10-10T11:52:34.552478',
seen: false,
description: 'More content can be added here',
},
{
key: 2,
result: ['mock result -2', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-09-10T11:52:34.552478',
result: ['mock result -2', ' example.lab.eng.com'],
end: '2020-10-10T11:52:34.552478',
deletion: '2020-11-10T11:52:34.552478',
seen: false,
description: 'More content can be added here',
},
{
key: 3,
result: ['mock result -3', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-09-10T11:52:34.552478',
result: ['mock result -3', ' example.lab.eng.com'],
end: '2020-11-10T11:52:34.552478',
deletion: '2020-12-10T11:52:34.552478',
seen: false,
description: 'More content can be added here',
},
{
key: 4,
result: ['mock result -4', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-09-10T11:52:34.552478',
result: ['mock result -4', ' example.lab.eng.com'],
end: '2020-11-10T11:52:34.552478',
deletion: '2020-12-13T11:52:34.552478',
seen: false,
description: 'More content can be added here',
},
{
key: 5,
result: ['mock result -5', 'virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-11-13T11:52:34.552478',
deletion: '2020-11-13T11:52:34.552478',
result: ['mock result -5', 'example.lab.eng.com'],
end: '2020-12-10T11:52:34.552478',
deletion: '2021-01-10T11:52:34.552478',
seen: true,
description: 'More content can be added here',
},
{
key: 6,
result: ['mock result -6', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-11-20T11:52:34.552478',
deletion: '2020-11-20T11:52:34.552478',
result: ['mock result -6', ' example.lab.eng.com'],
end: '2020-12-10T11:52:34.552478',
deletion: '2021-01-10T11:52:34.552478',
seen: true,
description: 'More content can be added here',
},
{
key: 7,
result: ['mock result -7', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-11-15T11:52:34.552478',
deletion: '2020-11-15T11:52:34.552478',
result: ['mock result -7', ' example.lab.eng.com'],
end: '2021-01-10T11:52:34.552478',
deletion: '2021-02-10T11:52:34.552478',
seen: true,
description: 'More content can be added here',
},
{
key: 8,
result: ['mock result -8', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-11-25T11:52:34.552478',
deletion: '2020-11-25T11:52:34.552478',
result: ['mock result -8', ' example.lab.eng.com'],
end: '2021-01-10T11:52:34.552478',
deletion: '2021-02-10T11:52:34.552478',
seen: true,
description: 'More content can be added here',
},
{
key: 9,
result: ['mock result -9', ' virtual506.virt.lab.eng.bos.redhat.com'],
end: '2020-11-25T11:52:34.552478',
deletion: '2020-11-25T11:52:34.552478',
result: ['mock result -9', ' example.lab.eng.com'],
end: '2021-01-20T11:52:34.552478',
deletion: '2021-02-20T11:52:34.552478',
seen: true,
description: 'More content can be added here',
},
Expand Down
51 changes: 27 additions & 24 deletions src/pages/Overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,19 @@ class Overview extends React.Component {
title: 'Result',
dataIndex: 'result',
key: 'result',
render: text => (
<div>
<Button variant="link" isInline style={{ marginBottom: '8px' }}>
{text[0]}
</Button>
<br />
<Text component={TextVariants.p} className={styles.subText}>
<span className={styles.label}>{text[1]}</span>
</Text>
</div>
),
render: text => {
return (
<div>
<Button variant="link" isInline style={{ marginBottom: '8px' }}>
{text[0]}
</Button>
<br />
<Text component={TextVariants.p} className={styles.subText}>
<span className={styles.label}>{text[1]}</span>
</Text>
</div>
);
},
},
{
title: 'End Time',
Expand Down Expand Up @@ -206,10 +208,11 @@ class Overview extends React.Component {
dataIndex: 'deletion',
key: 'deletion',
render: text => {
const startDate = moment(new Date(Date.parse(text)));
const deleteDate = moment(new Date(Date.parse(text)));
const currDate = moment(new Date());
const currDays = currDate.diff(startDate, 'days');
if (currDays < expirationLimit) {
const remainingDays = currDate.diff(deleteDate, 'days');
console.log(remainingDays, expirationLimit);
if (remainingDays < 0) {
return (
<Text>
{moment(text)
Expand Down Expand Up @@ -308,7 +311,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-1
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -321,7 +324,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-2
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -334,7 +337,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-3
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -347,7 +350,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-4
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -360,7 +363,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-5
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -373,7 +376,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-6
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -386,7 +389,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-7
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -399,7 +402,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-8
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -412,7 +415,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-9
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand All @@ -426,7 +429,7 @@ class Overview extends React.Component {
<div className={styles.paddingSmall}>
<TextContent>
<Button variant="link" isInline>
fio_2020.09.10T12.42.11
mock-result-10
</Button>
<Text component={TextVariants.p} className={styles.subText}>
<OutlinedClockIcon className={styles.icons} /> 2020-09-10T
Expand Down

0 comments on commit 8d39333

Please sign in to comment.