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:
parent
f5c96f814a
commit
57434e2ef7
|
@ -432,14 +432,14 @@ class TicketViewer extends React.Component {
|
|||
let APICallPromise = new Promise(resolve => resolve());
|
||||
|
||||
if(owner) {
|
||||
APICallPromise.then(() => API.call({
|
||||
APICallPromise = APICallPromise.then(() => API.call({
|
||||
path: '/staff/un-assign-ticket',
|
||||
data: { ticketNumber }
|
||||
}));
|
||||
}
|
||||
|
||||
if(id !== 0) {
|
||||
APICallPromise.then(() => API.call({
|
||||
APICallPromise = APICallPromise.then(() => API.call({
|
||||
path: '/staff/assign-ticket',
|
||||
data: { ticketNumber, staffId: id }
|
||||
}));
|
||||
|
@ -483,7 +483,7 @@ class TicketViewer extends React.Component {
|
|||
}
|
||||
|
||||
reopenTicket() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/re-open',
|
||||
data: {
|
||||
ticketNumber: this.props.ticket.ticketNumber
|
||||
|
@ -492,7 +492,7 @@ class TicketViewer extends React.Component {
|
|||
}
|
||||
|
||||
closeTicket() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/close',
|
||||
data: {
|
||||
ticketNumber: this.props.ticket.ticketNumber
|
||||
|
@ -501,7 +501,7 @@ class TicketViewer extends React.Component {
|
|||
}
|
||||
|
||||
deleteTicket() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/delete',
|
||||
data: {
|
||||
ticketNumber: this.props.ticket.ticketNumber
|
||||
|
@ -513,7 +513,7 @@ class TicketViewer extends React.Component {
|
|||
}
|
||||
|
||||
changeDepartment(index) {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/change-department',
|
||||
data: {
|
||||
ticketNumber: this.props.ticket.ticketNumber,
|
||||
|
@ -529,7 +529,7 @@ class TicketViewer extends React.Component {
|
|||
'high'
|
||||
];
|
||||
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/change-priority',
|
||||
data: {
|
||||
ticketNumber: this.props.ticket.ticketNumber,
|
||||
|
|
|
@ -166,7 +166,7 @@ class TopicViewer extends React.Component {
|
|||
}
|
||||
|
||||
onDeleteClick() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/article/delete-topic',
|
||||
data: {
|
||||
topicId: this.props.id
|
||||
|
|
|
@ -153,7 +153,7 @@ class AdminPanelViewArticle extends React.Component {
|
|||
}
|
||||
|
||||
onArticleDeleted(article) {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/article/delete',
|
||||
data: {
|
||||
articleId: article.id
|
||||
|
|
|
@ -178,7 +178,7 @@ class AdminPanelAdvancedSettings extends React.Component {
|
|||
|
||||
onDeleteKeyClick() {
|
||||
AreYouSure.openModal(null, () => {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/delete-api-key',
|
||||
data: {
|
||||
name: this.state.APIKeys[this.state.selectedAPIKey].name
|
||||
|
@ -195,19 +195,19 @@ class AdminPanelAdvancedSettings extends React.Component {
|
|||
}
|
||||
|
||||
onCheckboxMandatoryLoginChange() {
|
||||
AreYouSure.openModal(null, this.onAreYouSureUserSystemOk.bind(this), 'secure');
|
||||
AreYouSure.openModal(null, this.onAreYouSureMandatoryLoginOk.bind(this), 'secure');
|
||||
}
|
||||
|
||||
onCheckboxRegistrationChange() {
|
||||
AreYouSure.openModal(null, this.onAreYouSureRegistrationOk.bind(this), 'secure');
|
||||
}
|
||||
|
||||
onAreYouSureUserSystemOk(password) {
|
||||
onAreYouSureMandatoryLoginOk(password) {
|
||||
const {
|
||||
config,
|
||||
dispatch
|
||||
} = this.props;
|
||||
API.call({
|
||||
return API.call({
|
||||
path: config['mandatory-login'] ? '/system/disable-mandatory-login' : '/system/enable-mandatory-login',
|
||||
data: {
|
||||
password: password
|
||||
|
@ -227,7 +227,7 @@ class AdminPanelAdvancedSettings extends React.Component {
|
|||
config,
|
||||
dispatch
|
||||
} = this.props;
|
||||
API.call({
|
||||
return API.call({
|
||||
path: config['registration'] ? '/system/disable-registration' : '/system/enable-registration',
|
||||
data: {
|
||||
password: password
|
||||
|
@ -247,7 +247,7 @@ class AdminPanelAdvancedSettings extends React.Component {
|
|||
}
|
||||
|
||||
onAreYouSureCSVOk(file, password) {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/csv-import',
|
||||
dataAsForm: true,
|
||||
data: {
|
||||
|
@ -290,7 +290,7 @@ class AdminPanelAdvancedSettings extends React.Component {
|
|||
}
|
||||
|
||||
onAreYouSureDeleteAllUsersOk(password) {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/delete-all-users',
|
||||
data: {
|
||||
password: password
|
||||
|
|
|
@ -80,7 +80,7 @@ class AdminPanelCustomTags extends React.Component {
|
|||
}
|
||||
|
||||
deleteCustomTag(tagId) {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/delete-tag',
|
||||
data: {
|
||||
tagId,
|
||||
|
|
|
@ -442,7 +442,7 @@ class AdminPanelEmailSettings extends React.Component {
|
|||
recoverEmailTemplate() {
|
||||
const {selectedIndex, language, templates} = this.state;
|
||||
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/recover-mail-template',
|
||||
data: {
|
||||
template: templates[selectedIndex],
|
||||
|
@ -458,7 +458,7 @@ class AdminPanelEmailSettings extends React.Component {
|
|||
loadingForm: true,
|
||||
});
|
||||
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/get-mail-template',
|
||||
data: {template: this.state.templates[index], language}
|
||||
}).then((result) => this.setState({
|
||||
|
|
|
@ -315,7 +315,7 @@ class AdminPanelDepartments extends React.Component {
|
|||
}
|
||||
|
||||
deleteDepartment() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/delete-department',
|
||||
data: {
|
||||
departmentId: this.getCurrentDepartment(this.props.departments).id,
|
||||
|
|
|
@ -325,7 +325,7 @@ class StaffEditor extends React.Component {
|
|||
}
|
||||
|
||||
onDeleteClick() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/staff/delete',
|
||||
data: {
|
||||
staffId: this.props.staffId
|
||||
|
|
|
@ -203,7 +203,7 @@ class AdminPanelCustomResponses extends React.Component {
|
|||
}
|
||||
|
||||
deleteCustomResponse() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/ticket/delete-custom-response',
|
||||
data: {
|
||||
id: this.props.items[this.state.selectedIndex].id
|
||||
|
|
|
@ -85,7 +85,7 @@ class AdminPanelCustomFields extends React.Component {
|
|||
}
|
||||
|
||||
deleteCustomField(id) {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/system/delete-custom-field',
|
||||
data: {id}
|
||||
})
|
||||
|
|
|
@ -145,7 +145,7 @@ class AdminPanelViewUser extends React.Component {
|
|||
}
|
||||
|
||||
disableUser() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: this.state.disabled ? '/user/enable' : '/user/disable',
|
||||
data: {
|
||||
userId: this.props.params.userId
|
||||
|
@ -154,7 +154,7 @@ class AdminPanelViewUser extends React.Component {
|
|||
}
|
||||
|
||||
deleteUser() {
|
||||
API.call({
|
||||
return API.call({
|
||||
path: '/user/delete',
|
||||
data: {
|
||||
userId: this.props.params.userId
|
||||
|
|
|
@ -157,7 +157,7 @@ class DashboardEditProfilePage extends React.Component {
|
|||
this.setState({
|
||||
loadingEmail: true
|
||||
});
|
||||
API.call({
|
||||
return API.call({
|
||||
path: "/user/edit-email",
|
||||
data: {
|
||||
newEmail: formState.newEmail
|
||||
|
@ -179,7 +179,7 @@ class DashboardEditProfilePage extends React.Component {
|
|||
this.setState({
|
||||
loadingPass: true
|
||||
});
|
||||
API.call({
|
||||
return API.call({
|
||||
path: "/user/edit-password",
|
||||
data: {
|
||||
oldPassword: formState.oldPassword,
|
||||
|
|
Loading…
Reference in New Issue