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

Remove customizations since they will be available in Volto17 core #265

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

tedw87
Copy link
Contributor

@tedw87 tedw87 commented Sep 26, 2024

This pr should only be merged after the frontend is upgraded to Volto 17.20

dobri1408 and others added 2 commits October 9, 2024 10:19
@avoinea
Copy link
Member

avoinea commented Oct 21, 2024

@dobri1408 I see there are some diff between InternalURLWidget volto 17.20.0 and our deleted version:

3a4,5
>  * Volto pr: https://github.com/plone/volto/pull/6036
>  * Remove after the pr has been merged and put in the right version
6c8
< import React, { useState } from 'react';
---
> import React, { useState, useEffect } from 'react';
18c20
<  * This is a widget used for getting and setting an internal url. You can also use
---
>  * This is the default widget used for the `remoteUrl` field. You can also use
24c26
<  *  widget: 'internal_url',
---
>  *  widget: 'url',
38c40
<     value,
---
>     value: propValue,
41a44
>   const [value, setValue] = useState(flattenToAppURL(propValue));
43a47,51
>   useEffect(() => {
>     if (propValue !== value) {
>       setValue(flattenToAppURL(propValue));
>     }
>   }, [propValue, value]);
48c56
<    * @returns {string} Empty string
---
>    * @returns {undefined}
51c59,60
<     onChange(id, '');
---
>     setValue('');
>     onChange(id, undefined);
65a75,76
>     setValue(newValue);
> 
76c87
<     onChange(id, newValue);
---
>     onChange(id, newValue === '' ? undefined : newValue);
90c101,103
<           onBlur={({ target }) => onBlur(id, target.value)}
---
>           onBlur={({ target }) =>
>             onBlur(id, target.value === '' ? undefined : target.value)
>           }
92,93c105,106
<           minLength={minLength}
<           maxLength={maxLength}
---
>           minLength={minLength || null}
>           maxLength={maxLength || null}

@dobri1408
Copy link
Contributor

The changes were made because the Volto components were updated by the core team during the review process, while our version was the initial one that I developed

@avoinea
Copy link
Member

avoinea commented Oct 21, 2024

Found the original diff from Volto 17.16.0:

3a4,5
>  * Volto pr: https://github.com/plone/volto/pull/6036
>  * Remove after the pr has been merged and put in the right version
6,7c8
< import React, { useState } from 'react';
< import { compose } from 'redux';
---
> import React, { useState, useEffect } from 'react';
10c11,12
< import { FormFieldWrapper, Icon } from '@plone/volto/components';
---
> import { Icon } from '@plone/volto/components';
> import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
37a40
>     value: propValue,
41c44
<   const [value, setValue] = useState(flattenToAppURL(props.value));
---
>   const [value, setValue] = useState(flattenToAppURL(propValue));
42a46,51
> 
>   useEffect(() => {
>     if (propValue !== value) {
>       setValue(flattenToAppURL(propValue));
>     }
>   }, [propValue, value]);
180c189
< export default compose(withObjectBrowser)(InternalUrlWidget);
---
> export default withObjectBrowser(InternalUrlWidget);

@avoinea avoinea merged commit cece189 into develop Oct 21, 2024
6 checks passed
@avoinea avoinea deleted the remove-customization-blocksform-form branch October 21, 2024 14:17
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.

3 participants