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 (#3255) #3256

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

kbeaugrand
Copy link
Member


Description

What's new?

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

* Add of layerId in device twin

* #2998 Quartz migration for SendPlanningCommand

* #2856 Disable built-in device model deletion

* #3238 Update view when a device is unchecked

* 3239 Allow to delete a planning from client

* 3239 Allow to delete a planning

* 2998 Schedule commands

* #3239 Change checkboxes for layers displayed

* Merge from main

* 2516 add supportLoRaFeatures tag in template file

* #3250 Import device list using the template given

* #2985 Batch import creates ABP tags in Device Twin for OTAA-based device models

* #3251 Import device - data overwritten

* Unit tests

* Update src/IoTHub.Portal.Infrastructure/Jobs/SendPlanningCommandJob.cs

Co-authored-by: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com>

* #2958 Remove 'Connection State' and 'Last status update' columns

* #3023 startupOrder not supported in Edge Device Model schema

---------

Co-authored-by: E068097 <julie.ramos_ext@michelin.com>
Co-authored-by: judramos <ramos.julie.63@gmail.com>
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

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

Project coverage is 84.69%. Comparing base (32be2da) to head (d6f81cc).

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    #3256      +/-   ##
==========================================
+ Coverage   83.12%   84.69%   +1.56%     
==========================================
  Files         327      328       +1     
  Lines       12428    12525      +97     
  Branches      980      993      +13     
==========================================
+ Hits        10331    10608     +277     
+ Misses       1807     1607     -200     
- Partials      290      310      +20     

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

Comment on lines +63 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(...)'.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant