mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	improved the logic of the "dismiss completed" button
This commit is contained in:
		| @@ -1,12 +1,12 @@ | |||||||
| <app-widget-frame title="Upload new documents" i18n-title [class.has-multiple-status]="(getStatus().length + getStatusesHidden().length)> 1"> | <app-widget-frame title="Upload new documents" i18n-title> | ||||||
|   <div header-buttons> |   <div header-buttons> | ||||||
|     <button type="button" class="btn btn-link dismiss-all" [disabled]="!getStatus().length" (click)="dismissAll()"> |     <a *ngIf="getStatusCompleted().length > 0" (click)="dismissAll()" [routerLink]="" > | ||||||
|       <small class="mr-1" i18n>Dismiss completed</small> |       <span i18n>Dismiss completed</span>  | ||||||
|       <svg xmlns="http://www.w3.org/2000/svg" width="1rem" height="1rem" fill="currentColor" class="bi bi-check2-all" viewBox="0 0 16 16"> |       <svg xmlns="http://www.w3.org/2000/svg" width="1rem" height="1rem" fill="currentColor" class="bi bi-check2-all" viewBox="0 0 16 16"> | ||||||
|         <path d="M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7l-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z"/> |         <path d="M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7l-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z"/> | ||||||
|         <path d="M5.354 7.146l.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z"/> |         <path d="M5.354 7.146l.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z"/> | ||||||
|       </svg> |       </svg> | ||||||
|     </button> |     </a> | ||||||
|   </div> |   </div> | ||||||
|   <div content> |   <div content> | ||||||
|     <form> |     <form> | ||||||
|   | |||||||
| @@ -23,15 +23,6 @@ form { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| .dismiss-all { |  | ||||||
|   transition: opacity 0.2s ease; |  | ||||||
|   opacity: 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .has-multiple-status .dismiss-all { |  | ||||||
|   opacity: 1; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| ::ng-deep .progress { | ::ng-deep .progress { | ||||||
|   position: absolute; |   position: absolute; | ||||||
|   top: 0; |   top: 0; | ||||||
|   | |||||||
| @@ -32,6 +32,9 @@ export class UploadFileWidgetComponent implements OnInit { | |||||||
|     return this.consumerStatusService.getConsumerStatus(FileStatusPhase.UPLOADING) |     return this.consumerStatusService.getConsumerStatus(FileStatusPhase.UPLOADING) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   getStatusCompleted() { | ||||||
|  |     return this.consumerStatusService.getConsumerStatusCompleted() | ||||||
|  |   } | ||||||
|   getTotalUploadProgress() { |   getTotalUploadProgress() { | ||||||
|     let current = 0 |     let current = 0 | ||||||
|     let max = 0 |     let max = 0 | ||||||
|   | |||||||
| @@ -97,6 +97,10 @@ export class ConsumerStatusService { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   getConsumerStatusCompleted() { | ||||||
|  |     return this.consumerStatus.filter(s => s.phase == FileStatusPhase.FAILED || s.phase == FileStatusPhase.SUCCESS) | ||||||
|  |   } | ||||||
|  |  | ||||||
|   connect() { |   connect() { | ||||||
|     this.disconnect() |     this.disconnect() | ||||||
|     this.statusWebSocked = new WebSocket("ws://localhost:8000/ws/status/"); |     this.statusWebSocked = new WebSocket("ws://localhost:8000/ws/status/"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler