Skip to content

Commit b74df1f

Browse files
fixes
1 parent 4b89a8c commit b74df1f

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

apps/gitness/src/pages-v2/pull-request/hooks/usePRChecksDecision.ts

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,45 +47,20 @@ export function usePRChecksDecision({
4747
status: string
4848
}>({ title: '', content: '', color: '', status: '' })
4949

50-
const checks = [
51-
{
52-
bypassable: true,
53-
required: false,
54-
check: {
55-
created: 0,
56-
ended: 0,
57-
id: 1,
58-
identifier: 'some',
59-
link: '',
60-
metadata: {},
61-
payload: {
62-
data: {},
63-
kind: 'pipeline',
64-
version: '1.0.0'
65-
},
66-
reported_by: '',
67-
started: 0,
68-
status: 'success',
69-
summary: 'some text',
70-
updated: 0
71-
}
72-
}
73-
]
74-
7550
const status = useMemo(() => {
7651
let _status: ExecutionState | undefined
7752
const _count = { ...DEFAULT_COUNTS }
78-
const total = checks?.length
53+
const total = data?.checks?.length
7954
// @ts-expect-error remove "@ts-expect-error" once CodeServiceClient Response for useChecksPullReqQuery is fixed
80-
const { message: summaryMessage } = generateStatusSummary(checks)
55+
const { message: summaryMessage } = generateStatusSummary(data?.checks)
8156
setSummaryText(summaryMessage)
8257
// @ts-expect-error remove "@ts-expect-error" once CodeServiceClient Response for useChecksPullReqQuery is fixed
83-
const checkInfoData = determineStatusMessage(checks)
58+
const checkInfoData = determineStatusMessage(data?.checks)
8459
if (checkInfoData) {
8560
setCheckInfo(checkInfoData)
8661
}
8762
if (total) {
88-
for (const check of checks) {
63+
for (const check of (data as Data).checks) {
8964
switch (check.check.status) {
9065
case ExecutionState.ERROR:
9166
case ExecutionState.FAILURE:
@@ -165,7 +140,7 @@ export function usePRChecksDecision({
165140
}
166141

167142
return _status
168-
}, [])
143+
}, [data])
169144

170145
// *******
171146
// NOTE: TODO: refactor this to make it more clear and readable
@@ -194,7 +169,7 @@ export function usePRChecksDecision({
194169
overallStatus: status,
195170
count,
196171
error,
197-
data: { ...data, checks },
172+
data,
198173
color,
199174
background,
200175
message,

apps/gitness/src/pages-v2/pull-request/pull-request-conversation.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ export default function PullRequestConversationPage() {
190190
pullReqCommits: state.pullReqCommits,
191191
repoMetadata: state.repoMetadata
192192
}))
193-
console.log('🚀 ~ PullRequestConversationPage ~ pullReqChecksDecision:', pullReqChecksDecision)
194193

195194
const { currentUser: currentUserData } = useAppContext()
196195

packages/ui/src/views/repo/pull-request/details/components/conversation/pull-request-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ const PullRequestPanel = ({
673673
}
674674
/>
675675
{showMergeInputs && (
676-
<Layout.Vertical className="border-cn-3 bg-cn-1 gap-cn-md p-cn-sm rounded-3 mb-cn-3xs w-full border">
676+
<Layout.Vertical className="bg-cn-1 gap-cn-md p-cn-sm rounded-3 mb-cn-3xs w-full">
677677
<TextInput
678678
id="merge-title"
679679
label="Commit message"

0 commit comments

Comments
 (0)