Skip to content

Commit

Permalink
fix artifact page bug (#19807)
Browse files Browse the repository at this point in the history
* fix artifact page bug

* update testcase
  • Loading branch information
ShengqiWang authored Jan 15, 2024
1 parent eb12541 commit 04a1403
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
(clickLabel)="selectValue($event)"
[scope]="'p'"
[projectId]="projectId"
[dropdownOpened]="dropdownOpened"
[width]="200"
[ownedLabels]="getSelectLabel()">
</app-label-selector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ describe('LabelSelectorComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
const checkIcon = fixture.nativeElement.querySelector('.check-icon');
expect(checkIcon.style.visibility).toEqual('visible');
expect(checkIcon.style.visibility).toEqual('hidden');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class LabelSelectorComponent implements OnInit, OnChanges, OnDestroy {
scope: string = GLOBAL; // 'g' for global and 'p' for project, default 'g'
@Input()
projectId: number; // if scope = 'p', projectId is required
@Input()
dropdownOpened: boolean; // parent component opened status
candidateLabels: Label[] = [];
searchValue: string;
loading: boolean = false;
Expand Down Expand Up @@ -159,7 +161,7 @@ export class LabelSelectorComponent implements OnInit, OnChanges, OnDestroy {
isSelect(label: Label): boolean {
if (this.ownedLabels?.length) {
return this.ownedLabels.some(item => {
return item.id === label.id;
return item.id === label.id && this.dropdownOpened;
});
}
return false;
Expand Down

0 comments on commit 04a1403

Please sign in to comment.