From 54216709b2063e2d42b426fce1968d6cbd9d5672 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 10 Feb 2024 15:30:34 +0200 Subject: [PATCH] text field audited --- application/Espo/Tools/Stream/Service.php | 2 +- client/res/templates/stream/notes/update.tpl | 6 +++--- client/src/views/stream/notes/update.js | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/application/Espo/Tools/Stream/Service.php b/application/Espo/Tools/Stream/Service.php index dc5b62ffe2..d0fe96f29d 100644 --- a/application/Espo/Tools/Stream/Service.php +++ b/application/Espo/Tools/Stream/Service.php @@ -926,7 +926,7 @@ class Service if ( $fieldDefs && - in_array($fieldDefs->getType(), [FieldType::TEXT, FieldType::WYSIWYG]) + $fieldDefs->getType() == FieldType::WYSIWYG ) { continue; } diff --git a/client/res/templates/stream/notes/update.tpl b/client/res/templates/stream/notes/update.tpl index 7a1fc29ca5..34ca223093 100644 --- a/client/res/templates/stream/notes/update.tpl +++ b/client/res/templates/stream/notes/update.tpl @@ -21,11 +21,11 @@ {{#each fieldsArr}} - + - -
{{translate field category='fields' scope=../parentType}} + {{#unless noValues}} {{{var was ../this}}} {{/unless}} @@ -35,7 +35,7 @@ {{/unless}} + {{#unless noValues}} {{{var became ../this}}} {{/unless}} diff --git a/client/src/views/stream/notes/update.js b/client/src/views/stream/notes/update.js index c38d18e2d7..5a85ed6c19 100644 --- a/client/src/views/stream/notes/update.js +++ b/client/src/views/stream/notes/update.js @@ -69,7 +69,7 @@ class UpdateNoteStreamView extends NoteStreamView { this.fieldsArr = []; - const fields = data.fields; + const fields = this.fieldList = data.fields; fields.forEach(field => { const type = model.getFieldType(field) || 'base'; @@ -105,6 +105,7 @@ class UpdateNoteStreamView extends NoteStreamView { }, mode: 'detail', inlineEditDisabled: true, + selector: `.row[data-name="${field}"] .cell-was`, }); this.createView(field + 'Became', viewName, { @@ -115,6 +116,7 @@ class UpdateNoteStreamView extends NoteStreamView { }, mode: 'detail', inlineEditDisabled: true, + selector: `.row[data-name="${field}"] .cell-became`, }); this.fieldsArr.push({ @@ -136,6 +138,16 @@ class UpdateNoteStreamView extends NoteStreamView { if (this.$el.find('.details').hasClass('hidden')) { this.$el.find('.details').removeClass('hidden'); + this.fieldList.forEach(field => { + const wasField = this.getView(field + 'Was'); + const becomeField = this.getView(field + 'Became'); + + if (wasField && becomeField) { + wasField.trigger('panel-show-propagated'); + becomeField.trigger('panel-show-propagated'); + } + }); + $(target).find('span') .removeClass('fa-chevron-down') .addClass('fa-chevron-up');