diff --git a/src/app/components/shared/_dialogs/deep-ldialog/deep-ldialog.component.ts b/src/app/components/shared/_dialogs/deep-ldialog/deep-ldialog.component.ts index e04ccd81f274c38c49caf1a38ac2af383ee7e60f..2ccabc9798128b53f7e556277035ba5fbc1ceda0 100644 --- a/src/app/components/shared/_dialogs/deep-ldialog/deep-ldialog.component.ts +++ b/src/app/components/shared/_dialogs/deep-ldialog/deep-ldialog.component.ts @@ -86,7 +86,9 @@ export class DeepLDialogComponent implements OnInit, AfterViewInit { } openHelp() { - const ref = this.dialog.open(ExplanationDialogComponent); + const ref = this.dialog.open(ExplanationDialogComponent, { + autoFocus: false + }); ref.componentInstance.translateKey = 'explanation.deepl'; } diff --git a/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.html b/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.html index b5c9a25e25c32c1b2a02f48ebb6bee19b8bdc5d0..591921b2b7061cf427ab4a14d6e3e6498987b2cc 100644 --- a/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.html +++ b/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.html @@ -4,10 +4,13 @@ <mat-label>{{'quill.tooltip-label-' + data.type | translate}}</mat-label> <input type="text" matInput + autofocus placeholder="{{'quill.tooltip-placeholder-' + data.type | translate}}" [(ngModel)]="value"> </mat-form-field> - <app-custom-markdown [data]="getKatex()" *ngIf="data.type === 'formula'"> + <app-custom-markdown [data]="getKatex()" + *ngIf="data.type === 'formula'" + [katexOptions]="katexOptions"> </app-custom-markdown> </mat-dialog-content> <app-dialog-action-buttons diff --git a/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.ts b/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.ts index 24ab8e0bc532565af740e75f84f0711c61e13a42..208868b77ec9d1298c41f7c9cb7881c793dfaa7f 100644 --- a/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.ts +++ b/src/app/components/shared/_dialogs/quill-input-dialog/quill-input-dialog.component.ts @@ -1,6 +1,7 @@ import { Component, Inject, OnInit } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import Delta from 'quill-delta'; +import { KatexOptions } from 'ngx-markdown'; interface DialogData { type: string; @@ -17,7 +18,10 @@ interface DialogData { }) export class QuillInputDialogComponent implements OnInit { - value: string; + value = ''; + katexOptions: KatexOptions = { + throwOnError: false + }; constructor(@Inject(MAT_DIALOG_DATA) public data: DialogData, private dialogRef: MatDialogRef<QuillInputDialogComponent>) { @@ -38,7 +42,7 @@ export class QuillInputDialogComponent implements OnInit { } ngOnInit(): void { - this.value = this.data.meta; + this.value = this.data.meta || ''; } getKatex(): string { diff --git a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts index 390225ce22f092017684d5cb0c0b2228a80ee0fa..d7dfa2988693e9ac008aa98b0a5f6bc60e25f819 100644 --- a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts +++ b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts @@ -158,7 +158,9 @@ export class SpacyDialogComponent implements OnInit, AfterContentInit { } openHelp() { - const ref = this.dialog.open(ExplanationDialogComponent); + const ref = this.dialog.open(ExplanationDialogComponent, { + autoFocus: false + }); ref.componentInstance.translateKey = 'explanation.spacy'; } } diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss index 86c644ce629cd8a7704e986c99957c3071e622fb..d2d7016945f138f7beb5eee32166f0a01caa6b09 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss @@ -177,7 +177,12 @@ mat-dialog-content { .reset { margin: 25px auto auto auto; - background-color: var(--secondary); - color: black; + background-color: var(--primary); + color: var(--on-primary); width: 100%; + + &:focus { + background-color: var(--secondary); + color: var(--on-secondary); + } } diff --git a/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts b/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts index 1c0466365fab1d40bfb62c3c424dbbdf65891e23..b02423352836c29705e0318208e0fecb31dd6e81 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts +++ b/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts @@ -158,7 +158,9 @@ export class TopicCloudFilterComponent implements OnInit { } openHelp() { - const ref = this.dialog.open(ExplanationDialogComponent); + const ref = this.dialog.open(ExplanationDialogComponent, { + autoFocus: false + }); ref.componentInstance.translateKey = 'explanation.topic-cloud'; } diff --git a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts index 77b32abda5c7f29d5fa3b4d559e558e36d3ad61a..438c5192aaaa1846215b6f97d4861d048a3df251 100644 --- a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts +++ b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts @@ -1,6 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { Language } from '../../../../models/comment'; import { ProfanityFilterService } from '../../../../services/util/profanity-filter.service'; +import { ViewCommentDataComponent } from '../../view-comment-data/view-comment-data.component'; @Component({ selector: 'app-topic-dialog-comment', @@ -49,6 +50,7 @@ export class TopicDialogCommentComponent implements OnInit { if (!this.language) { return; } + this.question = ViewCommentDataComponent.getTextFromData(this.question); this.questionWithoutProfanity = this.profanityFilterService. filterProfanityWords(this.question, this.partialWords, this.languageSpecific, this.language); this.partsWithoutProfanity = this.splitQuestion(this.questionWithoutProfanity); diff --git a/src/app/components/shared/view-comment-data/view-comment-data.component.ts b/src/app/components/shared/view-comment-data/view-comment-data.component.ts index 1829bbc58530c787c34f63f1cfc999a5ce3aaff2..9098e0ddda94e15cc0826e0840e3ed7a7439c72d 100644 --- a/src/app/components/shared/view-comment-data/view-comment-data.component.ts +++ b/src/app/components/shared/view-comment-data/view-comment-data.component.ts @@ -285,7 +285,6 @@ export class ViewCommentDataComponent implements OnInit, AfterViewInit { if (!selection || !selection.length) { return; } - meta = quill.getText(selection.index, selection.length); } this.dialog.open(QuillInputDialogComponent, { width: '900px', diff --git a/src/app/components/shared/write-comment/write-comment.component.ts b/src/app/components/shared/write-comment/write-comment.component.ts index 5889eaef166febce44b0d4b72e7e4ea9e791167b..e0aaf9bd6535cf53598225584f45663d8f9b6507 100644 --- a/src/app/components/shared/write-comment/write-comment.component.ts +++ b/src/app/components/shared/write-comment/write-comment.component.ts @@ -206,7 +206,7 @@ export class WriteCommentComponent implements OnInit { result, onClose } - }); + }).afterClosed().subscribe(() => this.buildCreateCommentActionCallback()()); }, (_) => { this.isSpellchecking = false; onClose(body, text, this.commentData);