-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add an Export button for Devices list #1483
Conversation
Codecov ReportBase: 89.70% // Head: 89.74% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1483 +/- ##
==========================================
+ Coverage 89.70% 89.74% +0.04%
==========================================
Files 256 259 +3
Lines 8011 8123 +112
==========================================
+ Hits 7186 7290 +104
- Misses 825 833 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Globally 2 things:
- I think this might be only an option in an Admin menu instead of the device list page...
- The best for us might to use the Device registry as the source to export regardless of the device kind
src/AzureIoTHub.Portal.Server/Controllers/v1.0/ImportExportController.cs
Outdated
Show resolved
Hide resolved
src/AzureIoTHub.Portal.Server/Controllers/v1.0/ImportExportController.cs
Outdated
Show resolved
Hide resolved
2d89b51
to
f709df8
Compare
4c14030
to
fab8fb0
Compare
63156d2
to
e34964d
Compare
foreach (var item in list) | ||
{ | ||
var deviceObject = JsonNode.Parse(item)!; | ||
|
||
csvWriter.WriteField(deviceObject["deviceId"].ToString(), true); | ||
csvWriter.WriteField(deviceObject["tags"]["deviceName"]?.ToString(), true); | ||
csvWriter.WriteField(deviceObject["tags"]["modelId"]); | ||
|
||
foreach (var tag in tags) | ||
{ | ||
csvWriter.WriteField(string.Format(CultureInfo.InvariantCulture, $"{deviceObject!["tags"][tag]}")); | ||
} | ||
|
||
foreach (var property in properties) | ||
{ | ||
csvWriter.WriteField(string.Format(CultureInfo.InvariantCulture, $"{deviceObject!["desired"][property]}")); | ||
} | ||
|
||
await csvWriter.NextRecordAsync(); | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select
src/AzureIoTHub.Portal.Tests.Unit/Server/Controllers/v1.0/AdminControllerTests.cs
Fixed
Show fixed
Hide fixed
8921ecf
to
293e671
Compare
Description
What's new?
What kind of change does this PR introduce?