Fix loading in AreYouSure component. (#826)

* Fix loading in AreYouSure component.

* Fix are you sure loading in some panels and components.

* Delete ticket admin panel custom tags.
This commit is contained in:
LautaroCesso 2020-07-06 12:16:44 -03:00 committed by GitHub
parent f5c96f814a
commit 57434e2ef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 27 additions and 27 deletions

View File

@ -432,14 +432,14 @@ class TicketViewer extends React.Component {
let APICallPromise = new Promise(resolve => resolve()); let APICallPromise = new Promise(resolve => resolve());
if(owner) { if(owner) {
APICallPromise.then(() => API.call({ APICallPromise = APICallPromise.then(() => API.call({
path: '/staff/un-assign-ticket', path: '/staff/un-assign-ticket',
data: { ticketNumber } data: { ticketNumber }
})); }));
} }
if(id !== 0) { if(id !== 0) {
APICallPromise.then(() => API.call({ APICallPromise = APICallPromise.then(() => API.call({
path: '/staff/assign-ticket', path: '/staff/assign-ticket',
data: { ticketNumber, staffId: id } data: { ticketNumber, staffId: id }
})); }));
@ -483,7 +483,7 @@ class TicketViewer extends React.Component {
} }
reopenTicket() { reopenTicket() {
API.call({ return API.call({
path: '/ticket/re-open', path: '/ticket/re-open',
data: { data: {
ticketNumber: this.props.ticket.ticketNumber ticketNumber: this.props.ticket.ticketNumber
@ -492,7 +492,7 @@ class TicketViewer extends React.Component {
} }
closeTicket() { closeTicket() {
API.call({ return API.call({
path: '/ticket/close', path: '/ticket/close',
data: { data: {
ticketNumber: this.props.ticket.ticketNumber ticketNumber: this.props.ticket.ticketNumber
@ -501,7 +501,7 @@ class TicketViewer extends React.Component {
} }
deleteTicket() { deleteTicket() {
API.call({ return API.call({
path: '/ticket/delete', path: '/ticket/delete',
data: { data: {
ticketNumber: this.props.ticket.ticketNumber ticketNumber: this.props.ticket.ticketNumber
@ -513,7 +513,7 @@ class TicketViewer extends React.Component {
} }
changeDepartment(index) { changeDepartment(index) {
API.call({ return API.call({
path: '/ticket/change-department', path: '/ticket/change-department',
data: { data: {
ticketNumber: this.props.ticket.ticketNumber, ticketNumber: this.props.ticket.ticketNumber,
@ -529,7 +529,7 @@ class TicketViewer extends React.Component {
'high' 'high'
]; ];
API.call({ return API.call({
path: '/ticket/change-priority', path: '/ticket/change-priority',
data: { data: {
ticketNumber: this.props.ticket.ticketNumber, ticketNumber: this.props.ticket.ticketNumber,

View File

@ -166,7 +166,7 @@ class TopicViewer extends React.Component {
} }
onDeleteClick() { onDeleteClick() {
API.call({ return API.call({
path: '/article/delete-topic', path: '/article/delete-topic',
data: { data: {
topicId: this.props.id topicId: this.props.id

View File

@ -153,7 +153,7 @@ class AdminPanelViewArticle extends React.Component {
} }
onArticleDeleted(article) { onArticleDeleted(article) {
API.call({ return API.call({
path: '/article/delete', path: '/article/delete',
data: { data: {
articleId: article.id articleId: article.id

View File

@ -178,7 +178,7 @@ class AdminPanelAdvancedSettings extends React.Component {
onDeleteKeyClick() { onDeleteKeyClick() {
AreYouSure.openModal(null, () => { AreYouSure.openModal(null, () => {
API.call({ return API.call({
path: '/system/delete-api-key', path: '/system/delete-api-key',
data: { data: {
name: this.state.APIKeys[this.state.selectedAPIKey].name name: this.state.APIKeys[this.state.selectedAPIKey].name
@ -195,19 +195,19 @@ class AdminPanelAdvancedSettings extends React.Component {
} }
onCheckboxMandatoryLoginChange() { onCheckboxMandatoryLoginChange() {
AreYouSure.openModal(null, this.onAreYouSureUserSystemOk.bind(this), 'secure'); AreYouSure.openModal(null, this.onAreYouSureMandatoryLoginOk.bind(this), 'secure');
} }
onCheckboxRegistrationChange() { onCheckboxRegistrationChange() {
AreYouSure.openModal(null, this.onAreYouSureRegistrationOk.bind(this), 'secure'); AreYouSure.openModal(null, this.onAreYouSureRegistrationOk.bind(this), 'secure');
} }
onAreYouSureUserSystemOk(password) { onAreYouSureMandatoryLoginOk(password) {
const { const {
config, config,
dispatch dispatch
} = this.props; } = this.props;
API.call({ return API.call({
path: config['mandatory-login'] ? '/system/disable-mandatory-login' : '/system/enable-mandatory-login', path: config['mandatory-login'] ? '/system/disable-mandatory-login' : '/system/enable-mandatory-login',
data: { data: {
password: password password: password
@ -227,7 +227,7 @@ class AdminPanelAdvancedSettings extends React.Component {
config, config,
dispatch dispatch
} = this.props; } = this.props;
API.call({ return API.call({
path: config['registration'] ? '/system/disable-registration' : '/system/enable-registration', path: config['registration'] ? '/system/disable-registration' : '/system/enable-registration',
data: { data: {
password: password password: password
@ -247,7 +247,7 @@ class AdminPanelAdvancedSettings extends React.Component {
} }
onAreYouSureCSVOk(file, password) { onAreYouSureCSVOk(file, password) {
API.call({ return API.call({
path: '/system/csv-import', path: '/system/csv-import',
dataAsForm: true, dataAsForm: true,
data: { data: {
@ -290,7 +290,7 @@ class AdminPanelAdvancedSettings extends React.Component {
} }
onAreYouSureDeleteAllUsersOk(password) { onAreYouSureDeleteAllUsersOk(password) {
API.call({ return API.call({
path: '/system/delete-all-users', path: '/system/delete-all-users',
data: { data: {
password: password password: password

View File

@ -80,7 +80,7 @@ class AdminPanelCustomTags extends React.Component {
} }
deleteCustomTag(tagId) { deleteCustomTag(tagId) {
API.call({ return API.call({
path: '/ticket/delete-tag', path: '/ticket/delete-tag',
data: { data: {
tagId, tagId,

View File

@ -442,7 +442,7 @@ class AdminPanelEmailSettings extends React.Component {
recoverEmailTemplate() { recoverEmailTemplate() {
const {selectedIndex, language, templates} = this.state; const {selectedIndex, language, templates} = this.state;
API.call({ return API.call({
path: '/system/recover-mail-template', path: '/system/recover-mail-template',
data: { data: {
template: templates[selectedIndex], template: templates[selectedIndex],
@ -458,7 +458,7 @@ class AdminPanelEmailSettings extends React.Component {
loadingForm: true, loadingForm: true,
}); });
API.call({ return API.call({
path: '/system/get-mail-template', path: '/system/get-mail-template',
data: {template: this.state.templates[index], language} data: {template: this.state.templates[index], language}
}).then((result) => this.setState({ }).then((result) => this.setState({

View File

@ -315,7 +315,7 @@ class AdminPanelDepartments extends React.Component {
} }
deleteDepartment() { deleteDepartment() {
API.call({ return API.call({
path: '/system/delete-department', path: '/system/delete-department',
data: { data: {
departmentId: this.getCurrentDepartment(this.props.departments).id, departmentId: this.getCurrentDepartment(this.props.departments).id,

View File

@ -325,7 +325,7 @@ class StaffEditor extends React.Component {
} }
onDeleteClick() { onDeleteClick() {
API.call({ return API.call({
path: '/staff/delete', path: '/staff/delete',
data: { data: {
staffId: this.props.staffId staffId: this.props.staffId

View File

@ -203,7 +203,7 @@ class AdminPanelCustomResponses extends React.Component {
} }
deleteCustomResponse() { deleteCustomResponse() {
API.call({ return API.call({
path: '/ticket/delete-custom-response', path: '/ticket/delete-custom-response',
data: { data: {
id: this.props.items[this.state.selectedIndex].id id: this.props.items[this.state.selectedIndex].id

View File

@ -85,7 +85,7 @@ class AdminPanelCustomFields extends React.Component {
} }
deleteCustomField(id) { deleteCustomField(id) {
API.call({ return API.call({
path: '/system/delete-custom-field', path: '/system/delete-custom-field',
data: {id} data: {id}
}) })

View File

@ -145,7 +145,7 @@ class AdminPanelViewUser extends React.Component {
} }
disableUser() { disableUser() {
API.call({ return API.call({
path: this.state.disabled ? '/user/enable' : '/user/disable', path: this.state.disabled ? '/user/enable' : '/user/disable',
data: { data: {
userId: this.props.params.userId userId: this.props.params.userId
@ -154,7 +154,7 @@ class AdminPanelViewUser extends React.Component {
} }
deleteUser() { deleteUser() {
API.call({ return API.call({
path: '/user/delete', path: '/user/delete',
data: { data: {
userId: this.props.params.userId userId: this.props.params.userId

View File

@ -157,7 +157,7 @@ class DashboardEditProfilePage extends React.Component {
this.setState({ this.setState({
loadingEmail: true loadingEmail: true
}); });
API.call({ return API.call({
path: "/user/edit-email", path: "/user/edit-email",
data: { data: {
newEmail: formState.newEmail newEmail: formState.newEmail
@ -179,7 +179,7 @@ class DashboardEditProfilePage extends React.Component {
this.setState({ this.setState({
loadingPass: true loadingPass: true
}); });
API.call({ return API.call({
path: "/user/edit-password", path: "/user/edit-password",
data: { data: {
oldPassword: formState.oldPassword, oldPassword: formState.oldPassword,