Skip to content

Commit

Permalink
feat: Added delay button in the scaled down revision (#1355) (#1804)
Browse files Browse the repository at this point in the history
feat: Added delay button in the scaled down revision (#1355) (#1804)

Signed-off-by: “schakradari” <[email protected]>
  • Loading branch information
schakrad authored Feb 9, 2022
1 parent f371665 commit 459112b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 31 deletions.
6 changes: 4 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/classnames": "2.2.9",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^16.9.3",
"@types/react-dom": "^16.9.3",
"@types/react-helmet": "^6.1.0",
"@types/react-router-dom": "^5.1.7",
"argo-ui": "git+https://github.com/argoproj/argo-ui.git",
"classnames": "2.2.6",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"portable-fetch": "^3.0.0",
Expand All @@ -21,10 +23,10 @@
"react-helmet": "^6.1.0",
"react-hot-loader": "^3.1.3",
"react-keyhooks": "^0.2.3",
"react-router-dom": "^5.2.0",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
"rxjs": "^6.6.6",
"typescript": "^4.1.2",
"typescript": "4.3.5",
"web-vitals": "^1.0.1",
"webpack-dev-server": "^3.11.2"
},
Expand Down
18 changes: 17 additions & 1 deletion ui/src/app/components/pods/pods.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {Menu, ThemeDiv, Tooltip, WaitFor} from 'argo-ui/v2';
import {Menu, ThemeDiv, Tooltip, WaitFor, InfoItem} from 'argo-ui/v2';
import * as React from 'react';
import * as moment from 'moment';
import {Duration, Ticker} from 'argo-ui';
import {RolloutReplicaSetInfo} from '../../../models/rollout/generated';
import {Pod} from '../../../models/rollout/rollout';
import {ReplicaSetStatus, ReplicaSetStatusIcon} from '../status-icon/status-icon';
Expand Down Expand Up @@ -107,6 +109,20 @@ export const ReplicaSet = (props: {rs: RolloutReplicaSetInfo; showRevision?: boo
<ThemeDiv className='pods__header'>
<span style={{marginRight: '5px'}}>{rsName}</span> <ReplicaSetStatusIcon status={props.rs.status as ReplicaSetStatus} />
{props.showRevision && <div style={{marginLeft: 'auto'}}>Revision {props.rs.revision}</div>}
{props.rs.scaleDownDeadline && (
<div style={{marginLeft: 'auto'}}>
<Ticker>
{(now) => {
const time = moment(props.rs.scaleDownDeadline).diff(now, 'second');
return time <= 0 ? null : (
<Tooltip content={<span>Scaledown in <Duration durationMs={time}/></span>}>
<InfoItem content={<Duration durationMs={time}/> as any} icon='fa fa-clock'></InfoItem>
</Tooltip>
);
}}
</Ticker>
</div>
)}
</ThemeDiv>
)}

Expand Down
68 changes: 40 additions & 28 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1157,13 +1157,20 @@
dependencies:
regenerator-runtime "^0.13.4"

"@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":
"@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":
version "7.14.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6"
integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.12.1":
version "7.17.2"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941"
integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.4.2", "@babel/runtime@^7.8.7":
version "7.15.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.3.tgz#2e1c2880ca118e5b2f9988322bd8a7656a32502b"
Expand Down Expand Up @@ -1762,6 +1769,11 @@
dependencies:
"@babel/types" "^7.3.0"

"@types/[email protected]":
version "2.2.9"
resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.9.tgz#d868b6febb02666330410fe7f58f3c4b8258be7b"
integrity sha512-MNl+rT5UmZeilaPxAVs6YaPC2m6aA8rofviZbhbxpPpl61uKodfdQVsBtgJGTqGizEf02oW3tsVe7FYB8kK14A==

"@types/eslint@^7.2.6":
version "7.2.10"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.10.tgz#4b7a9368d46c0f8cd5408c23288a59aa2394d917"
Expand Down Expand Up @@ -1800,6 +1812,11 @@
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==

"@types/history@^4.7.11":
version "4.7.11"
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64"
integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==

"@types/html-minifier-terser@^5.0.0":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50"
Expand Down Expand Up @@ -1911,11 +1928,11 @@
"@types/react" "*"

"@types/react-router-dom@^5.1.7":
version "5.1.7"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.7.tgz#a126d9ea76079ffbbdb0d9225073eb5797ab7271"
integrity sha512-D5mHD6TbdV/DNHYsnwBTv+y73ei+mMjrkGrla86HthE4/PVvL1J94Bu3qABU+COXzpL23T1EZapVVpwHuBXiUg==
version "5.3.3"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83"
integrity sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==
dependencies:
"@types/history" "*"
"@types/history" "^4.7.11"
"@types/react" "*"
"@types/react-router" "*"

Expand Down Expand Up @@ -3437,10 +3454,10 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"

classnames@^2.2.5, classnames@^2.2.6:
version "2.3.1"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
classnames@2.2.6, classnames@^2.2.5, classnames@^2.2.6:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==

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

react-router-dom@^4.2.2:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==
dependencies:
history "^4.7.2"
invariant "^2.2.4"
loose-envify "^1.3.1"
prop-types "^15.6.1"
react-router "^4.3.1"
warning "^4.0.1"

react-router-dom@^5.2.0:
[email protected]:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
Expand All @@ -9599,6 +9604,18 @@ react-router-dom@^5.2.0:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router-dom@^4.2.2:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==
dependencies:
history "^4.7.2"
invariant "^2.2.4"
loose-envify "^1.3.1"
prop-types "^15.6.1"
react-router "^4.3.1"
warning "^4.0.1"

[email protected]:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
Expand Down Expand Up @@ -11464,16 +11481,11 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

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

typescript@^4.1.2:
version "4.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==

unbox-primitive@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
Expand Down

0 comments on commit 459112b

Please sign in to comment.