Skip to content

Commit 129e4b0

Browse files
committed
Fix dialog header text
1 parent 60464d3 commit 129e4b0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

frontend/src/app/questions/questions.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h3 class="m-0">Manage Questions</h3>
7878
<p-dialog header="Header" [(visible)]="isDialogVisible" [modal]="true" [style]="{ width: '25rem' }">
7979
<ng-template pTemplate="header">
8080
<div class="inline-flex align-items-center justify-content-center gap-2">
81-
<span class="font-bold white-space-nowrap"> Create new question </span>
81+
<span class="font-bold white-space-nowrap"> {{ dialogHeader }}</span>
8282
</div>
8383
</ng-template>
8484

frontend/src/app/questions/questions.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export class QuestionsComponent implements OnInit {
6767

6868
cols: Column[] = [];
6969

70+
dialogHeader = '';
71+
7072
constructor(
7173
private questionService: QuestionService,
7274
private messageService: MessageService,
@@ -83,8 +85,6 @@ export class QuestionsComponent implements OnInit {
8385
this.initDifficulties();
8486

8587
this.initFormGroup();
86-
87-
// this.initListeners();
8888
}
8989

9090
get isTitleInvalid(): boolean {
@@ -108,6 +108,7 @@ export class QuestionsComponent implements OnInit {
108108
}
109109

110110
openNewQuestion() {
111+
this.dialogHeader = 'Create new question';
111112
this.resetFormGroup();
112113
this.question = {} as Question;
113114
this.submitted = false;
@@ -154,6 +155,7 @@ export class QuestionsComponent implements OnInit {
154155
}
155156

156157
editQuestion(question: Question) {
158+
this.dialogHeader = 'Edit Question';
157159
this.question.id = question.id;
158160
this.questionFormGroup.patchValue({
159161
title: question.title,

0 commit comments

Comments
 (0)