From 62799e679592ad6a9f52e9eabcacba48da6732ab Mon Sep 17 00:00:00 2001 From: Arcadio Quintero Date: Fri, 27 Sep 2024 11:24:33 -0400 Subject: [PATCH] Fix iqa comments (#30172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Proposed Changes * When you have multiple Wysiwyg fields and switch between Wysiwyg and Code, the popup is displayed three times, one for each of the fields instead only for the field being modified ✅ * We should not show the popup when switching from Wysiwyg to Code but only from Code to Wysiwyg. ✅ * Remove the "HTML" word from the message in the popup ✅ ### Checklist - [ ] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info ** any additional useful context or info ** ### Screenshots Original | Updated :-------------------------:|:-------------------------: ** original screenshot ** | ** updated screenshot ** --- .../feature/edit-content/edit-content.layout.component.html | 1 + .../lib/feature/edit-content/edit-content.layout.component.ts | 4 +++- .../dot-edit-content-wysiwyg-field.component.html | 2 -- .../dot-edit-content-wysiwyg-field.component.ts | 2 +- dotCMS/src/main/webapp/WEB-INF/messages/Language.properties | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.html b/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.html index e998384ef2d8..aa7bdf2acb49 100644 --- a/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.html +++ b/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.html @@ -78,3 +78,4 @@ } + diff --git a/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.ts b/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.ts index a409da6506b9..86b4498675a0 100644 --- a/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.ts +++ b/core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.ts @@ -14,6 +14,7 @@ import { ActivatedRoute, RouterLink } from '@angular/router'; import { MessageService } from 'primeng/api'; import { ButtonModule } from 'primeng/button'; +import { ConfirmDialogModule } from 'primeng/confirmdialog'; import { MessagesModule } from 'primeng/messages'; import { ToastModule } from 'primeng/toast'; @@ -47,7 +48,8 @@ import { DotEditContentService } from '../../services/dot-edit-content.service'; RouterLink, DotEditContentFormComponent, DotEditContentAsideComponent, - DotEditContentToolbarComponent + DotEditContentToolbarComponent, + ConfirmDialogModule ], templateUrl: './edit-content.layout.component.html', styleUrls: ['./edit-content.layout.component.scss'], diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.html b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.html index b4c12628f220..d507855f5c11 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.html +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.html @@ -21,5 +21,3 @@ data-testId="language-selector" /> } - - diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.ts index 0e3f9266ba0e..f9f17eeabb87 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/dot-edit-content-wysiwyg-field.component.ts @@ -184,7 +184,7 @@ export class DotEditContentWYSIWYGFieldComponent implements AfterViewInit { const currentDisplayedEditor = this.$displayedEditor(); const content = this.$fieldContent(); - if (content.length > 0) { + if (content.length > 0 && this.$displayedEditor() !== AvailableEditor.TinyMCE) { this.#confirmationService.confirm({ header: this.#dotMessageService.get( 'edit.content.wysiwyg.confirm.switch-editor.header' diff --git a/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties b/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties index 536ace0f3fcb..7e0e51171d0c 100644 --- a/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties +++ b/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties @@ -5797,4 +5797,4 @@ edit.content.category-field.search.empty.title=There are no categories yet edit.content.category-field.search.empty.legend=To create a new category, navigate to: Content model > Categories > Click the "+" Plus Button > Add. edit.content.wysiwyg.confirm.switch-editor.header=Confirm View Change -edit.content.wysiwyg.confirm.switch-editor.message=Switching to the WYSIWYG view may change your HTML code and cause code loss.
Are you sure you want to continue? +edit.content.wysiwyg.confirm.switch-editor.message=Switching to the WYSIWYG view may change your code and cause code loss.
Are you sure you want to continue?