mirror of
https://github.com/goharbor/harbor
synced 2025-05-21 16:40:10 +00:00
fix artifact page bug (#19807)
* fix artifact page bug * update testcase
This commit is contained in:
parent
eb125419cc
commit
04a140332e
@ -83,6 +83,7 @@
|
||||
(clickLabel)="selectValue($event)"
|
||||
[scope]="'p'"
|
||||
[projectId]="projectId"
|
||||
[dropdownOpened]="dropdownOpened"
|
||||
[width]="200"
|
||||
[ownedLabels]="getSelectLabel()">
|
||||
</app-label-selector>
|
||||
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
@ -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;
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user