-
Notifications
You must be signed in to change notification settings - Fork 24
AXON-379: Atlassian Notifications - Bitbucket and Jira Comments #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,147
−181
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
b9ecbed
Skeleton for atlassian notification. Need to rework notification mana…
bwieger-atlassian-com 2416f02
Refactor the notification manager for better
bwieger-atlassian-com 269d818
badge delegate refactor
bwieger-atlassian-com 598a731
Notification manager now handles window state, auth changes, and conf…
bwieger-atlassian-com 406718b
Saving some changes before using some AI
bwieger-atlassian-com 27a4a54
Merge branch 'main' of https://github.com/atlassian/atlascode into AX…
bwieger-atlassian-com c78e3f0
making a pr to see changes easily
bwieger-atlassian-com ba72671
.
bwieger-atlassian-com 724045a
Proof that unseen notifications works
bwieger-atlassian-com c972533
Graphql for get notification feed is working
bwieger-atlassian-com 9c18749
letting ai take the wheel
bwieger-atlassian-com 3c4e715
Store changes. Doing release
bwieger-atlassian-com f3e1da3
Adding badges works decently
bwieger-atlassian-com f488035
Pull requests can now clear their badges
bwieger-atlassian-com 25c18d2
Merge branch 'main' of https://github.com/atlassian/atlascode into AX…
bwieger-atlassian-com e190bcd
The banner now link to prs and jiras
bwieger-atlassian-com c838ba3
Only notification within the last week are kept
bwieger-atlassian-com 06f60d1
Notification can be marked as read between VS Code sessions
bwieger-atlassian-com 9aa8fba
encapsulate notficationDB
bwieger-atlassian-com f226d81
Hand some stuff to christian
bwieger-atlassian-com 429d5e2
badges disappear when logging out
bwieger-atlassian-com d18c60f
Notifications show previews of the message
bwieger-atlassian-com f68091e
simplified a function
bwieger-atlassian-com 29f4fc0
AXON-379: issueKey or prKey for button text
cabella-dot 01dfd6d
ff
bwieger-atlassian-com 22e4022
Merge branch 'main' of https://github.com/atlassian/atlascode into AX…
bwieger-atlassian-com 80aecac
exp flags & fix to PR number discovery
bwieger-atlassian-com 87dc5f2
AXON-379: badge color + banner action analytics
cabella-dot 6c1c616
test pass
bwieger-atlassian-com e54dcca
Merge branch 'AXON-379-atlassian-notifications' of https://github.com…
bwieger-atlassian-com 2c44f94
Update atlassianNotificationNotifier.ts
bwieger-atlassian-com bc9d4d5
bug fix
bwieger-atlassian-com bc58943
If BB is not authed and notification is click, auth screen will show
bwieger-atlassian-com c10d8e4
address PR comments
bwieger-atlassian-com 45a3b25
small refactor
bwieger-atlassian-com c444ce9
PR Comments
bwieger-atlassian-com c01648c
done merging
bwieger-atlassian-com 52bd056
fix some compilation
bwieger-atlassian-com ecc1e00
Fix tests
bwieger-atlassian-com 1e673ec
pause on making more test
bwieger-atlassian-com 3fe3f31
Merge branch 'main' of https://github.com/atlassian/atlascode into AX…
bwieger-atlassian-com 72bfc0c
Some TTL work
bwieger-atlassian-com 97a9f84
PR Comments
bwieger-atlassian-com 6e43a67
Merge branch 'main' of https://github.com/atlassian/atlascode into AX…
bwieger-atlassian-com File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { request } from 'graphql-request'; | ||
|
||
import { Logger } from '../../logger'; | ||
import { AuthInfo, isOAuthInfo } from '../authInfo'; | ||
|
||
export async function graphqlRequest<T = any>( | ||
document: string, | ||
variables: Record<string, any>, | ||
authInfo: AuthInfo, | ||
endpoint: string = 'https://api.atlassian.com/graphql', | ||
): Promise<T> { | ||
if (!document) { | ||
throw new Error('GraphQL document is not set.'); | ||
} | ||
if (!authInfo) { | ||
throw new Error('Auth info is not set.'); | ||
} | ||
|
||
Logger.debug('GraphQL request', { | ||
endpoint, | ||
document, | ||
variables, | ||
}); | ||
|
||
try { | ||
const response = await request<T>(endpoint, document, variables, createHeaders(authInfo)); | ||
Logger.debug('GraphQL response', { response }); | ||
return response; | ||
} catch (error) { | ||
Logger.error(error, 'GraphQL request failed'); | ||
throw error; | ||
} | ||
} | ||
|
||
function createHeaders(authInfo: AuthInfo) { | ||
const headers: Record<string, string> = {}; | ||
headers['Content-Type'] = 'application/json'; | ||
setAuthorizationHeader(authInfo, headers); | ||
return headers; | ||
} | ||
|
||
function setAuthorizationHeader(authInfo: AuthInfo, headers: Record<string, string>) { | ||
if (isOAuthInfo(authInfo)) { | ||
headers['Authorization'] = `Bearer ${authInfo.access}`; | ||
} else { | ||
throw new Error('Unsupported authentication type.'); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { gql } from 'graphql-request'; | ||
|
||
export const unseenNotificationCountVSCode = gql` | ||
query unseenNotificationCountVSCode { | ||
notifications { | ||
unseenNotificationCount | ||
} | ||
} | ||
`; | ||
|
||
export const notificationFeedVSCode = gql` | ||
query notificationFeedVSCode($first: Int) { | ||
notifications { | ||
notificationFeed(filter: { readStateFilter: unread, categoryFilter: direct }, flat: true, first: $first) { | ||
nodes { | ||
headNotification { | ||
notificationId | ||
timestamp | ||
content { | ||
actor { | ||
displayName | ||
} | ||
bodyItems { | ||
document { | ||
format | ||
data | ||
} | ||
} | ||
url | ||
type | ||
message | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.