Conversation
| ) { | ||
| return `${baseGoBackURL}${appendEnvOverridePath ? envOverridePath : ''}` | ||
| } | ||
| return `${baseGoBackURL}${appendEnvOverridePath ? envOverridePath : ''}/${currentResourceType}${currentResourceName ? `/${currentResourceName}` : ''}` |
There was a problem hiding this comment.
${baseGoBackURL}${appendEnvOverridePath ? envOverridePath : ''} could be a variable
| const getNavItemHref = (resourceType: EnvResourceType, resourceName: string) => | ||
| `${generatePath(routePath, { ...params, resourceType, resourceName })}${location.search}` | ||
|
|
||
| const calculatedGoBackURL = useMemo(() => { |
…improve response parsing
| { | ||
| appId, | ||
| envId, | ||
| ...params, |
There was a problem hiding this comment.
appId and envId should be after params right?
| { | ||
| appId, | ||
| envId, | ||
| ...params, |
| setGlobalAPITimeout(window._env_.GLOBAL_API_TIMEOUT) | ||
| }, []) | ||
|
|
||
| useEffect(() => { |
| import { FILTER_NAME_REGEX } from '../ApplicationGroup/Constants' | ||
| import { NO_WORKFLOW_NAME, INVALID_WORKFLOW_NAME, MIN_3CHARS, MAX_30CHARS, SUCCESS_CREATION } from './constants' | ||
|
|
||
| export default function EmptyWorkflow(props: EmptyWorkflowProps) { | ||
| const params = useParams<{ appId: string }>() |
| } | ||
| } | ||
| const AddWorkflow = ({ onClose, getWorkflows, isTemplateView }: AddWorkflowProps) => { | ||
| const params = useParams<{ appId: string; workflowId: string }>() |
| to={`${generatePath(ROUTER_URLS.INFRASTRUCTURE_MANAGEMENT_APP_DETAIL.EXTERNAL_HELM_APP, { | ||
| appId: `1|devtroncd|${appName}`, | ||
| appName | ||
| })}/${URLS.APP_DETAILS}/${URLS.APP_DETAILS_K8}/pod/${logPodName}/logs`} |
There was a problem hiding this comment.
${generatePath(ROUTER_URLS.INFRASTRUCTURE_MANAGEMENT_APP_DETAIL.EXTERNAL_HELM_APP, { appId: 1|devtroncd|${appName}, appName })} This much part can be variable and reduced
| ].map((pathPattern) => ( | ||
| <Route | ||
| key={pathPattern} | ||
| path={pathPattern} |
There was a problem hiding this comment.
Does route not provide support for multiple paths?
| @@ -250,47 +219,7 @@ const EnvironmentSelectorComponent = ({ | |||
|
|
|||
| <div className="fw-6 fs-14 cb-5"> | |||
| <div style={{ minWidth: '200px' }}> | |||
| {environments && environments.length > 0 && ( | |||
There was a problem hiding this comment.
Is this and useEffects not required?
| const location = useLocation() | ||
| const { path } = useRouteMatch() | ||
| const path = location.pathname |
There was a problem hiding this comment.
This might be wrong since location would give live location
| @@ -105,10 +104,10 @@ const NodeDeleteComponent = ({ | |||
|
|
|||
| function describeNodeWrapper(tab) { | |||
| queryParams.set('kind', params.podName) | |||
| const updatedPath = `${path.substring(0, path.indexOf('/k8s-resources/'))}/${ | |||
| const updatedPath = `${location.pathname.substring(0, location.pathname.indexOf('/k8s-resources/'))}/${ | |||
There was a problem hiding this comment.
Path and location are not interchangable, pls check once
| @@ -153,7 +152,7 @@ const NodeComponent = ({ | |||
| setTableHeader(tableHeaders) | |||
|
|
|||
| // splitting with /group as group is present in application-group url as well | |||
| let [, _selectedResource] = url.split('/group/') | |||
| let [, _selectedResource] = location.pathname.split('/group/') | |||
There was a problem hiding this comment.
Pls check since it was coming from useRouteMatch
| @@ -180,7 +179,7 @@ const NodeComponent = ({ | |||
|
|
|||
| setSelectedHealthyNodeCount(_healthyNodeCount) | |||
| } | |||
| }, [params.nodeType, podType, url, filteredNodes, podLevelExternalLinks]) | |||
| }, [params.nodeType, podType, location.pathname, filteredNodes, podLevelExternalLinks]) | |||
| @@ -221,7 +220,7 @@ const NodeComponent = ({ | |||
| } | |||
|
|
|||
| const handleActionTabClick = (node: iNode, _tabName: string, containerName?: string) => { | |||
| let [_url] = url.split('/group/') | |||
| let [_url] = location.pathname.split('/group/') | |||
| @@ -125,13 +125,13 @@ const TerminalComponent = ({ | |||
| } | |||
|
|
|||
| useEffect(() => { | |||
| selectedTab(NodeDetailTab.TERMINAL, url) | |||
| selectedTab(NodeDetailTab.TERMINAL, pathname) | |||
| handleAbort() | ||
| }, [params.podName, params.name, params.namespace]) | ||
|
|
||
| useEffect(() => { | ||
| if (showTerminal) { | ||
| selectedTab(NodeDetailTab.TERMINAL, `${url}/terminal`) | ||
| selectedTab(NodeDetailTab.TERMINAL, `${pathname}/terminal`) |
| @@ -257,7 +256,7 @@ const ManifestComponent = ({ | |||
| } | |||
|
|
|||
| useEffect(() => { | |||
| selectedTab(NodeDetailTab.MANIFEST, url) | |||
| selectedTab(NodeDetailTab.MANIFEST, location.pathname) | |||
| @@ -431,10 +435,16 @@ const LogsComponent = ({ | |||
|
|
|||
| useEffect(() => { | |||
| if (selectedTab) { | |||
| selectedTab(NodeDetailTab.LOGS, url) | |||
| selectedTab(NodeDetailTab.LOGS, location.pathname) | |||
| const [events, setEvents] = useState([]) | ||
| const [loading, setLoading] = useState(true) | ||
| const appDetails = IndexStore.getAppDetails() | ||
|
|
||
| useEffect(() => { | ||
| selectedTab(NodeDetailTab.EVENTS, url) | ||
| selectedTab(NodeDetailTab.EVENTS, location.pathname) |
There was a problem hiding this comment.
this will work fine
|




Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: