Skip to content
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

feat(sprint-poker): Push task to GitLab #6427

Merged
merged 193 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 177 commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
3d7e51f
render list of gitlab issues
nickoferrall Feb 21, 2022
779662a
use usePaginationFragment
nickoferrall Feb 21, 2022
e8423fe
increase default value for usePaginationFragment
nickoferrall Feb 22, 2022
857ba8b
implement GitLabScopingSearchResultItem
nickoferrall Feb 22, 2022
49f3377
add GitLabScopingSelectAllIssues
nickoferrall Feb 23, 2022
f563fcc
can add and remove gitlab issues in scope phase
nickoferrall Feb 24, 2022
87ab072
add UpdatePokerScopeMutation gitlab optimistic updater
nickoferrall Feb 28, 2022
37284a6
able to select all issues
nickoferrall Feb 28, 2022
e98ebc9
clean up type errors
nickoferrall Mar 2, 2022
0a9bba9
merge with master
nickoferrall Mar 2, 2022
5f27a7d
add projects name alias to rootSchema
nickoferrall Mar 2, 2022
6b0819a
include projectIds in search query
nickoferrall Mar 3, 2022
2f910f3
return iid from GitLabIssueId
nickoferrall Mar 3, 2022
d52e82f
fix merge conflict
nickoferrall Mar 3, 2022
fec37a1
sort projects by lastActivityAt
nickoferrall Mar 4, 2022
86fd627
implement fetchGitLabProjects
nickoferrall Mar 14, 2022
730d0f7
implement gitlab issue menu
nickoferrall Mar 14, 2022
434ab02
implement NewGitLabIssueMenuRoot instead of using useAllIntegrations
nickoferrall Mar 14, 2022
4721123
load next if projects dont have any issues
nickoferrall Mar 15, 2022
c18debf
update comment
nickoferrall Mar 15, 2022
2b23794
remove gitlab menu root and use defaultProjects query to populate menu
nickoferrall Mar 15, 2022
790a144
increase projectsFirst from 10 to 20
nickoferrall Mar 16, 2022
248ebad
query all gitlab projects
nickoferrall Mar 16, 2022
1e87555
merge with master
nickoferrall Mar 17, 2022
77d371c
chore(comment): how to extend BaseTaskIntegration
mattkrick Mar 17, 2022
b56dd56
able to create a new gitlab issue
nickoferrall Mar 17, 2022
70283f8
use GitLabServerManager and implement parseWebPath
nickoferrall Mar 18, 2022
67363cf
fix undefined baseUri
nickoferrall Mar 18, 2022
6783b66
Merge branch 'feat/6088/gitlab-issues-functionality' of github.com:Pa…
nickoferrall Mar 18, 2022
5170941
changed taskIntegrationGitLab and GitLabId to use providerId
nickoferrall Mar 18, 2022
e28adf5
merge functionality pr changes
nickoferrall Mar 21, 2022
591c01e
lowercase gitlabRequest to be consistent with gh
nickoferrall Mar 21, 2022
ffb6ddf
add handle create gitlab issue
nickoferrall Mar 21, 2022
59c473f
Merge branch 'master' into feat/6088/gitlab-issues-functionality
nickoferrall Mar 22, 2022
0bca3f7
add info fragment and return data instead of data.issue
nickoferrall Mar 22, 2022
9ef9a49
merge with issue functionality
nickoferrall Mar 22, 2022
73a1617
add serverBaseUrl
nickoferrall Mar 22, 2022
a91c4d2
Merge branch 'feat/6088/gitlab-issues-functionality' into feat/6033/a…
nickoferrall Mar 22, 2022
2565d74
adjusted root schema and can now render projects in input menu again
nickoferrall Mar 23, 2022
6344dd9
clean up update poker scope and create task gitlab
nickoferrall Mar 23, 2022
53336b2
fix ts errors
nickoferrall Mar 23, 2022
4a9a9f6
add gitlab query types
nickoferrall Mar 23, 2022
79ac256
add fullPath to gitLab issue edge if exists
nickoferrall Mar 24, 2022
bd754d5
get nodes appearing on insert
mattkrick Mar 24, 2022
7ae71ca
Merge pull request #6271 from ParabolInc/help-gl-issue-patch
nickoferrall Mar 24, 2022
f64d889
get gitlab issue title in create task updater
nickoferrall Mar 25, 2022
1ecde01
fix merge conflicts
nickoferrall Mar 25, 2022
2a3f61f
include webUrl in createTask query so user can click on newly create …
nickoferrall Mar 25, 2022
d98d2ce
add first and sort to allProjects query
nickoferrall Mar 25, 2022
efba243
rename GitLabRepo to GitLabProject
nickoferrall Mar 25, 2022
3022144
pass meetingId to issue input rather than querying it
nickoferrall Mar 25, 2022
d2d87bb
add gitlab search query
nickoferrall Mar 27, 2022
71525c0
filter by gitlab search query
nickoferrall Mar 27, 2022
740c34c
refactor to hooks
nickoferrall Mar 28, 2022
85c0ba1
query projects from project filter menu
nickoferrall Mar 28, 2022
ddddb91
remove __typename and resolveTypes
nickoferrall Mar 29, 2022
13f27ba
update UpdatePokerScopeMutation to fix selectAll bug
nickoferrall Mar 29, 2022
9b6d2fe
fix merge conflict
nickoferrall Mar 29, 2022
6d9f8e7
render projects in filter menu
nickoferrall Mar 29, 2022
dfd3385
use fullPath in gitlab menu and adjust max width
nickoferrall Mar 30, 2022
b9afa63
refactor gitlab search query from string to object with projectIds
nickoferrall Mar 30, 2022
be34a9e
selecting a project in the filter menu adds the item to selectedProje…
nickoferrall Mar 30, 2022
17be732
selecting a project filters the results
nickoferrall Mar 30, 2022
e5889e1
add search icon
nickoferrall Mar 30, 2022
becddb7
add search icon
nickoferrall Mar 30, 2022
ef26d0b
fix merge conflict
nickoferrall Mar 30, 2022
ca9f62e
remove searchQuery from scoping results query
nickoferrall Mar 30, 2022
66aacfc
clean-up return statement in fetchGitLabProjects
nickoferrall Mar 31, 2022
ef51f23
remove alias
nickoferrall Mar 31, 2022
6749e72
make selectedProjectIds nullable
nickoferrall Mar 31, 2022
a28f3e4
Merge branch 'feat/6033/add-gitlab-issue' into feat/6046/project-filt…
nickoferrall Mar 31, 2022
46e1787
add search to issue args
nickoferrall Mar 31, 2022
d009798
include search string when adding new gitlab issue
nickoferrall Mar 31, 2022
2de633f
refactor search query to a gql object
nickoferrall Mar 31, 2022
0b4ac3f
merge with search issues branch
nickoferrall Mar 31, 2022
2cf7ddd
remove useLoadNextOnScrollBottom and increase default projects first
nickoferrall Mar 31, 2022
c8de86f
merge with master
nickoferrall Mar 31, 2022
72233e7
Merge branch 'master' into feat/6033/add-gitlab-issue
nickoferrall Mar 31, 2022
01b5210
merge with master
nickoferrall Mar 31, 2022
b2c9420
fix merge conflicts
nickoferrall Mar 31, 2022
87f71fd
fix selectedProjects type err
nickoferrall Mar 31, 2022
8cb3ed4
merge with search issues pr
nickoferrall Mar 31, 2022
204e3da
Merge branch 'master' into feat/6046/project-filter-gitlab
mattkrick Mar 31, 2022
684d1b0
fix merge conflicts and fix meetingCard breaking the rules of hooks
nickoferrall Apr 1, 2022
c106ffc
add search string to differentiate project menu query and include ids…
nickoferrall Apr 1, 2022
e56df01
add gitlab and github types to gitignore
nickoferrall Apr 1, 2022
b247d46
use react-swipeable-views workaround
nickoferrall Apr 1, 2022
b7e062c
merge with master
nickoferrall Apr 1, 2022
1bdc0ed
add _xGitLabProject resolver
nickoferrall Apr 4, 2022
aef8e66
Merge branch 'master' into feat/6033/add-gitlab-issue
nickoferrall Apr 4, 2022
9bf29ea
merge with master
nickoferrall Apr 4, 2022
f39ccbb
remove resolverTypes and gitlabTypes
nickoferrall Apr 4, 2022
d3f5553
Merge branch 'feat/6033/add-gitlab-issue' into feat/6045/search-gitla…
nickoferrall Apr 4, 2022
79ffb3c
map over tabs instead of contents
nickoferrall Apr 4, 2022
fe3381a
fix merge conflicts
nickoferrall Apr 4, 2022
8dca40e
implement new scope search ui in gitlab
nickoferrall Apr 4, 2022
9c4b485
refactor gitlabSearchQuery from selectedProjectsIds to selectedProjects
nickoferrall Apr 4, 2022
cecd11c
selected projects showing up in current filters
nickoferrall Apr 5, 2022
f4a324d
truncate current filters
nickoferrall Apr 5, 2022
44d8bba
add new scope search to jira
nickoferrall Apr 5, 2022
5fb1078
show jira project names
nickoferrall Apr 5, 2022
a387a95
improve current filters positioning
nickoferrall Apr 5, 2022
5b43e8b
remove gitlab types
nickoferrall Apr 5, 2022
48540ce
implement new scope search ui in parabol integration
nickoferrall Apr 5, 2022
a136458
implement new scope search bar ui in github
nickoferrall Apr 5, 2022
a6316f3
change filter var to status
nickoferrall Apr 5, 2022
7ef9531
query projects from GitLabIntegration and remove fullPath from gitlab…
nickoferrall Apr 6, 2022
03f0456
refactor scoping results query to usePagination and add alias to new …
nickoferrall Apr 6, 2022
0d5e474
refactor PokerEstimateHeaderCard to make PokerEstimateHeaderCardConte…
nickoferrall Apr 6, 2022
2e6109c
adding commit to play by the gh title rules
nickoferrall Apr 6, 2022
f8637e6
track start of search
nickoferrall Apr 6, 2022
814d762
track end of search
nickoferrall Apr 6, 2022
a79e298
track updated poker scope
nickoferrall Apr 6, 2022
da86a7d
fix(gitlab): add proper client-side alias handling (#6361)
mattkrick Apr 6, 2022
0641b73
make poker input menu a dropdown and fix width
nickoferrall Apr 7, 2022
bafd1ee
refactor baseTabs to include Component
nickoferrall Apr 7, 2022
fed8dce
create a single source of truth for gitlab issue args
nickoferrall Apr 7, 2022
ba9e565
fix merge conflict
nickoferrall Apr 7, 2022
3a7a3ef
add viewerMeetingMember check and remove selectedProjectsIds resolver
nickoferrall Apr 7, 2022
7981e5c
track selected gitlab project filter
nickoferrall Apr 7, 2022
cd4a078
Merge branch 'master' into feat/6303/track-gitlab
nickoferrall Apr 7, 2022
710c499
track selected all issues
nickoferrall Apr 7, 2022
a9fe382
track cleared gitlab search
nickoferrall Apr 7, 2022
89f7764
Merge branch 'master' into feat/6033/add-gitlab-issue
nickoferrall Apr 7, 2022
d07d4a2
fix merge conflicts
nickoferrall Apr 7, 2022
b66b227
remove refetchable from gitlab scoping results query
nickoferrall Apr 7, 2022
4193167
fix merge conflict
nickoferrall Apr 7, 2022
359ee30
fix merge conflicts
nickoferrall Apr 7, 2022
2925cfa
fix merge conflict
nickoferrall Apr 7, 2022
75eb079
Merge branch 'feat/6138/new-scope-search-ui' into feat/6244/gitlab-vi…
nickoferrall Apr 7, 2022
a1d82e0
Merge branch 'feat/6244/gitlab-visible-in-estimate' into feat/6303/tr…
nickoferrall Apr 7, 2022
dcec2b8
fix ts error
nickoferrall Apr 8, 2022
4aba591
keep focus in search input after clearing query
nickoferrall Apr 8, 2022
a351e2f
change searchQueryFilters event track options from string to id
nickoferrall Apr 8, 2022
2f6aab5
use nullish coalescing instead of logical or
nickoferrall Apr 11, 2022
41f2d9e
make selectedProjectsIds null if empty array
nickoferrall Apr 11, 2022
c3e5d54
Merge branch 'feat/6046/project-filter-gitlab' into feat/6138/new-sco…
nickoferrall Apr 11, 2022
e5a7723
Merge branch 'feat/6138/new-scope-search-ui' into feat/6244/gitlab-vi…
nickoferrall Apr 11, 2022
377a6a6
Merge branch 'feat/6244/gitlab-visible-in-estimate' into feat/6303/tr…
nickoferrall Apr 11, 2022
a1ebd14
update SegmentEventTrackOptions
nickoferrall Apr 11, 2022
ea03b94
render gitlab menu ui
nickoferrall Apr 11, 2022
1d769cd
implement gitlab dimension query and mutation
nickoferrall Apr 12, 2022
6801d18
use optional chaining rather than destructuring many vars
nickoferrall Apr 12, 2022
6560170
use gid instead of project path in gitlab dimension queries
nickoferrall Apr 12, 2022
62bc81e
begin implementing pushEstimateToGitLab
nickoferrall Apr 12, 2022
fd29041
feat(sprint-poker): GitLab issue is visible in Estimate phase (#6355)
nickoferrall Apr 12, 2022
47a88b6
able to push comment to gitlab issue
nickoferrall Apr 13, 2022
2c24663
fix linting errors
nickoferrall Apr 13, 2022
e4dda85
change mutation name to createNote
nickoferrall Apr 13, 2022
15e82bd
fix merge conflicts
nickoferrall Apr 13, 2022
9717542
merge with master
nickoferrall Apr 13, 2022
fe9d112
merge with master
nickoferrall Apr 13, 2022
8ea3cbf
Merge branch 'feat/6138/new-scope-search-ui' of github.com:ParabolInc…
nickoferrall Apr 13, 2022
426aea3
fix merge conflicts
nickoferrall Apr 13, 2022
487786a
Merge branch 'feat/6303/track-gitlab' into feat/6322/can-vote-on-gitl…
nickoferrall Apr 13, 2022
2f63534
merge with master
nickoferrall Apr 13, 2022
d35b2c4
Merge branch 'master' into feat/6045/search-gitlab-issues
nickoferrall Apr 13, 2022
e95f9ca
Merge branch 'master' into feat/6033/add-gitlab-issue
nickoferrall Apr 13, 2022
ee43e5d
Merge branch 'feat/6033/add-gitlab-issue' into feat/6045/search-gitla…
nickoferrall Apr 13, 2022
04442d0
Merge branch 'feat/6045/search-gitlab-issues' into feat/6046/project-…
nickoferrall Apr 13, 2022
fed8fb3
Merge branch 'feat/6046/project-filter-gitlab' into feat/6138/new-sco…
nickoferrall Apr 13, 2022
2fff02f
Merge branch 'feat/6138/new-scope-search-ui' into feat/6303/track-gitlab
nickoferrall Apr 13, 2022
8ec93b5
Merge branch 'feat/6303/track-gitlab' into feat/6322/can-vote-on-gitl…
nickoferrall Apr 13, 2022
b90c351
remove log
nickoferrall Apr 13, 2022
87333c7
implement gitlab TaskIntegrationManager in GitLabServerManager and re…
nickoferrall Apr 19, 2022
3617843
implement createNote method
nickoferrall Apr 19, 2022
47391b1
implement getProjects in GitLabServerManager
nickoferrall Apr 19, 2022
b90c833
implement create task in GitLabServerManager
nickoferrall Apr 20, 2022
1c37835
update types in pushEstimateToGitLab
nickoferrall Apr 20, 2022
25fb6a8
can push a task to gitlab
nickoferrall Apr 20, 2022
eb5f000
after integrating a task with gitlab, the task ui updates
nickoferrall Apr 20, 2022
bfa9ec2
update pushEstimateToGitLab checks
nickoferrall Apr 20, 2022
aa691d8
fix merge conflicts
nickoferrall Apr 20, 2022
9cf36e7
fix merge conflicts
nickoferrall Apr 20, 2022
8a21eb8
fix merge conflict
nickoferrall Apr 20, 2022
cefafa2
add provider check
nickoferrall Apr 20, 2022
e11747d
implement AddToGitLabMenuItem
nickoferrall Apr 20, 2022
30b30a4
use new sdl pattern in updateGitLabDimensionField
nickoferrall Apr 22, 2022
1e610fa
remove redundant auth check
nickoferrall Apr 25, 2022
2511dcf
change teamId to varchar(100)
nickoferrall Apr 25, 2022
07c3d42
use projectId and providerId in gitlab dimension queries
nickoferrall Apr 27, 2022
a4d24bd
fix merge conflict
nickoferrall Apr 27, 2022
c1ff4d5
use GetIssueQuery type
nickoferrall Apr 27, 2022
b675b0b
fix merge conflict
nickoferrall Apr 27, 2022
4160277
check if gitlab exists as it doesnt in the demo
nickoferrall Apr 27, 2022
5b98baa
use integrationsRef instead of gitlab ref
nickoferrall May 3, 2022
fcecb09
Merge branch 'master' into feat/6322/can-vote-on-gitlab-issue
nickoferrall May 3, 2022
22108df
return success payload for updateGitlabDimensionField mutation
nickoferrall May 3, 2022
f3efc7d
use accessUserId instead of viewerId for the gitlabAuth
nickoferrall May 3, 2022
80737ec
fix merge conflicts
nickoferrall May 3, 2022
c891816
fix merge conflicts
nickoferrall May 3, 2022
717ece4
implement addCreatedBySomeoneElseComment
nickoferrall May 3, 2022
c155fb6
fix merge conflicts
nickoferrall May 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions packages/client/components/AddToGitLabMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import styled from '@emotion/styled'
import graphql from 'babel-plugin-relay/macro'
import React, {forwardRef} from 'react'
import {useFragment} from 'react-relay'
import GitLabClientManager from '~/utils/GitLabClientManager'
import useAtmosphere from '../hooks/useAtmosphere'
import useMutationProps, {MenuMutationProps} from '../hooks/useMutationProps'
import {ICON_SIZE} from '../styles/typographyV2'
import {AddToGitLabMenuItem_GitLabIntegration$key} from '../__generated__/AddToGitLabMenuItem_GitLabIntegration.graphql'
import GitLabSVG from './GitLabSVG'
import MenuItem from './MenuItem'
import MenuItemComponentAvatar from './MenuItemComponentAvatar'
import MenuItemLabel from './MenuItemLabel'

interface Props {
teamId: string
mutationProps: MenuMutationProps
gitlabRef: AddToGitLabMenuItem_GitLabIntegration$key
}

const MenuItemIcon = styled(MenuItemComponentAvatar)({
'& svg': {
display: 'block',
height: ICON_SIZE.MD18,
width: ICON_SIZE.MD18
}
})

const AddToGitLabMenuItem = forwardRef((props: Props, ref) => {
const {teamId, gitlabRef} = props
const mutationProps = useMutationProps()
const gitlab = useFragment(
graphql`
fragment AddToGitLabMenuItem_GitLabIntegration on GitLabIntegration {
cloudProvider {
id
clientId
serverBaseUrl
}
}
`,
gitlabRef
)
const atmosphere = useAtmosphere()
const {cloudProvider} = gitlab
if (!cloudProvider) return null
const {id: providerId, clientId, serverBaseUrl} = cloudProvider
const openOAuth = () => {
GitLabClientManager.openOAuth(
atmosphere,
providerId,
clientId,
serverBaseUrl,
teamId,
mutationProps
)
}
return (
<MenuItem
ref={ref}
label={
<MenuItemLabel>
<MenuItemIcon>
<GitLabSVG />
</MenuItemIcon>
{'Add GitLab integration'}
</MenuItemLabel>
}
onClick={openOAuth}
/>
)
})

export default AddToGitLabMenuItem
89 changes: 89 additions & 0 deletions packages/client/components/GitLabFieldDimensionDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import styled from '@emotion/styled'
import graphql from 'babel-plugin-relay/macro'
import React from 'react'
import {useFragment} from 'react-relay'
import {PALETTE} from '~/styles/paletteV3'
import {MenuPosition} from '../hooks/useCoords'
import useMenu from '../hooks/useMenu'
import {ICON_SIZE} from '../styles/typographyV2'
import {SprintPokerDefaults} from '../types/constEnums'
import {GitLabFieldDimensionDropdown_stage$key} from '../__generated__/GitLabFieldDimensionDropdown_stage.graphql'
import GitLabFieldMenu from './GitLabFieldMenu'
import Icon from './Icon'
import PlainButton from './PlainButton/PlainButton'

interface Props {
clearError: () => void
isFacilitator: boolean
stageRef: GitLabFieldDimensionDropdown_stage$key
submitScore(): void
}

const Wrapper = styled(PlainButton)<{isFacilitator: boolean}>(({isFacilitator}) => ({
color: PALETTE.SLATE_700,
cursor: isFacilitator ? undefined : 'default',
display: 'flex',
paddingRight: isFacilitator ? undefined : 8,
userSelect: 'none',
':hover,:focus,:active': {
opacity: isFacilitator ? '50%' : undefined
}
}))

const CurrentValue = styled('div')({
fontSize: 14
})

const StyledIcon = styled(Icon)<{isFacilitator: boolean}>(({isFacilitator}) => ({
fontSize: ICON_SIZE.MD18,
display: isFacilitator ? undefined : 'none'
}))

const labelLookup = {
[SprintPokerDefaults.SERVICE_FIELD_COMMENT]: SprintPokerDefaults.SERVICE_FIELD_COMMENT_LABEL,
[SprintPokerDefaults.SERVICE_FIELD_NULL]: SprintPokerDefaults.SERVICE_FIELD_NULL_LABEL
}

const GitLabFieldDimensionDropdown = (props: Props) => {
const {clearError, stageRef, isFacilitator, submitScore} = props
const stage = useFragment(
graphql`
fragment GitLabFieldDimensionDropdown_stage on EstimateStage {
...GitLabFieldMenu_stage
finalScore
serviceField {
name
}
}
`,
stageRef
)
const {serviceField} = stage
const {name: serviceFieldName} = serviceField
const {togglePortal, menuPortal, originRef, menuProps} = useMenu<HTMLButtonElement>(
MenuPosition.UPPER_RIGHT,
{isDropdown: true}
)

const onClick = () => {
if (!isFacilitator) return
togglePortal()
clearError()
}

const label = labelLookup[serviceFieldName]

return (
<>
<Wrapper isFacilitator={isFacilitator} onClick={onClick} ref={originRef}>
<CurrentValue>{label}</CurrentValue>
<StyledIcon isFacilitator={isFacilitator}>{'expand_more'}</StyledIcon>
</Wrapper>
{menuPortal(
<GitLabFieldMenu menuProps={menuProps} stageRef={stage} submitScore={submitScore} />
)}
</>
)
}

export default GitLabFieldDimensionDropdown
98 changes: 98 additions & 0 deletions packages/client/components/GitLabFieldMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import graphql from 'babel-plugin-relay/macro'
import React from 'react'
import {useFragment} from 'react-relay'
import useAtmosphere from '../hooks/useAtmosphere'
import {MenuProps} from '../hooks/useMenu'
import UpdateGitLabDimensionFieldMutation from '../mutations/UpdateGitLabDimensionFieldMutation'
import {SprintPokerDefaults} from '../types/constEnums'
import {GitLabFieldMenu_stage$key} from '../__generated__/GitLabFieldMenu_stage.graphql'
import Menu from './Menu'
import MenuItem from './MenuItem'

interface Props {
menuProps: MenuProps
stageRef: GitLabFieldMenu_stage$key
submitScore(): void
}

const GitLabFieldMenu = (props: Props) => {
const {menuProps, stageRef, submitScore} = props
const atmosphere = useAtmosphere()
const stage = useFragment(
graphql`
fragment GitLabFieldMenu_stage on EstimateStage {
serviceField {
name
}
dimensionRef {
name
}
task {
integration {
... on _xGitLabIssue {
__typename
id
}
}
}
meetingId
}
`,
stageRef
)
const {portalStatus, isDropdown, closePortal} = menuProps
const {serviceField, task, dimensionRef, meetingId} = stage
const {name: dimensionName} = dimensionRef
const {name: serviceFieldName} = serviceField
const defaults = [
SprintPokerDefaults.SERVICE_FIELD_COMMENT,
SprintPokerDefaults.SERVICE_FIELD_NULL
] as string[]
const defaultActiveIdx = defaults.indexOf(serviceFieldName)

if (task?.integration?.__typename !== '_xGitLabIssue') return null
const {integration} = task
const {id: gid} = integration
const handleClick = (labelTemplate: string) => () => {
if (labelTemplate !== serviceFieldName) {
UpdateGitLabDimensionFieldMutation(
atmosphere,
{
dimensionName,
labelTemplate,
gid,
meetingId
},
{
onCompleted: submitScore,
onError: () => {
/* noop */
}
}
)
} else {
submitScore()
}
closePortal()
}

return (
<Menu
ariaLabel={'Select whether to publish estimate as a comment in GitLab'}
portalStatus={portalStatus}
isDropdown={isDropdown}
defaultActiveIdx={defaultActiveIdx}
>
<MenuItem
label={SprintPokerDefaults.SERVICE_FIELD_COMMENT_LABEL}
onClick={handleClick(SprintPokerDefaults.SERVICE_FIELD_COMMENT)}
/>
<MenuItem
label={SprintPokerDefaults.SERVICE_FIELD_NULL_LABEL}
onClick={handleClick(SprintPokerDefaults.SERVICE_FIELD_NULL)}
/>
</Menu>
)
}

export default GitLabFieldMenu
12 changes: 12 additions & 0 deletions packages/client/components/IntegratedTaskContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ const IntegratedTaskContent = (props: Props) => {
<div dangerouslySetInnerHTML={{__html: bodyHTML}} />
</Content>
)
} else if (integration.__typename === '_xGitLabIssue') {
const {descriptionHtml, title} = integration
return (
<Content>
<Summary>{title}</Summary>
{descriptionHtml && <div dangerouslySetInnerHTML={{__html: descriptionHtml}} />}
</Content>
)
}
return null
}
Expand All @@ -69,6 +77,10 @@ export default createFragmentContainer(IntegratedTaskContent, {
descriptionHTML
summary
}
... on _xGitLabIssue {
descriptionHtml
title
}
}
}
`
Expand Down
14 changes: 12 additions & 2 deletions packages/client/components/PokerDimensionFinalScorePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Breakpoint} from '~/types/constEnums'
import {PALETTE} from '../styles/paletteV3'
import {PokerDimensionFinalScorePicker_stage$key} from '../__generated__/PokerDimensionFinalScorePicker_stage.graphql'
import GitHubFieldDimensionDropdown from './GitHubFieldDimensionDropdown'
import GitLabFieldDimensionDropdown from './GitLabFieldDimensionDropdown'
import JiraFieldDimensionDropdown from './JiraFieldDimensionDropdown'
import LinkButton from './LinkButton'
import StyledError from './StyledError'
Expand Down Expand Up @@ -81,6 +82,7 @@ const PokerDimensionFinalScorePicker = (props: Props) => {
fragment PokerDimensionFinalScorePicker_stage on EstimateStage {
...GitHubFieldDimensionDropdown_stage
...JiraFieldDimensionDropdown_stage
...GitLabFieldDimensionDropdown_stage
task {
integration {
__typename
Expand All @@ -96,7 +98,8 @@ const PokerDimensionFinalScorePicker = (props: Props) => {
const titleByType = {
_xGitHubIssue: 'GitHub',
JiraIssue: 'Jira',
JiraServerIssue: 'Jira Server'
JiraServerIssue: 'Jira Server',
_xGitLabIssue: 'GitLab'
}
const title = titleByType[integrationType]
const isDesktop = useBreakpoint(Breakpoint.SIDEBAR_LEFT)
Expand All @@ -123,7 +126,6 @@ const PokerDimensionFinalScorePicker = (props: Props) => {
submitScore={submitScore}
/>
)}

{(integrationType === 'JiraIssue' || integrationType === 'JiraServerIssue') && (
<JiraFieldDimensionDropdown
clearError={clearError}
Expand All @@ -132,6 +134,14 @@ const PokerDimensionFinalScorePicker = (props: Props) => {
submitScore={submitScore}
/>
)}
{integrationType === '_xGitLabIssue' && (
<GitLabFieldDimensionDropdown
clearError={clearError}
stageRef={stage}
isFacilitator={isFacilitator}
submitScore={submitScore}
/>
)}
</ControlWrapper>
</Mapper>
</Wrapper>
Expand Down
1 change: 0 additions & 1 deletion packages/client/components/PokerDimensionValueControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ const PokerDimensionValueControl = (props: Props) => {
/>
</MiniPokerCard>
{!isFacilitator && <Label>{label}</Label>}

<PokerDimensionFinalScorePicker
canUpdate={isStale}
stageRef={stage}
Expand Down
Loading