Skip to content

Commit

Permalink
fix: update goBackURL logic to handle Manifest resource type correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhishekA1509 committed Feb 14, 2025
1 parent 7c1596c commit ba9d4e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ const AppComposeRouter = () => {
const resourceTypePath = `/${match.params.resourceType === EnvResourceType.Manifest || match.params.resourceType === EnvResourceType.PipelineStrategy ? EnvResourceType.DeploymentTemplate : match.params.resourceType}`
const resourceNamePath = match.params.resourceName ? `/${match.params.resourceName}` : ''

const goBackURL = `${basePath}${envOverridePath}${resourceTypePath}${resourceNamePath}`
const goBackURL =
match.params.resourceType === EnvResourceType.Manifest
? `${basePath}${envOverridePath}`
: `${basePath}${envOverridePath}${resourceTypePath}${resourceNamePath}`

return (
<DeploymentConfigCompare
Expand Down
5 changes: 4 additions & 1 deletion src/Pages/Releases/Detail/Configurations/Configurations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ export const Configurations = () => {
const resourceTypePath = `/${match.params.resourceType === EnvResourceType.Manifest || match.params.resourceType === EnvResourceType.PipelineStrategy ? EnvResourceType.DeploymentTemplate : match.params.resourceType}`
const resourceNamePath = match.params.resourceName ? `/${match.params.resourceName}` : ''

const goBackURL = `${basePath}${resourceTypePath}${resourceNamePath}`
const goBackURL =
match.params.resourceType === EnvResourceType.Manifest
? basePath
: `${basePath}${resourceTypePath}${resourceNamePath}`

return showConfig ? (
<DeploymentConfigCompare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ const EnvConfig = ({ filteredAppIds, envName }: AppGroupDetailDefaultType) => {
const resourceTypePath = `/${match.params.resourceType === EnvResourceType.Manifest || match.params.resourceType === EnvResourceType.PipelineStrategy ? EnvResourceType.DeploymentTemplate : match.params.resourceType}`
const resourceNamePath = match.params.resourceName ? `/${match.params.resourceName}` : ''

const goBackURL = `${basePath}${resourceTypePath}${resourceNamePath}`
const goBackURL =
match.params.resourceType === EnvResourceType.Manifest
? basePath
: `${basePath}${resourceTypePath}${resourceNamePath}`

return (
<DeploymentConfigCompare
Expand Down

0 comments on commit ba9d4e2

Please sign in to comment.