Skip to content

Commit

Permalink
add space users call in pull request quick actions
Browse files Browse the repository at this point in the history
  • Loading branch information
srzainab committed Feb 15, 2024
1 parent 8b0f172 commit 3f3a385
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/pullRequestQuickActions/pullRequestQuickActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Presence } from '../models/presence'
import { TimeSelectionItem, timePicker } from '../views/quickpicks/timePicker'
import moment = require('moment')
import { PullRequestState } from '../utils/pullRequestsState'
import { SpaceUsers } from '../models/spaceUsers'

export const PullRequestQuickActions = {
applyLabel: async ({
Expand Down Expand Up @@ -118,10 +119,19 @@ export const PullRequestQuickActions = {
context: ExtensionContext
statusBar: StatusBarItem
}) => {
const spaceUsers = await SpaceUsers.get({
context,
codeReviewId: codeReview.id,
})
if (!spaceUsers) {
return false
}

spaceUserPicker({
context,
placeholder: 'Select a user',
title: 'Add assignee to pull request',
spaceUsers,
onDidChangeSelection: async (item) => {
if (!item[0].description) return false

Expand Down Expand Up @@ -156,6 +166,7 @@ export const PullRequestQuickActions = {
context,
statusBar,
})
return true
},

requestReview: async ({
Expand All @@ -167,10 +178,19 @@ export const PullRequestQuickActions = {
context: ExtensionContext
statusBar: StatusBarItem
}) => {
const spaceUsers = await SpaceUsers.get({
context,
codeReviewId: codeReview.id,
})
if (!spaceUsers) {
return false
}

spaceUserPicker({
context,
placeholder: 'Select a user',
title: 'Add reviewer to pull request',
spaceUsers,
onDidChangeSelection: async (item) => {
if (!item[0].description) return false

Expand Down Expand Up @@ -209,6 +229,7 @@ export const PullRequestQuickActions = {
context,
statusBar,
})
return true
},

refresh: async ({
Expand Down

0 comments on commit 3f3a385

Please sign in to comment.