Skip to content
Snippets Groups Projects
Verified Commit 83ed0850 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

alert if too much datas

parent d263ca58
No related branches found
No related tags found
No related merge requests found
......@@ -289,29 +289,34 @@ export class ExportComponent implements OnInit {
this.loadingExport = true;
this.http.put('../../rest/resourcesList/users/' + this.data.ownerId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/exports', this.exportModel, { responseType: "blob" })
.subscribe((data) => {
let downloadLink = document.createElement('a');
downloadLink.href = window.URL.createObjectURL(data);
let today: any;
let dd: any;
let mm: any;
let yyyy: any;
today = new Date();
dd = today.getDate();
mm = today.getMonth() + 1;
yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
if (data.type !== 'text/html') {
let downloadLink = document.createElement('a');
downloadLink.href = window.URL.createObjectURL(data);
let today: any;
let dd: any;
let mm: any;
let yyyy: any;
today = new Date();
dd = today.getDate();
mm = today.getMonth() + 1;
yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
}
today = dd + '-' + mm + '-' + yyyy;
downloadLink.setAttribute('download', "export_maarch_" + today + "." + this.exportModel.format.toLowerCase());
document.body.appendChild(downloadLink);
downloadLink.click();
this.exportModelList[this.exportModel.format.toLowerCase()].data = this.exportModel.data;
} else {
alert(this.lang.tooMuchDatas);
}
today = dd + '-' + mm + '-' + yyyy;
downloadLink.setAttribute('download', "export_maarch_" + today + "." + this.exportModel.format.toLowerCase());
document.body.appendChild(downloadLink);
downloadLink.click();
this.exportModelList[this.exportModel.format.toLowerCase()].data = this.exportModel.data;
this.loadingExport = false;
}, (err: any) => {
this.notify.handleErrors(err);
......
......@@ -141,29 +141,33 @@ export class SummarySheetComponent implements OnInit {
this.http.post('../../rest/resourcesList/users/' + this.data.ownerId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/summarySheets', { units: currElemData, resources: this.data.selectedRes }, { responseType: "blob" })
.subscribe((data) => {
let downloadLink = document.createElement('a');
downloadLink.href = window.URL.createObjectURL(data);
let today: any;
let dd: any;
let mm: any;
let yyyy: any;
today = new Date();
dd = today.getDate();
mm = today.getMonth() + 1;
yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
if (data.type !== 'text/html') {
let downloadLink = document.createElement('a');
downloadLink.href = window.URL.createObjectURL(data);
let today: any;
let dd: any;
let mm: any;
let yyyy: any;
today = new Date();
dd = today.getDate();
mm = today.getMonth() + 1;
yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
}
today = dd + '-' + mm + '-' + yyyy;
downloadLink.setAttribute('download', this.lang.summarySheetsAlt + "_" + today + ".pdf");
document.body.appendChild(downloadLink);
downloadLink.click();
} else {
alert(this.lang.tooMuchDatas);
}
today = dd + '-' + mm + '-' + yyyy;
downloadLink.setAttribute('download', this.lang.summarySheetsAlt + "_" + today + ".pdf");
document.body.appendChild(downloadLink);
downloadLink.click();
this.loading = false;
}, (err: any) => {
......
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