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

Update device summary store structure #26

Merged
merged 5 commits into from
Jul 29, 2019
Merged

Update device summary store structure #26

merged 5 commits into from
Jul 29, 2019

Conversation

YingXue
Copy link
Member

@YingXue YingXue commented Jul 27, 2019

Removed digital twin related information from device summary, which have created some unncessary complexity and introduced a few bugs.
Instead, the component now directly calls digital twin api to update itself when user expand the device list cell, without going through the saga and redux.
By doing so, we removed the complex logic of checking whether device list component needs an update which caused couple bugs during bugbash.
The device list in the store is still using immutable all the way down, but there is no point having a List<Map<string, any>> as we lost all the intellisense in the device list reducer. Now it is simply a immutable map.

Bugs related:
https://msazure.visualstudio.com/One/_workitems/edit/4991936
https://msazure.visualstudio.com/One/_workitems/edit/4992402
https://msazure.visualstudio.com/One/_workitems/edit/4992707

@andrew-buckley
Copy link
Contributor

Please hold off on this one. I'd like to continue going through it more thoroughly

montgomp
montgomp previously approved these changes Jul 29, 2019
@YingXue
Copy link
Member Author

YingXue commented Jul 29, 2019

Please hold off on this one. I'd like to continue going through it more thoroughly

Sure. Overall I feel like the device summary doesn't need to hold all the info. And I also thought about having another Map type holds the information of <deviceid, digitaltwininterfaceids>. But we are not using the digitalinterfaceids information anywhere else, might as well not going through redux at all like the device events.

<span className={`device-list-cell-item ${!device.isPnpDevice && 'last'}`}>{`${context.t(ResourceKeys.deviceLists.columns.statusUpdatedTime)}: `}<span className="data">{device.statusUpdatedTime || context.t(ResourceKeys.deviceLists.noData)}</span></span>
{!!device.isPnpDevice &&
<span className={`device-list-cell-item ${this.state.interfaceIds.length === 0 && 'last'}`}>{`${context.t(ResourceKeys.deviceLists.columns.statusUpdatedTime)}: `}<span className="data">{device.statusUpdatedTime || context.t(ResourceKeys.deviceLists.noData)}</span></span>
{this.state.interfaceIds.length !== 0 &&
Copy link
Contributor

@andrew-buckley andrew-buckley Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right condition? Before pnp devices were devices that implemented an interface other than ModelDiscovery. I think now every device is a PNP device, if that's the case do we still need the icon?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concerns here. Reached out again to the PMs, and that's keep it as is, and see what they would decide.

@YingXue YingXue merged commit 52617f6 into Azure:master Jul 29, 2019
@YingXue YingXue deleted the fixListStore branch August 1, 2019 19:45
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.

5 participants