@plone/volto 16.32.1 → 16.33.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.
Files changed (41) hide show
  1. package/.changelog.draft +17 -2
  2. package/CHANGELOG.md +21 -0
  3. package/locales/ca/LC_MESSAGES/volto.po +55 -13
  4. package/locales/ca.json +1 -1
  5. package/locales/de/LC_MESSAGES/volto.po +56 -14
  6. package/locales/de.json +1 -1
  7. package/locales/en/LC_MESSAGES/volto.po +55 -13
  8. package/locales/en.json +1 -1
  9. package/locales/es/LC_MESSAGES/volto.po +55 -13
  10. package/locales/es.json +1 -1
  11. package/locales/eu/LC_MESSAGES/volto.po +55 -13
  12. package/locales/eu.json +1 -1
  13. package/locales/fi/LC_MESSAGES/volto.po +55 -13
  14. package/locales/fi.json +1 -1
  15. package/locales/fr/LC_MESSAGES/volto.po +55 -13
  16. package/locales/fr.json +1 -1
  17. package/locales/it/LC_MESSAGES/volto.po +55 -13
  18. package/locales/it.json +1 -1
  19. package/locales/ja/LC_MESSAGES/volto.po +55 -13
  20. package/locales/ja.json +1 -1
  21. package/locales/nl/LC_MESSAGES/volto.po +55 -13
  22. package/locales/nl.json +1 -1
  23. package/locales/pt/LC_MESSAGES/volto.po +55 -13
  24. package/locales/pt.json +1 -1
  25. package/locales/pt_BR/LC_MESSAGES/volto.po +55 -13
  26. package/locales/pt_BR.json +1 -1
  27. package/locales/ro/LC_MESSAGES/volto.po +55 -13
  28. package/locales/ro.json +1 -1
  29. package/locales/volto.pot +56 -14
  30. package/locales/zh_CN/LC_MESSAGES/volto.po +55 -13
  31. package/locales/zh_CN.json +1 -1
  32. package/package.json +1 -1
  33. package/packages/volto-slate/package.json +1 -1
  34. package/src/actions/aliases/aliases.js +27 -7
  35. package/src/actions/aliases/aliases.test.js +1 -1
  36. package/src/components/manage/Controlpanels/Aliases.jsx +542 -583
  37. package/src/components/manage/Controlpanels/Aliases.test.jsx +7 -0
  38. package/src/components/manage/Form/ModalForm.jsx +3 -1
  39. package/src/constants/ActionTypes.js +1 -0
  40. package/src/helpers/Api/Api.js +12 -1
  41. package/src/middleware/api.js +3 -0
@@ -58,6 +58,13 @@ describe('Aliases', () => {
58
58
  locale: 'en',
59
59
  messages: {},
60
60
  },
61
+ site: {
62
+ data: {
63
+ features: {
64
+ filter_aliases_by_date: true,
65
+ },
66
+ },
67
+ },
61
68
  });
62
69
  const component = renderer.create(
63
70
  <Provider store={store}>
@@ -69,6 +69,7 @@ class ModalForm extends Component {
69
69
  required: PropTypes.arrayOf(PropTypes.string),
70
70
  }).isRequired,
71
71
  title: PropTypes.string.isRequired,
72
+ description: PropTypes.objectOf(PropTypes.any),
72
73
  formData: PropTypes.objectOf(PropTypes.any),
73
74
  submitError: PropTypes.string,
74
75
  onSubmit: PropTypes.func.isRequired,
@@ -210,7 +211,7 @@ class ModalForm extends Component {
210
211
  * @returns {string} Markup for the component.
211
212
  */
212
213
  render() {
213
- const { schema, onCancel } = this.props;
214
+ const { schema, onCancel, description } = this.props;
214
215
  const currentFieldset = schema.fieldsets[this.state.currentTab];
215
216
 
216
217
  const fields = map(currentFieldset.fields, (field) => ({
@@ -244,6 +245,7 @@ class ModalForm extends Component {
244
245
  onSubmit={this.onSubmit}
245
246
  error={state_errors || Boolean(this.props.submitError)}
246
247
  >
248
+ {description}
247
249
  <Message error>
248
250
  {state_errors ? (
249
251
  <FormattedMessage
@@ -135,6 +135,7 @@ export const MOVE_CONTENT_RULE = 'MOVE_CONTENT_RULE';
135
135
  export const GET_ALIASES = 'GET_ALIASES';
136
136
  export const ADD_ALIASES = 'ADD_ALIASES';
137
137
  export const REMOVE_ALIASES = 'REMOVE_ALIASES';
138
+ export const UPLOAD_ALIASES = 'UPLOAD_ALIASES';
138
139
  export const GET_USERSCHEMA = 'GET_USERSCHEMA';
139
140
  export const GET_UPGRADE = 'GET_UPGRADE';
140
141
  export const POST_UPGRADE = 'POST_UPGRADE';
@@ -50,7 +50,14 @@ class Api {
50
50
  methods.forEach((method) => {
51
51
  this[method] = (
52
52
  path,
53
- { params, data, type, headers = {}, checkUrl = false } = {},
53
+ {
54
+ params,
55
+ data,
56
+ type,
57
+ headers = {},
58
+ checkUrl = false,
59
+ attach = [],
60
+ } = {},
54
61
  ) => {
55
62
  let request;
56
63
  let promise = new Promise((resolve, reject) => {
@@ -88,6 +95,10 @@ class Api {
88
95
  request.send(data);
89
96
  }
90
97
 
98
+ attach.forEach((attachment) => {
99
+ request.attach.apply(request, attachment);
100
+ });
101
+
91
102
  request.end((err, response) => {
92
103
  if (
93
104
  checkUrl &&
@@ -170,6 +170,7 @@ const apiMiddlewareFactory = (api) => ({ dispatch, getState }) => (next) => (
170
170
  checkUrl: settings.actions_raising_api_errors.includes(
171
171
  action.type,
172
172
  ),
173
+ attach: item.attach,
173
174
  },
174
175
  ).then((reqres) => {
175
176
  return [...acc, reqres];
@@ -186,6 +187,7 @@ const apiMiddlewareFactory = (api) => ({ dispatch, getState }) => (next) => (
186
187
  checkUrl: settings.actions_raising_api_errors.includes(
187
188
  action.type,
188
189
  ),
190
+ attach: item.attach,
189
191
  }),
190
192
  ),
191
193
  )
@@ -195,6 +197,7 @@ const apiMiddlewareFactory = (api) => ({ dispatch, getState }) => (next) => (
195
197
  headers: request.headers,
196
198
  params: request.params,
197
199
  checkUrl: settings.actions_raising_api_errors.includes(action.type),
200
+ attach: request.attach,
198
201
  });
199
202
  actionPromise.then(
200
203
  (result) => {