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

#2093 combine s group menus and remove generic s group #2140

Merged

Conversation

yuleicul
Copy link
Collaborator

@yuleicul yuleicul commented Jan 30, 2023

Resolves #2093

For reviewers:

Before:

image

After:

image

More details: https://excalidraw.com/#json=akG_vHaNa4J29lFtRzbSY,eFq4Q1LGavcpuj25tG3Mtw

@yuleicul yuleicul self-assigned this Jan 30, 2023
@yuleicul yuleicul marked this pull request as draft January 30, 2023 10:06
@yuleicul yuleicul marked this pull request as ready for review January 30, 2023 12:42
@yuleicul yuleicul requested a review from Nitvex January 30, 2023 12:43
(prop) => prop !== 'type' && prop !== 'context' && prop !== 'fieldName'
)
.map((prop) => {
return prop === 'radiobuttons' ? (
Copy link
Collaborator

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.

Copy link
Collaborator Author

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 = {}
Copy link
Collaborator

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} />

Copy link
Collaborator Author

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.

@yuleicul yuleicul requested a review from Nitvex February 9, 2023 05:39
@KonstantinEpam23 KonstantinEpam23 merged commit b6139d7 into master Feb 10, 2023
@KonstantinEpam23 KonstantinEpam23 deleted the #2093-combine-s-group-menus-and-remove-generic-s-group branch February 10, 2023 10:05
ansivgit pushed a commit that referenced this pull request Feb 22, 2023
* Combine sdata to sgroup modal

* Remove s-group data from left toolbar

* Remove Data S-Group modal

* Make code more readable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combine s-group menus and remove generic s-group
3 participants