Skip to content
Snippets Groups Projects
Commit 4bef8226 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #15029 TIME 2:00 remove check on header + added spinner when saving doc in admin

parent 2d47552d
No related branches found
No related tags found
No related merge requests found
......@@ -171,18 +171,6 @@ class CollaboraOnlineController
public function saveFile(Request $request, Response $response, array $args)
{
$headers = $request->getHeaders();
// Collabora online saves automatically every X seconds, but we do not want to save the document yet
if (empty($headers['HTTP_X_LOOL_WOPI_EXTENDEDDATA'][0])) {
return $response->withStatus(200);
}
$extendedData = $headers['HTTP_X_LOOL_WOPI_EXTENDEDDATA'][0];
$extendedData = explode('=', $extendedData);
if (empty($extendedData) || $extendedData[0] != 'FinalSave' || $extendedData[1] != 'True') {
return $response->withStatus(200);
}
$queryParams = $request->getQueryParams();
if (!Validator::stringType()->notEmpty()->validate($queryParams['access_token'])) {
......
<div class="mat-dialog-content-container">
<mat-dialog-content style="padding: 0px;">
<div class="example-loading-shade" *ngIf="loading">
<mat-spinner></mat-spinner>
</div>
<onlyoffice-viewer *ngIf="editorType === 'onlyoffice'" #onlyofficeViewer style="height:100%;width:100%;" [hideCloseEditor]="true"
[params]="editorOptions" [file]="file" [editMode]="true" (triggerAfterUpdatedDoc)="close()"
(triggerCloseEditor)="dialogRef.close('');" (triggerModifiedDocument)="documentIsModified = true"></onlyoffice-viewer>
......@@ -10,7 +13,7 @@
<span class="divider-modal"></span>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary"
(click)="close()" [disabled]="!documentIsModified">{{'lang.validate' | translate}}</button>
(click)="close()" [disabled]="!documentIsModified || loading">{{'lang.validate' | translate}}</button>
<button mat-raised-button mat-button [disabled]="loading" [mat-dialog-close]="">{{'lang.cancel' | translate}}</button>
</div>
</div>
......@@ -30,10 +30,12 @@ export class TemplateFileEditorModalComponent implements OnInit {
}
close() {
this.loading = true;
if (this.editorType === 'onlyoffice') {
this.onlyofficeViewer.getFile().pipe(
take(1),
tap((data: any) => {
this.loading = false;
this.dialogRef.close(data);
})
).subscribe();
......@@ -41,10 +43,12 @@ export class TemplateFileEditorModalComponent implements OnInit {
this.collaboraOnlineViewer.getFile().pipe(
take(1),
tap((data: any) => {
this.loading = false;
this.dialogRef.close(data);
})
).subscribe();
} else {
this.loading = false;
this.dialogRef.close();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment