Skip to content

Commit e40f47f

Browse files
authored
Fix some bug (vmware-archive#409)
* The default label 'Reviewee' value * The default label 'Reviewee' value
1 parent 04f0dfd commit e40f47f

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

annotation-app/src/app/component/projects/annotate-progress-board/annotate-progress-board.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h5>Annotator Review Progress</h5>
4747
(change)="onSelectingReviewee($event)"
4848
[(ngModel)]="reviewee"
4949
>
50-
<option *ngFor="let item of msg?.projectInfo?.userCompleteCase" [value]="item.user">
50+
<option *ngFor="let item of optionList" [value]="item.user">
5151
{{ item.user }}
5252
</option>
5353
</select>

annotation-app/src/app/component/projects/annotate-progress-board/annotate-progress-board.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,21 @@ export class AnnotateProgressBoardComponent implements OnInit {
2525
reviewee: string;
2626
isAllowedAnnotate: boolean;
2727
user: any;
28+
optionList:[];
2829

2930
constructor(private userAuthService: UserAuthService) {
3031
this.user = this.userAuthService.loggedUser().user;
3132
}
3233

33-
ngOnInit(): void {}
34-
35-
ngOnChanges() {
34+
ngOnInit(): void {
3635
this.reviewOrder = this.msg.reviewOrder;
3736
this.reviewee = this.msg.reviewee;
3837
this.isAllowedAnnotate = this.msg.projectInfo.annotator.indexOf(this.user.email) > -1 ? true : false;
38+
this.optionList = this.msg?.projectInfo?.userCompleteCase;
3939
}
4040

41+
ngOnChanges() {}
42+
4143
historyBack(index, id) {
4244
let value = {
4345
index,

annotation-app/src/app/component/projects/create-project/create-project.component.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright 2019-2023 VMware, Inc.
33
SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { Component, OnInit, ViewChild } from '@angular/core';
6+
import { Component, OnInit, ViewChild,ChangeDetectorRef } from '@angular/core';
77
import { ApiService } from 'src/app/services/api.service';
88
import { DatasetData } from '../../../model/index';
99
import { FormGroup, FormBuilder } from '@angular/forms';
@@ -21,7 +21,6 @@ import { BehaviorSubject, Observable } from 'rxjs';
2121
import { ActivatedRoute, Router } from '@angular/router';
2222
import { UserAuthService } from 'src/app/services/user-auth.service';
2323
import { InternalApiService } from 'src/app/services/internal-api.service';
24-
2524
@Component({
2625
selector: 'app-create-project',
2726
templateUrl: './create-project.component.html',
@@ -86,6 +85,7 @@ export class CreateProjectComponent implements OnInit {
8685
private route: ActivatedRoute,
8786
private userAuthService: UserAuthService,
8887
private internalApiService: InternalApiService,
88+
private changeDetectorRef:ChangeDetectorRef
8989
) {
9090
this.user = this.userAuthService.loggedUser().user.email;
9191
}
@@ -206,33 +206,50 @@ export class CreateProjectComponent implements OnInit {
206206
this.dsDialogForm.get('selectedqueryStrategy').value &&
207207
this.dsDialogForm.get('selectedEncoder').value
208208
) {
209-
return (this.clrWizardPageNextDisabled.page6 = false);
209+
this.clrWizardPageNextDisabled.page6 = false
210+
this.updateView();
211+
return;
210212
} else {
211-
return (this.clrWizardPageNextDisabled.page6 = true);
213+
this.clrWizardPageNextDisabled.page6 = true;
214+
this.updateView();
215+
return;
212216
}
213217
}
214218
} else if (this.dsDialogForm.get('projectType').value == 'text') {
215219
if (this.dsDialogForm.get('multipleLabel').value == 'y') {
216-
return (this.clrWizardPageNextDisabled.page6 = false);
220+
this.clrWizardPageNextDisabled.page6 = false;
221+
this.updateView();
222+
return;
217223
} else {
218224
if (
219225
this.dsDialogForm.get('selectedClassifier').value &&
220226
this.dsDialogForm.get('selectedqueryStrategy').value
221227
) {
222-
return (this.clrWizardPageNextDisabled.page6 = false);
228+
this.clrWizardPageNextDisabled.page6 = false
229+
this.updateView()
230+
return;
223231
} else {
224-
return (this.clrWizardPageNextDisabled.page6 = true);
232+
this.clrWizardPageNextDisabled.page6 = true;
233+
this.updateView();
234+
return
225235
}
226236
}
227237
} else {
228238
this.clrWizardPageNextDisabled.page6 = false;
239+
this.updateView();
229240
}
230241
} else {
231-
return (this.clrWizardPageNextDisabled.page6 = false);
242+
this.clrWizardPageNextDisabled.page6 = false;
243+
this.updateView();
244+
return;
232245
}
233246
}
234247
}
235248

249+
updateView(){
250+
this.changeDetectorRef.markForCheck();
251+
this.changeDetectorRef.detectChanges();
252+
}
236253
changeEncoder() {
237254
this.clrWizardPageOnLoad('clr-wizard-page-6');
238255
}

0 commit comments

Comments
 (0)