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

Set filed's option problem #117

Open
yangwawa0323 opened this issue Feb 3, 2023 · 4 comments
Open

Set filed's option problem #117

yangwawa0323 opened this issue Feb 3, 2023 · 4 comments

Comments

@yangwawa0323
Copy link

yangwawa0323 commented Feb 3, 2023

There has a problem that is to set some optional field. I was debug by using the browser's develop tool , there is no any option field in the modified schema send to BE. By reading the source code , I found the problem where is.

In the FE SchemaOptionModal.jsx file.
the 4th parameter of the useEffect which call name is missed.

  useEffect(() => {
		- handleSchema(fieldInfo.id, fieldInfo.label, fieldInfo.field, option);
		+  handleSchema(fieldInfo.id, fieldInfo.label, fieldInfo.field, fieldInfo.name, option);
		
console.log('Im', option);
  }, [option]);

 
const handleSchema = (id, label, field, name, option) => {            
    // ...
}

WeChat Screenshot_20230203214027

@yangwawa0323
Copy link
Author

When change the has optional attribute filed, the old option is keepped. In CommonResourceModal.jsx

<FormControl fullWidth>
	<InputLabel id='resource-label'>Field</InputLabel>
	<Select
	labelId='resource-label'
        id='resource-id'
	 sx={{ mb: 0 }}
	 size='small'
	 label='Field'
	 name='field'
	 value={item.field}
	 onChange={(e) => {
		 handleSchema(
			 item.id,
			 item.label,
			 e.target.value,
			- e.target.value
			+ e.target.name,
			+ {}               // For the beginning, reset the option
	);
}}
>

@Girishbari
Copy link

problem has solved or not then, seems issues was already assigned to @yangwawa0323

@Bayyana-kiran
Copy link

Can u assign me i can work on this?

@Bayyana-kiran
Copy link

@yangwawa0323 In the above image only male is occuring ....so should i change that to male and female ???right??

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

No branches or pull requests

4 participants