Skip to content

Commit 09309fd

Browse files
Ticket relations changed. Q Label added.
1 parent a5ff264 commit 09309fd

File tree

3 files changed

+77
-5
lines changed

3 files changed

+77
-5
lines changed

src/components/ticket/CategorizedTicketsList.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function createTicketLines(tickets) {
1111
name={ticket.name}
1212
description={ticket.description}
1313
url={ticket.url}
14-
customFields={ticket.customFields}
14+
relations={ticket.relations}
1515
/>;
1616
}) : <Alert variant={"light"} className={"h-10"}>
1717
The list is empty.
@@ -42,6 +42,7 @@ export class CategorizedTicketsList extends React.Component {
4242
}).then(response => {
4343
return response.data;
4444
}).then(ticketsInCategories => {
45+
console.log(ticketsInCategories)
4546
this.setState({
4647
formTickets: ticketsInCategories.formTickets,
4748
formVersionTickets: ticketsInCategories.formVersionTickets,
Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,77 @@
11
import React from "react";
2+
import ListGroup from "react-bootstrap/ListGroup";
3+
import Row from "react-bootstrap/Row";
4+
import Col from "react-bootstrap/Col";
5+
import Card from "react-bootstrap/Card";
6+
import Form from "react-bootstrap/Form";
7+
import ToggleButton from "react-bootstrap/ToggleButton";
28

39
export class CreateTicketForm extends React.Component {
410

11+
constructor() {
12+
super();
13+
this.state = {
14+
relateToForm: false,
15+
relateToFormVersion: false,
16+
relateToQuestion: false
17+
}
18+
}
19+
520
render() {
6-
return <div/>;
21+
22+
return <Card>
23+
<ListGroup variant="flush">
24+
<ListGroup.Item>
25+
<div>
26+
<Row>
27+
<Col>
28+
<div>
29+
<Form.Group controlId="ticketName">
30+
<Form.Label>Name</Form.Label>
31+
<Form.Control type="text" placeholder="ticket name"/>
32+
</Form.Group>
33+
<Form.Group controlId="ticketName">
34+
<Form.Label>Description</Form.Label>
35+
<Form.Control as="textarea"
36+
placeholder="ticket description"
37+
name="ticketDescription" rows={3}
38+
onChange={this.onChangeSetState}/>
39+
</Form.Group>
40+
<ToggleButton variant="light" style={{marginBottom: "0"}} type="checkbox"
41+
checked={this.state.relateToForm}
42+
value="1"
43+
onChange={e => this.setState({relateToForm: e.currentTarget.checked})}>
44+
{' '} Relate to form
45+
</ToggleButton>
46+
{' '}
47+
<ToggleButton variant="light" style={{marginBottom: "0"}} type="checkbox"
48+
checked={this.state.relateToFormVersion}
49+
value="1"
50+
onChange={e => this.setState({relateToFormVersion: e.currentTarget.checked})}>
51+
{' '} Relate to form version
52+
</ToggleButton>
53+
{' '}
54+
<ToggleButton variant="light" style={{marginBottom: "0"}} type="checkbox"
55+
checked={this.state.relateToQuestion}
56+
value="1"
57+
onChange={e => this.setState({relateToQuestion: e.currentTarget.checked})}>
58+
{' '} Relate to question (origin path)
59+
</ToggleButton>
60+
<br/>
61+
{/*<Form.Group controlId="questionOrigin">*/}
62+
{/* <Form.Label>Question-Origin</Form.Label>*/}
63+
{/* <Form.Control as="text"*/}
64+
{/* placeholder={"question origin path"}*/}
65+
{/* name="questionOriginPath" // TODO: DAG select*/}
66+
{/* onChange={this.onChangeSetState}/>*/}
67+
{/*</Form.Group>*/}
68+
</div>
69+
</Col>
70+
</Row>
71+
</div>
72+
</ListGroup.Item>
73+
</ListGroup>
74+
</Card>;
775
}
876

977
}

src/components/ticket/TicketLine.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Card from "react-bootstrap/Card";
77
export class TicketLine extends React.Component {
88

99
render() {
10+
11+
1012
return <Card>
1113
<ListGroup variant="flush">
1214
<ListGroup.Item>
@@ -21,12 +23,13 @@ export class TicketLine extends React.Component {
2123
<br/>
2224
<span>Link: <a href={this.props.url} target="_blank">link</a></span>
2325
<br/>
24-
<span>Form version identifier: <b>{this.props?.customFields["SpecificFormVersionKEY"]}</b></span>
26+
<span>Form version identifier: <b>{this.props.relations?.relatedForm}</b></span>
2527
<br/>
26-
<span>Form identifier: <b>{this.props?.customFields["SpecificFormCU"]}</b></span>
28+
<span>Form identifier: <b>{this.props.relations?.relatedFormVersion}</b></span>
2729
<br/>
28-
<span>Question: <b>{this.props?.customFields["SpecificQuestionQO"]}</b></span>
30+
<span>Question origin path: {this.props.relations?.relatedQuestionOriginPath}</span>
2931
<br/>
32+
<span>Question label: <b>{this.props.relations?.relatedQuestionLabel}</b></span>
3033

3134
</div>
3235
</Col>

0 commit comments

Comments
 (0)