Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add swap traffic button #2193

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ FEATURE_CONFIG_DRIFT_ENABLE=false
FEATURE_PROMO_EMBEDDED_BUTTON_TEXT=
FEATURE_PROMO_EMBEDDED_MODAL_TITLE=
FEATURE_PROMO_EMBEDDED_IFRAME_URL=
FEATURE_SWAP_TRAFFIC_ENABLE=true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "/dashboard",
"dependencies": {
"@devtron-labs/devtron-fe-common-lib": "0.6.5",
"@devtron-labs/devtron-fe-common-lib": "0.6.5-beta-6",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
Expand Down
34 changes: 25 additions & 9 deletions src/components/app/details/appDetails/SourceInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import HelmAppConfigApplyStatusCard from '@Components/v2/appDetails/sourceInfo/e
const AppDetailsDownloadCard = importComponentFromFELibrary('AppDetailsDownloadCard')
const DeploymentWindowStatusCard = importComponentFromFELibrary('DeploymentWindowStatusCard')
const ConfigSyncStatusButton = importComponentFromFELibrary('ConfigSyncStatusButton', null, 'function')
const SwapTraffic = importComponentFromFELibrary('SwapTraffic', null, 'function')

export const SourceInfo = ({
appDetails,
Expand Down Expand Up @@ -158,15 +159,18 @@ export const SourceInfo = ({
</div>
</Tooltip>
)}
{appDetails?.resourceTree && !isIsolatedEnv && window._env_.FEATURE_CONFIG_DRIFT_ENABLE && ConfigSyncStatusButton && (
<div className="pl-8">
<ConfigSyncStatusButton
areConfigurationsDrifted={appDetails.resourceTree.hasDrift}
appId={appDetails.appId}
envId={envId}
/>
</div>
)}
{appDetails?.resourceTree &&
!isIsolatedEnv &&
window._env_.FEATURE_CONFIG_DRIFT_ENABLE &&
ConfigSyncStatusButton && (
<div className="pl-8">
<ConfigSyncStatusButton
areConfigurationsDrifted={appDetails.resourceTree.hasDrift}
appId={appDetails.appId}
envId={envId}
/>
</div>
)}
{isdeploymentAppDeleting && (
<div data-testid="deleteing-argocd-pipeline" className="flex left">
<Trash className="icon-dim-16 mr-8 ml-12" />
Expand Down Expand Up @@ -214,6 +218,18 @@ export const SourceInfo = ({
style={ButtonStyleType.neutral}
/>
)}
{window._env_.FEATURE_SWAP_TRAFFIC_ENABLE &&
SwapTraffic &&
!!appDetails.pcoId &&
!appDetails.trafficSwitched && (
<SwapTraffic
appName={appDetails.appName}
envName={appDetails.environmentName}
appId={appDetails.appId}
envId={appDetails.environmentId}
pcoId={appDetails.pcoId}
/>
)}
{!isVirtualEnvironment && showHibernateModal && (
<Button
dataTestId="app-details-hibernate-modal-button"
Expand Down
2 changes: 2 additions & 0 deletions src/components/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export interface AppDetails extends CDModalProps {
imageTag?: string
isPipelineTriggered?: boolean
releaseMode: ReleaseMode
trafficSwitched?: boolean
pcoId?: number
}

export interface LabelTag {
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ if (!window || !window._env_) {
FEATURE_CONFIG_DRIFT_ENABLE: false,
FEATURE_PROMO_EMBEDDED_BUTTON_TEXT: '',
FEATURE_PROMO_EMBEDDED_MODAL_TITLE: '',
FEATURE_PROMO_EMBEDDED_IFRAME_URL:''
FEATURE_PROMO_EMBEDDED_IFRAME_URL:'',
FEATURE_SWAP_TRAFFIC_ENABLE: true,
}
}

Expand Down
58 changes: 29 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,10 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@devtron-labs/devtron-fe-common-lib@0.6.5":
version "0.6.5"
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-0.6.5.tgz#a718c8b1e982309f2329244fe9f6fbcee281e2ea"
integrity sha512-PBuqYnCIMwMu0Xr8KFnCvMPyFdg7gl12KeUCodkHkDZa2gy88Eaa1oM6DxCoYcidhdmwgfPdWUgHv87A3JWGiA==
"@devtron-labs/devtron-fe-common-lib@0.6.5-beta-6":
version "0.6.5-beta-6"
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-0.6.5-beta-6.tgz#5cd30eaadb7cc821fe2dfd60042b37a04a190718"
integrity sha512-HT7apfG1az/2gIArd8iei5s1Z9uCrTfao5ASL7T6mSJ6p6/3kHSUhTYOKu3UfDU7okBKWvD0xS/+62cyRi50FQ==
dependencies:
"@types/react-dates" "^21.8.6"
ansi_up "^5.2.1"
Expand Down Expand Up @@ -3644,14 +3644,14 @@ browser-assert@^1.2.1:
integrity sha512-nfulgvOR6S4gt9UKCeGJOuSGBPGiFT6oQ/2UBnvTY/5aQ1PnksW72fhZkM30DzoRRv2WpwZf1vHHEr3mtuXIWQ==

browserslist@^4.23.1, browserslist@^4.23.3:
version "4.23.3"
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz"
integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==
version "4.24.2"
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz"
integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==
dependencies:
caniuse-lite "^1.0.30001646"
electron-to-chromium "^1.5.4"
caniuse-lite "^1.0.30001669"
electron-to-chromium "^1.5.41"
node-releases "^2.0.18"
update-browserslist-db "^1.1.0"
update-browserslist-db "^1.1.1"

bs-logger@^0.2.6:
version "0.2.6"
Expand Down Expand Up @@ -3734,10 +3734,10 @@ camelcase@^6.2.0:
resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001646:
version "1.0.30001667"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz"
integrity sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==
caniuse-lite@^1.0.30001669:
version "1.0.30001680"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz"
integrity sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==

chai@^4.3.10:
version "4.5.0"
Expand Down Expand Up @@ -4537,10 +4537,10 @@ ejs@^3.1.10, ejs@^3.1.6:
dependencies:
jake "^10.8.5"

electron-to-chromium@^1.5.4:
version "1.5.32"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.32.tgz"
integrity sha512-M+7ph0VGBQqqpTT2YrabjNKSQ2fEl9PVx6AK3N558gDH9NO8O6XN9SXXFWRo9u9PbEg/bWq+tjXQr+eXmxubCw==
electron-to-chromium@^1.5.41:
version "1.5.56"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.56.tgz"
integrity sha512-7lXb9dAvimCFdvUMTyucD4mnIndt/xhRKFAlky0CyFogdnNmdPQNoHI23msF/2V4mpTxMzgMdjK4+YRlFlRQZw==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down Expand Up @@ -4780,10 +4780,10 @@ esbuild-register@^3.5.0:
"@esbuild/win32-ia32" "0.21.5"
"@esbuild/win32-x64" "0.21.5"

escalade@^3.1.2:
version "3.1.2"
resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz"
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
escalade@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz"
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==

escape-html@~1.0.3:
version "1.0.3"
Expand Down Expand Up @@ -7573,7 +7573,7 @@ performance-now@^2.1.0:
resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==

picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0:
picocolors@^1.0.0, picocolors@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz"
integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==
Expand Down Expand Up @@ -9720,13 +9720,13 @@ upath@^1.2.0:
resolved "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz"
integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==

update-browserslist-db@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz"
integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==
update-browserslist-db@^1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz"
integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==
dependencies:
escalade "^3.1.2"
picocolors "^1.0.1"
escalade "^3.2.0"
picocolors "^1.1.0"

uri-js@^4.2.2, uri-js@^4.4.1:
version "4.4.1"
Expand Down
Loading