very crude implementation of dashboard views

This commit is contained in:
Jonas Winkler 2020-10-31 00:22:12 +01:00
parent a1c3645a4b
commit 69a62fbf64
3 changed files with 50 additions and 5 deletions

View File

@ -44,7 +44,7 @@
</ul>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted" *ngIf='viewConfigService.getSideBarConfigs().length > 0'>
<span>Saved filters</span>
<span>Saved views</span>
</h6>
<ul class="nav flex-column mb-2">
<li class="nav-item" *ngFor='let config of viewConfigService.getSideBarConfigs()'>

View File

@ -3,14 +3,33 @@
</app-page-header>
<p>... This space for rent</p>
<p>This page will provide more information in the future, such as access to recently scanned documents, etc.</p>
<div class='row'>
<div class="col-lg">
<h4>Statistics</h4>
<p>None yet.</p>
<ng-container *ngFor="let v of savedDashboardViews">
<h4>{{v.viewConfig.title}}</h4>
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">Document</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let doc of v.documents" routerLink="/documents/{{doc.id}}">
<td>{{ doc.title }}</td>
</tr>
</tbody>
</table>
</ng-container>
</div>
<div class="col-lg">
<h4>Statistics</h4>
<p>None yet.</p>
<h4>Upload new Document</h4>
<form>
<ngx-file-drop
@ -22,5 +41,18 @@
</ngx-file-drop>
</form>
<h5 class="mt-3">Document conumser status</h5>
<div class="card bg-light">
<div class="card-body">
<p class="card-text"><strong>Filename.pdf:</strong> OCR for ger...</p>
<p><ngb-progressbar type="info" [value]="50"></ngb-progressbar></p>
</div>
</div>
<div class="card bg-light">
<div class="card-body">
<p class="card-text"><strong>Filename2.pdf:</strong> FAILED: language ITA not found</p>
<p><ngb-progressbar type="danger" [value]="100"></ngb-progressbar></p>
</div>
</div>
</div>
</div>

View File

@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { FileSystemDirectoryEntry, FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop';
import { SavedViewConfig } from 'src/app/data/saved-view-config';
import { DocumentService } from 'src/app/services/rest/document.service';
import { SavedViewConfigService } from 'src/app/services/saved-view-config.service';
import { Toast, ToastService } from 'src/app/services/toast.service';
@Component({
@ -10,11 +12,22 @@ import { Toast, ToastService } from 'src/app/services/toast.service';
})
export class DashboardComponent implements OnInit {
constructor(private documentService: DocumentService, private toastService: ToastService) { }
constructor(private documentService: DocumentService, private toastService: ToastService,
public savedViewConfigService: SavedViewConfigService) { }
savedDashboardViews = []
ngOnInit(): void {
this.savedViewConfigService.getDashboardConfigs().forEach(config => {
this.documentService.list(1,10,config.sortField,config.sortDirection,config.filterRules).subscribe(result => {
this.savedDashboardViews.push({viewConfig: config, documents: result.results})
})
})
}
public fileOver(event){
console.log(event);
}