@@ -5,11 +5,15 @@ import { Breadcrumbs } from 'baseui/breadcrumbs';
55import { StyledLink } from 'baseui/link' ;
66import Image from 'next/image' ;
77import Link from 'next/link' ;
8+ import queryString from 'query-string' ;
89
910import cadenceLogoBlack from '@/assets/cadence-logo-black.svg' ;
1011import ErrorBoundary from '@/components/error-boundary/error-boundary' ;
1112import PageSection from '@/components/page-section/page-section' ;
13+ import { type PageQueryParamSetterValues } from '@/hooks/use-page-query-params/use-page-query-params.types' ;
1214import useStyletronClasses from '@/hooks/use-styletron-classes' ;
15+ import type domainPageQueryParamsConfig from '@/views/domain-page/config/domain-page-query-params.config' ;
16+ import type domainPageTabsConfig from '@/views/domain-page/config/domain-page-tabs.config' ;
1317
1418import WorkflowPageStatusTag from '../workflow-page-status-tag/workflow-page-status-tag' ;
1519
@@ -23,6 +27,7 @@ export default function WorkflowPageHeader({
2327 cluster,
2428} : Props ) {
2529 const { cls } = useStyletronClasses ( cssStyles ) ;
30+ const domainLink = `/domains/${ encodeURIComponent ( domain ) } /${ encodeURIComponent ( cluster ) } ` ;
2631 return (
2732 < PageSection >
2833 < Breadcrumbs
@@ -36,15 +41,26 @@ export default function WorkflowPageHeader({
3641 alt = "Cadence Icon"
3742 src = { cadenceLogoBlack }
3843 />
39- < StyledLink
40- $as = { Link }
41- href = { `/domains/${ encodeURIComponent ( domain ) } /${ encodeURIComponent ( cluster ) } ` }
42- >
44+ < StyledLink $as = { Link } href = { domainLink } >
4345 { domain }
4446 </ StyledLink >
4547 </ div >
46- { /** TODO: @assem.hafez change those to actual links */ }
47- < StyledLink $as = { Link } href = "#" >
48+ < StyledLink
49+ $as = { Link }
50+ href = { queryString . stringifyUrl ( {
51+ url :
52+ domainLink +
53+ '/' +
54+ // ensuring that this tab exists in config
55+ ( 'workflows' satisfies ( typeof domainPageTabsConfig ) [ number ] [ 'key' ] ) ,
56+ // ensuring that these query params exist in config
57+ query : {
58+ search : workflowId ,
59+ } satisfies Partial <
60+ PageQueryParamSetterValues < typeof domainPageQueryParamsConfig >
61+ > ,
62+ } ) }
63+ >
4864 { workflowId }
4965 </ StyledLink >
5066 < div className = { cls . breadcrumbItemContainer } >
0 commit comments