Export DataSet to GoogleSheet

This commit is contained in:
2022-12-22 15:12:19 +01:00
parent c7b907da7c
commit f2d2d3f28b
8 changed files with 149 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { Component, ViewChild } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Router, ActivatedRoute } from '@angular/router';
@@ -32,7 +33,8 @@ export class DataSetDetailComponent {
private router$: Router,
private http$: HttpClient,
private route$: ActivatedRoute,
private auth$: AuthService
private auth$: AuthService,
private snackBar: MatSnackBar
) { }
async ngOnInit() {
@@ -50,4 +52,11 @@ export class DataSetDetailComponent {
trackByUid(index : number, item : DataRow) {
return item.id;
}
async export() {
if (await DataSet.exportToGoogleSheet(this.document.id || "", this.http$)) {
this.snackBar.open("Plik został zapisany na dysku Google", "OK");
} else {
this.snackBar.open("Zapis się nie udał.", "OK");
}
}
}