-
-
Notifications
You must be signed in to change notification settings - Fork 151
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: Self hosted GitLab instances #957
base: master
Are you sure you want to change the base?
Changes from all commits
7461f61
1f4d111
68a62d8
69fc8e1
3a0ff18
65505ac
dae7568
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import GitLabLogo from './gitlab.svg'; | |
import { persistField } from '../../util/settings_persister'; | ||
import { | ||
createGitlabOAuth, | ||
gitLabProjectIdFromURL, | ||
} from '../../sync_backend_clients/gitlab_sync_backend_client'; | ||
|
||
import { DropboxAuth } from 'dropbox'; | ||
|
@@ -113,15 +112,10 @@ function GitLab() { | |
const defaultProject = 'https://gitlab.com/your/project'; | ||
const [project, setProject] = useState(defaultProject); | ||
const handleSubmit = (evt) => { | ||
const projectId = gitLabProjectIdFromURL(project); | ||
if (projectId) { | ||
persistField('authenticatedSyncService', 'GitLab'); | ||
persistField('gitLabProject', projectId); | ||
createGitlabOAuth().fetchAuthorizationCode(); | ||
} else { | ||
evt.preventDefault(); | ||
alert('Project does not appear to be a valid gitlab.com URL'); | ||
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. @zaz I see that you've refactored the extraction of the 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. Sure. Do you want the alert in 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. You can move it to |
||
} | ||
persistField('authenticatedSyncService', 'GitLab'); | ||
persistField('gitLabURL', project); | ||
// TODO handle incorrect URLs, possibly with try ... catch ... | ||
createGitlabOAuth(project).fetchAuthorizationCode(); | ||
}; | ||
|
||
return ( | ||
|
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.
Minor issue here:
yarn eslint
will complain thatevt
is never used. I'm not removing it as long as the validation of theprojectId
is still in question.