Skip to content

Commit e9d505a

Browse files
committed
feat: bitbucket cloud support
Signed-off-by: Adam Setch <[email protected]>
1 parent 127c328 commit e9d505a

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

src/components/AccountNotifications.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,19 @@ export const AccountNotifications: FC<IAccountNotifications> = (
121121
title="My Issues"
122122
icon={IssueOpenedIcon}
123123
size={Size.SMALL}
124-
onClick={() => openGitHubIssues(account.hostname)}
124+
onClick={(event: MouseEvent<HTMLElement>) => {
125+
// Don't trigger onClick of parent element.
126+
event.stopPropagation();
127+
openGitHubIssues(account.hostname);
128+
}}
125129
/>
126130
)}
127131
<InteractionButton
128132
title="My Pull Requests"
129133
icon={GitPullRequestIcon}
130134
size={Size.SMALL}
131-
onClick={() => {
135+
onClick={(event: MouseEvent<HTMLElement>) => {
136+
// Don't trigger onClick of parent element.
132137
event.stopPropagation();
133138
if (account.platform === 'Bitbucket Cloud') {
134139
openBitbucketPulls(account);

src/utils/auth/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ export async function refreshBitbucketAccount(
172172
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
173173
const res: any = await getBitbucketUser(account);
174174

175-
console.log(JSON.stringify(res));
176-
177175
// Refresh user data
178176
account.user = {
179177
id: res.data.account_id,

src/utils/notifications.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,15 @@ export async function getAllNotifications(
135135
try {
136136
// TODO - this needs to be correctly implemented
137137
if (accountNotifications.account.platform === 'Bitbucket Cloud') {
138-
const pulls =
139-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
140-
((await accountNotifications.notifications).data as any)
141-
.pullRequests?.reviewing;
138+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
139+
const res = (await accountNotifications.notifications).data as any;
142140

143-
console.log(pulls);
141+
// TODO - when using IP allowlists, Bitbucket doesn't return any response indicator
142+
143+
const pulls = res.pullRequests?.reviewing;
144+
145+
// console.log(JSON.stringify(pulls));
146+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
144147
const notifications = pulls?.map((pull: any) => ({
145148
id: `${pull.destination.repository.full_name}-${pull.id}`,
146149
reason: 'review_requested',

0 commit comments

Comments
 (0)