-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix composite measures should be correctly exported to CSV #309
Conversation
name: "ask:device-manager:model:measure:get"; | ||
|
||
payload: { type: string }; | ||
|
||
result: MeasureModelContent; | ||
}; |
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.
Nit-picking, why blank lines here ?
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.
Idk, it was already done this way..
But I'm curious about it 🤔 ..
const header = `${name}${ | ||
pathWithoutType !== "" ? `.${pathWithoutType}` : "" | ||
}`; |
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 header = `${name}${ | |
pathWithoutType !== "" ? `.${pathWithoutType}` : "" | |
}`; | |
const header = `${name}.${pathWithoutType}`; |
This ternary condition seems to be useless.
Unless if you want to handle nullish value in this case you have an error and the better solution is to use nullish coalsing, like pathWithoutType ?? ''
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.
You're not entirely right, it was useful, but your comment made me rework this crap.
I've fixed it. I now use a simple regex to do what I wanted to do.
I will add a comment in this PR explaining what I did
Following my response to Seb's comment. When I implemented this fix, I assumed that we should not repeat the type of a measure in the column header.
What's actually going on is this:
Do you guys, think this should not be this way ? |
d63b92a
to
7692786
Compare
* refactor: add acceleration measure to the DummyTemp Decoder * fix: test name * test: implement failing tests * feat: add an ask event to retrieve the content of a measure * feat: generate a measure column for each property of a measure * fix: position needs to be the first property for consistency purposes * fix: failing test * refactor: more proper way of computing header string --------- Co-authored-by: Théo Dislay <tdislay@kuzzle.io>
# [2.3.0](v2.2.8...v2.3.0) (2023-08-14) ### Bug Fixes * composite measures should be correctly exported to CSV ([#309](#309)) ([487c1e8](487c1e8)) * **docs:** wrong arguments in models' getDevice request ([#310](#310)) ([028c65c](028c65c)) ### Features * **assetGroups:** add assetGroups roles ([b9d0fae](b9d0fae)) * **assetGroups:** add groups for assets ([#306](#306)) ([10de8b4](10de8b4)) * **assetGroups:** add lastUpdate on changes ([#311](#311)) ([36a4575](36a4575)) * **semantic-release:** add semantic release support to device manager ([99b1683](99b1683))
# [2.3.0](v2.2.8...v2.3.0) (2023-08-14) ### Bug Fixes * composite measures should be correctly exported to CSV ([#309](#309)) ([487c1e8](487c1e8)) * **docs:** wrong arguments in models' getDevice request ([#310](#310)) ([028c65c](028c65c)) ### Features * **assetGroups:** add assetGroups roles ([b9d0fae](b9d0fae)) * **assetGroups:** add groups for assets ([#306](#306)) ([10de8b4](10de8b4)) * **assetGroups:** add lastUpdate on changes ([#311](#311)) ([36a4575](36a4575)) * **semantic-release:** add semantic release support to device manager ([99b1683](99b1683))
# [2.3.0](v2.2.8...v2.3.0) (2023-08-14) ### Bug Fixes * composite measures should be correctly exported to CSV ([#309](#309)) ([487c1e8](487c1e8)) * **docs:** wrong arguments in models' getDevice request ([#310](#310)) ([028c65c](028c65c)) ### Features * **assetGroups:** add assetGroups roles ([b9d0fae](b9d0fae)) * **assetGroups:** add groups for assets ([#306](#306)) ([10de8b4](10de8b4)) * **assetGroups:** add lastUpdate on changes ([#311](#311)) ([36a4575](36a4575)) * **semantic-release:** add semantic release support to device manager ([99b1683](99b1683))
What does this PR do ?
Composite measures (measures with multiple properties, which can be objects) are now correctly exported. Before, only the property with the name equal to the measure type was exported (see the issue below).
Fixes #308.
Other changes
valueMappings
for the position measurement. It helps with consistency (which means, we do not need to sort properties from the mappings to display in a logical order the columns in the csv export).Boyscout