Skip to content

Commit

Permalink
Fix iqa comments (#30172)
Browse files Browse the repository at this point in the history
### 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 **
  • Loading branch information
oidacra authored Sep 27, 2024
1 parent daef808 commit 62799e6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@
}

<p-toast></p-toast>
<p-confirmDialog />
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
data-testId="language-selector" />
}
</div>

<p-confirmDialog />
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br> 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.<br> Are you sure you want to continue?

0 comments on commit 62799e6

Please sign in to comment.