-
Notifications
You must be signed in to change notification settings - Fork 177
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
#2093 combine s group menus and remove generic s group #2140
#2093 combine s group menus and remove generic s group #2140
Conversation
(prop) => prop !== 'type' && prop !== 'context' && prop !== 'fieldName' | ||
) | ||
.map((prop) => { | ||
return prop === 'radiobuttons' ? ( |
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 propose to don't use two nested ternary operators.
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.
Done. Thank you.
Object.keys(schemes[type].properties) | ||
.filter((prop) => prop !== 'type') | ||
.map((prop) => { | ||
const props = {} |
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.
Small proposal, may be the following can be better:
if (sGroupProperty === 'connectivity') {
<Field
name={prop}
key={`${type}-${prop}`}
{...props}
component={Select}
options={getSelectOptionsFromSchema(schemes[type].properties[prop])}
/>
}
const propsMapping = {
name: { maxLength: 15 },
fieldName: { maxLength: 30 },
fieldValue: { type: 'textarea' },
radiobuttons: { type: 'radio' }
}
const props = propsMapping[sGroupProperty] || {}
return <Field name={prop} key={`${type}-${prop}`} {...props} />
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.
Done. Really good suggestions, thank you so much.
* Combine sdata to sgroup modal * Remove s-group data from left toolbar * Remove Data S-Group modal * Make code more readable
Resolves #2093
For reviewers:
Before:
After:
More details: https://excalidraw.com/#json=akG_vHaNa4J29lFtRzbSY,eFq4Q1LGavcpuj25tG3Mtw