Skip to content

Commit ee0a990

Browse files
Merge pull request #4 from microting/master
Master changes
2 parents ea9b785 + 2d7df6c commit ee0a990

File tree

12 files changed

+133
-192
lines changed

12 files changed

+133
-192
lines changed

eFormAPI/eFormAPI.Web/Infrastructure/Models/Folders/FolderDtoModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public class FolderDtoModel
3535
public DateTime? CreatedAt { get; set; }
3636
public DateTime? UpdatedAt { get; set; }
3737
public int? MicrotingUId { get; set; }
38+
public bool IsLocked { get; set; }
39+
public bool IsEditable { get; set; }
40+
public bool ManagedByPlugin { get; set; }
3841
public List<FolderDtoModel> Children { get; set; }
3942
= new List<FolderDtoModel>();
4043
}

eFormAPI/eFormAPI.Web/Services/CasesService.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ public async Task<OperationResult> Update(ReplyRequest model)
249249
var sdkDbContext = core.DbContextHelper.GetDbContext();
250250

251251
var foundCase = await sdkDbContext.Cases
252-
.Where(x => x.Id == model.Id
253-
&& x.WorkflowState != Constants.WorkflowStates.Removed)
254-
.FirstOrDefaultAsync();
252+
.FirstOrDefaultAsync(x => x.Id == model.Id);
255253

256254
if (foundCase != null)
257255
{
@@ -260,7 +258,13 @@ public async Task<OperationResult> Update(ReplyRequest model)
260258
var newDoneAt = new DateTime(model.DoneAt.Year, model.DoneAt.Month, model.DoneAt.Day,
261259
foundCase.DoneAt.Value.Hour, foundCase.DoneAt.Value.Minute, foundCase.DoneAt.Value.Second);
262260
foundCase.DoneAtUserModifiable = newDoneAt;
261+
} else
262+
{
263+
var newDoneAt = new DateTime(model.DoneAt.Year, model.DoneAt.Month, model.DoneAt.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
264+
foundCase.DoneAtUserModifiable = newDoneAt;
263265
}
266+
foundCase.WorkflowState = Constants.WorkflowStates.Created;
267+
foundCase.UpdatedAt = DateTime.UtcNow;
264268

265269
await foundCase.Update(sdkDbContext);
266270
}
@@ -375,17 +379,17 @@ public async Task<OperationDataResult<LatestCaseActivity>> GetLatestActivity()
375379
.OrderByDescending(x => x.UpdatedAt)
376380
.Select(x => new { x.Id, x.UpdatedAt, x.CheckListId })
377381
.FirstOrDefaultAsync();
378-
var eFormText = await sdkDbContext.CheckListTranslations
379-
.Where(x => x.CheckListId == latestActivity.CheckListId)
380-
.Select(x => x.Text)
381-
.FirstOrDefaultAsync();
382382

383383
if (latestActivity == null)
384384
{
385385
return new OperationDataResult<LatestCaseActivity>(false,
386386
localizationService.GetString("CouldNotGetLatestActivity"));
387387
}
388388

389+
var eFormText = await sdkDbContext.CheckListTranslations
390+
.Where(x => x.CheckListId == latestActivity.CheckListId)
391+
.Select(x => x.Text)
392+
.FirstOrDefaultAsync();
389393
if (eFormText == null)
390394
{
391395
return new OperationDataResult<LatestCaseActivity>(false,

eFormAPI/eFormAPI.Web/Services/FoldersService.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ private static IQueryable<FolderDtoModel> AddSelectToQueryForList(IQueryable<Fol
288288
.First(y => y.LanguageId == languageId)
289289
.Name,
290290
ParentId = x.ParentId,
291-
UpdatedAt = x.UpdatedAt
291+
UpdatedAt = x.UpdatedAt,
292+
IsLocked = x.IsLocked,
293+
IsEditable = x.IsEditable,
294+
ManagedByPlugin = x.ManagedByPlugin
292295
});
293296
}
294297

@@ -307,6 +310,9 @@ private static FolderDtoModel MapFolder(Folder folder, List<Folder> allFolders,
307310
.FirstOrDefault(),
308311
MicrotingUId = folder.MicrotingUid,
309312
ParentId = folder.ParentId,
313+
IsLocked = folder.IsLocked,
314+
IsEditable = folder.IsEditable,
315+
ManagedByPlugin = folder.ManagedByPlugin,
310316
Children = new List<FolderDtoModel>(),
311317
};
312318

eFormAPI/eFormAPI.Web/eFormAPI.Web.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@
5050
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="9.0.0" />
5151
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
5252
<PackageReference Include="HtmlToOpenXml.dll" Version="3.2.7" />
53-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.9" />
54-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.9" />
55-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.9" />
56-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.9" />
53+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.10" />
54+
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.10" />
55+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.10" />
56+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.10" />
5757
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
58-
<PackageReference Include="Microting.eForm" Version="9.0.58" />
59-
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.47" />
60-
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.53" />
58+
<PackageReference Include="Microting.eForm" Version="9.0.65" />
59+
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.52" />
60+
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.57" />
6161
<PackageReference Include="PureOtp" Version="1.0.0.1" />
62-
<PackageReference Include="Sentry" Version="5.16.0" />
62+
<PackageReference Include="Sentry" Version="5.16.1" />
6363
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
6464
<PackageReference Include="McMaster.NETCore.Plugins" Version="2.0.0" />
6565
<PackageReference Include="sendgrid" Version="9.29.3" />
66-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.9" />
67-
<PackageReference Include="System.Threading.AccessControl" Version="9.0.9" />
66+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.10" />
67+
<PackageReference Include="System.Threading.AccessControl" Version="9.0.10" />
6868
</ItemGroup>
6969

7070
<ItemGroup>

eform-client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"@ngrx/store-devtools": "19.2.1",
8484
"@ngx-translate/core": "17.0.0",
8585
"@sentry/angular": "^10.8.0",
86-
"@sentry/cli": "^2.56.0",
86+
"@sentry/cli": "^2.56.1",
8787
"@swimlane/ngx-charts": "23.0.1",
8888
"@types/ramda": "^0.31.1",
8989
"@userback/widget": "^0.3.11",
@@ -131,7 +131,7 @@
131131
"@angular-eslint/eslint-plugin-template": "20.1.1",
132132
"@angular-eslint/schematics": "20.3.0",
133133
"@angular-eslint/template-parser": "20.1.1",
134-
"@angular/cli": "20.3.3",
134+
"@angular/cli": "20.3.5",
135135
"@angular/compiler-cli": "20.1.2",
136136
"@angular/language-service": "20.3.2",
137137
"@types/chai": "^5.2.2",
@@ -146,7 +146,7 @@
146146
"@typescript-eslint/eslint-plugin": "^7.18.0",
147147
"@typescript-eslint/parser": "^7.18.0",
148148
"@typescript-eslint/utils": "^8.45.0",
149-
"@wdio/cli": "9.19.2",
149+
"@wdio/cli": "9.20.0",
150150
"@wdio/local-runner": "9.20.0",
151151
"@wdio/mocha-framework": "9.19.2",
152152
"@wdio/spec-reporter": "9.20.0",

eform-client/src/app/common/models/dto/folder.dto.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ export class FolderDto {
88
parentId?: number;
99
microtingUId?: number;
1010
children?: FolderDto[];
11+
isLocked: boolean;
12+
isEditable: boolean;
13+
managedByPlugin: boolean;
1114
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export class SharedTagModel {
22
id: number;
33
name: string;
4+
description: string;
5+
isLocked: boolean;
46
}

eform-client/src/app/common/modules/eform-shared-tags/components/shared-tags/shared-tags.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h3 mat-dialog-title>{{ 'Tags management' | translate }}</h3>
2929
</div>
3030
<div class="spacer"></div>
3131
<div>
32-
<button
32+
<button *ngIf="!tag.isLocked"
3333
color="accent"
3434
mat-icon-button
3535
(click)="showEditTagModal(tag)"
@@ -38,7 +38,7 @@ <h3 mat-dialog-title>{{ 'Tags management' | translate }}</h3>
3838
>
3939
<mat-icon>edit</mat-icon>
4040
</button>
41-
<button
41+
<button *ngIf="!tag.isLocked"
4242
mat-icon-button
4343
color="warn"
4444
(click)="showDeleteTagModal(tag)"

eform-client/src/app/common/modules/eform-shared-tags/components/shared-tags/shared-tags.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
1414
export class SharedTagsComponent implements OnInit {
1515
dialogRef = inject<MatDialogRef<SharedTagsComponent>>(MatDialogRef);
1616

17-
public availableTags: CommonDictionaryModel[] = [];
17+
public availableTags: SharedTagModel[] = [];
1818
public showMultipleCreateBtn: boolean = false;
1919
public showCreateTag: EventEmitter<void> = new EventEmitter<void>();
2020
public showEditTag: EventEmitter<SharedTagModel> = new EventEmitter<SharedTagModel>();

eform-client/src/app/common/modules/eform-shared/components/eform-tree-view-picker/eform-tree-view-picker.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
<span>{{ 'Add new child folder' | translate }}</span>
4646
</button>
4747
</ng-container>
48-
<ng-container *ngIf="showEditAction">
48+
<ng-container *ngIf="showEditAction && node.isEditable">
4949
<button mat-menu-item (click)="edit(node.id)" id="editFolderTreeBtn">
5050
<mat-icon>edit</mat-icon>
5151
<span>{{ 'Edit folder' | translate }}</span>
5252
</button>
5353
</ng-container>
54-
<ng-container *ngIf="showDeleteAction">
54+
<ng-container *ngIf="showDeleteAction && !node.isLocked">
5555
<button mat-menu-item (click)="delete(node.id)" id="deleteFolderTreeBtn">
5656
<mat-icon>delete</mat-icon>
5757
<span>{{ 'Delete folder' | translate }}</span>
@@ -92,13 +92,13 @@
9292
<span>{{ 'Add new child folder' | translate }}</span>
9393
</button>
9494
</ng-container>
95-
<ng-container *ngIf="showEditAction">
95+
<ng-container *ngIf="showEditAction && node.isEditable">
9696
<button mat-menu-item (click)="edit(node.id)" id="editFolderTreeBtn">
9797
<mat-icon>edit</mat-icon>
9898
<span>{{ 'Edit folder' | translate }}</span>
9999
</button>
100100
</ng-container>
101-
<ng-container *ngIf="showDeleteAction">
101+
<ng-container *ngIf="showDeleteAction && !node.isLocked">
102102
<button mat-menu-item (click)="delete(node.id)" id="deleteFolderTreeBtn">
103103
<mat-icon>delete</mat-icon>
104104
<span>{{ 'Delete folder' | translate }}</span>

0 commit comments

Comments
 (0)