-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add overridable tags #287
Add overridable tags #287
Conversation
computeFundingContents={computeFundingContents} | ||
/> | ||
|
||
<Overridable id="InvenioVocabularies.FundingField.AddAward.Button"> |
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.
<Overridable id="InvenioVocabularies.FundingField.AddAward.Button"> | |
<Overridable id="InvenioVocabularies.FundingField.actions.container"> |
I would go with a common container for the actions of this field, rather than wrapping each element separately. There might be more action buttons that can be added to this field, and common container allows for more flexibility as well as it reduces the amount of unique overridable IDs that we need to maintain in the code base
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.
We actually need these separate ids on individual elements since we just want to hide one of these buttons (we only want to allow adding custom awards in our project)
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 there would be less flexibility in wrapping the common container. You would have to override each element (including those you want to keep) and even the possible future elements, wouldn't you?
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 understand your point, and you are right on the fact we should allow overriding each of the elements as well. In this case, however, the overridable ID should be added in the component itself - either on the <Button>
in line 118 or inFundingModal
. While we are adding overridable IDs as wrappers (parent of several "subcomponents") then we identify it as a "container" - otherwise we have
InvenioVocabularies.FundingField.AddAward.Button
InvenioVocabularies.FundingField.AddCustom.Button
both wrapping two instantiations of FundingModal
component, which is semantically incorrect - the naming does not mention the modal itself whatsoever. This naming convention we reserved to be associated with a component definition, not instantiation, to avoid misunderstandings and inconsistencies in the naming.
I am happy to explain it more in details on how this naming convention was planned to be used over a call.
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.
Hello @SarahW91 I was reviewing both PRs, please check my comments in
inveniosoftware/invenio-rdm-records#1631 (review)
I believe we could better align over a zoom call. We could try to schedule it on discord. Please let me know what you think :)
"selectedFunding.funder", | ||
deserializedFunder | ||
); | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.RemoteSelectField.SelectedFundingFunderId"> |
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.
<Overridable id="InvenioVocabularies.CustomAwardForm.RemoteSelectField.SelectedFundingFunderId"> | |
<Overridable id="InvenioVocabularies.CustomAwardForm.container"> |
/> | ||
</Overridable> | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardInformation.Header"> |
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.
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardInformation.Header"> | |
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardInformation.Header.container"> |
</Header> | ||
</Overridable> | ||
<Form.Group widths="equal"> | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardNumber.TextField"> |
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.
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardNumber.TextField"> | |
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardNumber.container"> |
fieldPath="selectedFunding.award.number" | ||
/> | ||
</Overridable> | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardTitle.TextField"> |
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.
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardTitle.TextField"> | |
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardTitle.container"> |
fieldPath="selectedFunding.award.title" | ||
/> | ||
</Overridable> | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardUrl.TextField"> |
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.
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardUrl.TextField"> | |
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardUrl.container"> |
/> | ||
</Overridable> | ||
|
||
<Overridable id="InvenioVocabularies.FundingField.AddCustom.Button"> |
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.
<Overridable id="InvenioVocabularies.FundingField.AddCustom.Button"> | |
<Overridable id="InvenioVocabularies.FundingField.AddCustom.container"> |
...ries/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js
Outdated
Show resolved
Hide resolved
…s/src/contrib/forms/Funding/CustomAwardForm.js Add fieldPath attribute to Overridable tag Co-authored-by: Karolina <[email protected]>
fieldPath="selectedFunding.award.number" | ||
/> | ||
</Overridable> | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardTitleTextField.Container"> |
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.
suggestion: please apply the same as in the component above
fieldPath="selectedFunding.award.title" | ||
/> | ||
</Overridable> | ||
<Overridable id="InvenioVocabularies.CustomAwardForm.AwardUrlTextField.Container"> |
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.
suggestion: please apply the same as in the component above
Description
Added additional Overridable tags for a more finegrained control over React components.
Checklist
Third-party code
If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: