Skip to content

Commit

Permalink
Merge create and edit device screen (#1992)
Browse files Browse the repository at this point in the history
* merge create and edit device screen

* fix unit tests

* update unit tests

* fix solution project

* update unit tests

* update unit tests

* update unit tests

* update unit tests

* update unit tests

* update unit tests

---------

Co-authored-by: GuillaumeM <mourlonguillaume@gmail.com>
  • Loading branch information
kbeaugrand and GuillaumeM-2ISA authored Apr 7, 2023
1 parent 8216046 commit 917a8ae
Show file tree
Hide file tree
Showing 8 changed files with 2,180 additions and 1,871 deletions.
815 changes: 815 additions & 0 deletions src/AzureIoTHub.Portal.Client/Components/Devices/EditDevice.razor

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/AzureIoTHub.Portal.Client/Enums/CreateEditMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace AzureIoTHub.Portal.Client.Enums
{
public enum CreateEditMode
{
Create,
Edit
}
}
542 changes: 1 addition & 541 deletions src/AzureIoTHub.Portal.Client/Pages/Devices/CreateDevicePage.razor

Large diffs are not rendered by default.

420 changes: 3 additions & 417 deletions src/AzureIoTHub.Portal.Client/Pages/Devices/DeviceDetailPage.razor

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public LoRaDeviceDetailsValidator()
.NotEmpty()
.When(x => !x.UseOTAA)
.WithMessage("DevAddr is required.");

_ = RuleFor(x => x.DeviceID)
.NotEmpty()
.Length(1, 16)
.Matches("[A-F0-9]{16}")
.WithMessage("DeviceID is required. It should be a 16 bit hex string.");
}

public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
Expand Down
1,318 changes: 1,318 additions & 0 deletions src/AzureIoTHub.Portal.Tests.Unit/Client/Components/Devices/EditDeviceTests.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 917a8ae

Please sign in to comment.