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

Use property odataName in entities table #807

Merged
merged 1 commit into from
May 24, 2023
Merged

Conversation

matthew-white
Copy link
Member

Closes #793.

What has been done to verify that this works as intended?

A new test. Once it's on staging, I can verify it against the entity mentioned in the issue.

Why is this the best possible solution? Were any other approaches considered?

Backend returns the odataName, so Frontend just needs to use it.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

The risk of regression should be low.

Does this change require updates to user documentation? If so, please file an issue here and include the link below.

No changes needed.

Before submitting this PR, please make sure you have:

  • run npm run test and npm run lint and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

Copy link
Contributor

@sadiqkhoja sadiqkhoja left a comment

Choose a reason for hiding this comment

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

a minor change, rest looks good

@@ -3,6 +3,12 @@ import { comparator } from 'ramda';
import { dataStore } from './data-store';
import { extendedProjects } from './projects';

const normalizeProperty = (property) => ({
odataName: property.name,
Copy link
Contributor

Choose a reason for hiding this comment

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

odataName: property.odataName ?? property.name

Copy link
Member Author

Choose a reason for hiding this comment

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

property.name is the default odataName. The defaults are merged with property using ...property, so if property specifies its own odataName, it will overwrite the default.

@matthew-white matthew-white merged commit 658c07c into master May 24, 2023
@matthew-white matthew-white deleted the property-odata-name branch May 24, 2023 02:29
@matthew-white
Copy link
Member Author

Once it's on staging, I can verify it against the entity mentioned in the issue.

Confirmed that the value of the property circumference.cm is now shown in the table. 🎉

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.

Dataset properties that are not valid OData identifiers are always empty in entities table
2 participants