notify fixes

This commit is contained in:
Yuri Kuznetsov
2023-05-06 09:32:39 +03:00
parent dd640c2fbe
commit 1adea79d23
22 changed files with 44 additions and 52 deletions
@@ -129,7 +129,6 @@
"Loading...": "Loading...",
"Uploading...": "Uploading...",
"Sending...": "Sending...",
"Merging...": "Merging...",
"Merged": "Merged",
"Removed": "Removed",
"Posted": "Posted",
@@ -143,15 +142,11 @@
"Record has been removed": "Record has been removed",
"Wrong username/password": "Wrong username/password",
"Post cannot be empty": "Post cannot be empty",
"Removing...": "Removing...",
"Unlinking...": "Unlinking...",
"Posting...": "Posting...",
"Username can not be empty!": "Username can not be empty!",
"Cache is not enabled": "Cache is not enabled",
"Cache has been cleared": "Cache has been cleared",
"Rebuild has been done": "Rebuild has been done",
"Return to Application": "Return to Application",
"Saving...": "Saving...",
"Modified": "Modified",
"Created": "Created",
"Create": "Create",
@@ -59,6 +59,7 @@
"Export": "Export"
},
"messages": {
"importRunning": "Import running...",
"noErrors": "No errors.",
"utf8": "Should be UTF-8 encoded",
"duplicatesRemoved": "Duplicates removed",
@@ -755,7 +755,7 @@ define('crm:views/calendar/calendar', ['view', 'lib!full-calendar'], function (D
this.handleAllDay(event, true);
this.fillColor(event);
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.getModelFactory().create(event.scope, (model) => {
model.id = event.recordId;
@@ -782,7 +782,7 @@ define('crm:views/calendar/calendar', ['view', 'lib!full-calendar'], function (D
this.fillColor(event);
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.getModelFactory().create(event.scope, (model) => {
model.id = event.recordId;
@@ -87,7 +87,7 @@ define('crm:views/call/record/list', ['views/record/list'], function (Dep) {
this.collection.fetch();
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
model.save();
},
@@ -62,7 +62,7 @@ define('crm:views/meeting/record/list', ['views/record/list'], function (Dep) {
this.collection.fetch();
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
model.save();
},
@@ -87,7 +87,7 @@ define('crm:views/meeting/record/list', ['views/record/list'], function (Dep) {
this.collection.fetch();
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
model.save();
},
@@ -52,7 +52,7 @@ define('crm:views/task/record/list', ['views/record/list'], function (Dep) {
this.collection.fetch();
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
model.save();
},
});
+1 -1
View File
@@ -185,7 +185,7 @@ define('views/admin/extensions/index', ['view'], function (Dep) {
},
run: function (id, version, name) {
this.notify('Please wait...');
Espo.Ui.notify(this.translate('pleaseWait', 'messages'));
this.showError(false);
this.showErrorNotification(false);
+1 -1
View File
@@ -693,7 +693,7 @@ define('views/admin/field-manager/edit', ['view', 'model'], function (Dep, Model
this.broadcastUpdate();
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
if (this.isNew) {
this.model
+1 -1
View File
@@ -95,7 +95,7 @@ define('views/admin/field-manager/list', ['view'], function (Dep) {
removeField: function (field) {
this.confirm(this.translate('confirmation', 'messages'), () => {
Espo.Ui.notify(this.translate('Removing...'));
Espo.Ui.notify(' ... ');
Espo.Ajax.request('Admin/fieldManager/' + this.scope + '/' + field, 'delete').then(() => {
Espo.Ui.success(this.translate('Removed'));
+2 -1
View File
@@ -188,7 +188,8 @@ define('views/admin/integrations/edit', ['view', 'model'], function (Dep, Model)
this.notify('Saved', 'success');
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.model.save();
},
});
+1 -1
View File
@@ -72,7 +72,7 @@ define('views/admin/layouts/base', ['view'], function (Dep) {
actionSave: function () {
this.disableButtons();
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.save(this.enableButtons.bind(this));
},
+2 -1
View File
@@ -145,7 +145,8 @@ define('views/admin/upgrade/index', ['view'], function (Dep) {
run: function (id, version) {
let msg = this.translate('Upgrading...', 'labels', 'Admin');
this.notify('Please wait...');
Espo.Ui.notify(this.translate('pleaseWait', 'messages'));
this.textNotification(msg);
Espo.Ajax
+5 -6
View File
@@ -187,17 +187,18 @@ define('views/dashlet', ['view'], function (Dep) {
name: this.name,
optionsData: this.getOptionsData(),
fields: this.getView('body').optionsFields,
}, (view) => {
}, view => {
view.render();
this.listenToOnce(view, 'save', (attributes) => {
let id = this.id;
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.getPreferences().once('sync', () => {
this.getPreferences().trigger('update');
this.notify(false);
Espo.Ui.notify(false);
view.close();
this.trigger('change');
@@ -207,9 +208,7 @@ define('views/dashlet', ['view'], function (Dep) {
o[id] = attributes;
this.getPreferences().save({
dashletsOptions: o
}, {patch: true});
this.getPreferences().save({dashletsOptions: o}, {patch: true});
});
});
},
+2 -1
View File
@@ -184,7 +184,8 @@ define('views/external-account/oauth2', ['view', 'model'], function (Dep, Model)
}
});
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.model.save();
},
+1 -1
View File
@@ -1187,7 +1187,7 @@ define('views/fields/base', ['view', 'ui/select'], function (Dep, /** module:ui/
return;
}
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
model
.save(attrs, {patch: true})
+1 -1
View File
@@ -270,7 +270,7 @@ define('views/modals/mass-update', ['views/modal', 'helpers/mass-action'], funct
return;
}
Espo.Ui.notify(this.translate('Saving...'));
Espo.Ui.notify(this.translate('saving', 'messages'));
Espo.Ajax
.postRequest('MassAction', {
+8 -10
View File
@@ -471,18 +471,16 @@ define('views/modals/related-list', ['views/modal', 'search-manager'], function
},
actionUnlinkRelated: function (data) {
var id = data.id;
let id = data.id;
this.confirm({
message: this.translate('unlinkRecordConfirmation', 'messages'),
confirmText: this.translate('Unlink'),
}, () => {
this.notify('Unlinking...');
Espo.Ui.notify(' ... ');
Espo.Ajax.deleteRequest(this.collection.url, {
id: id,
}).then(() => {
this.notify('Unlinked', 'success');
Espo.Ajax.deleteRequest(this.collection.url, {id: id}).then(() => {
Espo.Ui.success(this.translate('Unlinked'));
this.collection.fetch();
@@ -496,9 +494,9 @@ define('views/modals/related-list', ['views/modal', 'search-manager'], function
let actionName = this.defs.createAction || 'createRelated';
let methodName = 'action' + Espo.Utils.upperCaseFirst(actionName);
var p = this.getParentView();
let p = this.getParentView();
var view = null;
let view = null;
while (p) {
if (p[methodName]) {
@@ -520,9 +518,9 @@ define('views/modals/related-list', ['views/modal', 'search-manager'], function
let actionName = this.defs.selectAction || 'selectRelated';
let methodName = 'action' + Espo.Utils.upperCaseFirst(actionName);
var p = this.getParentView();
let p = this.getParentView();
var view = null;
let view = null;
while (p) {
if (p[methodName]) {
+5 -7
View File
@@ -908,10 +908,10 @@ function (Dep, ViewRecordHelper, DynamicLogic, _) {
*/
afterSave: function () {
if (this.isNew) {
this.notify('Created', 'success');
Espo.Ui.success(this.translate('Created'));
}
else {
this.notify('Saved', 'success');
Espo.Ui.success(this.translate('Saved'));
}
this.setIsNotChanged();
@@ -926,7 +926,7 @@ function (Dep, ViewRecordHelper, DynamicLogic, _) {
* Processed before save.
*/
beforeSave: function () {
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
},
/**
@@ -938,9 +938,7 @@ function (Dep, ViewRecordHelper, DynamicLogic, _) {
* Processed after save a not modified record.
*/
afterNotModified: function () {
let msg = this.translate('notModified', 'messages');
Espo.Ui.warning(msg);
Espo.Ui.warning(this.translate('notModified', 'messages'));
this.setIsNotChanged();
},
@@ -949,7 +947,7 @@ function (Dep, ViewRecordHelper, DynamicLogic, _) {
* Processed after save not valid.
*/
afterNotValid: function () {
this.notify('Not valid', 'error');
Espo.Ui.error(this.translate('Not valid'));
},
/**
+1 -1
View File
@@ -2441,7 +2441,7 @@ function (Dep, ViewRecordHelper, ActionItemSetup) {
},
beforeSave: function () {
this.notify('Saving...');
Espo.Ui.notify(this.translate('saving', 'messages'));
this.blockUpdateWebSocket();
},
+2 -2
View File
@@ -1381,7 +1381,7 @@ function (Dep, MassActionHelper, ExportHelper, RecordModal) {
message: this.translate('removeSelectedRecordsConfirmation', 'messages', this.scope),
confirmText: this.translate('Remove'),
}, () => {
Espo.Ui.notify(this.translate('Removing...'));
Espo.Ui.notify(' ... ');
let helper = new MassActionHelper(this);
let params = this.getMassActionSelectionPostData();
@@ -3146,7 +3146,7 @@ function (Dep, MassActionHelper, ExportHelper, RecordModal) {
this.collection.trigger('model-removing', id);
this.collection.remove(model);
this.notify('Removing...');
Espo.Ui.notify(' ... ');
model
.destroy({wait: true, fromList: true})
+3 -6
View File
@@ -116,7 +116,7 @@ define('views/record/merge', ['view'], function (Dep) {
});
});
this.notify('Merging...');
Espo.Ui.notify(' ... ');
let sourceIdList =
this.models
@@ -140,12 +140,9 @@ define('views/record/merge', ['view'], function (Dep) {
},
})
.then(() => {
this.notify('Merged', 'success');
Espo.Ui.success(this.translate('Merged'));
this.getRouter().navigate(
'#' + this.scope + '/view/' + model.id,
{trigger: true}
);
this.getRouter().navigate('#' + this.scope + '/view/' + model.id, {trigger: true});
if (this.collection) {
this.collection.fetch();
+1
View File
@@ -578,6 +578,7 @@ define('views/stream/panel', ['views/record/panels/relationship', 'lib!Textcompl
this.prepareNoteForPost(model);
this.notify('Posting...');
Espo.Ui.notify(this.translate('posting', 'messages'));
model.save(null)
.then(() => {