-
Notifications
You must be signed in to change notification settings - Fork 25
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: data-items underscore properties #2323
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4fff756
fix: data-items underscore properties
chrismclarke 2434c87
test: dynamic data service meta fields
chrismclarke def2ae6
Merge branch 'master' of https://github.com/IDEMSInternational/parent…
chrismclarke 882ab08
Merge branch 'master' into fix/data-items-underscore
jfmcquade 4b9188d
Merge branch 'master' into fix/data-items-underscore
esmeetewinkel 8fdc03b
Merge branch 'master' into fix/data-items-underscore
esmeetewinkel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Don't we want to keep
[key: string]: any
to capture the fact that the doc will have other fields?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.
I think it can be argued either way - my slight preference for not emphasising the generic fields is loss of type-safety when trying to refer to the doc in code. e.g. if we changed
APP_META
to be something else likeAPP_PROTECTED
typescript won't catch the error in other components that refer to the code (as the previous APP_META field would still be allowed). So here the typescript is less trying to accurately represent the data, more representing the subset of data that will be accessed directly within code. If we later want to impose more fields for certain types of datalists we can just extend the base class to keep explicit as required.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.
Ah yeh, that makes sense. I was only seeing the typescript's purpose as a way of accurately representing the data, but I can see how it's more useful in cases like this to have the type-safety that comes with just representing a subset of the data.