mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-29 15:36:07 +00:00
hide complex modified field if not modified
This commit is contained in:
@@ -98,9 +98,10 @@ class DefaultSidePanelView extends SidePanelView {
|
||||
baseName: 'modified',
|
||||
},
|
||||
});
|
||||
}
|
||||
if (!this.model.get('modifiedById') && !this.model.get('modifiedAt')) {
|
||||
this.recordViewObject.hideField('complexModified');
|
||||
|
||||
if (!this.isModifiedVisible()) {
|
||||
this.recordViewObject.hideField('complexModified');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.recordViewObject.hideField('complexModified');
|
||||
@@ -126,7 +127,7 @@ class DefaultSidePanelView extends SidePanelView {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.model.get('modifiedById') && !this.model.get('modifiedAt')) {
|
||||
if (!this.isModifiedVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -152,6 +153,26 @@ class DefaultSidePanelView extends SidePanelView {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @return {boolean}
|
||||
*/
|
||||
isModifiedVisible() {
|
||||
if (!this.hasComplexModified) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.model.get('modifiedById') && !this.model.get('modifiedAt')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.model.get('modifiedById') && this.model.get('modifiedAt') === this.model.get('createdAt')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
controlFollowersField() {
|
||||
if (this.model.get('followersIds') && this.model.get('followersIds').length) {
|
||||
this.recordViewObject.showField('followers');
|
||||
|
||||
@@ -151,6 +151,7 @@ class SidePanelView extends View {
|
||||
this.readOnly = this.readOnly || this.options.readOnly;
|
||||
this.inlineEditDisabled = this.inlineEditDisabled || this.options.inlineEditDisabled;
|
||||
|
||||
/** @type {import('views/record/base').default} */
|
||||
this.recordViewObject = this.options.recordViewObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user