This commit is contained in:
Yuri Kuznetsov
2024-08-08 19:59:49 +03:00
parent 62ae30aa8f
commit e7331efcbe
3 changed files with 85 additions and 86 deletions
@@ -26,48 +26,53 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/group-email-folder/record/list', ['views/record/list'], function (Dep) {
import ListRecordView from 'views/record/list';
return Dep.extend({
export default class extends ListRecordView {
rowActionsView: 'views/email-folder/record/row-actions/default',
rowActionsView = 'views/email-folder/record/row-actions/default'
actionMoveUp: function (data) {
let model = this.collection.get(data.id);
// noinspection JSUnusedGlobalSymbols
async actionMoveUp(data) {
const model = this.collection.get(data.id);
if (!model) {
return;
}
if (!model) {
return;
}
let index = this.collection.indexOf(model);
const index = this.collection.indexOf(model);
if (index === 0) {
return;
}
if (index === 0) {
return;
}
Espo.Ajax.postRequest('GroupEmailFolder/action/moveUp', {id: model.id})
.then(() => {
this.collection.fetch();
});
},
Espo.Ui.notify(' ... ');
actionMoveDown: function (data) {
let model = this.collection.get(data.id);
await Espo.Ajax.postRequest('GroupEmailFolder/action/moveUp', {id: model.id});
await this.collection.fetch();
if (!model) {
return;
}
Espo.Ui.notify(false);
}
let index = this.collection.indexOf(model);
// noinspection JSUnusedGlobalSymbols
async actionMoveDown(data) {
const model = this.collection.get(data.id);
if ((index === this.collection.length - 1) && (this.collection.length === this.collection.total)) {
return;
}
if (!model) {
return;
}
Espo.Ajax.postRequest('GroupEmailFolder/action/moveDown', {id: model.id})
.then(() => {
this.collection.fetch();
});
},
});
});
const index = this.collection.indexOf(model);
if ((index === this.collection.length - 1) && (this.collection.length === this.collection.total)) {
return;
}
Espo.Ui.notify(' ... ');
await Espo.Ajax.postRequest('GroupEmailFolder/action/moveDown', {id: model.id});
await this.collection.fetch();
Espo.Ui.notify(false);
}
}
@@ -26,36 +26,31 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email-folder/record/row-actions/default', ['views/record/row-actions/default'], function (Dep) {
import DefaultRowActionsView from 'views/record/row-actions/default';
return Dep.extend({
export default class extends DefaultRowActionsView {
setup: function () {
Dep.prototype.setup.call(this);
},
getActionList() {
const list = super.getActionList();
getActionList: function () {
var list = Dep.prototype.getActionList.call(this);
if (this.options.acl.edit) {
list.unshift({
action: 'moveDown',
label: 'Move Down',
data: {
id: this.model.id,
},
});
if (this.options.acl.edit) {
list.unshift({
action: 'moveDown',
label: 'Move Down',
data: {
id: this.model.id,
},
});
list.unshift({
action: 'moveUp',
label: 'Move Up',
data: {
id: this.model.id,
},
});
}
list.unshift({
action: 'moveUp',
label: 'Move Up',
data: {
id: this.model.id,
},
});
}
return list;
},
});
});
return list;
}
}
@@ -26,39 +26,38 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/import-error/fields/line-number', ['views/fields/int'], (Dep) => {
import IntFieldView from 'views/fields/int';
return Dep.extend({
export default class extends IntFieldView {
disableFormatting: true,
disableFormatting = true
data: function () {
let data = Dep.prototype.data.call(this);
data() {
const data = super.data();
data.valueIsSet = this.model.has(this.sourceName);
data.isNotEmpty = this.model.has(this.sourceName);
data.valueIsSet = this.model.has(this.sourceName);
data.isNotEmpty = this.model.has(this.sourceName);
return data;
},
return data;
}
setup: function () {
Dep.prototype.setup.call(this);
setup() {
super.setup();
this.sourceName = this.name === 'exportLineNumber' ?
'exportRowIndex' :
'rowIndex';
},
this.sourceName = this.name === 'exportLineNumber' ?
'exportRowIndex' :
'rowIndex';
}
getAttributeList: function () {
return [this.sourceName];
},
getAttributeList() {
return [this.sourceName];
}
getValueForDisplay: function () {
let value = this.model.get(this.sourceName);
getValueForDisplay() {
let value = this.model.get(this.sourceName);
value++;
value++;
return this.formatNumber(value);
},
});
});
return this.formatNumber(value);
}
}