@plone/volto 16.18.0 → 16.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changelog.draft +6 -7
- package/CHANGELOG.md +17 -0
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/pyvenv.cfg +1 -1
- package/src/actions/language/language.js +1 -0
- package/src/components/theme/View/DefaultView.jsx +1 -1
- package/src/helpers/FormValidation/FormValidation.js +10 -1
- package/src/helpers/FormValidation/FormValidation.test.js +41 -0
- package/styles/Vocab/Plone/accept.txt +2 -0
- package/styles/Vocab/Plone/reject.txt +5 -0
package/.changelog.draft
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
## 16.
|
|
1
|
+
## 16.19.0 (2023-04-04)
|
|
2
2
|
|
|
3
3
|
### Feature
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- DefaultView (view of fields for content types with blocks disabled): Show field name as tip on hover of label. @ksuess [#4598](https://github.com/plone/volto/issues/4598)
|
|
6
|
+
- Set sameSite in I18N_LANGUAGE cookie @sneridagh [#4627](https://github.com/plone/volto/issues/4627)
|
|
6
7
|
|
|
7
8
|
### Bugfix
|
|
8
9
|
|
|
9
|
-
-
|
|
10
|
-
- InternalURl helper method should incorporate externalRoutes settings into consideration. @iFlameing [#4559](https://github.com/plone/volto/issues/4559)
|
|
11
|
-
- Update message add-on control panel: remove 'buildout', update reference. @ksuess [#4574](https://github.com/plone/volto/issues/4574)
|
|
10
|
+
- Fix regexp that checks valid URLs and improve tests [cekk] [#4601](https://github.com/plone/volto/issues/4601)
|
|
12
11
|
|
|
13
12
|
### Documentation
|
|
14
13
|
|
|
15
|
-
-
|
|
16
|
-
- Fix
|
|
14
|
+
- Added `JavaScript` and `NodeJS` as accepted spellings, and deviations of them as rejected spellings. @utkkkarshhh [#3092](https://github.com/plone/volto/issues/3092)
|
|
15
|
+
- Fix documentation build, add pins @sneridagh [#4626](https://github.com/plone/volto/issues/4626)
|
|
17
16
|
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 16.19.0 (2023-04-04)
|
|
12
|
+
|
|
13
|
+
### Feature
|
|
14
|
+
|
|
15
|
+
- DefaultView (view of fields for content types with blocks disabled): Show field name as tip on hover of label. @ksuess [#4598](https://github.com/plone/volto/issues/4598)
|
|
16
|
+
- Set sameSite in I18N_LANGUAGE cookie @sneridagh [#4627](https://github.com/plone/volto/issues/4627)
|
|
17
|
+
|
|
18
|
+
### Bugfix
|
|
19
|
+
|
|
20
|
+
- Fix regexp that checks valid URLs and improve tests [cekk] [#4601](https://github.com/plone/volto/issues/4601)
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
- Added `JavaScript` and `NodeJS` as accepted spellings, and deviations of them as rejected spellings. @utkkkarshhh [#3092](https://github.com/plone/volto/issues/3092)
|
|
25
|
+
- Fix documentation build, add pins @sneridagh [#4626](https://github.com/plone/volto/issues/4626)
|
|
26
|
+
|
|
27
|
+
|
|
11
28
|
## 16.18.0 (2023-03-22)
|
|
12
29
|
|
|
13
30
|
### Feature
|
package/package.json
CHANGED
package/pyvenv.cfg
CHANGED
|
@@ -65,7 +65,16 @@ const widgetValidation = {
|
|
|
65
65
|
},
|
|
66
66
|
url: {
|
|
67
67
|
isValidURL: (urlValue, urlObj, intlFunc) => {
|
|
68
|
-
|
|
68
|
+
var urlRegex = new RegExp(
|
|
69
|
+
'^(https?:\\/\\/)?' + // validate protocol
|
|
70
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
|
|
71
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))|' + // validate OR ip (v4) address
|
|
72
|
+
'(localhost)' + // validate OR localhost address
|
|
73
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
|
|
74
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
|
|
75
|
+
'(\\#[-a-z\\d_]*)?$', // validate fragment locator
|
|
76
|
+
'i',
|
|
77
|
+
);
|
|
69
78
|
const isValid = urlRegex.test(urlValue);
|
|
70
79
|
return !isValid ? intlFunc(messages.isValidURL) : null;
|
|
71
80
|
},
|
|
@@ -5,6 +5,7 @@ const schema = {
|
|
|
5
5
|
properties: {
|
|
6
6
|
username: { title: 'Username', type: 'string', description: '' },
|
|
7
7
|
email: { title: 'Email', type: 'string', widget: 'email', description: '' },
|
|
8
|
+
url: { title: 'url', type: 'string', widget: 'url', description: '' },
|
|
8
9
|
},
|
|
9
10
|
fieldsets: [
|
|
10
11
|
{ id: 'default', title: 'FIXME: User Data', fields: ['username'] },
|
|
@@ -87,5 +88,45 @@ describe('FormValidation', () => {
|
|
|
87
88
|
}),
|
|
88
89
|
).toEqual({});
|
|
89
90
|
});
|
|
91
|
+
it('validates incorrect url', () => {
|
|
92
|
+
formData.url = 'foo';
|
|
93
|
+
expect(
|
|
94
|
+
FormValidation.validateFieldsPerFieldset({
|
|
95
|
+
schema,
|
|
96
|
+
formData,
|
|
97
|
+
formatMessage,
|
|
98
|
+
}),
|
|
99
|
+
).toEqual({ url: [messages.isValidURL.defaultMessage] });
|
|
100
|
+
});
|
|
101
|
+
it('validates url', () => {
|
|
102
|
+
formData.url = 'https://plone.org/';
|
|
103
|
+
expect(
|
|
104
|
+
FormValidation.validateFieldsPerFieldset({
|
|
105
|
+
schema,
|
|
106
|
+
formData,
|
|
107
|
+
formatMessage,
|
|
108
|
+
}),
|
|
109
|
+
).toEqual({});
|
|
110
|
+
});
|
|
111
|
+
it('validates url with ip', () => {
|
|
112
|
+
formData.url = 'http://127.0.0.1:8080/Plone';
|
|
113
|
+
expect(
|
|
114
|
+
FormValidation.validateFieldsPerFieldset({
|
|
115
|
+
schema,
|
|
116
|
+
formData,
|
|
117
|
+
formatMessage,
|
|
118
|
+
}),
|
|
119
|
+
).toEqual({});
|
|
120
|
+
});
|
|
121
|
+
it('validates url with localhost', () => {
|
|
122
|
+
formData.url = 'http://localhost:8080/Plone';
|
|
123
|
+
expect(
|
|
124
|
+
FormValidation.validateFieldsPerFieldset({
|
|
125
|
+
schema,
|
|
126
|
+
formData,
|
|
127
|
+
formatMessage,
|
|
128
|
+
}),
|
|
129
|
+
).toEqual({});
|
|
130
|
+
});
|
|
90
131
|
});
|
|
91
132
|
});
|