Fix bug in assing ticket dropdown (#840)

* fix assing ticket dropdown bug in ticket viewer.

* add tabulations in render tag
This commit is contained in:
LautaroCesso 2020-07-16 19:11:07 -03:00 committed by GitHub
parent f8342ffa16
commit 507be7bff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 9 deletions

View File

@ -76,6 +76,7 @@ class TicketViewer extends React.Component {
render() {
const ticket = this.props.ticket;
return (
<div className="ticket-viewer">
{this.state.editTitle ? this.renderEditableTitle() : this.renderTitleHeader()}
@ -94,8 +95,7 @@ class TicketViewer extends React.Component {
file={ticket.file}
edit={this.state.edit && this.state.editId == 0}
onToggleEdit={this.onToggleEdit.bind(this, 0)}
allowAttachments={this.props.allowAttachments}
/>
allowAttachments={this.props.allowAttachments} />
</div>
<div className="ticket-viewer__comments">
{ticket.events && ticket.events.map(this.renderTicketEvent.bind(this))}
@ -267,8 +267,7 @@ class TicketViewer extends React.Component {
renderAssignStaffList() {
const items = this.getStaffAssignmentItems();
const ownerId = this.props.ticket.owner && this.props.ticket.owner.id;
const ownerId = this.props.ticket.owner && this.props.ticket.owner.id*1;
let selectedIndex = _.findIndex(items, {id: ownerId});
selectedIndex = (selectedIndex !== -1) ? selectedIndex : 0;
@ -662,7 +661,7 @@ class TicketViewer extends React.Component {
_.filter(staffMembers, ({id, departments}) => {
return (id != userId) && _.some(departments, {id: ticketDepartmentId});
}),
({id, name}) => ({content: name, id})
({id, name}) => ({content: name, id: id*1})
)
);
@ -675,8 +674,8 @@ class TicketViewer extends React.Component {
showDeleteButton() {
if(!this.props.ticket.owner) {
if(this.props.userLevel == 3) return true;
if(this.props.userId == this.props.ticket.author.id) {
if(this.props.userLevel === 3) return true;
if(this.props.userId == this.props.ticket.author.id*1) {
if((this.props.userStaff && this.props.ticket.author.staff) || (!this.props.userStaff && !this.props.ticket.author.staff)){
return true;
}

View File

@ -57,7 +57,14 @@ class AdminPanelCustomTags extends React.Component {
renderTag(tag, index) {
return (
<div key={index} className="admin-panel-custom-tags__tag-container" >
<Tag color={tag.color} name={tag.name} onEditClick={this.openEditTagModal.bind(this, tag.id, tag.name, tag.color)} onRemoveClick={this.onDeleteClick.bind(this, tag.id)} size='large' showEditButton showDeleteButton />
<Tag
color={tag.color}
name={tag.name}
onEditClick={this.openEditTagModal.bind(this, tag.id, tag.name, tag.color)}
onRemoveClick={this.onDeleteClick.bind(this, tag.id)}
size='large'
showEditButton
showDeleteButton />
</div>
)
}

View File

@ -142,7 +142,7 @@ export default connect((store) => {
return {
isLogged: store.session.logged,
config: store.config,
topics: store.articles.topics.map((topic) => {return {...topic, private: topic.private === "1" ? true : false}}),
topics: store.articles.topics.map((topic) => {return {...topic, private: topic.private === "1"}}),
loading: store.articles.loading
};
})(DashboardListArticlesPage);