-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Convert TaxCloud panel to React #3121
Convert TaxCloud panel to React #3121
Conversation
- add some i18n text
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.
This is sort of an incomplete conversion. We should be converting this to the container/component pattern and eliminate all the Blaze we can.
); | ||
}; | ||
|
||
TaxCloudSettingsForm.propTypes = { |
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.
Let's document propTypes like here:
https://github.com/reactioncommerce/reaction-jsdoc/blob/master/README.md#document-a-react-components
* @since 1.5.1 | ||
* @return {Object} - returns the data found for the said Package. | ||
*/ | ||
function getPackageData(pkgName) { |
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.
Let's use this function instead:
reaction/server/api/core/core.js
Line 434 in 8521e1d
getPackageSettings(name) { |
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.
So I think we want to pretty much eliminate all this code in the old template file and replace this with a container and just have a placeholder that renders the container.
@zenweasel Roger that. Implementing those reviews right away. |
This is the container example I was talking about reaction/imports/plugins/core/checkout/client/containers/completedOrderContainer.js Line 1 in 7ead8c0
See how it relates to the component here:
|
Roger that @zenweasel . That example is really helpful. |
Status updateThis PR is currently WIP because I'm busy implementing the changes above. |
Status updateTwo of the reviews above have been implemented. The one that remains is to create and use the container component discussed above. |
Status updateReview #3 has been implemented. Will soon remove the [WIP] tag, but only after some more testing/linting. |
Suggested method is not the same as requirements
Roger that @zenweasel . I'll work on adding tests for the |
@zenweasel After adding the specs for |
@zenweasel I have pushed the tests for NB: For now, I used |
UPDATEI added a spec for when cc @zenweasel |
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.
The JSDoc comments look good to me!
<div className="rui taxcloud-settings-form"> | ||
{!settings.taxcloud.apiLoginId && | ||
<div className="alert alert-info"> | ||
<span data-i18n="admin.taxSettings.taxcloudCredentials">Add API Login ID to enable</span> |
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 use data-i18n
use the translation component <Components.Translation defaultValue="" i18nkey="" />
bba0eb5
@mikemurray Thanks for catching the data-i18n. In the interest of getting this merged I made the requested change. If that's correct can you review and approve? |
@mikemurray Can you double-check that my changes are good and we can approve? |
Thanks @mikemurray |
…ud-panel-to-react-3093 Convert TaxCloud panel to React
Resolves #3093 .
This PR converts the TaxCloud settings panel from using AutoForm to using React for editing its settings.
Test Instructions
Package
collection for the package withname: taxes-taxcloud
. Then cycle between editing the TaxCloud settings form and checking thesettings.taxcloud
field in the said package. You'll notice that that field always changes as appropriate.