Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler and plannings management #3247

Closed
wants to merge 17 commits into from
Closed

Conversation

judramos
Copy link

Description

What's new?

  • Bugfix on built-in devices deletion
  • Bugfix on layers' management
  • Feature to schedule commands sending
  • Feature to allow to delete a planning

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

@judramos judramos requested a review from a team as a code owner October 31, 2024 15:31
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 71.29187% with 60 lines in your changes missing coverage. Please review.

Project coverage is 84.70%. Comparing base (dcdbb69) to head (72d53b0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...Client/Dialogs/Planning/DeletePlanningDialog.razor 48.83% 22 Missing ⚠️
...rtal.Infrastructure/Jobs/SendPlanningCommandJob.cs 77.58% 9 Missing and 4 partials ⚠️
src/IoTHub.Portal.Server/Managers/ExportManager.cs 38.46% 7 Missing and 1 partial ⚠️
...l.Client/Dialogs/Layer/LinkDeviceLayerDialog.razor 0.00% 6 Missing ⚠️
.../IoTHub.Portal.Application/Helpers/ConfigHelper.cs 63.63% 3 Missing and 1 partial ⚠️
...rtal.Client/Components/Planning/EditPlanning.razor 89.65% 3 Missing ⚠️
...ortal.Client/Pages/Planning/PlanningListPage.razor 72.72% 2 Missing and 1 partial ⚠️
...THub.Portal.Client/Pages/Layer/LayerListPage.razor 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3247      +/-   ##
==========================================
+ Coverage   83.12%   84.70%   +1.57%     
==========================================
  Files         327      328       +1     
  Lines       12428    12525      +97     
  Branches      980      993      +13     
==========================================
+ Hits        10331    10609     +278     
+ Misses       1807     1606     -201     
- Partials      290      310      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +64 to +68
foreach (var layer in Layers.Where(layer => layer.Planning == planningId))
{
var updatedLayer = FindLayer(layer.Id);
updatedLayer.Planning = null;
await LayerClientService.UpdateLayer(updatedLayer);
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select Note

This foreach loop immediately
maps its iteration variable to another variable
- consider mapping the sequence explicitly using '.Select(...)'.
src/IoTHub.Portal.Infrastructure/Jobs/SendPlanningCommandJob.cs Dismissed Show dismissed Hide dismissed
Comment on lines +165 to +169
foreach (var schedule in schedules)
{
// Add schedules to the planning
if (schedule.PlanningId == planningCommand.planningId) addSchedule(schedule, planningCommand);
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where Note

This foreach loop
implicitly filters its target sequence
- consider filtering the sequence explicitly using '.Where(...)'.

var mockScheduleList = Fixture.CreateMany<ScheduleDto>(2).ToList();

var deviceModels = Fixture.CreateMany<DeviceModelDto>(2).ToList();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
deviceModels
is useless, since its value is never read.
Comment on lines +568 to +572
var expectedPaginatedDeviceModels = new PaginationResult<DeviceModelDto>()
{
Items = mockDeviceModel.ToList(),
TotalItems = mockDeviceModel.Count
};

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
expectedPaginatedDeviceModels
is useless, since its value is never read.
public async Task LinkDeviceLayerDialog_Search_RendersCorrectlyAsync()
{
// Arrange
var searchedDevices = Fixture.CreateMany<TableData<DeviceListItem>>(3).ToList();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
searchedDevices
is useless, since its value is never read.
public async Task LinkDeviceLayerDialog_Search_ShouldDisplayDevicesAsync()
{
// Arrange
var searchedDevices = Fixture.CreateMany<TableData<DeviceListItem>>(3).ToList();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
searchedDevices
is useless, since its value is never read.
public async Task LinkDeviceLayerDialog_Save_UpdatesDevices()
{
// Arrange
var searchedDevices = Fixture.CreateMany<TableData<DeviceListItem>>(3).ToList();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
searchedDevices
is useless, since its value is never read.
@kbeaugrand
Copy link
Member

@judramos I'll close this PR to move it to another branch for vnext, don't worry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment