generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…as it is in the Core now
Refs #277684 - remove InternalWidgetUrl from customizations
@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} |
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 |
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
approved these changes
Oct 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr should only be merged after the frontend is upgraded to Volto 17.20