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

ADDON-34289: Added Text, Radio and CheckBox components #116

Conversation

dkhatri-crest
Copy link
Contributor

ADDON-34289
Added Text, Radio and CheckBox components

@github-actions
Copy link

github-actions bot commented Mar 5, 2021

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

}

handleClick = (e) => {
this.props.handleClick(this.props.id, e.target.value);
Copy link
Contributor

Choose a reason for hiding this comment

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

What would be the type of e.target.value here? , if it's 0/1 then it's fine. but if it is true/false then you need to convert before calling the handleClick as you're expecting 0/1 in this.props.value . Also, rename the function to this.props.handleChange. because all the components will receive the same function.

Also, if possible then check what's expected value on REST Handler side for Radiobox. true/false or 0/1 and call this.props.handleChange with that value ? . So later We won't need to parse value again before REST call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated funcation name to this.props.handleChange and it returns 0/1 value with field's id.
for CheckBox REST Handler uses 0/1 value. So, no need to parse the value.
for RadioBar return value would be item value provided in the GlobalConfig which will be used in REST Handler.

value: PropTypes.string,
handleClick: PropTypes.func.isRequired,
field: PropTypes.string,
label: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, you won't need to handle label as discussed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

onChange={this.handleChange}
value={this.props.value}
key={this.props.field}
style={{ width: 200 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

just wondering, Do we explicitly need to set width here? because what if our label has long name ? If you've check with diff. scenarios then it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated and used inline argument which is working as expected with different scenarios.

inline
placeholder={this.props.controlOptions.placeholder}
className={this.props.field}
disabled={this.props.controlOptions.display === false ? true : false}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, this.props.controlOptions.display is used in form for to hide the component. That would be handle by ControlWarpper.
For, disabled you will receive this.props.disabled .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

disabled={this.props.disabled}
value={this.props.value}
onChange={this.handleChange}
type={this.props.encrypted === true ? 'password' : 'text'}
Copy link
Contributor

Choose a reason for hiding this comment

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

@dkhatri-crest No need to check this.props.encrypted === true
We can use this.props.encrypted ? 'password' : 'text'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

key={this.props.field}
value={this.props.value}
onClick={this.handleChange}
selected={this.props.value === 1 ? true : false}
Copy link
Contributor

Choose a reason for hiding this comment

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

@dkhatri-crest What should be the value of this.props.value?
If it's only 0 or 1 then we can simplify our statement like: this.props.value ? true : false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@github-actions
Copy link

github-actions bot commented Mar 8, 2021

Expected release notes (by @dkhatri-crest)

features:
Removed log line (1f51cb4)
Added schemaGenerator.py file (be0b945)
Fixed issue (887f419)
Fixed typo (668d2a5)
Added error modal component (bbde4cf)
Added parsing and validation functionality for globalConfig.json file (e690000)

fixes:
title in input and configuration page templates (6328fdf)
commented oauth realated logic from ucc-gen temporarily (6d08509)

others (will not be included in Semantic-Release notes):
Updated CheckBox and Text components (9cb3558)
Updated Text, Radio and CheckBox components (057b670)
Added Text, Radio and CheckBox components (200b680)
d7746da Add mulitselect compomemt
84b0e1e ADDON-34285 reverting script removal for link:app
feat: added axios call wrapper and updated package.json (5cb5f13)
ucc_ui_lib: updated webpack config according to guideline mentioned in react doc for code-splitting (57a81ec)
ucc_ui_lib: removed unused import (e490b81)
ucc_ui_lib: updated configs and structure to have single entry point js and template file (e04d1db)
d234bfb fix the output path for static files
update build scripts and circle ci config (a949f40)
ef5c95a removed old ucc ui lib
migrate to splunk-ui template structure and ci (bd099f4)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

@dkhatri-crest dkhatri-crest merged commit 83a08d1 into ucc_ui_lib_migration Mar 8, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2021
@ryanfaircloth
Copy link
Contributor

🎉 This PR is included in version 4.4.0-develop.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ryanfaircloth
Copy link
Contributor

🎉 This PR is included in version 5.0.0-develop.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ryanfaircloth
Copy link
Contributor

🎉 This PR is included in version 5.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ghost ghost deleted the feature/ADDON-34289-Text-Radio-and-CheckBox-components-using-SplunkUI branch July 12, 2021 09:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants