diff --git a/src/components/Card.js b/src/components/Card.js
index 36948ec..77ec85f 100644
--- a/src/components/Card.js
+++ b/src/components/Card.js
@@ -18,7 +18,7 @@ class Card extends Component {
let bodyAlign;
let headAlign;
- if (this.props.align) {
+ if (this.props.bodyAlign) {
bodyAlign = `text-${this.props.bodyAlign}`;
}
diff --git a/src/components/DropDown.js b/src/components/DropDown.js
index 414b573..05b16b0 100644
--- a/src/components/DropDown.js
+++ b/src/components/DropDown.js
@@ -18,7 +18,7 @@ class DropDown extends Component {
return(
+
+
+ tick3t
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+export default NavBar;
\ No newline at end of file
diff --git a/src/components/Table.js b/src/components/Table.js
index 1ea23bb..8ef166a 100644
--- a/src/components/Table.js
+++ b/src/components/Table.js
@@ -60,6 +60,10 @@ class Table extends Component {
message |
{data.message} |
+
+ note |
+ {data.note} |
+
diff --git a/src/containers/Admin/Login.js b/src/containers/Admin/Login.js
deleted file mode 100644
index 5d93e1f..0000000
--- a/src/containers/Admin/Login.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import React, { Component } from 'react';
-import {
- Row,
- Col,
- Form,
- FormGroup,
- Label,
- Input,
- Button
-} from 'reactstrap';
-
-import Card from '../../components/Card';
-
-class Login extends Component {
- constructor(props) {
- super(props);
-
- this.state = {
- email: '',
- password: '',
- err: ''
- };
-
- this.handleInputChange = this.handleInputChange.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- }
-
- componentDidMount() {
-
- }
-
- handleInputChange(event) {
- const target = event.target;
- const name = target.name;
- const value = target.type === 'checkbox' ? target.checked : target.value;
-
- this.setState({
- [name]: value
- });
- }
-
- handleSubmit(event) {
- event.preventDefault();
- }
-
- render() {
-
- if (this.state.err) {
- return (
-
- {this.state.err}
-
- );
- }
-
- return (
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Login;
\ No newline at end of file
diff --git a/src/containers/Administration/Login.js b/src/containers/Administration/Login.js
new file mode 100644
index 0000000..7beaa03
--- /dev/null
+++ b/src/containers/Administration/Login.js
@@ -0,0 +1,106 @@
+import React, { Component } from 'react';
+import {
+ Row,
+ Col,
+ Form,
+ FormGroup,
+ Label,
+ Input,
+ Button
+} from 'reactstrap';
+
+import Card from '../../components/Card';
+
+class Login extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ email: '',
+ password: '',
+ err: ''
+ };
+
+ this.handleInputChange = this.handleInputChange.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleInputChange(event) {
+ const target = event.target;
+ const name = target.name;
+ const value = target.type === 'checkbox' ? target.checked : target.value;
+
+ this.setState({
+ [name]: value
+ });
+ }
+
+ handleSubmit(event) {
+ event.preventDefault();
+ }
+
+ render() {
+
+ if (this.state.err) {
+ return (
+
+ {this.state.err}
+
+ );
+ }
+
+ return (
+
+
+
+
+
+
+
+ );
+ }
+}
+
+export default Login;
\ No newline at end of file
diff --git a/src/containers/OpenTicket/OpenTicket.js b/src/containers/CreateTicket/CreateTicket.js
similarity index 87%
rename from src/containers/OpenTicket/OpenTicket.js
rename to src/containers/CreateTicket/CreateTicket.js
index 7c68bcd..6f5367c 100644
--- a/src/containers/OpenTicket/OpenTicket.js
+++ b/src/containers/CreateTicket/CreateTicket.js
@@ -12,7 +12,8 @@ import {
import Card from '../../components/Card';
import DropDown from '../../components/DropDown';
-class OpenTicket extends Component {
+
+class CreateTicket extends Component {
constructor(props) {
super(props);
@@ -32,14 +33,13 @@ class OpenTicket extends Component {
this.handleSubmit = this.handleSubmit.bind(this);
}
+
componentDidMount() {
- fetch("http://localhost:3001/categories", {
+ fetch("http://localhost:3001/categories?type=ticketType", {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
- .then((res) => {
- return res.json();
- })
+ .then(res => res.json())
.then((json) => {
this.setState({
categories: json
@@ -47,11 +47,12 @@ class OpenTicket extends Component {
})
.catch((err) => {
this.setState({
- ticketErr: err.message
+ error: err.message
});
});
}
+
handleInputChange(event) {
const target = event.target;
const name = target.name;
@@ -62,16 +63,16 @@ class OpenTicket extends Component {
});
}
+
handleSubmit(event) {
event.preventDefault();
- const { ticketId, ticketErr, ...rest } = this.state;
+ const { ticketId, error, categories, ...rest } = this.state;
if (!rest.firstName || !rest.lastName || !rest.email || !rest.message
|| rest.type === '---' || !rest.subject) {
alert('Form is invalid');
return;
-
}
fetch("http://localhost:3001/tickets", {
@@ -79,9 +80,7 @@ class OpenTicket extends Component {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(rest)
})
- .then((res) => {
- return res.json();
- })
+ .then(res => res.json())
.then((json) => {
this.setState({
ticketId: json.id
@@ -89,34 +88,32 @@ class OpenTicket extends Component {
})
.catch((err) => {
this.setState({
- ticketErr: err.message
+ error: err.message
});
});
}
+
render() {
-
-
-
if (this.state.ticketId) {
return (
- {`Ticket ID: ${this.state.ticketId}`}
+
+ {`Ticket ID: ${this.state.ticketId}`}
+
);
- } else if (this.state.ticketErr) {
+ } else if (this.state.error) {
return (
- {this.state.ticketErr}
+ {this.state.error}
);
}
-
return (