Skip to content

Commit fe3908c

Browse files
authored
add link to parent on service details (#2096)
1 parent eb15b1e commit fe3908c

File tree

11 files changed

+101
-70
lines changed

11 files changed

+101
-70
lines changed

assets/src/components/ai/chatbot/ChatbotPanelThread.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export function ChatbotPanelThread({
121121
update: (cache, { data }) =>
122122
updateChatCache(currentThread.id, cache, data?.hybridChat ?? []),
123123
})
124-
console.log({ messages })
125124

126125
const sendingMessage = regLoading || hybridLoading
127126
const messageError = regError || hybridError

assets/src/components/cd/globalServices/GlobalServicesTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
useFetchPaginatedData,
2020
} from '../../utils/table/useFetchPaginatedData'
2121

22-
import { columns } from './GlobalService'
22+
import { columns } from './GlobalServices'
2323

2424
function GlobalServicesTableComponent({
2525
setRefetch,

assets/src/components/cd/globalServices/details/GlobalService.tsx

Lines changed: 41 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { PluralErrorBoundary } from '../../PluralErrorBoundary'
3030
import { GlobalServiceServices } from './GlobalServiceServices.tsx'
3131
import GlobalServiceSidecar from './GlobalServiceSidecar.tsx'
3232
import { ResponsiveLayoutPage } from '../../../utils/layout/ResponsiveLayoutPage.tsx'
33-
import { crumbs } from '../GlobalService.tsx'
33+
import { crumbs } from '../GlobalServices.tsx'
3434
import { RESPONSIVE_LAYOUT_CONTENT_WIDTH } from '../../../utils/layout/ResponsiveLayoutContentContainer.tsx'
3535

3636
export default function GlobalService() {
@@ -70,56 +70,46 @@ export default function GlobalService() {
7070
if (!globalService || !globalServices) return <LoadingIndicator />
7171

7272
return (
73-
<ResponsiveLayoutPage css={{ flexDirection: 'column' }}>
74-
<div
75-
css={{
76-
alignSelf: 'center',
77-
height: '100%',
78-
maxWidth: theme.breakpoints.desktop,
79-
overflow: 'hidden',
80-
width: '100%',
81-
82-
[`@media (min-width: 1833px)`]: {
83-
maxWidth: theme.breakpoints.desktop + theme.spacing.large + 220, // Increased by sidecar and spacing size.
84-
},
85-
}}
86-
>
87-
<PluralErrorBoundary>
88-
<Flex gap={'large'}>
89-
<Flex
90-
direction={'column'}
91-
gap={'large'}
92-
flexGrow={1}
93-
flexShrink={1}
94-
width={RESPONSIVE_LAYOUT_CONTENT_WIDTH}
95-
>
96-
<GlobalServiceSelect
97-
selectedGlobalService={globalService}
98-
globalServices={globalServices}
99-
/>
100-
<GlobalServiceServices
101-
globalServiceID={globalServiceId}
102-
seedService={globalService?.service as ServiceDeployment}
103-
/>
104-
</Flex>
105-
<Flex
106-
align={'flex-end'}
107-
direction={'column'}
108-
gap={'large'}
109-
>
110-
<KickButton
111-
secondary
112-
startIcon={<ReloadIcon />}
113-
kickMutationHook={useSyncGlobalServiceMutation}
114-
message="Resync"
115-
tooltipMessage="Sync this service now instead of at the next poll interval"
116-
variables={{ id: globalServiceId }}
117-
/>
118-
<GlobalServiceSidecar globalService={globalService} />
119-
</Flex>
120-
</Flex>
121-
</PluralErrorBoundary>
122-
</div>
73+
<ResponsiveLayoutPage
74+
css={{
75+
gap: theme.spacing.large,
76+
maxWidth: theme.breakpoints.desktopLarge,
77+
margin: 'auto',
78+
}}
79+
>
80+
<PluralErrorBoundary>
81+
<Flex
82+
direction="column"
83+
gap="large"
84+
flexGrow={1}
85+
flexShrink={1}
86+
width={RESPONSIVE_LAYOUT_CONTENT_WIDTH}
87+
>
88+
<GlobalServiceSelect
89+
selectedGlobalService={globalService}
90+
globalServices={globalServices}
91+
/>
92+
<GlobalServiceServices
93+
globalServiceID={globalServiceId}
94+
seedService={globalService?.service as ServiceDeployment}
95+
/>
96+
</Flex>
97+
<Flex
98+
align="flex-end"
99+
direction="column"
100+
gap="large"
101+
>
102+
<KickButton
103+
secondary
104+
startIcon={<ReloadIcon />}
105+
kickMutationHook={useSyncGlobalServiceMutation}
106+
message="Resync"
107+
tooltipMessage="Sync this service now instead of at the next poll interval"
108+
variables={{ id: globalServiceId }}
109+
/>
110+
<GlobalServiceSidecar globalService={globalService} />
111+
</Flex>
112+
</PluralErrorBoundary>
123113
</ResponsiveLayoutPage>
124114
)
125115
}

assets/src/components/cd/globalServices/details/GlobalServiceSidecar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ export default function GlobalServiceSidecar({
3636

3737
return (
3838
<Flex
39-
direction={'column'}
40-
gap={'medium'}
39+
direction="column"
40+
gap="medium"
41+
overflow="auto"
4142
width={220}
4243
>
4344
<Sidecar heading="Source">

assets/src/components/cd/globalServices/details/columns.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const ColDeployment = columnHelper.accessor(({ node }) => node, {
2424
return (
2525
serviceDeployment && (
2626
<DecoratedName deletedAt={serviceDeployment.deletedAt}>
27-
{serviceDeployment.name}
27+
<span css={{ width: 'max-content', whiteSpace: 'nowrap' }}>
28+
{serviceDeployment.name}
29+
</span>
2830
{serviceDeployment.id === id && (
2931
<Chip size="small">Seed service</Chip>
3032
)}

assets/src/components/cd/services/ServicesColumns.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const ColCluster = columnHelper.accessor(
8383

8484
return (
8585
<ColWithIcon
86+
css={{ width: 'max-content' }}
8687
icon={getClusterIconUrl({
8788
cluster: original?.node?.cluster,
8889
mode: theme.mode,

assets/src/components/cd/services/service/ServiceDetailsSidecar.tsx

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import {
22
AppIcon,
3+
ArrowTopRightIcon,
4+
Button,
35
Chip,
46
DryRunIcon,
57
ErrorIcon,
8+
Flex,
69
GitHubLogoIcon,
710
Sidecar,
811
SidecarItem,
@@ -20,7 +23,11 @@ import {
2023
} from 'generated/graphql'
2124
import { useMemo } from 'react'
2225
import { Link, useLocation } from 'react-router-dom'
23-
import { CD_REL_PATH, CLUSTERS_REL_PATH } from 'routes/cdRoutesConsts'
26+
import {
27+
CD_REL_PATH,
28+
CLUSTERS_REL_PATH,
29+
getServiceDetailsPath,
30+
} from 'routes/cdRoutesConsts'
2431
import { useTheme } from 'styled-components'
2532
import { getStacksAbsPath } from '../../../../routes/stacksRoutesConsts.tsx'
2633
import StackStatusIcon from '../../../stacks/common/StackStatusIcon.tsx'
@@ -57,6 +64,7 @@ export function ServiceDetailsSidecar({
5764
namespace,
5865
repository,
5966
helmRepository,
67+
parent,
6068
} = serviceDeployment
6169

6270
return (
@@ -89,6 +97,23 @@ export function ServiceDetailsSidecar({
8997
width="100%"
9098
/>
9199
</div>
100+
{parent && (
101+
<Sidecar>
102+
<SidecarItem heading="Parent service">{parent.name}</SidecarItem>
103+
<Button
104+
marginTop={theme.spacing.large}
105+
secondary
106+
as={Link}
107+
to={getServiceDetailsPath({
108+
clusterId: cluster?.id,
109+
serviceId: parent.id,
110+
})}
111+
endIcon={<ArrowTopRightIcon />}
112+
>
113+
Go to parent
114+
</Button>
115+
</Sidecar>
116+
)}
92117
<Sidecar>
93118
{name && <SidecarItem heading="Service name"> {name}</SidecarItem>}
94119
{namespace && (
@@ -155,19 +180,24 @@ export function ServiceDetailsSidecar({
155180
</SidecarItem>
156181
)}
157182
{repository && (
158-
<SidecarItem heading="Git repository">
183+
<SidecarItem
184+
heading={
185+
<Flex
186+
align="center"
187+
gap="xsmall"
188+
>
189+
Git repository
190+
<GitHubLogoIcon size={12} />
191+
</Flex>
192+
}
193+
>
159194
<div
160195
css={{
161196
display: 'flex',
162197
alignItems: 'center',
163198
gap: theme.spacing.xsmall,
164199
}}
165200
>
166-
<AppIcon
167-
spacing="padding"
168-
size="xxsmall"
169-
icon={<GitHubLogoIcon />}
170-
/>
171201
{repository.url}
172202
</div>
173203
</SidecarItem>

assets/src/generated/graphql.ts

Lines changed: 10 additions & 6 deletions
Large diffs are not rendered by default.

assets/src/graph/cdServices.graphql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ fragment ServiceDeploymentDetails on ServiceDeployment {
104104
deletedAt
105105
}
106106
}
107+
parent {
108+
id
109+
name
110+
}
107111
alerts(first: 500) {
108112
# just to get the count
109113
edges {

0 commit comments

Comments
 (0)