Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Refactor logic to render labels for required and optional fields #88

Open
pestevez opened this issue Mar 19, 2018 · 5 comments
Open

Refactor logic to render labels for required and optional fields #88

pestevez opened this issue Mar 19, 2018 · 5 comments

Comments

@pestevez
Copy link
Contributor

Requested by @mburak in #83

We have duplicated code to generate the icons for the labels of required and optional fields. Let's refactor the code by adding constants for the characters used to display the checkmark and bullet point, and also create a helper function to generate the labels based on the value of their respective prop.

@manishbisht
Copy link

I am interested in working this issue. Can I put the helper function in the RuleUtils.js ?

@pestevez
Copy link
Contributor Author

pestevez commented Apr 2, 2018

Thanks for your interest to work on this, @manishbisht. RuleUtils.js looks like a good place for a helper function; so I'd be happy to a review a pull request.

Also, you could also create a separate React component that uses the helper function. Just a thought, though...

@manishbisht
Copy link

Exactly !! Component will look much better. I was thinking about the same.

@manishbisht
Copy link

@pestevez I have added the RuleLabel Component and can you review the PR.

Once it is approved my next task will be to create a helped function in RuleUtils.js and then use the helper function to get the level so that the repeated code can be removed.

@manishbisht
Copy link

@pestevez I have added the component. I don't think we need the helper function now. Can you review the PR and let me know if it is still needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants