Skip to content

Commit 459112b

Browse files
authored
feat: Added delay button in the scaled down revision (argoproj#1355) (argoproj#1804)
feat: Added delay button in the scaled down revision (argoproj#1355) (argoproj#1804) Signed-off-by: “schakradari” <[email protected]>
1 parent f371665 commit 459112b

File tree

3 files changed

+61
-31
lines changed

3 files changed

+61
-31
lines changed

ui/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
"@testing-library/jest-dom": "^5.11.4",
77
"@testing-library/react": "^11.1.0",
88
"@testing-library/user-event": "^12.1.10",
9+
"@types/classnames": "2.2.9",
910
"@types/jest": "^26.0.15",
1011
"@types/node": "^12.0.0",
1112
"@types/react": "^16.9.3",
1213
"@types/react-dom": "^16.9.3",
1314
"@types/react-helmet": "^6.1.0",
1415
"@types/react-router-dom": "^5.1.7",
1516
"argo-ui": "git+https://github.com/argoproj/argo-ui.git",
17+
"classnames": "2.2.6",
1618
"moment": "^2.29.1",
1719
"moment-timezone": "^0.5.33",
1820
"portable-fetch": "^3.0.0",
@@ -21,10 +23,10 @@
2123
"react-helmet": "^6.1.0",
2224
"react-hot-loader": "^3.1.3",
2325
"react-keyhooks": "^0.2.3",
24-
"react-router-dom": "^5.2.0",
26+
"react-router-dom": "5.2.0",
2527
"react-scripts": "4.0.3",
2628
"rxjs": "^6.6.6",
27-
"typescript": "^4.1.2",
29+
"typescript": "4.3.5",
2830
"web-vitals": "^1.0.1",
2931
"webpack-dev-server": "^3.11.2"
3032
},

ui/src/app/components/pods/pods.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import {Menu, ThemeDiv, Tooltip, WaitFor} from 'argo-ui/v2';
1+
import {Menu, ThemeDiv, Tooltip, WaitFor, InfoItem} from 'argo-ui/v2';
22
import * as React from 'react';
3+
import * as moment from 'moment';
4+
import {Duration, Ticker} from 'argo-ui';
35
import {RolloutReplicaSetInfo} from '../../../models/rollout/generated';
46
import {Pod} from '../../../models/rollout/rollout';
57
import {ReplicaSetStatus, ReplicaSetStatusIcon} from '../status-icon/status-icon';
@@ -107,6 +109,20 @@ export const ReplicaSet = (props: {rs: RolloutReplicaSetInfo; showRevision?: boo
107109
<ThemeDiv className='pods__header'>
108110
<span style={{marginRight: '5px'}}>{rsName}</span> <ReplicaSetStatusIcon status={props.rs.status as ReplicaSetStatus} />
109111
{props.showRevision && <div style={{marginLeft: 'auto'}}>Revision {props.rs.revision}</div>}
112+
{props.rs.scaleDownDeadline && (
113+
<div style={{marginLeft: 'auto'}}>
114+
<Ticker>
115+
{(now) => {
116+
const time = moment(props.rs.scaleDownDeadline).diff(now, 'second');
117+
return time <= 0 ? null : (
118+
<Tooltip content={<span>Scaledown in <Duration durationMs={time}/></span>}>
119+
<InfoItem content={<Duration durationMs={time}/> as any} icon='fa fa-clock'></InfoItem>
120+
</Tooltip>
121+
);
122+
}}
123+
</Ticker>
124+
</div>
125+
)}
110126
</ThemeDiv>
111127
)}
112128

ui/yarn.lock

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,13 +1157,20 @@
11571157
dependencies:
11581158
regenerator-runtime "^0.13.4"
11591159

1160-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
1160+
"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
11611161
version "7.14.0"
11621162
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6"
11631163
integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==
11641164
dependencies:
11651165
regenerator-runtime "^0.13.4"
11661166

1167+
"@babel/runtime@^7.12.1":
1168+
version "7.17.2"
1169+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941"
1170+
integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==
1171+
dependencies:
1172+
regenerator-runtime "^0.13.4"
1173+
11671174
"@babel/runtime@^7.4.2", "@babel/runtime@^7.8.7":
11681175
version "7.15.3"
11691176
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.3.tgz#2e1c2880ca118e5b2f9988322bd8a7656a32502b"
@@ -1762,6 +1769,11 @@
17621769
dependencies:
17631770
"@babel/types" "^7.3.0"
17641771

1772+
1773+
version "2.2.9"
1774+
resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.9.tgz#d868b6febb02666330410fe7f58f3c4b8258be7b"
1775+
integrity sha512-MNl+rT5UmZeilaPxAVs6YaPC2m6aA8rofviZbhbxpPpl61uKodfdQVsBtgJGTqGizEf02oW3tsVe7FYB8kK14A==
1776+
17651777
"@types/eslint@^7.2.6":
17661778
version "7.2.10"
17671779
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.10.tgz#4b7a9368d46c0f8cd5408c23288a59aa2394d917"
@@ -1800,6 +1812,11 @@
18001812
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
18011813
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
18021814

1815+
"@types/history@^4.7.11":
1816+
version "4.7.11"
1817+
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64"
1818+
integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==
1819+
18031820
"@types/html-minifier-terser@^5.0.0":
18041821
version "5.1.1"
18051822
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50"
@@ -1911,11 +1928,11 @@
19111928
"@types/react" "*"
19121929

19131930
"@types/react-router-dom@^5.1.7":
1914-
version "5.1.7"
1915-
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.7.tgz#a126d9ea76079ffbbdb0d9225073eb5797ab7271"
1916-
integrity sha512-D5mHD6TbdV/DNHYsnwBTv+y73ei+mMjrkGrla86HthE4/PVvL1J94Bu3qABU+COXzpL23T1EZapVVpwHuBXiUg==
1931+
version "5.3.3"
1932+
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83"
1933+
integrity sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==
19171934
dependencies:
1918-
"@types/history" "*"
1935+
"@types/history" "^4.7.11"
19191936
"@types/react" "*"
19201937
"@types/react-router" "*"
19211938

@@ -3437,10 +3454,10 @@ class-utils@^0.3.5:
34373454
isobject "^3.0.0"
34383455
static-extend "^0.1.1"
34393456

3440-
classnames@^2.2.5, classnames@^2.2.6:
3441-
version "2.3.1"
3442-
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
3443-
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
3457+
classnames@2.2.6, classnames@^2.2.5, classnames@^2.2.6:
3458+
version "2.2.6"
3459+
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
3460+
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
34443461

34453462
clean-css@^4.2.3:
34463463
version "4.2.3"
@@ -9574,19 +9591,7 @@ react-refresh@^0.8.3:
95749591
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f"
95759592
integrity sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==
95769593

9577-
react-router-dom@^4.2.2:
9578-
version "4.3.1"
9579-
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
9580-
integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==
9581-
dependencies:
9582-
history "^4.7.2"
9583-
invariant "^2.2.4"
9584-
loose-envify "^1.3.1"
9585-
prop-types "^15.6.1"
9586-
react-router "^4.3.1"
9587-
warning "^4.0.1"
9588-
9589-
react-router-dom@^5.2.0:
9594+
95909595
version "5.2.0"
95919596
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
95929597
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
@@ -9599,6 +9604,18 @@ react-router-dom@^5.2.0:
95999604
tiny-invariant "^1.0.2"
96009605
tiny-warning "^1.0.0"
96019606

9607+
react-router-dom@^4.2.2:
9608+
version "4.3.1"
9609+
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
9610+
integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==
9611+
dependencies:
9612+
history "^4.7.2"
9613+
invariant "^2.2.4"
9614+
loose-envify "^1.3.1"
9615+
prop-types "^15.6.1"
9616+
react-router "^4.3.1"
9617+
warning "^4.0.1"
9618+
96029619
96039620
version "5.2.0"
96049621
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
@@ -11464,16 +11481,11 @@ typedarray@^0.0.6:
1146411481
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1146511482
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1146611483

11467-
typescript@^4.0.3:
11484+
typescript@4.3.5, typescript@^4.0.3:
1146811485
version "4.3.5"
1146911486
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
1147011487
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==
1147111488

11472-
typescript@^4.1.2:
11473-
version "4.2.4"
11474-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
11475-
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==
11476-
1147711489
unbox-primitive@^1.0.0:
1147811490
version "1.0.1"
1147911491
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"

0 commit comments

Comments
 (0)