-
Notifications
You must be signed in to change notification settings - Fork 336
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
[RFC] Add GitLab auth #5594
Closed
Closed
[RFC] Add GitLab auth #5594
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
0dc385e
initial commit, framing in mattermost
jordanh 99e4b43
feature complete
jordanh f91cffb
self-review fixups
jordanh e8ba78c
review changes
jordanh fb0bfd5
remove autofocus
jordanh e575a8b
Majority of Maintainer review fixups
jordanh 40f8fec
refactor: add userId to MattermostAuth
jordanh 49b363c
better scheduled jobs types
mattkrick 1577aa6
address @mattkrick 2nd review comments
jordanh 298dc22
Refactor Mattermost, add GitLab w/new auth scheme
jordanh 9352749
remove notifyMattermost okResponse
jordanh b9a6fe5
refactor/rename field names
jordanh 450baf3
self-review fixups
jordanh 64c5db9
Merge branch master into add-mattermost
mattkrick a75833f
Merge branch 'master' into add-mattermost
jordanh adc7cef
maintainer review round 3 fixups
jordanh 89f97d6
Webpack updates for server image assets
jordanh 841afb8
fixed small nits
jordanh cedec5f
Merge branch 'add-mattermost' into add-gitlab-auth
jordanh e47d6ba
Merge branch 'master' into add-gitlab-auth
BartoszJarocki 55a8ba1
fix: removed not needed mattermost queries
BartoszJarocki 5fbfeae
fix: removed not needed mattermost queries
BartoszJarocki 627a11c
fix: added integration auth loaders to CustomLoaderMakers
BartoszJarocki 74bad44
fix: mattermost provider row missing variables
BartoszJarocki 94ff90a
fix: various merge fixes, type improvements
BartoszJarocki 59eaa56
fix: mattermost panel component types
BartoszJarocki 4e05e68
refactor: lowercase integration provider enums, various fixes
BartoszJarocki 94479be
Re-added mattermost webhook validation
jordanh 130c02c
Merge branch 'master' into add-gitlab-auth
BartoszJarocki 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
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"schema": "packages/server/utils/githubSchema.graphql", | ||
"documents": "packages/server/utils/githubQueries/*.graphql", | ||
"config": { | ||
"content": "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck" | ||
}, | ||
"generates": { | ||
"packages/server/types/githubTypes.ts": { | ||
"plugins": [ | ||
"typescript", | ||
"typescript-operations", | ||
"add" | ||
], | ||
"config": { | ||
"content": "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck" | ||
} | ||
"schema": "packages/server/utils/githubSchema.graphql", | ||
"documents": "packages/server/utils/githubQueries/*.graphql", | ||
"plugins": ["typescript", "typescript-operations", "add"] | ||
}, | ||
"packages/server/types/gitlabTypes.ts": { | ||
"schema": "packages/server/graphql/nestedSchema/GitLab/gitlabSchema.graphql", | ||
"documents": "packages/server/graphql/nestedSchema/GitLab/queries/*.graphql", | ||
"plugins": ["typescript", "typescript-operations", "add"] | ||
} | ||
} | ||
} |
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,10 @@ | ||
import styled from '@emotion/styled' | ||
import logo from '../styles/theme/images/graphics/gitlab-icon-rgb.svg' | ||
|
||
const GitLabProviderLogo = styled('div')({ | ||
background: `url("${logo}")`, | ||
height: 48, | ||
width: 48 | ||
}) | ||
|
||
export default GitLabProviderLogo |
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,39 @@ | ||
import React from 'react' | ||
|
||
const GitLabSVG = React.memo(() => { | ||
return ( | ||
<svg | ||
version='1.1' | ||
width='24' | ||
height='24' | ||
viewBox='0 0 24 24' | ||
xmlns='http://www.w3.org/2000/svg' | ||
> | ||
<g transform='matrix(1.3333 0 0 -1.3333 0 745.33)'> | ||
<g transform='matrix(.0053314 0 0 .0053314 -6.6229 535.81)'> | ||
<path d='m2930.3 1240.2 621.99 1913.2h-1243.1l621.08-1913.2' fill='#e33426' /> | ||
<path | ||
d='m1438 3153.4-189.42-581.26c-17.13-52.78 1.37-111.04 46.61-143.94l1635.1-1188-1492.3 1913.2' | ||
fill='#f79818' | ||
/> | ||
<path | ||
d='m1438 3153.4h871.2l-374.94 1152.2c-19.19 58.95-102.82 58.95-122.7 0l-373.56-1152.2' | ||
fill='#e33426' | ||
/> | ||
<path | ||
d='m4423.5 3153.4 188.72-581.26c17.14-52.78-1.37-111.04-46.61-143.94l-1635.3-1188 1493.2 1913.2' | ||
fill='#f79818' | ||
/> | ||
<path | ||
d='m4423.5 3153.4h-871.21l374.25 1152.2c19.2 58.95 102.82 58.95 122.7 0l374.26-1152.2' | ||
fill='#e33426' | ||
/> | ||
<path d='m2930.3 1240.2 621.99 1913.2h871.21z' fill='#f25923' /> | ||
<path d='m2930.3 1240.2-1492.3 1913.2h871.2z' fill='#f25923' /> | ||
</g> | ||
</g> | ||
</svg> | ||
) | ||
}) | ||
|
||
export default GitLabSVG |
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,11 @@ | ||
import styled from '@emotion/styled' | ||
import logo from '../styles/theme/images/graphics/mattermost.svg' | ||
|
||
const MattermostProviderLogo = styled('div')({ | ||
background: `url("${logo}")`, | ||
height: 48, | ||
width: 48, | ||
backgroundSize: 'contain' | ||
}) | ||
|
||
export default MattermostProviderLogo |
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,28 @@ | ||
import React from 'react' | ||
|
||
const MattermostSVG = React.memo(() => { | ||
return ( | ||
<svg | ||
width='24' | ||
height='24' | ||
viewBox='0 0 700 700' | ||
fill='none' | ||
xmlns='http://www.w3.org/2000/svg' | ||
> | ||
<path | ||
fillRule='evenodd' | ||
clipRule='evenodd' | ||
d='M496.909 147.716L499.54 200.779C542.559 248.303 559.539 315.609 538.125 378.865C506.159 473.292 400.753 522.93 302.694 489.735C204.635 456.54 151.057 353.081 183.023 258.653C204.508 195.186 259.171 151.953 322.48 140.505L356.685 100.091C249.969 97.2018 149.288 163.442 113.265 269.853C69.0048 400.598 139.114 542.468 269.859 586.729C400.604 630.99 542.474 560.88 586.735 430.135C622.7 323.895 583.148 210.308 496.909 147.716Z' | ||
fill='#222222' | ||
/> | ||
<path | ||
fillRule='evenodd' | ||
clipRule='evenodd' | ||
d='M435.623 304.289L433.812 230.109L432.359 187.424L431.376 150.444C431.376 150.444 431.581 132.612 430.959 128.422C430.828 127.54 430.551 126.822 430.221 126.196C430.18 126.108 430.141 126.02 430.096 125.934C430.049 125.854 430.003 125.78 429.954 125.705C429.27 124.528 428.195 123.572 426.804 123.101C425.381 122.619 423.909 122.738 422.631 123.29C422.604 123.3 422.579 123.309 422.552 123.32C422.4 123.388 422.255 123.465 422.109 123.546C421.503 123.841 420.887 124.223 420.284 124.808C417.244 127.758 406.575 142.048 406.575 142.048L383.331 170.826L356.248 203.851L309.749 261.677C309.749 261.677 288.411 288.308 293.126 321.088C297.841 353.868 322.211 369.837 341.117 376.238C360.023 382.638 389.082 384.756 412.74 361.581C436.396 338.405 435.623 304.289 435.623 304.289Z' | ||
fill='#222222' | ||
/> | ||
</svg> | ||
) | ||
}) | ||
|
||
export default MattermostSVG |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,8 @@ export default class DemoUser { | |
createdAt = new Date().toJSON() | ||
email: string | ||
featureFlags = { | ||
jira: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I presume it is ok to remove this flag of yesteryear... |
||
gitlab: false, | ||
video: false | ||
} | ||
facilitatorUserId: string | ||
facilitatorName: string | ||
|
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
37 changes: 37 additions & 0 deletions
37
packages/client/modules/teamDashboard/components/ProviderRow/GitLabConfigMenu.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,37 @@ | ||
import React from 'react' | ||
import useAtmosphere from '../../../../hooks/useAtmosphere' | ||
import {MenuProps} from '../../../../hooks/useMenu' | ||
import {MenuMutationProps} from '../../../../hooks/useMutationProps' | ||
import RemoveIntegrationTokenMutation from '../../../../mutations/RemoveIntegrationTokenMutation' | ||
import Menu from '../../../../components/Menu' | ||
import MenuItem from '../../../../components/MenuItem' | ||
|
||
interface Props { | ||
menuProps: MenuProps | ||
mutationProps: MenuMutationProps | ||
providerId: string | ||
teamId: string | ||
terminatePortal: () => void | ||
} | ||
|
||
const GitLabConfigMenu = (props: Props) => { | ||
const {menuProps, mutationProps, providerId, teamId, terminatePortal} = props | ||
const {onError, onCompleted, submitMutation, submitting} = mutationProps | ||
const atmosphere = useAtmosphere() | ||
|
||
const removeGitLabAuth = () => { | ||
if (submitting) return | ||
submitMutation() | ||
RemoveIntegrationTokenMutation(atmosphere, {providerId, teamId}, {onCompleted, onError}) | ||
// Our parent component does not unmount, and it often re-renders before the CSS menu transition | ||
// can complete. We nuke the portal here to ensure the menu is closed. | ||
terminatePortal() | ||
} | ||
return ( | ||
<Menu ariaLabel={'Configure your Mattermost integration'} {...menuProps}> | ||
<MenuItem label='Remove Mattermost' onClick={removeGitLabAuth} /> | ||
</Menu> | ||
) | ||
} | ||
|
||
export default GitLabConfigMenu |
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.
Changes here are only to return
terminatePortal
so it may be used