Skip to content

Commit

Permalink
Merge pull request #57 from shikshalokam/SB-29619
Browse files Browse the repository at this point in the history
Sb 29619
  • Loading branch information
aks30 authored Apr 22, 2022
2 parents 1197783 + 5bfabbc commit 388e5cd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
42 changes: 28 additions & 14 deletions helper/common_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3585,6 +3585,13 @@ exports.improvementProjectPdfGeneration = async function (responseData) {
filename: 'index.html'
}
});

FormData.push({
value: fs.createReadStream(dir + '/style.css'),
options: {
filename: 'style.css'
}
});
optionsHtmlToPdf.formData.files = FormData;


Expand Down Expand Up @@ -3614,15 +3621,15 @@ exports.improvementProjectPdfGeneration = async function (responseData) {
let i = 0;
for (const file of files) {

// fs.unlink(path.join(imgPath, file), err => {
// if (err) throw err;
// });
fs.unlink(path.join(imgPath, file), err => {
if (err) throw err;
});

if (i == files.length) {
// fs.unlink('../../' + currentTempFolder, err => {
// if (err) throw err;
fs.unlink('../../' + currentTempFolder, err => {
if (err) throw err;

// });
});
console.log("path.dirname(filename).split(path.sep).pop()", path.dirname(file).split(path.sep).pop());

}
Expand All @@ -3631,7 +3638,7 @@ exports.improvementProjectPdfGeneration = async function (responseData) {

}
});
// rimraf(imgPath, function () { console.log("done"); });
rimraf(imgPath, function () { console.log("done"); });

return resolve({
status: filesHelper.status_success,
Expand Down Expand Up @@ -3737,6 +3744,13 @@ exports.improvementProjectTaskPdfGeneration = async function (responseData) {
filename: 'index.html'
}
});

FormData.push({
value: fs.createReadStream(dir + '/style.css'),
options: {
filename: 'style.css'
}
});
optionsHtmlToPdf.formData.files = FormData;


Expand Down Expand Up @@ -3766,15 +3780,15 @@ exports.improvementProjectTaskPdfGeneration = async function (responseData) {
let i = 0;
for (const file of files) {

// fs.unlink(path.join(imgPath, file), err => {
// if (err) throw err;
// });
fs.unlink(path.join(imgPath, file), err => {
if (err) throw err;
});

if (i == files.length) {
// fs.unlink('../../' + currentTempFolder, err => {
// if (err) throw err;
fs.unlink('../../' + currentTempFolder, err => {
if (err) throw err;

// });
});
console.log("path.dirname(filename).split(path.sep).pop()", path.dirname(file).split(path.sep).pop());

}
Expand All @@ -3783,7 +3797,7 @@ exports.improvementProjectTaskPdfGeneration = async function (responseData) {

}
});
// rimraf(imgPath, function () { console.log("done"); });
rimraf(imgPath, function () { console.log("done"); });

return resolve({
status: filesHelper.status_success,
Expand Down
8 changes: 1 addition & 7 deletions views/improvementProjectTaskTemplate.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">

<style>
progress::-moz-progress-bar {
Expand Down
10 changes: 6 additions & 4 deletions views/improvementProjectTemplate.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> -->

<link rel="stylesheet" type="text/css" href="style.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> -->

<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> -->

<style>
progress::-moz-progress-bar {
Expand Down Expand Up @@ -170,7 +172,7 @@
</div>
</div>

<hr class="borderColor">
<hr class="borderColor" >

<div style="margin-top:50px !important;font-size: 18px;width:100%">
<% if (data.response.tasks && data.response.tasks.length > 0) { %>
Expand Down

0 comments on commit 388e5cd

Please sign in to comment.