From 507be7bff2ceb0b809478278eec84cd53eb58d2a Mon Sep 17 00:00:00 2001
From: LautaroCesso <59095036+LautaroCesso@users.noreply.github.com>
Date: Thu, 16 Jul 2020 19:11:07 -0300
Subject: [PATCH] Fix bug in assing ticket dropdown (#840)
* fix assing ticket dropdown bug in ticket viewer.
* add tabulations in render tag
---
client/src/app-components/ticket-viewer.js | 13 ++++++-------
.../admin/panel/settings/admin-panel-custom-tags.js | 9 ++++++++-
.../dashboard-list-articles-page.js | 2 +-
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/client/src/app-components/ticket-viewer.js b/client/src/app-components/ticket-viewer.js
index 7638e7f0..8554ffeb 100644
--- a/client/src/app-components/ticket-viewer.js
+++ b/client/src/app-components/ticket-viewer.js
@@ -76,6 +76,7 @@ class TicketViewer extends React.Component {
render() {
const ticket = this.props.ticket;
+
return (
{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} />
{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;
}
diff --git a/client/src/app/admin/panel/settings/admin-panel-custom-tags.js b/client/src/app/admin/panel/settings/admin-panel-custom-tags.js
index 9f008fcb..69e84fad 100644
--- a/client/src/app/admin/panel/settings/admin-panel-custom-tags.js
+++ b/client/src/app/admin/panel/settings/admin-panel-custom-tags.js
@@ -57,7 +57,14 @@ class AdminPanelCustomTags extends React.Component {
renderTag(tag, index) {
return (
-
+
)
}
diff --git a/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js b/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js
index 052f30f5..6e3c8b34 100644
--- a/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js
+++ b/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js
@@ -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);