Guillermo - Tooltip-ticket-number [skip ci]
This commit is contained in:
parent
bbfcda7522
commit
4006eb4799
|
@ -31,7 +31,7 @@ class TicketInfo extends React.Component {
|
|||
<span className="ticket-info__properties__label">
|
||||
Priority:
|
||||
</span>
|
||||
<span className="ticket-info__properties__badge-green">
|
||||
<span className={this.getPriorityClass()}>
|
||||
{this.props.ticket.priority}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -55,13 +55,23 @@ class TicketInfo extends React.Component {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
getStatusClass(){
|
||||
if(this.props.ticket.closed){
|
||||
return "ticket-info__properties__badge-red";
|
||||
}else{
|
||||
return "ticket-info__properties__badge-green";
|
||||
getStatusClass() {
|
||||
if(this.props.ticket.closed) {
|
||||
return 'ticket-info__properties__badge-red';
|
||||
} else {
|
||||
return 'ticket-info__properties__badge-green';
|
||||
}
|
||||
}
|
||||
|
||||
getPriorityClass() {
|
||||
let priorityClasses = {
|
||||
'low': 'ticket-info__properties__badge-green',
|
||||
'medium': 'ticket-info__properties__badge-blue',
|
||||
'high': 'ticket-info__properties__badge-red'
|
||||
};
|
||||
|
||||
return priorityClasses[this.props.ticket.priority];
|
||||
}
|
||||
}
|
||||
|
||||
export default TicketInfo;
|
|
@ -5,6 +5,7 @@ import i18n from 'lib-app/i18n';
|
|||
import Table from 'core-components/table';
|
||||
import Button from 'core-components/button';
|
||||
import Tooltip from 'core-components/tooltip';
|
||||
import TicketInfo from 'app-components/ticket-info';
|
||||
|
||||
class TicketList extends React.Component {
|
||||
static propTypes = {
|
||||
|
@ -97,7 +98,7 @@ class TicketList extends React.Component {
|
|||
|
||||
return {
|
||||
number: (
|
||||
<Tooltip content="hola">
|
||||
<Tooltip content={<TicketInfo ticket={ticket}/>} openOnHover>
|
||||
{'#' + ticket.ticketNumber}
|
||||
</Tooltip>
|
||||
),
|
||||
|
|
|
@ -5,7 +5,6 @@ import i18n from 'lib-app/i18n';
|
|||
|
||||
import Header from 'core-components/header';
|
||||
import TicketList from 'app-components/ticket-list';
|
||||
import TicketInfo from 'app-components/ticket-info';
|
||||
|
||||
class DashboardListTicketsPage extends React.Component {
|
||||
static propTypes = {
|
||||
|
|
|
@ -60,28 +60,29 @@ class Tooltip extends React.Component {
|
|||
let props = {};
|
||||
props.className= 'tooltip__children';
|
||||
|
||||
if (!this.props.openOnHover) {
|
||||
if(!this.props.openOnHover) {
|
||||
props.onClick= this.onClick.bind(this);
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
onMouseOver() {
|
||||
this.setState({
|
||||
show:true
|
||||
})
|
||||
show: true
|
||||
});
|
||||
}
|
||||
onMouseOut() {
|
||||
this.setState({
|
||||
show:false
|
||||
})
|
||||
show: false
|
||||
});
|
||||
}
|
||||
|
||||
onClick(){
|
||||
if (this.state.show) {
|
||||
this.setState({show : false});
|
||||
this.setState({show: false});
|
||||
} else {
|
||||
this.setState({show : true});
|
||||
this.setState({show: true});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
.tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
&__children{
|
||||
|
||||
&__children{
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
&__message{
|
||||
|
@ -17,6 +18,7 @@
|
|||
color: black;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
&__pointer{
|
||||
|
||||
border: solid transparent;
|
||||
|
|
Loading…
Reference in New Issue