@plone/volto 17.0.0-alpha.17 → 17.0.0-alpha.19
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +57 -0
- package/cypress/support/commands.js +17 -0
- package/locales/ca/LC_MESSAGES/volto.po +39 -0
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +39 -0
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +39 -0
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +39 -0
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +39 -0
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +39 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +39 -0
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +40 -1
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +39 -0
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +39 -0
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +39 -0
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +39 -0
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +39 -0
- package/locales/ro.json +1 -1
- package/locales/volto.pot +39 -0
- package/locales/zh_CN/LC_MESSAGES/volto.po +39 -0
- package/locales/zh_CN.json +1 -1
- package/package.json +2 -2
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx +21 -212
- package/packages/volto-slate/src/blocks/Table/schema.js +122 -0
- package/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js +14 -5
- package/packages/volto-slate/src/utils/blocks.js +7 -0
- package/packages/volto-slate/src/widgets/RichTextWidget.jsx +15 -8
- package/src/components/index.js +1 -0
- package/src/components/manage/Blocks/Search/components/Facets.jsx +6 -2
- package/src/components/manage/Blocks/Search/components/SearchInput.jsx +9 -2
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +12 -1
- package/src/components/manage/Blocks/ToC/Schema.jsx +5 -1
- package/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +142 -8
- package/src/components/manage/LinksToItem/LinksToItem.jsx +209 -0
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +97 -0
- package/src/components/manage/Toolbar/More.jsx +15 -0
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +1 -1
- package/src/components/theme/Breadcrumbs/Breadcrumbs.jsx +52 -99
- package/src/components/theme/Breadcrumbs/Breadcrumbs.stories.jsx +14 -13
- package/src/components/theme/Comments/CommentEditModal.jsx +63 -115
- package/src/components/theme/ContactForm/ContactForm.jsx +108 -192
- package/src/components/theme/ContactForm/ContactForm.stories.jsx +1 -1
- package/src/components/theme/ContactForm/ContactForm.test.jsx +2 -3
- package/src/components/theme/Login/Login.jsx +1 -1
- package/src/components/theme/SearchWidget/SearchWidget.jsx +38 -98
- package/src/components/theme/View/LinkView.jsx +51 -79
- package/src/config/NonContentRoutes.jsx +1 -0
- package/src/config/index.js +2 -0
- package/src/config/server.js +2 -0
- package/src/express-middleware/ok.js +16 -0
- package/src/hooks/client/useClient.js +11 -0
- package/src/hooks/index.js +1 -0
- package/src/routes.js +9 -0
- package/theme/themes/pastanaga/extras/main.less +2 -1
- package/theme/themes/pastanaga/extras/toc.less +29 -0
- package/news/4351.bugfix +0 -1
- package/news/4725.bugfix +0 -1
- package/news/4932.bugfix +0 -1
- package/news/4941.documentation +0 -1
- package/news/4951.breaking +0 -1
- package/news/4962.feature +0 -1
- package/news/4964.bugfix +0 -1
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* Comment edit modal.
|
|
3
|
-
* @module components/theme/Comments/CommentEditModal
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { Component } from 'react';
|
|
1
|
+
import { useEffect } from 'react';
|
|
7
2
|
import PropTypes from 'prop-types';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { defineMessages, injectIntl } from 'react-intl';
|
|
3
|
+
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
|
|
4
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
11
5
|
|
|
6
|
+
import { usePrevious } from '@plone/volto/helpers';
|
|
12
7
|
import { updateComment } from '@plone/volto/actions';
|
|
13
8
|
import { ModalForm } from '@plone/volto/components';
|
|
14
9
|
|
|
@@ -27,116 +22,69 @@ const messages = defineMessages({
|
|
|
27
22
|
},
|
|
28
23
|
});
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class CommentEditModal extends Component {
|
|
36
|
-
/**
|
|
37
|
-
* Property types.
|
|
38
|
-
* @property {Object} propTypes Property types.
|
|
39
|
-
* @static
|
|
40
|
-
*/
|
|
41
|
-
static propTypes = {
|
|
42
|
-
updateComment: PropTypes.func.isRequired,
|
|
43
|
-
id: PropTypes.string,
|
|
44
|
-
text: PropTypes.string,
|
|
45
|
-
request: PropTypes.shape({
|
|
46
|
-
loading: PropTypes.bool,
|
|
47
|
-
loaded: PropTypes.bool,
|
|
48
|
-
}).isRequired,
|
|
49
|
-
open: PropTypes.bool.isRequired,
|
|
50
|
-
onOk: PropTypes.func.isRequired,
|
|
51
|
-
onCancel: PropTypes.func.isRequired,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Default properties.
|
|
56
|
-
* @property {Object} defaultProps Default properties.
|
|
57
|
-
* @static
|
|
58
|
-
*/
|
|
59
|
-
static defaultProps = {
|
|
60
|
-
id: '',
|
|
61
|
-
text: '',
|
|
62
|
-
};
|
|
25
|
+
const CommentEditModal = (props) => {
|
|
26
|
+
const intl = useIntl();
|
|
27
|
+
const dispatch = useDispatch();
|
|
28
|
+
const { onOk, open, onCancel } = props;
|
|
29
|
+
const request = useSelector((state) => state.comments.update, shallowEqual);
|
|
63
30
|
|
|
64
|
-
|
|
65
|
-
* Constructor
|
|
66
|
-
* @method constructor
|
|
67
|
-
* @param {Object} props Component properties
|
|
68
|
-
* @constructs CommentEditModal
|
|
69
|
-
*/
|
|
70
|
-
constructor(props) {
|
|
71
|
-
super(props);
|
|
72
|
-
this.onSubmit = this.onSubmit.bind(this);
|
|
73
|
-
}
|
|
31
|
+
const prevRequestLoading = usePrevious(request.loading);
|
|
74
32
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* @param {Object} nextProps Next properties
|
|
79
|
-
* @returns {undefined}
|
|
80
|
-
*/
|
|
81
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
82
|
-
if (this.props.request.loading && nextProps.request.loaded) {
|
|
83
|
-
this.props.onOk();
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (prevRequestLoading && request.loaded) {
|
|
35
|
+
onOk();
|
|
84
36
|
}
|
|
85
|
-
}
|
|
37
|
+
}, [onOk, prevRequestLoading, request.loaded]);
|
|
86
38
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
* @param {Object} data Form data
|
|
91
|
-
* @returns {undefined}
|
|
92
|
-
*/
|
|
93
|
-
onSubmit(data) {
|
|
94
|
-
this.props.updateComment(this.props.id, data.text);
|
|
95
|
-
}
|
|
39
|
+
const onSubmit = (data) => {
|
|
40
|
+
dispatch(updateComment(props.id, data.text));
|
|
41
|
+
};
|
|
96
42
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
],
|
|
119
|
-
properties: {
|
|
120
|
-
text: {
|
|
121
|
-
title: this.props.intl.formatMessage(messages.comment),
|
|
122
|
-
type: 'string',
|
|
123
|
-
description: '',
|
|
124
|
-
},
|
|
43
|
+
return (
|
|
44
|
+
props.open && (
|
|
45
|
+
<ModalForm
|
|
46
|
+
open={open}
|
|
47
|
+
onSubmit={onSubmit}
|
|
48
|
+
onCancel={onCancel}
|
|
49
|
+
formData={{ text: props.text }}
|
|
50
|
+
title={intl.formatMessage(messages.editComment)}
|
|
51
|
+
schema={{
|
|
52
|
+
fieldsets: [
|
|
53
|
+
{
|
|
54
|
+
id: 'default',
|
|
55
|
+
title: intl.formatMessage(messages.default),
|
|
56
|
+
fields: ['text'],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
properties: {
|
|
60
|
+
text: {
|
|
61
|
+
title: intl.formatMessage(messages.comment),
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: '',
|
|
125
64
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
}
|
|
65
|
+
},
|
|
66
|
+
required: ['text'],
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
CommentEditModal.propTypes = {
|
|
74
|
+
id: PropTypes.string.isRequired,
|
|
75
|
+
text: PropTypes.string.isRequired,
|
|
76
|
+
request: PropTypes.shape({
|
|
77
|
+
loading: PropTypes.bool,
|
|
78
|
+
loaded: PropTypes.bool,
|
|
79
|
+
}),
|
|
80
|
+
open: PropTypes.bool.isRequired,
|
|
81
|
+
onOk: PropTypes.func.isRequired,
|
|
82
|
+
onCancel: PropTypes.func.isRequired,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
CommentEditModal.defaultProps = {
|
|
86
|
+
id: '',
|
|
87
|
+
text: '',
|
|
88
|
+
};
|
|
133
89
|
|
|
134
|
-
export default
|
|
135
|
-
injectIntl,
|
|
136
|
-
connect(
|
|
137
|
-
(state) => ({
|
|
138
|
-
request: state.comments.update,
|
|
139
|
-
}),
|
|
140
|
-
{ updateComment },
|
|
141
|
-
),
|
|
142
|
-
)(CommentEditModal);
|
|
90
|
+
export default CommentEditModal;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
* Contact Form container.
|
|
3
|
-
* @module components/theme/ContactForm/ContactForm
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { Component } from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import { Helmet } from '@plone/volto/helpers';
|
|
9
|
-
import { connect } from 'react-redux';
|
|
10
|
-
import { compose } from 'redux';
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
11
2
|
import { Portal } from 'react-portal';
|
|
12
3
|
import { Container, Message, Icon } from 'semantic-ui-react';
|
|
13
|
-
import { defineMessages,
|
|
14
|
-
import { Link,
|
|
4
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
5
|
+
import { Link, useHistory, useLocation } from 'react-router-dom';
|
|
15
6
|
import { toast } from 'react-toastify';
|
|
16
7
|
|
|
17
|
-
import { Form, Toolbar, Toast } from '@plone/volto/components';
|
|
18
8
|
import { emailNotification } from '@plone/volto/actions';
|
|
19
|
-
import {
|
|
9
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
10
|
+
import { Form, Toolbar, Toast } from '@plone/volto/components';
|
|
11
|
+
import { getBaseUrl, Helmet, usePrevious } from '@plone/volto/helpers';
|
|
12
|
+
import { useClient } from '@plone/volto/hooks';
|
|
20
13
|
|
|
21
14
|
const messages = defineMessages({
|
|
22
15
|
send: {
|
|
@@ -65,195 +58,118 @@ const messages = defineMessages({
|
|
|
65
58
|
},
|
|
66
59
|
});
|
|
67
60
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*/
|
|
73
|
-
export class ContactFormComponent extends Component {
|
|
74
|
-
/**
|
|
75
|
-
* Property types.
|
|
76
|
-
* @property {Object} propTypes Property types.
|
|
77
|
-
* @static
|
|
78
|
-
*/
|
|
79
|
-
static propTypes = {
|
|
80
|
-
emailNotification: PropTypes.func.isRequired,
|
|
81
|
-
error: PropTypes.shape({
|
|
82
|
-
message: PropTypes.string,
|
|
83
|
-
}),
|
|
84
|
-
loading: PropTypes.bool,
|
|
85
|
-
loaded: PropTypes.bool,
|
|
86
|
-
pathname: PropTypes.string.isRequired,
|
|
87
|
-
};
|
|
61
|
+
const useEmailNotification = () => {
|
|
62
|
+
const loading = useSelector((state) => state.emailNotification.loading);
|
|
63
|
+
const loaded = useSelector((state) => state.emailNotification.loaded);
|
|
64
|
+
const error = useSelector((state) => state.emailNotification.error);
|
|
88
65
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
66
|
+
return { loading, loaded, error };
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const ContactFormComponent = () => {
|
|
70
|
+
const history = useHistory();
|
|
71
|
+
const { pathname } = useLocation();
|
|
72
|
+
const dispatch = useDispatch();
|
|
73
|
+
const intl = useIntl();
|
|
74
|
+
const isClient = useClient();
|
|
99
75
|
|
|
100
|
-
|
|
101
|
-
* Constructor
|
|
102
|
-
* @method constructor
|
|
103
|
-
* @param {Object} props Component properties
|
|
104
|
-
* @constructs WysiwygEditor
|
|
105
|
-
*/
|
|
106
|
-
constructor(props) {
|
|
107
|
-
super(props);
|
|
108
|
-
this.onSubmit = this.onSubmit.bind(this);
|
|
109
|
-
this.onCancel = this.onCancel.bind(this);
|
|
110
|
-
this.state = { isClient: false };
|
|
111
|
-
}
|
|
76
|
+
const { loaded, loading, error } = useEmailNotification();
|
|
112
77
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* @returns {undefined}
|
|
118
|
-
*/
|
|
119
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
120
|
-
if (this.props.loading && nextProps.loaded) {
|
|
78
|
+
const prevloading = usePrevious(loading);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (prevloading && loaded) {
|
|
121
82
|
toast.success(
|
|
122
83
|
<Toast
|
|
123
84
|
success
|
|
124
|
-
title={
|
|
125
|
-
content={
|
|
85
|
+
title={intl.formatMessage(messages.success)}
|
|
86
|
+
content={intl.formatMessage(messages.messageSent)}
|
|
126
87
|
/>,
|
|
127
88
|
);
|
|
128
89
|
}
|
|
129
|
-
}
|
|
90
|
+
}, [intl, loaded, prevloading]);
|
|
130
91
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*/
|
|
136
|
-
componentDidMount() {
|
|
137
|
-
this.setState({ isClient: true });
|
|
138
|
-
}
|
|
92
|
+
const onSubmit = (data) => {
|
|
93
|
+
const { from, message, name, subject } = data;
|
|
94
|
+
dispatch(emailNotification(from, message, name, subject));
|
|
95
|
+
};
|
|
139
96
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
* @param {Object} data Data object.
|
|
144
|
-
* @returns {undefined}
|
|
145
|
-
*/
|
|
146
|
-
onSubmit(data) {
|
|
147
|
-
this.props.emailNotification(
|
|
148
|
-
data.from,
|
|
149
|
-
data.message,
|
|
150
|
-
data.name,
|
|
151
|
-
data.subject,
|
|
152
|
-
);
|
|
153
|
-
}
|
|
97
|
+
const onCancel = useCallback(() => {
|
|
98
|
+
history.goBack();
|
|
99
|
+
}, [history]);
|
|
154
100
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
* @returns {string} Markup for the component.
|
|
167
|
-
*/
|
|
168
|
-
render() {
|
|
169
|
-
return (
|
|
170
|
-
<div id="contact-form">
|
|
171
|
-
<Container id="view">
|
|
172
|
-
<Helmet title={this.props.intl.formatMessage(messages.contactForm)} />
|
|
173
|
-
{this.props.error && (
|
|
174
|
-
<Message
|
|
175
|
-
icon="warning"
|
|
176
|
-
negative
|
|
177
|
-
attached
|
|
178
|
-
header={this.props.intl.formatMessage(messages.error)}
|
|
179
|
-
content={this.props.error.message}
|
|
180
|
-
/>
|
|
181
|
-
)}
|
|
182
|
-
<Form
|
|
183
|
-
onSubmit={this.onSubmit}
|
|
184
|
-
onCancel={this.onCancel}
|
|
185
|
-
formData={{ blocksLayoutFieldname: {} }}
|
|
186
|
-
submitLabel={this.props.intl.formatMessage(messages.send)}
|
|
187
|
-
resetAfterSubmit
|
|
188
|
-
title={this.props.intl.formatMessage(messages.contactForm)}
|
|
189
|
-
loading={this.props.loading}
|
|
190
|
-
schema={{
|
|
191
|
-
fieldsets: [
|
|
192
|
-
{
|
|
193
|
-
fields: ['name', 'from', 'subject', 'message'],
|
|
194
|
-
id: 'default',
|
|
195
|
-
title: this.props.intl.formatMessage(messages.default),
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
properties: {
|
|
199
|
-
name: {
|
|
200
|
-
title: this.props.intl.formatMessage(messages.name),
|
|
201
|
-
type: 'string',
|
|
202
|
-
},
|
|
203
|
-
from: {
|
|
204
|
-
title: this.props.intl.formatMessage(messages.from),
|
|
205
|
-
type: 'email',
|
|
206
|
-
},
|
|
207
|
-
subject: {
|
|
208
|
-
title: this.props.intl.formatMessage(messages.subject),
|
|
209
|
-
type: 'string',
|
|
210
|
-
},
|
|
211
|
-
message: {
|
|
212
|
-
title: this.props.intl.formatMessage(messages.message),
|
|
213
|
-
type: 'string',
|
|
214
|
-
widget: 'textarea',
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
required: ['from', 'message'],
|
|
218
|
-
}}
|
|
101
|
+
return (
|
|
102
|
+
<div id="contact-form">
|
|
103
|
+
<Container id="view">
|
|
104
|
+
<Helmet title={intl.formatMessage(messages.contactForm)} />
|
|
105
|
+
{error && (
|
|
106
|
+
<Message
|
|
107
|
+
icon="warning"
|
|
108
|
+
negative
|
|
109
|
+
attached
|
|
110
|
+
header={intl.formatMessage(messages.error)}
|
|
111
|
+
content={error.message}
|
|
219
112
|
/>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
113
|
+
)}
|
|
114
|
+
<Form
|
|
115
|
+
onSubmit={onSubmit}
|
|
116
|
+
onCancel={onCancel}
|
|
117
|
+
formData={{ blocksLayoutFieldname: {} }}
|
|
118
|
+
submitLabel={intl.formatMessage(messages.send)}
|
|
119
|
+
resetAfterSubmit
|
|
120
|
+
title={intl.formatMessage(messages.contactForm)}
|
|
121
|
+
loading={loading}
|
|
122
|
+
schema={{
|
|
123
|
+
fieldsets: [
|
|
124
|
+
{
|
|
125
|
+
fields: ['name', 'from', 'subject', 'message'],
|
|
126
|
+
id: 'default',
|
|
127
|
+
title: intl.formatMessage(messages.default),
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
properties: {
|
|
131
|
+
name: {
|
|
132
|
+
title: intl.formatMessage(messages.name),
|
|
133
|
+
type: 'string',
|
|
134
|
+
},
|
|
135
|
+
from: {
|
|
136
|
+
title: intl.formatMessage(messages.from),
|
|
137
|
+
type: 'email',
|
|
138
|
+
},
|
|
139
|
+
subject: {
|
|
140
|
+
title: intl.formatMessage(messages.subject),
|
|
141
|
+
type: 'string',
|
|
142
|
+
},
|
|
143
|
+
message: {
|
|
144
|
+
title: intl.formatMessage(messages.message),
|
|
145
|
+
type: 'string',
|
|
146
|
+
widget: 'textarea',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
required: ['from', 'message'],
|
|
150
|
+
}}
|
|
151
|
+
/>
|
|
152
|
+
{isClient && (
|
|
153
|
+
<Portal node={document.getElementById('toolbar')}>
|
|
154
|
+
<Toolbar
|
|
155
|
+
pathname={pathname}
|
|
156
|
+
hideDefaultViewButtons
|
|
157
|
+
inner={
|
|
158
|
+
<Link to={`${getBaseUrl(pathname)}`} className="item">
|
|
159
|
+
<Icon
|
|
160
|
+
name="arrow left"
|
|
161
|
+
size="big"
|
|
162
|
+
color="blue"
|
|
163
|
+
title={intl.formatMessage(messages.back)}
|
|
164
|
+
/>
|
|
165
|
+
</Link>
|
|
166
|
+
}
|
|
167
|
+
/>
|
|
168
|
+
</Portal>
|
|
169
|
+
)}
|
|
170
|
+
</Container>
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
246
174
|
|
|
247
|
-
export default
|
|
248
|
-
withRouter,
|
|
249
|
-
injectIntl,
|
|
250
|
-
connect(
|
|
251
|
-
(state, props) => ({
|
|
252
|
-
loading: state.emailNotification.loading,
|
|
253
|
-
loaded: state.emailNotification.loaded,
|
|
254
|
-
error: state.emailNotification.error,
|
|
255
|
-
pathname: props.location.pathname,
|
|
256
|
-
}),
|
|
257
|
-
{ emailNotification },
|
|
258
|
-
),
|
|
259
|
-
)(ContactFormComponent);
|
|
175
|
+
export default ContactFormComponent;
|
|
@@ -10,7 +10,6 @@ jest.mock('react-portal', () => ({
|
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
12
|
const mockStore = configureStore();
|
|
13
|
-
|
|
14
13
|
describe('Contact form', () => {
|
|
15
14
|
it('renders a contact form', () => {
|
|
16
15
|
const store = mockStore({
|
|
@@ -29,7 +28,7 @@ describe('Contact form', () => {
|
|
|
29
28
|
const component = renderer.create(
|
|
30
29
|
<Provider store={store}>
|
|
31
30
|
<MemoryRouter>
|
|
32
|
-
<ContactForm
|
|
31
|
+
<ContactForm />
|
|
33
32
|
</MemoryRouter>
|
|
34
33
|
</Provider>,
|
|
35
34
|
);
|
|
@@ -56,7 +55,7 @@ describe('Contact form', () => {
|
|
|
56
55
|
const component = renderer.create(
|
|
57
56
|
<Provider store={store}>
|
|
58
57
|
<MemoryRouter>
|
|
59
|
-
<ContactForm
|
|
58
|
+
<ContactForm />
|
|
60
59
|
</MemoryRouter>
|
|
61
60
|
</Provider>,
|
|
62
61
|
);
|