-
Notifications
You must be signed in to change notification settings - Fork 31
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
[#3168] - edit datapoints #3397
Conversation
const { devices, datapointAssignments } = this.context.data; | ||
|
||
const deviceData = devices.find(device => device.id === selectedDeviceId); | ||
const selectedDatapoint = datapointAssignments.find( |
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.
const selectedDatapoint = datapointAssignments.find( | |
const selectedDatapointAssignment = datapointAssignments.find( |
</span> | ||
<span className="divider">.</span> | ||
<a href="#" onClick={() => this.props.changeTab('EDIT_DATAPOINTS', deviceData.id)}> | ||
Edit |
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.
It feels a little strange that the Edit button is active even when there are no datapoints assigned. This should probably only be activated when there are actually datapoints that have been assigned to a device.
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.
Also should be a translated string.
@@ -731,5 +724,31 @@ FLOW.AssignmentEditView = FLOW.ReactComponentView.extend( | |||
|
|||
this.renderReactSide(); | |||
}, | |||
|
|||
removeDatapointsFromAssignments(datapoints, deviceIdInString) { |
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.
removeDatapointsFromAssignments(datapoints, deviceIdInString) { | |
removeDatapointsFromAssignments(datapointIds, deviceIdInString) { |
...dpAssignment, | ||
datapoints: dps, | ||
}; | ||
}); |
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.
This section feels a bit confusing the way its constructed. The focus is on the single datapoint assignment that we have to update to reflect that its list of datapointIds has changed. I dont think its necessary to go filtering through all the other datapoint assignments since all we do is just return as long as they dont match the one we want.
The solution
Add page/view to be able to edit data points in a device.
Screenshots (if appropriate)
Reviewer Checklist