Skip to content

Commit c74254e

Browse files
ui: add gitlab authorization button
Signed-off-by: Leticia Wanderley <[email protected]>
1 parent 0b6a648 commit c74254e

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pids
1010
*.pid
1111
*.seed
1212
*.pid.lock
13+
.DS_Store
1314

1415
# built docs
1516
docs/_build

reana-ui/src/components/Header.js

+16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import React, { Component } from "react";
1212
import history from "../history";
1313
import { Segment, Image, Menu, Icon } from "semantic-ui-react";
1414
import LogoImg from "../images/logo-reana.svg";
15+
import GitLabLogo from "../images/gitlab-icon-rgb.svg";
16+
import Config from "../config";
1517
import Cookies from "universal-cookie";
1618
import "./Header.css";
1719

@@ -33,6 +35,9 @@ export default class Header extends Component {
3335
};
3436

3537
render() {
38+
let authorize_gitlab = `${Config.reana_gitlab_url}/oauth/authorize?client_id=` +
39+
`${Config.reana_gitlab_client_id}&redirect_uri=${Config.api}/gitlab` +
40+
`&response_type=code&scope=api`
3641
return (
3742
<Segment secondary clearing attached="top" padded>
3843
<Image
@@ -51,6 +56,17 @@ export default class Header extends Component {
5156
>
5257
Documentation
5358
</Menu.Item>
59+
<Menu.Item
60+
href={authorize_gitlab}
61+
>
62+
<Image
63+
src={GitLabLogo}
64+
size="mini"
65+
floated="left"
66+
style={{ margin: "-7px", paddingRight: "7px" }}
67+
/>
68+
Connect with GitLab
69+
</Menu.Item>
5470
<Menu.Item
5571
className="logout-button"
5672
onClick={this.logOut}

reana-ui/src/config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const config = {
1212
name: "CERN REANA UI",
1313
sign_up_email: "[email protected]",
1414
api: "http://reana-dev.cern.ch",
15-
pooling_secs: 5
15+
pooling_secs: 5,
16+
reana_gitlab_url: "https://gitlab.com",
17+
reana_gitlab_client_id: "CHANGE_ME",
1618
};
1719

1820
export default config;
+1
Loading

0 commit comments

Comments
 (0)