mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	always show count badges
This commit is contained in:
		| @@ -21,7 +21,7 @@ | ||||
|       </div> | ||||
|       <div *ngIf="toggleableItems" class="items"> | ||||
|         <ng-container *ngFor="let toggleableItem of toggleableItems | filter: filterText"> | ||||
|           <app-toggleable-dropdown-button [toggleableItem]="toggleableItem" [showCounts]="showCounts" (toggle)="toggleItem($event)"></app-toggleable-dropdown-button> | ||||
|           <app-toggleable-dropdown-button [toggleableItem]="toggleableItem" (toggle)="toggleItem($event)"></app-toggleable-dropdown-button> | ||||
|         </ng-container> | ||||
|       </div> | ||||
|       <button *ngIf="type == types.Editing" class="list-group-item list-group-item-action bg-light" (click)="dropdown.close()" [disabled]="!hasBeenToggled || (toggleableItems | filter: filterText).length == 0"> | ||||
|   | ||||
| @@ -76,17 +76,6 @@ export class FilterableDropdownComponent { | ||||
|   @Output() | ||||
|   editingComplete = new EventEmitter() | ||||
|  | ||||
|   _showCounts: boolean = true | ||||
|  | ||||
|   @Input() | ||||
|   set showCounts(show: boolean) { | ||||
|     this._showCounts = show | ||||
|   } | ||||
|  | ||||
|   get showCounts(): boolean { | ||||
|     return this._showCounts && (this.type == FilterableDropdownType.Editing || (this.type == FilterableDropdownType.Filtering && this.itemsSelected.length == 0)) | ||||
|   } | ||||
|  | ||||
|   hasBeenToggled:boolean = false | ||||
|  | ||||
|   constructor(private filterPipe: FilterPipe) { } | ||||
|   | ||||
| @@ -8,5 +8,5 @@ | ||||
|     <app-tag *ngIf="isTag; else displayName" [tag]="toggleableItem?.item" [clickable]="true" linkTitle="Filter by tag"></app-tag> | ||||
|     <ng-template #displayName><small>{{toggleableItem?.item.name}}</small></ng-template> | ||||
|   </div> | ||||
|   <div *ngIf="showCounts" class="badge badge-light rounded-pill ml-auto mr-1">{{toggleableItem?.count}}</div> | ||||
|   <div class="badge badge-light rounded-pill ml-auto mr-1">{{toggleableItem?.count}}</div> | ||||
| </button> | ||||
|   | ||||
| @@ -23,9 +23,6 @@ export class ToggleableDropdownButtonComponent { | ||||
|   @Input() | ||||
|   toggleableItem: ToggleableItem | ||||
|  | ||||
|   @Input() | ||||
|   showCounts: boolean = true | ||||
|  | ||||
|   @Output() | ||||
|   toggle = new EventEmitter() | ||||
|  | ||||
|   | ||||
| @@ -32,21 +32,18 @@ | ||||
|       <app-filterable-dropdown class="mr-2 mr-md-3" title="Tags" icon="tag-fill" | ||||
|         [toggleableItems]="tagsToggleableItems" | ||||
|         [type]="dropdownTypes.Editing" | ||||
|         [showCounts]="!selectionSpansPages" | ||||
|         (open)="tagsDropdownOpen()" | ||||
|         (editingComplete)="setTags($event)"> | ||||
|       </app-filterable-dropdown> | ||||
|       <app-filterable-dropdown class="mr-2 mr-md-3" title="Correspondent" icon="person-fill" singular="true" | ||||
|         [toggleableItems]="correspondentsToggleableItems" | ||||
|         [type]="dropdownTypes.Editing" | ||||
|         [showCounts]="!selectionSpansPages" | ||||
|         (open)="correspondentsDropdownOpen()" | ||||
|         (editingComplete)="setCorrespondents($event)"> | ||||
|       </app-filterable-dropdown> | ||||
|       <app-filterable-dropdown class="mr-2 mr-md-3" title="Document Type" icon="file-earmark-fill" singular="true" | ||||
|         [toggleableItems]="documentTypesToggleableItems" | ||||
|         [type]="dropdownTypes.Editing" | ||||
|         [showCounts]="!selectionSpansPages" | ||||
|         (open)="documentTypesDropdownOpen()" | ||||
|         (editingComplete)="setDocumentTypes($event)"> | ||||
|       </app-filterable-dropdown> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler