Skip to content

Commit 65253cf

Browse files
committed
Adding better tags handling.
1 parent 4f9ad7e commit 65253cf

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn/Controllers/ItemsPlanningTagsController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public ItemsPlanningTagsController(IItemsPlanningTagsService itemsPlanningTagsSe
4646
}
4747

4848
[HttpGet]
49-
public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetItemsPlanningTags()
49+
public async Task<OperationDataResult<List<PlanningTagModel>>> GetItemsPlanningTags()
5050
{
5151
return await _itemsPlanningTagsService.GetItemsPlanningTags();
5252
}
@@ -77,4 +77,4 @@ public async Task<OperationResult> BulkPlanningTags([FromBody] PlanningBulkTagMo
7777
return await _itemsPlanningTagsService.BulkPlanningTags(requestModel);
7878
}
7979
}
80-
}
80+
}

eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn/Infrastructure/Models/Planning/PlanningTagModel.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
*/
2424

25+
using Microting.eFormApi.BasePn.Infrastructure.Models.Common;
26+
2527
namespace ItemsPlanning.Pn.Infrastructure.Models.Planning
2628
{
27-
public class PlanningTagModel
29+
public class PlanningTagModel : CommonDictionaryModel
2830
{
29-
public int? Id { get; set; }
30-
public string Name { get; set; }
31+
public bool IsLocked { get; set; }
3132
}
32-
}
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Microting.eFormApi.BasePn.Infrastructure.Models.Common;
2+
3+
namespace ItemsPlanning.Pn.Infrastructure.Models;
4+
5+
public class TagModel : CommonDictionaryModel
6+
{
7+
public bool IsLocked { get; set; }
8+
}

eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn/Services/ItemsPlanningTagsService/IItemsPlanningTagsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace ItemsPlanning.Pn.Services.ItemsPlanningTagsService
3232

3333
public interface IItemsPlanningTagsService
3434
{
35-
Task<OperationDataResult<List<CommonDictionaryModel>>> GetItemsPlanningTags();
35+
Task<OperationDataResult<List<PlanningTagModel>>> GetItemsPlanningTags();
3636

3737
Task<OperationResult> UpdateItemsPlanningTag(PlanningTagModel requestModel);
3838

@@ -42,4 +42,4 @@ public interface IItemsPlanningTagsService
4242

4343
Task<OperationResult> BulkPlanningTags(PlanningBulkTagModel requestModel);
4444
}
45-
}
45+
}

eFormAPI/Plugins/ItemsPlanning.Pn/ItemsPlanning.Pn/Services/ItemsPlanningTagsService/ItemsPlanningTagsService.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@ public class ItemsPlanningTagsService(
4848
IUserService userService)
4949
: IItemsPlanningTagsService
5050
{
51-
public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetItemsPlanningTags()
51+
public async Task<OperationDataResult<List<PlanningTagModel>>> GetItemsPlanningTags()
5252
{
5353
try
5454
{
5555
var itemsPlanningTags = await dbContext.PlanningTags
5656
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
5757
.AsNoTracking()
58-
.Select(x => new CommonDictionaryModel
58+
.Select(x => new PlanningTagModel
5959
{
6060
Id = x.Id,
61-
Name = x.Name
61+
Name = x.Name,
62+
IsLocked = x.IsLocked
6263
}).OrderBy(x => x.Name).ToListAsync();
6364

64-
return new OperationDataResult<List<CommonDictionaryModel>>(
65+
return new OperationDataResult<List<PlanningTagModel>>(
6566
true,
6667
itemsPlanningTags);
6768
}
@@ -70,7 +71,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetItemsPlan
7071
SentrySdk.CaptureException(e);
7172
logger.LogError(e.Message);
7273
logger.LogTrace(e.StackTrace);
73-
return new OperationDataResult<List<CommonDictionaryModel>>(
74+
return new OperationDataResult<List<PlanningTagModel>>(
7475
false,
7576
itemsPlanningLocalizationService.GetString("ErrorWhileObtainingItemsPlanningTags"));
7677
}

eform-client/src/app/plugins/modules/items-planning-pn/services/items-planning-pn-tags.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export let ItemsPlanningTagsMethods = {
2020
export class ItemsPlanningPnTagsService {
2121
constructor(private apiBaseService: ApiBaseService) {}
2222

23-
getPlanningsTags(): Observable<OperationDataResult<CommonDictionaryModel[]>> {
23+
getPlanningsTags(): Observable<OperationDataResult<SharedTagModel[]>> {
2424
return this.apiBaseService.get<SharedTagModel[]>(
2525
ItemsPlanningTagsMethods.Tags
2626
);

0 commit comments

Comments
 (0)