Manually process layer

This commit is contained in:
Michał Zieliński
2024-03-06 16:48:11 +01:00
parent 7d022e98c6
commit 7dbc81a3df
4 changed files with 230 additions and 136 deletions

View File

@@ -131,4 +131,15 @@ export class Layer extends Base {
})
})
}
static processLayer(id: string, _http: HttpClient): Promise<boolean> {
return new Promise((resolve, reject) => {
_http.get<boolean>(`${environment.api.url}/layers/processLayer/${id}`,
).subscribe({
next: (data) => {
resolve(data);
},
error: (e) => reject(e)
})
})
}
}

View File

@@ -9,6 +9,8 @@
[routerLink]="['/app/layers/Edit/', document.id, 'duplicate']">Duplicate</button>
<button mat-button *ngIf="document && document.type === LayerType.Administration"
[routerLink]="['/app/layers/Edit/', document.id]">Edit</button>
<button mat-button *ngIf="document && document.type === LayerType.Processed"
(click)="processLayer()">Process layer</button>
</mat-card-title>
<mat-card-subtitle>&nbsp;</mat-card-subtitle>
</mat-card-header>

View File

@@ -86,6 +86,14 @@ export class LayerDetailComponent implements OnInit {
}
}
processLayer() {
Layer.processLayer(this.document.id!, this.http$).then(() => {
this.notifications$.add({
text: "Layer processed",
});
});
}
async export() {
if (await Layer.exportToGoogleSheet(this.document.id || "", this.http$)) {
this.notifications$.add({