Skip to content

Commit 6789f55

Browse files
committed
Merge branch 'stable' of github.com:microting/eform-backendconfiguration-plugin into stable
2 parents 439029f + e2c4b84 commit 6789f55

File tree

6 files changed

+53
-54
lines changed

6 files changed

+53
-54
lines changed

.github/workflows/dotnet-core-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- name: Use Node.js
9898
uses: actions/setup-node@v3
9999
with:
100-
node-version: 20
100+
node-version: 22
101101
- name: 'Preparing Frontend checkout'
102102
uses: actions/checkout@v3
103103
with:

.github/workflows/dotnet-core-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- name: Use Node.js
8989
uses: actions/setup-node@v3
9090
with:
91-
node-version: 20
91+
node-version: 22
9292
- name: 'Preparing Frontend checkout'
9393
uses: actions/checkout@v3
9494
with:

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Handlers/WorkOrderCreatedHandler.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class WorkOrderCreatedHandler(
3636

3737
public async Task Handle(WorkOrderCreated message)
3838
{
39-
var pdfHash = await GeneratePdf(message.PicturesOfTasks).ConfigureAwait(false);
39+
// var pdfHash = await GeneratePdf(message.PicturesOfTasks).ConfigureAwait(false);
4040
await DeployEform(
4141
message.PropertyWorkers,
4242
message.EformId,
@@ -46,7 +46,7 @@ await DeployEform(
4646
message.WorkorderCaseId,
4747
message.NewDescription,
4848
message.DeviceUsersGroupId,
49-
pdfHash,
49+
// pdfHash,
5050
message.AssignedToSite,
5151
message.PushMessageBody,
5252
message.PushMessageTitle,
@@ -69,7 +69,7 @@ private async Task DeployEform(
6969
int workorderCaseId,
7070
string newDescription,
7171
int? deviceUsersGroupId,
72-
string pdfHash,
72+
// string pdfHash,
7373
Site assignedToSite,
7474
string pushMessageBody,
7575
string pushMessageTitle,
@@ -173,7 +173,7 @@ List<KeyValuePair<string, string>> picturesOfTasks
173173
((DataElement)mainElement.ElementList[0]).DataItemList[0].Description.InderValue = description.Replace("\r\n", "<br>").Replace("\n", "<br>");
174174
((DataElement)mainElement.ElementList[0]).DataItemList[0].Label = " ";
175175
((DataElement)mainElement.ElementList[0]).DataItemList[0].Color = Constants.FieldColors.Yellow;
176-
((ShowPdf)((DataElement)mainElement.ElementList[0]).DataItemList[1]).Value = pdfHash;
176+
// ((ShowPdf)((DataElement)mainElement.ElementList[0]).DataItemList[1]).Value = pdfHash;
177177
List<Microting.eForm.Dto.KeyValuePair> kvpList = ((SingleSelect) ((DataElement) mainElement.ElementList[0]).DataItemList[4]).KeyValuePairList;
178178
var newKvpList = new List<KeyValuePair>();
179179
foreach (var keyValuePair in kvpList)
@@ -203,30 +203,30 @@ List<KeyValuePair<string, string>> picturesOfTasks
203203
}
204204

205205
mainElement.StartDate = DateTime.Now.ToUniversalTime();
206-
if (hasImages == false)
206+
// if (hasImages == false)
207+
// {
208+
((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
209+
// }
210+
// unit.eFormVersion ??= "1.0.0";
211+
// if (int.Parse(unit.eFormVersion.Replace(".","")) > 3212)
212+
// {
213+
if (hasImages)
207214
{
208-
((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
209-
}
210-
unit.eFormVersion ??= "1.0.0";
211-
if (int.Parse(unit.eFormVersion.Replace(".","")) > 3212)
212-
{
213-
if (hasImages)
215+
// ((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
216+
// add a new show picture element for each picture in the picturesOfTasks list
217+
int j = 0;
218+
foreach (var picture in picturesOfTasks)
214219
{
215-
((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
216-
// add a new show picture element for each picture in the picturesOfTasks list
217-
int j = 0;
218-
foreach (var picture in picturesOfTasks)
219-
{
220-
var showPicture = new ShowPicture(j, false, false, "", "", "", 0, false, "");
221-
var storageResult = sdkCore.GetFileFromS3Storage(picture.Key).GetAwaiter().GetResult();
220+
var showPicture = new ShowPicture(j, false, false, "", "", "", 0, false, "");
221+
var storageResult = sdkCore.GetFileFromS3Storage(picture.Key).GetAwaiter().GetResult();
222222

223-
await sdkCore.PngUpload(storageResult.ResponseStream, picture.Value, picture.Key);
224-
showPicture.Value = picture.Value;
225-
((DataElement) mainElement.ElementList[0]).DataItemList.Add(showPicture);
226-
j++;
227-
}
223+
await sdkCore.PngUpload(storageResult.ResponseStream, picture.Value, picture.Key);
224+
showPicture.Value = picture.Value;
225+
((DataElement) mainElement.ElementList[0]).DataItemList.Add(showPicture);
226+
j++;
228227
}
229228
}
229+
// }
230230
var caseId = await sdkCore.CaseCreate(mainElement, "", (int)site.MicrotingUid!, folderId).ConfigureAwait(false);
231231
var newWorkOrderCase = new WorkorderCase
232232
{

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Handlers/WorkOrderUpdatedHandler.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ await DeployWorkOrderEform(message.PropertyWorkers,
3535
message.WorkorderCaseId,
3636
message.NewDescription,
3737
message.DeviceUsersGroupId,
38-
message.PdfHash,
38+
// message.PdfHash,
3939
message.AssignedToSite,
4040
message.PushMessageBody,
4141
message.PushMessageTitle,
@@ -56,7 +56,7 @@ private async Task DeployWorkOrderEform(
5656
int workorderCaseId,
5757
string newDescription,
5858
int? deviceUsersGroupId,
59-
string pdfHash,
59+
// string pdfHash,
6060
Site assignedToSite,
6161
string pushMessageBody,
6262
string pushMessageTitle,
@@ -161,7 +161,7 @@ private async Task DeployWorkOrderEform(
161161
((DataElement)mainElement.ElementList[0]).DataItemList[0].Description.InderValue = description.Replace("\n", "<br>");
162162
((DataElement)mainElement.ElementList[0]).DataItemList[0].Label = " ";
163163
((DataElement)mainElement.ElementList[0]).DataItemList[0].Color = Constants.FieldColors.Yellow;
164-
((ShowPdf) ((DataElement) mainElement.ElementList[0]).DataItemList[1]).Value = pdfHash;
164+
// ((ShowPdf) ((DataElement) mainElement.ElementList[0]).DataItemList[1]).Value = pdfHash;
165165

166166
List<Microting.eForm.Dto.KeyValuePair> kvpList = ((SingleSelect) ((DataElement) mainElement.ElementList[0]).DataItemList[4]).KeyValuePairList;
167167
var newKvpList = new List<KeyValuePair>();
@@ -192,31 +192,31 @@ private async Task DeployWorkOrderEform(
192192
}
193193

194194
mainElement.StartDate = DateTime.Now.ToUniversalTime();
195-
if (hasImages == false)
196-
{
197-
((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
198-
}
199-
unit.eFormVersion ??= "1.0.0";
200-
if (int.Parse(unit.eFormVersion.Replace(".","")) > 3212)
195+
((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
196+
// if (hasImages == false)
197+
// {
198+
// ((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
199+
// }
200+
// unit.eFormVersion ??= "1.0.0";
201+
// if (int.Parse(unit.eFormVersion.Replace(".","")) > 3212)
202+
// {
203+
if (hasImages)
201204
{
202-
if (hasImages)
205+
// add a new show picture element for each picture in the picturesOfTasks list
206+
int j = 0;
207+
foreach (var picture in picturesOfTasks)
203208
{
204-
((DataElement) mainElement.ElementList[0]).DataItemList.RemoveAt(1);
205-
// add a new show picture element for each picture in the picturesOfTasks list
206-
int j = 0;
207-
foreach (var picture in picturesOfTasks)
208-
{
209-
var showPicture = new ShowPicture(j, false, false, "", "", "", 0, false, "");
210-
var storageResult = sdkCore.GetFileFromS3Storage(picture.Key).GetAwaiter().GetResult();
211-
212-
await sdkCore.PngUpload(storageResult.ResponseStream, picture.Value, picture.Key);
213-
showPicture.Value = picture.Value;
214-
((DataElement) mainElement.ElementList[0]).DataItemList.Add(showPicture);
215-
216-
j++;
217-
}
209+
var showPicture = new ShowPicture(j, false, false, "", "", "", 0, false, "");
210+
var storageResult = sdkCore.GetFileFromS3Storage(picture.Key).GetAwaiter().GetResult();
211+
212+
await sdkCore.PngUpload(storageResult.ResponseStream, picture.Value, picture.Key);
213+
showPicture.Value = picture.Value;
214+
((DataElement) mainElement.ElementList[0]).DataItemList.Add(showPicture);
215+
216+
j++;
218217
}
219218
}
219+
// }
220220
int caseId = 0;
221221
if (status != CaseStatusesEnum.Completed)
222222
{

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Helpers/BackendConfigurationTaskManagementHelper.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static async Task<OperationResult> UpdateTask(WorkOrderCaseUpdateModel up
7777
}
7878

7979
var property = workOrderCase.PropertyWorker.Property;
80-
var hash = await GeneratePdf(picturesOfTasks, site.Id, core);
80+
// var hash = await GeneratePdf(picturesOfTasks, site.Id, core);
8181

8282
var label = $"<strong>{localizationService.GetString("AssignedTo")}:</strong> {site.Name}<br>";
8383

@@ -159,8 +159,7 @@ public static async Task<OperationResult> UpdateTask(WorkOrderCaseUpdateModel up
159159
}
160160

161161
await bus.SendLocal(new WorkOrderUpdated(propertyWorkerKvpList, eformIdForOngoingTasks, property.Id, label,
162-
updateModel.CaseStatusEnum, workOrderCase.Id, updateModel.Description, int.Parse(deviceUsersGroupUid),
163-
hash, site, pushMessageBody, pushMessageTitle, updatedByName, hasImages, picturesOfTasksList, userService.UserId, userService.UserId)).ConfigureAwait(false);
162+
updateModel.CaseStatusEnum, workOrderCase.Id, updateModel.Description, int.Parse(deviceUsersGroupUid), site, pushMessageBody, pushMessageTitle, updatedByName, hasImages, picturesOfTasksList, userService.UserId, userService.UserId)).ConfigureAwait(false);
164163

165164
return new OperationResult(true, localizationService.GetString("TaskUpdatedSuccessful"));
166165
}

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Messages/WorkOrderUpdated.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class WorkOrderUpdated(
1313
int workorderCaseId,
1414
string newDescription,
1515
int? deviceUsersGroupId,
16-
string pdfHash,
16+
// string pdfHash,
1717
Site assignedToSite,
1818
string pushMessageBody,
1919
string pushMessageTitle,
@@ -31,7 +31,7 @@ public class WorkOrderUpdated(
3131
public readonly int WorkorderCaseId = workorderCaseId;
3232
public readonly string NewDescription = newDescription;
3333
public int? DeviceUsersGroupId = deviceUsersGroupId;
34-
public readonly string PdfHash = pdfHash;
34+
// public readonly string PdfHash = pdfHash;
3535
public readonly Site AssignedToSite = assignedToSite;
3636
public readonly string PushMessageBody = pushMessageBody;
3737
public readonly string PushMessageTitle = pushMessageTitle;

0 commit comments

Comments
 (0)