This commit is contained in:
Yuri Kuznetsov
2023-06-14 23:35:37 +03:00
parent dcad84aeff
commit 535baff2aa
2 changed files with 4 additions and 160 deletions
-91
View File
@@ -44,97 +44,6 @@ class ActionHandler {
*/
this.view = view;
}
/**
* @deprecated Use `this.view`.
*/
getConfig() {
return this.view.getConfig();
}
/**
* @deprecated Use `this.view`.
*/
getMetadata() {
return this.view.getMetadata();
}
/**
* @deprecated Use `this.view`.
*/
getAcl() {
return this.view.getAcl();
}
/**
* @deprecated Use `this.view`.
*/
getUser() {
return this.view.getUser();
}
/**
* @deprecated Use `this.view`.
*/
getRouter() {
return this.view.getRouter();
}
/**
* @deprecated Use `this.view`.
*/
getHelper() {
return this.view.getHelper();
}
/**
* @deprecated Use `this.view`.
*/
getLanguage() {
return this.view.getLanguage();
}
/**
* @deprecated Use `this.view`.
*/
getModelFactory() {
return this.view.getModelFactory();
}
/**
* @deprecated Use `this.view`.
*/
getCollectionFactory() {
return this.view.getCollectionFactory();
}
/**
* @deprecated Use `Espo.Ajax`.
*/
ajaxPostRequest() {
return Espo.Ajax.postRequest.apply(this.view, arguments);
}
/**
* @deprecated Use `Espo.Ajax`.
*/
ajaxPutRequest() {
return Espo.Ajax.putRequest.apply(this.view, arguments);
}
/**
* @deprecated Use `Espo.Ajax`.
*/
ajaxGetRequest() {
return Espo.Ajax.getRequest.apply(this.view, arguments);
}
/**
* @deprecated Use `this.view`.
*/
confirm() {
return this.view.confirm.apply(this.view, arguments);
}
}
ActionHandler.extend = BullView.extend;
+4 -69
View File
@@ -113,7 +113,7 @@ class View extends BullView {
timeout = timeout || 2000;
if (!type) {
timeout = null;
timeout = void 0;
}
let text = this.getLanguage().translate(label, 'labels', scope);
@@ -333,17 +333,7 @@ class View extends BullView {
* @returns {Promise<any>}
*/
ajaxRequest(url, type, data, options) {
options = options || {};
options.type = type;
options.url = url;
options.context = this;
if (data) {
options.data = data;
}
return $.ajax(options);
return Espo.Ajax.request(url, type, data, options);
}
/**
@@ -356,45 +346,7 @@ class View extends BullView {
* @returns {Promise<any>}
*/
ajaxPostRequest(url, data, options) {
if (data) {
data = JSON.stringify(data);
}
return this.ajaxRequest(url, 'POST', data, options);
}
/**
* PATCH request.
*
* @deprecated Use `Espo.Ajax.patchRequest`.
* @param {string} url An URL.
* @param {any} [data] Data.
* @param {Object} [options] Options.
* @returns {Promise<any>}
*/
ajaxPatchRequest(url, data, options) {
if (data) {
data = JSON.stringify(data);
}
return this.ajaxRequest(url, 'PATCH', data, options);
}
/**
* PUT request.
*
* @deprecated Use `Espo.Ajax.putRequest`.
* @param {string} url An URL.
* @param {any} [data] Data.
* @param {Object} [options] Options.
* @returns {Promise<any>}
*/
ajaxPutRequest(url, data, options) {
if (data) {
data = JSON.stringify(data);
}
return this.ajaxRequest(url, 'PUT', data, options);
return Espo.Ajax.postRequest(url, data, options);
}
/**
@@ -407,24 +359,7 @@ class View extends BullView {
* @returns {Promise<any>}
*/
ajaxGetRequest(url, data, options) {
return this.ajaxRequest(url, 'GET', data, options);
}
/**
* DELETE request.
*
* @deprecated Use `Espo.Ajax.deleteRequest`.
* @param {string} url An URL.
* @param {any} [data] Data.
* @param {Object} [options] Options.
* @returns {Promise<any>}
*/
ajaxDeleteRequest(url, data, options) {
if (data) {
data = JSON.stringify(data);
}
return this.ajaxRequest(url, 'DELETE', data, options);
return Espo.Ajax.getRequest(url, data, options);
}
/**