Export DataSet to GoogleSheet
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
<mat-card appearance="outlined">
|
||||
<mat-toolbar color="secondary">
|
||||
Szczegóły warstwy danych
|
||||
<span class="fill-to-right"></span>
|
||||
<button mat-button (click)="export()">Eksportuj do Google</button>
|
||||
</mat-toolbar>
|
||||
<mat-card-content>
|
||||
<mat-grid-list cols="2" rowHeight="90px">
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user