Skip to content

Commit

Permalink
fix(search): use formatted execution dates
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChristophe committed Jul 6, 2023
1 parent 58c039c commit d6be063
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 49 deletions.
32 changes: 29 additions & 3 deletions components/resultSearch/columns/ExecutionDateColumn.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { FC } from 'react';
import { Result } from '@eosc-perf/eosc-perf-client';
import { formatDistance } from 'date-fns';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';

type ExecutionDateColumnProps = {
result: Result;
Expand All @@ -9,8 +11,32 @@ type ExecutionDateColumnProps = {
* Column to display the time the result was obtained
* @param result
*/
const ExecutionDateColumn: FC<ExecutionDateColumnProps> = ({ result }) => (
<>{result.execution_datetime}</>
);
const ExecutionDateColumn: FC<ExecutionDateColumnProps> = ({ result }) => {
const executionDate = new Date(result.execution_datetime);

return (
<span
style={{
textDecoration: 'underline',
textDecorationStyle: 'dotted',
textDecorationColor: 'rgba(0, 0, 0, 0.33)',
}}
>
<OverlayTrigger
overlay={
<Tooltip id={result.id + '-tooltip'}>
{executionDate.toLocaleString(undefined)}
</Tooltip>
}
>
<span>
{formatDistance(executionDate, new Date(), {
addSuffix: true,
})}
</span>
</OverlayTrigger>
</span>
);
};

export default ExecutionDateColumn;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
},
"dependencies": {
"@eosc-perf/eosc-perf-client": "1.0.0-SNAPSHOT.202210201417",
"@popperjs/core": "^2.10.2",
"@popperjs/core": "^2.11.7",
"axios": "^0.26.0",
"bootstrap": "^5.1.3",
"bootstrap": "^5.3.0",
"chart.js": "^3.9.1",
"echarts": "^5.4.0",
"echarts-for-react": "^3.0.2",
Expand All @@ -31,7 +31,7 @@
"prismjs": "^1.27.0",
"qs": "^6.10.2",
"react": "^18.2.0",
"react-bootstrap": "^2.0.3",
"react-bootstrap": "^2.8.0",
"react-bootstrap-icons": "^1.8.1",
"react-chartjs-2": "^4.3.1",
"react-datepicker": "^4.5.0",
Expand Down
115 changes: 72 additions & 43 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -919,13 +919,20 @@
core-js-pure "^3.25.1"
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
"@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
version "7.19.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.4.tgz#a42f814502ee467d55b38dd1c256f53a7b885c78"
integrity sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA==
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.21.0":
version "7.22.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.6.tgz#57d64b9ae3cff1d67eb067ae117dac087f5bd438"
integrity sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==
dependencies:
regenerator-runtime "^0.13.11"

"@babel/template@^7.18.10", "@babel/template@^7.3.3":
version "7.18.10"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71"
Expand Down Expand Up @@ -1469,38 +1476,43 @@
resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1"
integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==

"@popperjs/core@^2.10.2", "@popperjs/core@^2.11.5", "@popperjs/core@^2.9.2":
"@popperjs/core@^2.11.6", "@popperjs/core@^2.11.7":
version "2.11.8"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==

"@popperjs/core@^2.9.2":
version "2.11.6"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45"
integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==

"@react-aria/ssr@^3.2.0":
version "3.3.0"
resolved "https://registry.yarnpkg.com/@react-aria/ssr/-/ssr-3.3.0.tgz#25e81daf0c7a270a4a891159d8d984578e4512d8"
integrity sha512-yNqUDuOVZIUGP81R87BJVi/ZUZp/nYOBXbPsRe7oltJOfErQZD+UezMpw4vM2KRz18cURffvmC8tJ6JTeyDtaQ==
"@react-aria/ssr@^3.5.0":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@react-aria/ssr/-/ssr-3.7.0.tgz#7eda2964ab792dc1c3a1fdacbf5bfb185590e9a5"
integrity sha512-bfufjg4ESE5giN+Fxj1XIzS5f/YIhqcGc+Ve+vUUKU8xZ8t/Xtjlv8F3kjqDBQdk//n3mluFY7xG1wQVB9rMLQ==
dependencies:
"@babel/runtime" "^7.6.2"
"@swc/helpers" "^0.5.0"

"@restart/hooks@^0.4.6", "@restart/hooks@^0.4.7":
version "0.4.7"
resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.4.7.tgz#d79ca6472c01ce04389fc73d4a79af1b5e33cd39"
integrity sha512-ZbjlEHcG+FQtpDPHd7i4FzNNvJf2enAwZfJbpM8CW7BhmOAbsHpZe3tsHwfQUrBuyrxWqPYp2x5UMnilWcY22A==
"@restart/hooks@^0.4.9":
version "0.4.9"
resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.4.9.tgz#ad858fb39d99e252cccce19416adc18fc3f18fcb"
integrity sha512-3BekqcwB6Umeya+16XPooARn4qEPW6vNvwYnlofIYe6h9qG1/VeD7UvShCWx11eFz5ELYmwIEshz+MkPX3wjcQ==
dependencies:
dequal "^2.0.2"

"@restart/ui@^1.3.1":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@restart/ui/-/ui-1.4.0.tgz#8333294fefb045f58852d5bb34367c3323e2edb3"
integrity sha512-5dDj5uDzUgK1iijWPRg6AnxjkHM04XhTQDJirM1h/8tIc7KyLtF9YyjcCpNEn259hPMXswpkfXKNgiag0skPFg==
"@restart/ui@^1.6.3":
version "1.6.6"
resolved "https://registry.yarnpkg.com/@restart/ui/-/ui-1.6.6.tgz#3481e2eaf15d7cae55bb2f518624e10d19c75800"
integrity sha512-eC3puKuWE1SRYbojWHXnvCNHGgf3uzHCb6JOhnF4OXPibOIPEkR1sqDSkL643ydigxwh+ruCa1CmYHlzk7ikKA==
dependencies:
"@babel/runtime" "^7.18.3"
"@popperjs/core" "^2.11.5"
"@react-aria/ssr" "^3.2.0"
"@restart/hooks" "^0.4.7"
"@babel/runtime" "^7.21.0"
"@popperjs/core" "^2.11.6"
"@react-aria/ssr" "^3.5.0"
"@restart/hooks" "^0.4.9"
"@types/warning" "^3.0.0"
dequal "^2.0.2"
dequal "^2.0.3"
dom-helpers "^5.2.0"
uncontrollable "^7.2.1"
uncontrollable "^8.0.1"
warning "^4.0.3"

"@rushstack/eslint-patch@^1.1.3":
Expand Down Expand Up @@ -1723,6 +1735,13 @@
dependencies:
tslib "^2.4.0"

"@swc/helpers@^0.5.0":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.1.tgz#e9031491aa3f26bfcc974a67f48bd456c8a5357a"
integrity sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==
dependencies:
tslib "^2.4.0"

"@testing-library/dom@^8.5.0":
version "8.19.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.19.0.tgz#bd3f83c217ebac16694329e413d9ad5fdcfd785f"
Expand Down Expand Up @@ -1952,10 +1971,10 @@
dependencies:
"@types/react" "*"

"@types/react-transition-group@^4.4.4":
version "4.4.5"
resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.5.tgz#aae20dcf773c5aa275d5b9f7cdbca638abc5e416"
integrity sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==
"@types/react-transition-group@^4.4.5":
version "4.4.6"
resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.6.tgz#18187bcda5281f8e10dfc48f0943e2fdf4f75e2e"
integrity sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==
dependencies:
"@types/react" "*"

Expand Down Expand Up @@ -2553,10 +2572,10 @@ bluebird@*, bluebird@^3.7.2:
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==

bootstrap@^5.1.3:
version "5.2.2"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.2.2.tgz#834e053eed584a65e244d8aa112a6959f56e27a0"
integrity sha512-dEtzMTV71n6Fhmbg4fYJzQsw1N29hJKO1js5ackCgIpDcGid2ETMGC6zwSYw09v05Y+oRdQ9loC54zB1La3hHQ==
bootstrap@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.0.tgz#0718a7cc29040ee8dbf1bd652b896f3436a87c29"
integrity sha512-UnBV3E3v4STVNQdms6jSGO2CvOkjUMdDAVR2V5N4uCMdaIkaQjbcEAMqRimDHIs4uqBYzDAKCQwCB+97tJgHQw==

brace-expansion@^1.1.7:
version "1.1.11"
Expand Down Expand Up @@ -2769,7 +2788,7 @@ cjs-module-lexer@^1.0.0:
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40"
integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==

classnames@^2.2.6, classnames@^2.3.1:
classnames@^2.2.6, classnames@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924"
integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==
Expand Down Expand Up @@ -3411,7 +3430,7 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==

dequal@^2.0.2:
dequal@^2.0.2, dequal@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be"
integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==
Expand Down Expand Up @@ -6866,21 +6885,21 @@ react-bootstrap-icons@^1.8.1:
dependencies:
prop-types "^15.7.2"

react-bootstrap@^2.0.3:
version "2.5.0"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-2.5.0.tgz#e25e649e37f080d38eeb92ad5b4ed562a1d7de62"
integrity sha512-j/aLR+okzbYk61TM3eDOU1NqOqnUdwyVrF+ojoCRUxPdzc2R0xXvqyRsjSoyRoCo7n82Fs/LWjPCin/QJNdwvA==
dependencies:
"@babel/runtime" "^7.17.2"
"@restart/hooks" "^0.4.6"
"@restart/ui" "^1.3.1"
"@types/react-transition-group" "^4.4.4"
classnames "^2.3.1"
react-bootstrap@^2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-2.8.0.tgz#781f254b33090c1d50ed521b40697727267c6add"
integrity sha512-e/aNtxl0Z2ozrIaR82jr6Zz7ss9GSoaXpQaxmvtDUsTZIq/XalkduR/ZXP6vbQHz2T4syvjA+4FbtwELxxmpww==
dependencies:
"@babel/runtime" "^7.21.0"
"@restart/hooks" "^0.4.9"
"@restart/ui" "^1.6.3"
"@types/react-transition-group" "^4.4.5"
classnames "^2.3.2"
dom-helpers "^5.2.1"
invariant "^2.2.4"
prop-types "^15.8.1"
prop-types-extra "^1.1.0"
react-transition-group "^4.4.2"
react-transition-group "^4.4.5"
uncontrollable "^7.2.1"
warning "^4.0.3"

Expand Down Expand Up @@ -6983,7 +7002,7 @@ react-test-renderer@^18.2.0:
react-shallow-renderer "^16.15.0"
scheduler "^0.23.0"

react-transition-group@^4.4.2:
react-transition-group@^4.4.5:
version "4.4.5"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
integrity sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==
Expand Down Expand Up @@ -7085,6 +7104,11 @@ regenerate@^1.4.2:
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==

regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==

regenerator-runtime@^0.13.4:
version "0.13.10"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee"
Expand Down Expand Up @@ -8001,6 +8025,11 @@ uncontrollable@^7.2.1:
invariant "^2.2.4"
react-lifecycles-compat "^3.0.4"

uncontrollable@^8.0.1:
version "8.0.2"
resolved "https://registry.yarnpkg.com/uncontrollable/-/uncontrollable-8.0.2.tgz#ed11b9b6c785b6a471365bcd9a6789cebc4c7849"
integrity sha512-/GDx+K1STGtpgTsj5Dj3J51YaKxZDblbCQHTH1zHLuoBEWodj6MjtRVv3TUijj1JYLRLSFsFzN8NV4M3QV4d9w==

unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
Expand Down

0 comments on commit d6be063

Please sign in to comment.