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
Allow moving integration tasks between teams #5513
Merged
mattkrick
merged 15 commits into
master
from
feat/5200/allow-moving-teams-of-integration-tasks
Nov 11, 2021
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
81ef6b2
Allow moving integration tasks between teams
Dschoordsch 0847523
Remove teamId from updateTask mutation
Dschoordsch 9b28d90
Merge branch 'master' into feat/5200/allow-moving-teams-of-integratio…
Dschoordsch e5f7267
Before moving a task to another team check if an integration is needed
Dschoordsch 952ee95
Fix TaskFooterTeamAssigneeMenu_task fragment
Dschoordsch 10b24cf
Show add integration dialog when moving task to team w/o integration
Dschoordsch 6973960
Polish add integration now dialog
Dschoordsch 7921814
Merge branch 'master' into feat/5200/allow-moving-teams-of-integratio…
mattkrick 5fa6716
Merge branch 'master' into feat/5200/allow-moving-teams-of-integratio…
mattkrick cc7d172
Cleanup
Dschoordsch aaa72be
Copy integration first before moving a task to a different team
Dschoordsch 5266696
Don't start OAuth flow when moving a to another team w/o integration
Dschoordsch 6cf7590
Cleanup
Dschoordsch be84ae2
Merge branch 'master' into feat/5200/allow-moving-teams-of-integratio…
Dschoordsch d73485b
Clear freshly added integration auth from dataLoader
Dschoordsch File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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,26 @@ | ||
# Integrations | ||
|
||
## Jira and GitHub | ||
|
||
Some guidelines how we handle the user's integration of GitHub or Jira, especially in which cases the user's authentication might be used by someone else than the user. | ||
|
||
A user's integration might only be reused by someone else if the user previously connected the task with their credentials in some form. | ||
If a user has an integration set up, their authentication is used to perform actions with tasks. | ||
In some cases if the user has no integration set up, we will fall back to the assignee's authentication. | ||
|
||
This is how it should be in the future and does not necessarily reflect current state: | ||
|
||
- [ ] **reading** a task uses **any team member's auth** | ||
in the preferred order of: | ||
- `task.integration?.accessUserId` | ||
- fallback to viewer | ||
- fallback to the team lead (reason being is a team lead is less likely to leave a team. maybe this is too optimistic?) | ||
- fallback to any other member | ||
- [x] **pushing a task** requires **viewer auth or assignee's auth**, but in both cases a comment will be added if viewer !== assignee | ||
- [x] adding tasks in **scoping** requires **viewer's auth** | ||
- [ ] adding task **estimates** uses **viewer's auth or assignee's auth** (Most likely just added in scoping by the assignee, but even when added to the board before it's little risk as estimating is a team activity) | ||
- [ ] **adding fields** to project requires **viewer's auth** | ||
- [ ] when **moving a task between teams** we check who's auth is used for this task | ||
- if the viewer has an integration for the target team, use that | ||
- else if `accessUserId === userId` (**viewer's auth** since switching teams is only allowed for viewer's own tasks), then we ask them to add the integration to the new team in UI and move it over automatically in server | ||
- else if `accessUserId !== userId`, then we check if the user pushing the task initially has an integration set up for the target team and move the task if present, otherwise we report an error |
This file contains 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 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 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 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
64 changes: 64 additions & 0 deletions
64
...tcomeCard/components/OutcomeCardAssignMenu/TaskFooterTeamAssigneeAddIntegrationDialog.tsx
This file contains 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,64 @@ | ||
import React from 'react' | ||
import styled from '@emotion/styled' | ||
import DialogContainer from '~/components/DialogContainer' | ||
import DialogTitle from '~/components/DialogTitle' | ||
import SecondaryButton from '~/components/SecondaryButton' | ||
import PrimaryButton from '~/components/PrimaryButton' | ||
import DialogContent from '~/components/DialogContent' | ||
|
||
interface Props { | ||
onClose: () => void | ||
onConfirm: () => void | ||
serviceName: string | ||
teamName: string | ||
} | ||
|
||
const StyledDialogContainer = styled(DialogContainer)({ | ||
width: 480 | ||
}) | ||
|
||
const ButtonGroup = styled('div')({ | ||
marginTop: '24px', | ||
display: 'flex', | ||
justifyContent: 'flex-end' | ||
}) | ||
|
||
const StyledTip = styled('p')({ | ||
fontSize: 14, | ||
lineHeight: '20px', | ||
margin: 0, | ||
padding: '0 0 16px' | ||
}) | ||
|
||
const StyledPrimaryButton = styled(PrimaryButton)({ | ||
marginLeft: 16 | ||
}) | ||
|
||
const TaskFooterTeamAssigneeAddIntegrationDialog = (props: Props) => { | ||
const {onClose, onConfirm, serviceName, teamName} = props | ||
|
||
return ( | ||
<StyledDialogContainer> | ||
<DialogTitle> | ||
{serviceName} integration for {teamName} | ||
</DialogTitle> | ||
<DialogContent> | ||
<div> | ||
<StyledTip> | ||
You don't have {serviceName} configured for {teamName}. Do you want to add it now? | ||
</StyledTip> | ||
<ButtonGroup> | ||
<SecondaryButton onClick={onClose} size='medium'> | ||
Cancel | ||
</SecondaryButton> | ||
<StyledPrimaryButton onClick={onConfirm} size='medium'> | ||
Add it now | ||
</StyledPrimaryButton> | ||
</ButtonGroup> | ||
</div> | ||
</DialogContent> | ||
</StyledDialogContainer> | ||
) | ||
} | ||
|
||
export default TaskFooterTeamAssigneeAddIntegrationDialog |
This file contains 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 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.
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.
we should probably try to use
task.integration?.accessUserId
tooThere 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.
true