Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid menu closure when filtering labels #19561

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@
</button>
<clr-dropdown-menu
[hidden]="!selectedRow.length">
<div class="filter-grid" clrDropdownItem>
<div class="filter-grid">
<label class="dropdown-header">{{
'REPOSITORY.ADD_LABEL_TO_IMAGE'
| translate
}}</label>
<app-label-selector
[usedInDropdown]="true"
[width]="200"
[ownedLabels]="
selectedRow[0]?.labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,44 @@
(click)="goToLabelPage()">
{{ 'LABEL.NO_LABELS' | translate }}
</div>
<div [hidden]="!candidateLabels.length" class="has-label">
<button
type="button"
class="dropdown-item"
*ngFor="let label of candidateLabels"
(click)="selectLabel(label)">
<clr-icon
shape="check"
class="check-icon"
[style.visibility]="isSelect(label) ? 'visible' : 'hidden'">
</clr-icon>
<hbr-label-piece [label]="label" [labelWidth]="130">
</hbr-label-piece>
</button>
</div>
<ng-container *ngIf="usedInDropdown; else notUsedInDropdown">
<div [hidden]="!candidateLabels.length" class="has-label">
<button
clrDropdownItem
type="button"
class="dropdown-item"
*ngFor="let label of candidateLabels"
(click)="selectLabel(label)">
<clr-icon
shape="check"
class="check-icon"
[style.visibility]="
isSelect(label) ? 'visible' : 'hidden'
">
</clr-icon>
<hbr-label-piece [label]="label" [labelWidth]="130">
</hbr-label-piece>
</button>
</div>
</ng-container>
<ng-template #notUsedInDropdown>
<div [hidden]="!candidateLabels.length" class="has-label">
<button
type="button"
class="dropdown-item"
*ngFor="let label of candidateLabels"
(click)="selectLabel(label)">
<clr-icon
shape="check"
class="check-icon"
[style.visibility]="
isSelect(label) ? 'visible' : 'hidden'
">
</clr-icon>
<hbr-label-piece [label]="label" [labelWidth]="130">
</hbr-label-piece>
</button>
</div>
</ng-template>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const PAGE_SIZE: number = 50;
styleUrls: ['./label-selector.component.scss'],
})
export class LabelSelectorComponent implements OnInit, OnChanges, OnDestroy {
@Input()
usedInDropdown: boolean = false;
@Input()
ownedLabels: Label[] = [];
@Input()
Expand Down
Loading