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

[#188045959] Sampler changes to use attr and collection IDs to send data to CODAP #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eireland
Copy link
Contributor

Changes sending data to CODAP using attr IDs and collection IDs which may have been changed.

Make names less mutable. Only changes the title prop when user changes variable name.

… may have been changed.

Make names less mutable. Only changes the title prop when user changes variable name.
@eireland eireland requested a review from lublagg September 12, 2024 22:59
@@ -63,7 +70,7 @@ var CodapCom = function(getStateFunc, loadStateFunc, localeMgr) {
const attrName = msg.values.result.attrs[i].name;
const attrKey = _this.findKeyById(id);
// update the device name if the user has changed it in the codap table
if (attrKey === "output" && _this.attrMap["output"].name !== attrName) {
if (attrKey === "output" && _this.attrMap.items["output"].name !== attrName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this check if _this.attrMap.items["output"].title is not equal to attrName (since the title property changes but not the name property?

if (getDatasetResult && !getDatasetResult.success) {
if (deviceName && deviceName !== _this.attrMap.items["output"].name) {
_this.deviceName = deviceName;
_this.attrMap.items["output"].name = deviceName;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here about checking title vs name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, nevermind. I see we would be creating the new attribute with the new deviceName.

I do wonder if it would be better to always keep the name of this attribute 'output' and only change the title to the deviceName, though.

attrs: [{name: deviceName,title: deviceName}]
name: _this.collectionMap.items.name,
parent: _this.collectionMap.samples.id,
attrs: [{title: deviceName}]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this attr have a name property also?

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.

2 participants