From 55be763a84d160c7d8b4481c18c301992cd66ef1 Mon Sep 17 00:00:00 2001 From: dimitraz <dzuccare@redhat.com> Date: Fri, 13 Jul 2018 17:08:54 +0100 Subject: [PATCH] Jira view --- react-web/src/components/JiraLogin.js | 23 +++++++++ react-web/src/components/JiraLoginForm.js | 51 ++++++++++++++++++++ react-web/src/components/Session.js | 3 +- react-web/src/components/_createSession.scss | 5 -- 4 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 react-web/src/components/JiraLogin.js create mode 100644 react-web/src/components/JiraLoginForm.js delete mode 100644 react-web/src/components/_createSession.scss diff --git a/react-web/src/components/JiraLogin.js b/react-web/src/components/JiraLogin.js new file mode 100644 index 0000000..299c9a4 --- /dev/null +++ b/react-web/src/components/JiraLogin.js @@ -0,0 +1,23 @@ +import React from 'react'; +import { Alert } from 'patternfly-react'; +import { JiraLoginForm } from './JiraLoginForm' + +export class JiraLogin extends React.Component { + + render() { + return( + <div> + <header className="text-center"> + <h1>Link to Jira</h1> + </header> + <div> + <Alert type="info"> + Username and password are never stored. They are only used to generate a session token. + </Alert> + + <JiraLoginForm /> + </div> + </div> + ); + } +} diff --git a/react-web/src/components/JiraLoginForm.js b/react-web/src/components/JiraLoginForm.js new file mode 100644 index 0000000..666e58e --- /dev/null +++ b/react-web/src/components/JiraLoginForm.js @@ -0,0 +1,51 @@ +import React from 'react'; +import { Form, FormGroup, ControlLabel, FormControl, Button } from 'patternfly-react'; + +export class JiraLoginForm extends React.Component { + + constructor(props) { + super(props); + + this.state = { + 'jira-host': '', + 'jira-username': '', + 'jira-password': '' + }; + + this.handleControlChange = this.handleControlChange.bind(this); + } + + handleControlChange(evt) { + this.setState({[evt.target.id]: evt.target.value.trim()}); + } + + render() { + return ( + <div> + <Form> + <FormGroup> + <ControlLabel> + Jira Host: + </ControlLabel> + <FormControl type="text" id="jira-host" required onChange={this.handleControlChange} /> + </FormGroup> + <FormGroup> + <ControlLabel> + Jira Username: + </ControlLabel> + <FormControl type="text" id="jira-username" required onChange={this.handleControlChange} /> + </FormGroup> + <FormGroup> + <ControlLabel> + Jira Password: + </ControlLabel> + <FormControl type="text" id="jira-password" required onChange={this.handleControlChange} /> + </FormGroup> + <Button className="pull-right" bsStyle="primary" type="submit" value="Submit"> + Link to Jira + </Button> + </Form> + </div> + ); + } +} diff --git a/react-web/src/components/Session.js b/react-web/src/components/Session.js index c8c6537..31f646d 100644 --- a/react-web/src/components/Session.js +++ b/react-web/src/components/Session.js @@ -2,6 +2,7 @@ import React from 'react'; import { Nav, NavItem, TabContent, TabPane, Tabs } from 'patternfly-react'; import { StoryPointer } from './StoryPointer'; +import { JiraLogin } from './JiraLogin'; export class Session extends React.Component { render() { @@ -24,7 +25,7 @@ export class Session extends React.Component { <StoryPointer sessionId={this.props.sessionId} userName={this.props.userName}></StoryPointer> </TabPane> <TabPane eventKey={2}> - {/* JIRA Content */} + <JiraLogin /> </TabPane> <TabPane eventKey={3}> {/* Issues Content */} diff --git a/react-web/src/components/_createSession.scss b/react-web/src/components/_createSession.scss deleted file mode 100644 index 6c4149c..0000000 --- a/react-web/src/components/_createSession.scss +++ /dev/null @@ -1,5 +0,0 @@ -Form { - padding-top: 20px; - padding-left: 10%; - padding-right:10%; -} \ No newline at end of file