mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	remove status widget
This commit is contained in:
		
							parent
							
								
									05d69c0882
								
							
						
					
					
						commit
						77b85b9e93
					
				@ -60,7 +60,6 @@ import { NgSelectModule } from '@ng-select/ng-select';
 | 
			
		||||
import { NumberComponent } from './components/common/input/number/number.component';
 | 
			
		||||
import { SafePipe } from './pipes/safe.pipe';
 | 
			
		||||
import { CustomDatePipe } from './pipes/custom-date.pipe';
 | 
			
		||||
import { ConsumerStatusWidgetComponent } from './components/dashboard/widgets/consumer-status-widget/consumer-status-widget.component';
 | 
			
		||||
 | 
			
		||||
import localeFr from '@angular/common/locales/fr';
 | 
			
		||||
import localeNl from '@angular/common/locales/nl';
 | 
			
		||||
@ -119,8 +118,7 @@ registerLocaleData(localeDe)
 | 
			
		||||
    SelectDialogComponent,
 | 
			
		||||
    NumberComponent,
 | 
			
		||||
    SafePipe,
 | 
			
		||||
    CustomDatePipe,
 | 
			
		||||
    ConsumerStatusWidgetComponent
 | 
			
		||||
    CustomDatePipe
 | 
			
		||||
  ],
 | 
			
		||||
  imports: [
 | 
			
		||||
    BrowserModule,
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,5 @@
 | 
			
		||||
 | 
			
		||||
    <app-upload-file-widget></app-upload-file-widget>
 | 
			
		||||
  
 | 
			
		||||
    <app-consumer-status-widget></app-consumer-status-widget>
 | 
			
		||||
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@ -1,12 +0,0 @@
 | 
			
		||||
<app-widget-frame title="Document consumer status">
 | 
			
		||||
  <ng-container content>
 | 
			
		||||
    <div class="mb-2 border-bottom" *ngFor="let s of getStatus()">
 | 
			
		||||
      <div class="mb-1"><strong>{{s.filename}}:</strong> {{s.message}}</div>
 | 
			
		||||
      <ngb-progressbar [type]="getType(s.status)" [value]="s.current_progress" [max]="s.max_progress" class="mb-2"></ngb-progressbar>
 | 
			
		||||
      <div *ngIf="isFinished(s)" class="mb-2">
 | 
			
		||||
        <button *ngIf="s.document_id" class="btn btn-sm btn-outline-primary mr-2" routerLink="/documents/{{s.document_id}}" (click)="dismiss(s)">Open document</button>
 | 
			
		||||
        <button class="btn btn-sm btn-outline-secondary" (click)="dismiss(s)">Dismiss</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </ng-container>
 | 
			
		||||
</app-widget-frame>
 | 
			
		||||
@ -1,25 +0,0 @@
 | 
			
		||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { ConsumerStatusWidgetComponent } from './consumer-status-widget.component';
 | 
			
		||||
 | 
			
		||||
describe('ConsumerStatusWidgetComponent', () => {
 | 
			
		||||
  let component: ConsumerStatusWidgetComponent;
 | 
			
		||||
  let fixture: ComponentFixture<ConsumerStatusWidgetComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ ConsumerStatusWidgetComponent ]
 | 
			
		||||
    })
 | 
			
		||||
    .compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(ConsumerStatusWidgetComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
@ -1,35 +0,0 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { ConsumerStatusService, FileStatus } from 'src/app/services/consumer-status.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-consumer-status-widget',
 | 
			
		||||
  templateUrl: './consumer-status-widget.component.html',
 | 
			
		||||
  styleUrls: ['./consumer-status-widget.component.scss']
 | 
			
		||||
})
 | 
			
		||||
export class ConsumerStatusWidgetComponent implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor(private consumerStatusService: ConsumerStatusService) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getStatus() {
 | 
			
		||||
    return this.consumerStatusService.consumerStatus
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  isFinished(status: FileStatus) {
 | 
			
		||||
    return status.status == "FAILED" || status.status == "SUCCESS"
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getType(status) {
 | 
			
		||||
    switch (status) {
 | 
			
		||||
      case "WORKING": return "primary"
 | 
			
		||||
      case "FAILED": return "danger"
 | 
			
		||||
      case "SUCCESS": return "success"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  dismiss(status: FileStatus) {
 | 
			
		||||
    this.consumerStatusService.dismiss(status)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user