Skip to content

Commit 640e863

Browse files
committed
fix(pages-deployments): link logs
1 parent 3d118d3 commit 640e863

6 files changed

Lines changed: 23 additions & 26 deletions

File tree

libs/pages/application/src/lib/feature/page-deployments-feature/page-deployments-feature.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export function PageDeploymentsFeature() {
5555

5656
return (
5757
<PageDeployments
58-
applicationId={application?.id}
5958
deployments={!isLoading ? application?.deployments?.items : loadingApplicationsDeployments}
6059
listHelpfulLinks={listHelpfulLinks}
6160
isLoading={isLoading}

libs/pages/application/src/lib/ui/page-deployments/page-deployments.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import React, { useEffect, useState } from 'react'
33
import { BaseLink, HelpSection, Table, TableRowDeployment } from '@qovery/shared/ui'
44

55
export interface PageDeploymentsProps {
6-
applicationId?: string
76
deployments?: DeploymentHistoryApplication[]
87
listHelpfulLinks: BaseLink[]
98
isLoading?: boolean
109
}
1110

1211
export function Deployments(props: PageDeploymentsProps) {
13-
const { applicationId, deployments = [], listHelpfulLinks, isLoading = true } = props
12+
const { deployments = [], listHelpfulLinks, isLoading = true } = props
1413

1514
const [data, setData] = useState<DeploymentHistoryApplication[]>(deployments)
1615

@@ -66,8 +65,8 @@ export function Deployments(props: PageDeploymentsProps) {
6665
<div>
6766
{data?.map((currentData, index) => (
6867
<TableRowDeployment
69-
id={applicationId}
7068
data={currentData as DeploymentHistoryApplication}
69+
index={index}
7170
key={index}
7271
dataHead={tableHead}
7372
isLoading={isLoading}

libs/pages/database/src/lib/feature/page-deployments-feature/page-deployments-feature.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export function PageDeploymentsFeature() {
4949

5050
return (
5151
<PageDeployments
52-
databaseId={database?.id}
5352
deployments={!isLoading ? database?.deployments?.items : loadingDatabasesDeployments}
5453
listHelpfulLinks={listHelpfulLinks}
5554
isLoading={isLoading}

libs/pages/database/src/lib/ui/page-deployments/page-deployments.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import React, { useEffect, useState } from 'react'
33
import { BaseLink, HelpSection, Table, TableRowDeployment } from '@qovery/shared/ui'
44

55
export interface PageDeploymentsProps {
6-
databaseId?: string
76
deployments?: DeploymentHistoryDatabase[]
87
listHelpfulLinks: BaseLink[]
98
isLoading?: boolean
109
}
1110

1211
export function Deployments(props: PageDeploymentsProps) {
13-
const { databaseId, deployments = [], listHelpfulLinks, isLoading = true } = props
12+
const { deployments = [], listHelpfulLinks, isLoading = true } = props
1413

1514
const [data, setData] = useState<DeploymentHistoryDatabase[]>(deployments)
1615

@@ -62,9 +61,9 @@ export function Deployments(props: PageDeploymentsProps) {
6261
<div>
6362
{data?.map((currentData, index) => (
6463
<TableRowDeployment
65-
id={databaseId}
6664
data={currentData as DeploymentHistoryDatabase}
6765
key={index}
66+
index={index}
6867
dataHead={tableHead}
6968
isLoading={isLoading}
7069
noCommit

libs/pages/services/src/lib/ui/page-deployments/page-deployments.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function PageDeploymentsMemo(props: PageDeploymentsProps) {
8383
<div>
8484
{data?.map((currentData, index) => (
8585
<TableRowDeployment
86-
id={currentData.id}
8786
data={currentData as DeploymentService}
87+
index={index}
8888
key={index}
8989
dataHead={tableHead}
9090
isLoading={loading}

libs/shared/ui/src/lib/components/table/table-row-deployment/table-row-deployment.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
11
import { DeploymentHistoryApplication, DeploymentHistoryDatabase, StateEnum } from 'qovery-typescript-axios'
22
import { useState } from 'react'
3-
import { useParams } from 'react-router-dom'
3+
import { useNavigate, useParams } from 'react-router-dom'
44
import { Link } from 'react-router-dom'
55
import { ServiceTypeEnum } from '@qovery/shared/enums'
66
import { ContainerApplicationEntity, DeploymentService } from '@qovery/shared/interfaces'
7-
import { APPLICATION_GENERAL_URL, APPLICATION_URL } from '@qovery/shared/router'
8-
import { ButtonIconAction, Skeleton, StatusChip, TableRow, Tag, TagCommit, Tooltip } from '@qovery/shared/ui'
7+
import { APPLICATION_GENERAL_URL, APPLICATION_URL, DEPLOYMENT_LOGS_URL } from '@qovery/shared/router'
8+
import {
9+
ButtonIconAction,
10+
IconAwesomeEnum,
11+
Skeleton,
12+
StatusChip,
13+
TableRow,
14+
Tag,
15+
TagCommit,
16+
Tooltip,
17+
} from '@qovery/shared/ui'
918
import { renameStatus, timeAgo, trimId, upperCaseFirstLetter } from '@qovery/shared/utils'
1019
import Icon from '../../icon/icon'
1120
import { TableHeadProps } from '../table'
1221

1322
export interface TableRowDeploymentProps {
14-
id?: string
1523
data?: DeploymentService | DeploymentHistoryApplication | DeploymentHistoryDatabase
1624
dataHead: TableHeadProps[]
1725
columnsWidth?: string
1826
isLoading?: boolean
1927
startGroup?: boolean
2028
noCommit?: boolean
29+
index?: number
2130
}
2231

2332
export function TableRowDeployment(props: TableRowDeploymentProps) {
2433
const {
25-
id,
2634
dataHead,
2735
columnsWidth = `repeat(${dataHead.length},minmax(0,1fr))`,
2836
isLoading,
2937
startGroup,
3038
data,
3139
noCommit,
40+
index,
3241
} = props
3342

3443
const [copy, setCopy] = useState(false)
3544
const [hoverId, setHoverId] = useState(false)
3645
const { organizationId, projectId, environmentId } = useParams()
46+
const navigate = useNavigate()
3747

3848
const buttonActionsDefault = [
3949
{
40-
iconLeft: <Icon name="icon-solid-scroll" />,
41-
onClick: () =>
42-
window
43-
.open(
44-
`https://console.qovery.com/platform/organization/${organizationId}/projects/${projectId}/environments/${environmentId}/applications/${id}/summary?fullscreenLogs=true`,
45-
'_blank'
46-
)
47-
?.focus(),
50+
iconLeft: <Icon name={IconAwesomeEnum.SCROLL} />,
51+
onClick: () => navigate(DEPLOYMENT_LOGS_URL(organizationId, projectId, environmentId)),
4852
},
49-
/*{
50-
iconLeft: <Icon name="icon-solid-ellipsis-v" />,
51-
},*/
5253
]
5354

5455
const handleCopy = (e: React.MouseEvent) => {
@@ -136,7 +137,7 @@ export function TableRowDeployment(props: TableRowDeploymentProps) {
136137
{timeAgo(data?.updated_at ? new Date(data?.updated_at) : new Date(data?.created_at || ''))} ago
137138
</span>
138139
</p>
139-
{data?.name && !(data as ContainerApplicationEntity)?.image_name && (
140+
{index === 0 && data?.name && !(data as ContainerApplicationEntity)?.image_name && (
140141
<ButtonIconAction actions={buttonActionsDefault} />
141142
)}
142143
</>

0 commit comments

Comments
 (0)