Skip to content

Commit

Permalink
Merge branch 'main' into dev-AS-oipc-section14-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aparna-aot committed Sep 20, 2024
2 parents a8e1774 + 9efc018 commit 75150e4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ public CalendarFileProcessor(Stream sourceStream)

string organizer = string.Empty;
//Organizer Name and Email
if (e.Organizer != null)
if (e.Organizer?.Value != null)
{
try
{
organizer = e.Organizer.CommonName + "(" + e.Organizer.Value.AbsoluteUri + ")";
organizer = e.Organizer?.CommonName + "(" + e.Organizer?.Value.AbsoluteUri + ")";
}
catch
{
Expand Down Expand Up @@ -182,7 +182,7 @@ public CalendarFileProcessor(Stream sourceStream)
//Meeting created timestamp
htmlString.Append(@"<tr>
<td><b>Sent: </b></td>
<td>" + GetPSTTime(e.DtStamp.Date) + "</td></tr>");
<td>" + e.DtStamp.Value + "</td></tr>");

//Priority
htmlString.Append(@"<tr>
Expand All @@ -192,12 +192,12 @@ public CalendarFileProcessor(Stream sourceStream)
//Meeting Start Timestamp
htmlString.Append(@"<tr>
<td><b>Start Time: </b></td>
<td>" + GetPSTTime(e.DtStart.Value) + "</td></tr>");
<td>" + e.DtStart.Value + "</td></tr>");

//Meeting End Timestamp
htmlString.Append(@"<tr>
<td><b>End Time: </b></td>
<td>" + GetPSTTime(e.DtEnd.Value) + "</td></tr>");
<td>" + e.DtEnd.Value + "</td></tr>");
//Meeting Message
string message = @"" + e.Description?.Replace("\n", "<br>");
message = message.Replace("&lt;br&gt;", "<br>").Replace("&lt;br/&gt;", "<br/>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ public void ProcessComplexCalendarFilesTest()
Dictionary<MemoryStream, Dictionary<string, string>> attachments = new Dictionary<MemoryStream, Dictionary<string, string>>();
string rootFolder = getSourceFolder();
Stream output = new MemoryStream();
Stream testFile = new FileStream(Path.Combine(getSourceFolder(), "test-problematic-calendar.ics"), FileMode.Open, FileAccess.Read);
Stream testFile = new FileStream(Path.Combine(getSourceFolder(), "test-with-attachments.ics"), FileMode.Open, FileAccess.Read);

CalendarFileProcessor calendarFileProcessor = new CalendarFileProcessor(testFile);
calendarFileProcessor.WaitTimeinMilliSeconds = 5000;
calendarFileProcessor.FailureAttemptCount = 10;
(isProcessed, message, output, attachments) = calendarFileProcessor.ProcessCalendarFiles();
Assert.IsTrue(isProcessed == true, $"Calendar to PDF Conversion failed");

SaveStreamAsFile(getSourceFolder(), output, "result_test-problematic-calendar.pdf");
SaveStreamAsFile(getSourceFolder(), output, "result_test-with-attachmentsr.pdf");
}

private string getSourceFolder()
Expand Down
4 changes: 4 additions & 0 deletions MCS.FOI.S3FileConversion/MCS.FOI.MSGToPDF/MSGFileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ private string GenerateHtmlfromMsg(Storage.Message msg)
<td>" + msg.Subject + "</td></tr>");

DateTime sentDate = Convert.ToDateTime(msg.SentOn);
if(sentDate == DateTime.MinValue)
{
sentDate = Convert.ToDateTime(msg.CreationTime);
}
if (TimeZone.CurrentTimeZone.StandardName != "Pacific Standard Time")
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,12 @@ const useSaveResponsePackage = () => {
/**must apply redactions before removing pages*/
if (pagesToRemove.length > 0) {
await doc.removePages(pagesToRemove);
}
}
doc.setWatermark({
diagonal: {
text: ''
}
})
const { PDFNet } = _instance.Core;
PDFNet.initialize();

Expand Down
2 changes: 2 additions & 0 deletions web/src/components/FOI/Home/Redlining.js
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,8 @@ const Redlining = React.forwardRef(
}
},
});
docViewer?.refreshAll();
docViewer?.updateView();
}
//Cleanup Function: removes previous event listeiner to ensure handleCreateResponsePDFClick event is not called multiple times on click
return () => {
Expand Down

0 comments on commit 75150e4

Please sign in to comment.