-
Notifications
You must be signed in to change notification settings - Fork 21
[AXON-432] Transition issue from the context menu #427
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
base: main
Are you sure you want to change the base?
Conversation
Remaining stuff:
|
a64fee5
to
5e92ced
Compare
5e92ced
to
6607a3b
Compare
@@ -193,6 +195,33 @@ export function registerCommands(vscodeContext: ExtensionContext) { | |||
commands.executeCommand(Commands.ShowIssue, issueNode.issue), | |||
), | |||
commands.registerCommand(Commands.AssignIssueToMe, (issueNode: IssueNode) => assignIssue(issueNode)), | |||
commands.registerCommand(Commands.TransitionIssue, async (issueNode: IssueNode) => { | |||
const issue = issueNode.issue as MinimalIssue<DetailedSiteInfo>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it check if issue is a MinimalIssue? isMinimalIssue(...)
even inside the IssueNode class it's checked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the check, but I'm pretty sure it should only ever be a MinimalIssue
here 🤔
src/analytics.ts
Outdated
issueKey: string, | ||
method?: string, | ||
): Promise<TrackEvent> { | ||
return instanceTrackEvent(site, 'transitioned', 'issue', { actionSubjectId: issueKey, method }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: source
instead of method
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cabella-dot and I actually pondered for a bit on what to call this, with source
being among the options ;D
Happy to change it to that
FWIW, the rationale I had behind method
was because this is describing a transition
, and source
could possibly refer to the source state of the transition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some deliberation, ended up on this signature:
export async function transitionIssue(
issueOrKey: MinimalIssueOrKeyAndSite<DetailedSiteInfo>,
transition: Transition,
analyticsData?: {
source: string;
},
)
|
||
const target = issue.transitions.find((x) => x.name === transition.label); | ||
if (!target) { | ||
window.showErrorMessage(`Transition ${transition.label} not found`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is never supposed to happen since the labels are being built from the same transitions data 😆 but anyway, can you add a Logger.error
so we can catch it in telemetry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need an exception for that? Could you please elaborate a bit on how you'd like this handled?
What Is This Change?
A small PR to add a way to transition issues right from the
ASSIGNED
list on the left 😉There's a new dropdown menu button:

Which does this when you click it:

If you have fancy transitions, you get a fancy picker! 😁

How Has This Been Tested?
M A N U A L L Y
(over a rather short period of time 😢 )Basic checks:
npm run lint
npm run test
Advanced checks:
If Atlassian employee & Bitbucket changes: did you test with DC in mind? See Instructions- Nope, this is very much a quick fix only tested for cloudRecommendations: