Manually process layer
This commit is contained in:
@@ -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)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -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> </mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user