EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Ref
Yurii17e8587ac0fa
diff --git a/client/src/ajax.ts b/client/src/ajax.tsindex 3c9d2ffdb5..76f711ad18 100644--- a/client/src/ajax.ts+++ b/client/src/ajax.ts@@ -343,10 +343,6 @@ const Ajax = {},};--/**- * @name module:ajax.Xhr- */class Xhr extends XMLHttpRequest {/*** To be set in an error handler to bypass default handling.diff --git a/client/src/router.js b/client/src/router.jsindex df25ed8896..88fa78b55d 100644--- a/client/src/router.js+++ b/client/src/router.js@@ -29,6 +29,7 @@import Backbone from 'backbone';import {Events} from 'bullbone';import _ from 'underscore';+import Ui from 'ui';/*** On route.@@ -421,7 +422,7 @@ export default class Router {this.confirmLeaveOutDisplayed = true;this.confirmLeaveOutCanceled = false;- Espo.Ui.confirm(+ Ui.confirm(this.confirmLeaveOutMessage,{confirmText: this.confirmLeaveOutConfirmText,diff --git a/client/src/ui.ts b/client/src/ui.tsindex 7a75cb956d..a4e87bd1f3 100644--- a/client/src/ui.ts+++ b/client/src/ui.ts@@ -566,7 +566,7 @@ class Dialog {.addClass('btn-group').addClass('additional-btn-group');- this.buttonList.forEach(/** module:ui.Dialog~Button */o => {+ this.buttonList.forEach(o => {const style = o.style || 'default';const $button =diff --git a/client/src/view.ts b/client/src/view.tsindex b1a4d2d755..287423a39a 100644--- a/client/src/view.ts+++ b/client/src/view.ts@@ -384,10 +384,10 @@ export default class View<S extends ViewSchema = ViewSchema> extends BullView<S[const confirmStyle = options.confirmStyle || null;const cancelText = options.cancelText || this.translate('Cancel');- return Espo.Ui.confirm(message, {+ return Ui.confirm(message, {confirmText: confirmText,cancelText: cancelText,- confirmStyle: confirmStyle,+ confirmStyle: confirmStyle ?? undefined,backdrop: ('backdrop' in o) ? o.backdrop : true,isHtml: true,cancelCallback: options.cancelCallback,diff --git a/client/src/views/fields/base.ts b/client/src/views/fields/base.tsindex 77fcdfd97e..f386f6af2f 100644--- a/client/src/views/fields/base.ts+++ b/client/src/views/fields/base.ts@@ -31,6 +31,7 @@import View from 'view';import Select from 'ui/select';import Model from 'model';+import Ui from 'ui';import _ from 'underscore';import JQuery from 'jquery'@@ -993,11 +994,11 @@ export default class BaseFieldView<tooltipText = this.getHelper().transformMarkdownText(tooltipText, {linksInNewTab: true}).toString();- Espo.Ui.popover($a, {+ Ui.popover($a.get(0) as Element, {placement: 'bottom',content: tooltipText,preventDestroyOnRender: true,- }, this);+ }, this as View);});}@@ -1257,7 +1258,7 @@ export default class BaseFieldView<const isInvalid = this.validateCallback ? this.validateCallback() : this.validate();if (isInvalid) {- Espo.Ui.error(this.translate('Not valid'));+ Ui.error(this.translate('Not valid'));// @todo Revise.model.setMultiple(prev, {silent: true});@@ -1265,7 +1266,7 @@ export default class BaseFieldView<return;}- Espo.Ui.notify(this.translate('saving', 'messages'));+ Ui.notify(this.translate('saving', 'messages'));model.save(attrs as Record<string, any>, {patch: true})@@ -1275,10 +1276,10 @@ export default class BaseFieldView<model.trigger('after:save');- Espo.Ui.success(this.translate('Saved'));+ Ui.success(this.translate('Saved'));}).catch(() => {- Espo.Ui.error(this.translate('Error occurred'));+ Ui.error(this.translate('Error occurred'));// @todo Revise.model.setMultiple(prev, {silent: true});@@ -1526,14 +1527,14 @@ export default class BaseFieldView<} catch (e) {}}- const popover = Espo.Ui.popover($el, {+ const popover = Ui.popover($el, {placement: 'bottom',container: 'body',content: this.getHelper().transformMarkdownText(message).toString(),trigger: 'manual',noToggleInit: true,noHideOnOutsideClick: true,- }, view || this);+ }, (view ?? this) as View);popover.show();diff --git a/client/src/views/fields/varchar.ts b/client/src/views/fields/varchar.tsindex c0badb4c7e..8491f25ef8 100644--- a/client/src/views/fields/varchar.ts+++ b/client/src/views/fields/varchar.ts@@ -33,6 +33,7 @@ import RegExpPattern from 'helpers/reg-exp-pattern';import Autocomplete from 'ui/autocomplete';import MultiSelect from 'ui/multi-select';import Ajax from 'ajax';+import Ui from 'ui';interface Params extends BaseParams {maxLength?: number;@@ -169,7 +170,7 @@ class VarcharFieldView<const value = this.model.get(this.name);navigator.clipboard.writeText(value).then(() => {- Espo.Ui.success(this.translate('Copied to clipboard'));+ Ui.success(this.translate('Copied to clipboard'));});}diff --git a/client/src/views/notification/fields/container.js b/client/src/views/notification/fields/container.jsindex 44d57cba4f..3b0f47cdd7 100644--- a/client/src/views/notification/fields/container.js+++ b/client/src/views/notification/fields/container.js@@ -30,6 +30,7 @@ import BaseFieldView from 'views/fields/base';import NotificationListRecordView from 'views/notification/record/list';import NotificationPanelView from 'views/notification/panel';import Ajax from 'ajax';+import Ui from 'ui';class NotificationContainerFieldView extends BaseFieldView {@@ -243,7 +244,7 @@ class NotificationContainerFieldView extends BaseFieldView {button.classList.add('disabled');}- Espo.Ui.notifyWait();+ Ui.notifyWait();try {await collection.fetch();@@ -253,7 +254,7 @@ class NotificationContainerFieldView extends BaseFieldView {return;}- Espo.Ui.notify();+ Ui.notify();this.isGroupExpanded = true;diff --git a/client/src/views/notification/list.js b/client/src/views/notification/list.jsindex 9d865b4cc1..9bc955902b 100644--- a/client/src/views/notification/list.js+++ b/client/src/views/notification/list.js@@ -27,6 +27,8 @@************************************************************************/import View from 'view';+import Ajax from 'ajax';+import Ui from 'ui';class NotificationListView extends View {@@ -48,7 +50,7 @@ class NotificationListView extends View {}actionRefresh() {- Espo.Ui.notifyWait();+ Ui.notifyWait();const $btn = this.$el.find('[data-action="refresh"]');$btn.addClass('disabled').attr('disabled', 'disabled');@@ -57,7 +59,7 @@ class NotificationListView extends View {this.getRecordView().showNewRecords().then(() => {- Espo.Ui.notify(false);+ Ui.notify(false);}).finally(() => $btn.removeClass('disabled').removeAttr('disabled'));}@@ -110,15 +112,15 @@ class NotificationListView extends View {}actionMarkAllRead() {- Espo.Ui.notifyWait();+ Ui.notifyWait();const $link = this.$el.find('[data-action="markAllNotificationsRead"]');$link.attr('disabled', 'disabled').addClass('disabled');- Espo.Ajax.postRequest('Notification/action/markAllRead')+ Ajax.postRequest('Notification/action/markAllRead').then(() => {this.trigger('all-read');- Espo.Ui.notify(false);+ Ui.notify(false);this.$el.find('.badge-circle-warning').remove();})