@eeacms/volto-cca-policy 0.1.60 → 0.1.61
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.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [0.1.61](https://github.com/eea/volto-cca-policy/compare/0.1.60...0.1.61) - 17 January 2024
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: Add ContentTypeLayout customization [kreafox - [`06f4419`](https://github.com/eea/volto-cca-policy/commit/06f4419f4ffe29df43cc32f4faf0913a561bab0b)]
|
|
12
|
+
|
|
7
13
|
### [0.1.60](https://github.com/eea/volto-cca-policy/compare/0.1.59...0.1.60) - 16 January 2024
|
|
8
14
|
|
|
9
15
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The render of the ContentTypeLayout component is customized (lines 441, 442)
|
|
3
|
+
* Handle the cases when the schema is undefined
|
|
4
|
+
* Content Type component.
|
|
5
|
+
* @module components/manage/Controlpanels/ContentTypeLayout
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React, { Component } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { connect } from 'react-redux';
|
|
11
|
+
import { compose } from 'redux';
|
|
12
|
+
import { Link } from 'react-router-dom';
|
|
13
|
+
import {
|
|
14
|
+
getParentUrl,
|
|
15
|
+
hasBlocksData,
|
|
16
|
+
getBlocksFieldname,
|
|
17
|
+
getBlocksLayoutFieldname,
|
|
18
|
+
} from '@plone/volto/helpers';
|
|
19
|
+
import { Portal } from 'react-portal';
|
|
20
|
+
import { Button, Segment } from 'semantic-ui-react';
|
|
21
|
+
import { toast } from 'react-toastify';
|
|
22
|
+
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
|
23
|
+
import { nth, join } from 'lodash';
|
|
24
|
+
import {
|
|
25
|
+
Error,
|
|
26
|
+
Form,
|
|
27
|
+
Icon,
|
|
28
|
+
Toolbar,
|
|
29
|
+
Sidebar,
|
|
30
|
+
Toast,
|
|
31
|
+
} from '@plone/volto/components';
|
|
32
|
+
import {
|
|
33
|
+
getSchema,
|
|
34
|
+
updateSchema,
|
|
35
|
+
getControlpanel,
|
|
36
|
+
updateControlpanel,
|
|
37
|
+
} from '@plone/volto/actions';
|
|
38
|
+
|
|
39
|
+
import saveSVG from '@plone/volto/icons/save.svg';
|
|
40
|
+
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
41
|
+
import backSVG from '@plone/volto/icons/back.svg';
|
|
42
|
+
|
|
43
|
+
const messages = defineMessages({
|
|
44
|
+
changesSaved: {
|
|
45
|
+
id: 'Changes saved.',
|
|
46
|
+
defaultMessage: 'Changes saved.',
|
|
47
|
+
},
|
|
48
|
+
back: {
|
|
49
|
+
id: 'Back',
|
|
50
|
+
defaultMessage: 'Back',
|
|
51
|
+
},
|
|
52
|
+
save: {
|
|
53
|
+
id: 'Save',
|
|
54
|
+
defaultMessage: 'Save',
|
|
55
|
+
},
|
|
56
|
+
cancel: {
|
|
57
|
+
id: 'Cancel',
|
|
58
|
+
defaultMessage: 'Cancel',
|
|
59
|
+
},
|
|
60
|
+
info: {
|
|
61
|
+
id: 'Info',
|
|
62
|
+
defaultMessage: 'Info',
|
|
63
|
+
},
|
|
64
|
+
enable: {
|
|
65
|
+
id: 'Enable editable Blocks',
|
|
66
|
+
defaultMessage: 'Enable editable Blocks',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* ContentTypeLayout class.
|
|
72
|
+
* @class ContentTypeLayout
|
|
73
|
+
* @extends Component
|
|
74
|
+
*/
|
|
75
|
+
class ContentTypeLayout extends Component {
|
|
76
|
+
/**
|
|
77
|
+
* Property types.
|
|
78
|
+
* @property {Object} propTypes Property types.
|
|
79
|
+
* @static
|
|
80
|
+
*/
|
|
81
|
+
static propTypes = {
|
|
82
|
+
updateControlpanel: PropTypes.func.isRequired,
|
|
83
|
+
getControlpanel: PropTypes.func.isRequired,
|
|
84
|
+
getSchema: PropTypes.func.isRequired,
|
|
85
|
+
updateSchema: PropTypes.func.isRequired,
|
|
86
|
+
id: PropTypes.string.isRequired,
|
|
87
|
+
parent: PropTypes.string.isRequired,
|
|
88
|
+
pathname: PropTypes.string.isRequired,
|
|
89
|
+
schemaRequest: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
90
|
+
cpanelRequest: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
91
|
+
schema: PropTypes.objectOf(PropTypes.any),
|
|
92
|
+
controlpanel: PropTypes.shape({
|
|
93
|
+
'@id': PropTypes.string,
|
|
94
|
+
data: PropTypes.object,
|
|
95
|
+
schema: PropTypes.object,
|
|
96
|
+
title: PropTypes.string,
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Default properties.
|
|
102
|
+
* @property {Object} defaultProps Default properties.
|
|
103
|
+
* @static
|
|
104
|
+
*/
|
|
105
|
+
static defaultProps = {
|
|
106
|
+
schema: {},
|
|
107
|
+
controlpanel: null,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Constructor
|
|
112
|
+
* @method constructor
|
|
113
|
+
* @param {Object} props Component properties
|
|
114
|
+
* @constructs ContentTypeLayout
|
|
115
|
+
*/
|
|
116
|
+
constructor(props) {
|
|
117
|
+
super(props);
|
|
118
|
+
|
|
119
|
+
this.state = {
|
|
120
|
+
visual: false,
|
|
121
|
+
content: null,
|
|
122
|
+
readOnlyBehavior: null,
|
|
123
|
+
error: null,
|
|
124
|
+
isClient: false,
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
this.form = React.createRef();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Component did mount
|
|
132
|
+
* @method componentDidMount
|
|
133
|
+
* @returns {undefined}
|
|
134
|
+
*/
|
|
135
|
+
componentDidMount() {
|
|
136
|
+
this.props.getControlpanel(join([this.props.parent, this.props.id], '/'));
|
|
137
|
+
this.props.getSchema(this.props.id);
|
|
138
|
+
this.setState({ isClient: true });
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Component will receive props
|
|
143
|
+
* @method componentWillReceiveProps
|
|
144
|
+
* @param {Object} nextProps Next properties
|
|
145
|
+
* @returns {undefined}
|
|
146
|
+
*/
|
|
147
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
148
|
+
// Control Panel GET
|
|
149
|
+
if (
|
|
150
|
+
this.props.cpanelRequest.get.loading &&
|
|
151
|
+
nextProps.cpanelRequest.get.error
|
|
152
|
+
) {
|
|
153
|
+
this.setState({
|
|
154
|
+
error: nextProps.cpanelRequest.get.error,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Schema GET
|
|
159
|
+
if (this.props.schemaRequest.loading && nextProps.schemaRequest.loaded) {
|
|
160
|
+
const properties = nextProps.schema?.properties || {};
|
|
161
|
+
const content = {};
|
|
162
|
+
for (const key in properties) {
|
|
163
|
+
const value = properties[key].default;
|
|
164
|
+
if (value) {
|
|
165
|
+
content[key] = value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (hasBlocksData(properties)) {
|
|
170
|
+
this.setState({
|
|
171
|
+
visual: true,
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const blocksFieldName = getBlocksFieldname(properties);
|
|
175
|
+
const blocksLayoutFieldname = getBlocksLayoutFieldname(properties);
|
|
176
|
+
content[blocksFieldName] = properties[blocksFieldName]?.default || {};
|
|
177
|
+
content[blocksLayoutFieldname] = properties[blocksLayoutFieldname]
|
|
178
|
+
?.default || { items: [] };
|
|
179
|
+
|
|
180
|
+
const blocksBehavior = properties[blocksFieldName]?.behavior || '';
|
|
181
|
+
this.setState({
|
|
182
|
+
readOnlyBehavior: !blocksBehavior.includes('generated')
|
|
183
|
+
? blocksBehavior
|
|
184
|
+
: '',
|
|
185
|
+
});
|
|
186
|
+
} else {
|
|
187
|
+
this.setState({
|
|
188
|
+
visual: false,
|
|
189
|
+
readOnlyBehavior: '',
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
this.setState({
|
|
194
|
+
content: content,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Schema updated
|
|
199
|
+
if (
|
|
200
|
+
this.props.schemaRequest.update.loading &&
|
|
201
|
+
nextProps.schemaRequest.update.loaded
|
|
202
|
+
) {
|
|
203
|
+
this.props.getSchema(this.props.id);
|
|
204
|
+
toast.info(
|
|
205
|
+
<Toast
|
|
206
|
+
info
|
|
207
|
+
title={this.props.intl.formatMessage(messages.info)}
|
|
208
|
+
content={this.props.intl.formatMessage(messages.changesSaved)}
|
|
209
|
+
/>,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Blocks behavior disabled
|
|
214
|
+
if (
|
|
215
|
+
this.props.cpanelRequest.update.loading &&
|
|
216
|
+
nextProps.cpanelRequest.update.loaded
|
|
217
|
+
) {
|
|
218
|
+
this.onEnableBlocks();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Submit handler
|
|
224
|
+
* @method onSubmit
|
|
225
|
+
* @param {object} data Form data.
|
|
226
|
+
* @returns {undefined}
|
|
227
|
+
*/
|
|
228
|
+
onSubmit = (data) => {
|
|
229
|
+
const schema = { properties: {} };
|
|
230
|
+
Object.keys(data)
|
|
231
|
+
.filter((k) => data[k])
|
|
232
|
+
.forEach((k) => (schema.properties[k] = { default: data[k] }));
|
|
233
|
+
this.props.updateSchema(this.props.id, schema);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Cancel handler
|
|
238
|
+
* @method onCancel
|
|
239
|
+
* @returns {undefined}
|
|
240
|
+
*/
|
|
241
|
+
onCancel = () => {
|
|
242
|
+
const url = getParentUrl(this.props.pathname);
|
|
243
|
+
this.props.history.push(getParentUrl(url));
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Enable blocks handler
|
|
248
|
+
* @method onEnableBlocks
|
|
249
|
+
* @returns {undefined}
|
|
250
|
+
*/
|
|
251
|
+
onEnableBlocks = () => {
|
|
252
|
+
const { properties = {} } = this.props.schema;
|
|
253
|
+
const blocksFieldName = getBlocksFieldname(properties);
|
|
254
|
+
const blocksLayoutFieldname = getBlocksLayoutFieldname(properties);
|
|
255
|
+
const schema = {
|
|
256
|
+
fieldsets: [
|
|
257
|
+
{
|
|
258
|
+
id: 'layout',
|
|
259
|
+
title: 'Layout',
|
|
260
|
+
fields: ['blocks', 'blocks_layout'],
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
properties: {
|
|
264
|
+
blocks: {
|
|
265
|
+
title: 'Blocks',
|
|
266
|
+
type: 'dict',
|
|
267
|
+
widget: 'json',
|
|
268
|
+
factory: 'JSONField',
|
|
269
|
+
default: properties[blocksFieldName]?.default || {},
|
|
270
|
+
},
|
|
271
|
+
blocks_layout: {
|
|
272
|
+
title: 'Blocks Layout',
|
|
273
|
+
type: 'dict',
|
|
274
|
+
widget: 'json',
|
|
275
|
+
factory: 'JSONField',
|
|
276
|
+
default: properties[blocksLayoutFieldname]?.default || { items: [] },
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
this.props.updateSchema(this.props.id, schema);
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Disable Blocks behavior handler
|
|
285
|
+
* @method onDisableBlocksBehavior
|
|
286
|
+
* @returns {undefined}
|
|
287
|
+
*/
|
|
288
|
+
onDisableBlocksBehavior = () => {
|
|
289
|
+
this.props.updateControlpanel(this.props.controlpanel['@id'], {
|
|
290
|
+
[this.state.readOnlyBehavior]: false,
|
|
291
|
+
'volto.blocks.editable.layout': true,
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Enable Blocks behavior handler
|
|
297
|
+
* @method onEnableBlocksBehavior
|
|
298
|
+
* @returns {undefined}
|
|
299
|
+
*/
|
|
300
|
+
onEnableBlocksBehavior = () => {
|
|
301
|
+
this.props.updateControlpanel(this.props.controlpanel['@id'], {
|
|
302
|
+
'volto.blocks.editable.layout': true,
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Render method.
|
|
308
|
+
* @method render
|
|
309
|
+
* @returns {string} Markup for the component.
|
|
310
|
+
*/
|
|
311
|
+
render() {
|
|
312
|
+
// Error
|
|
313
|
+
if (this.state.error) {
|
|
314
|
+
return <Error error={this.state.error} />;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (!this.state.visual) {
|
|
318
|
+
// Still loading
|
|
319
|
+
if (!this.state.content) {
|
|
320
|
+
return <div />;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Blocks are not enabled
|
|
324
|
+
return (
|
|
325
|
+
<>
|
|
326
|
+
<Segment
|
|
327
|
+
placeholder
|
|
328
|
+
id="page-controlpanel-layout"
|
|
329
|
+
className="ui container center aligned"
|
|
330
|
+
>
|
|
331
|
+
<div>
|
|
332
|
+
<FormattedMessage
|
|
333
|
+
id="Can not edit Layout for <strong>{type}</strong> content-type as it doesn't have support for <strong>Volto Blocks</strong> enabled"
|
|
334
|
+
defaultMessage="Can not edit Layout for <strong>{type}</strong> content-type as it doesn't have support for <strong>Volto Blocks</strong> enabled"
|
|
335
|
+
values={{
|
|
336
|
+
strong: (...chunks) => <strong>{chunks}</strong>,
|
|
337
|
+
type: this.props?.controlpanel?.title || this.props.id,
|
|
338
|
+
}}
|
|
339
|
+
/>
|
|
340
|
+
</div>
|
|
341
|
+
<div className="ui divider"></div>
|
|
342
|
+
<Button
|
|
343
|
+
primary
|
|
344
|
+
onClick={this.onEnableBlocksBehavior}
|
|
345
|
+
content={this.props.intl.formatMessage(messages.enable)}
|
|
346
|
+
/>
|
|
347
|
+
</Segment>
|
|
348
|
+
<Portal
|
|
349
|
+
node={this.state.isClient && document.getElementById('toolbar')}
|
|
350
|
+
>
|
|
351
|
+
<Toolbar
|
|
352
|
+
pathname={this.props.pathname}
|
|
353
|
+
hideDefaultViewButtons
|
|
354
|
+
inner={
|
|
355
|
+
<>
|
|
356
|
+
<Link className="item" to="#" onClick={() => this.onCancel()}>
|
|
357
|
+
<Icon
|
|
358
|
+
name={backSVG}
|
|
359
|
+
size="30px"
|
|
360
|
+
className="contents circled"
|
|
361
|
+
title={this.props.intl.formatMessage(messages.back)}
|
|
362
|
+
/>
|
|
363
|
+
</Link>
|
|
364
|
+
</>
|
|
365
|
+
}
|
|
366
|
+
/>
|
|
367
|
+
</Portal>
|
|
368
|
+
</>
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (this.state.readOnlyBehavior) {
|
|
373
|
+
return (
|
|
374
|
+
<>
|
|
375
|
+
<Segment
|
|
376
|
+
placeholder
|
|
377
|
+
id="page-controlpanel-layout"
|
|
378
|
+
className="ui container center aligned"
|
|
379
|
+
>
|
|
380
|
+
<div>
|
|
381
|
+
<FormattedMessage
|
|
382
|
+
id="Can not edit Layout for <strong>{type}</strong> content-type as the <strong>Blocks behavior</strong> is enabled and <strong>read-only</strong>"
|
|
383
|
+
defaultMessage="Can not edit Layout for <strong>{type}</strong> content-type as the <strong>Blocks behavior</strong> is enabled and <strong>read-only</strong>"
|
|
384
|
+
values={{
|
|
385
|
+
strong: (...chunks) => <strong>{chunks}</strong>,
|
|
386
|
+
type: this.props?.controlpanel?.title || this.props.id,
|
|
387
|
+
}}
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
<div className="ui divider"></div>
|
|
391
|
+
<Button
|
|
392
|
+
primary
|
|
393
|
+
onClick={this.onDisableBlocksBehavior}
|
|
394
|
+
content={this.props.intl.formatMessage(messages.enable)}
|
|
395
|
+
/>
|
|
396
|
+
</Segment>
|
|
397
|
+
<Portal
|
|
398
|
+
node={this.state.isClient && document.getElementById('toolbar')}
|
|
399
|
+
>
|
|
400
|
+
<Toolbar
|
|
401
|
+
pathname={this.props.pathname}
|
|
402
|
+
hideDefaultViewButtons
|
|
403
|
+
inner={
|
|
404
|
+
<>
|
|
405
|
+
<Link className="item" to="#" onClick={() => this.onCancel()}>
|
|
406
|
+
<Icon
|
|
407
|
+
name={backSVG}
|
|
408
|
+
size="30px"
|
|
409
|
+
className="contents circled"
|
|
410
|
+
title={this.props.intl.formatMessage(messages.back)}
|
|
411
|
+
/>
|
|
412
|
+
</Link>
|
|
413
|
+
</>
|
|
414
|
+
}
|
|
415
|
+
/>
|
|
416
|
+
</Portal>
|
|
417
|
+
</>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Render layout editor
|
|
422
|
+
const blocksFieldName = getBlocksFieldname(
|
|
423
|
+
this.props.schema?.properties || {},
|
|
424
|
+
);
|
|
425
|
+
const blocksLayoutFieldname = getBlocksLayoutFieldname(
|
|
426
|
+
this.props.schema?.properties || {},
|
|
427
|
+
);
|
|
428
|
+
return (
|
|
429
|
+
<div id="page-controlpanel-layout">
|
|
430
|
+
<Form
|
|
431
|
+
isAdminForm
|
|
432
|
+
ref={this.form}
|
|
433
|
+
schema={{
|
|
434
|
+
fieldsets: [
|
|
435
|
+
{
|
|
436
|
+
id: 'layout',
|
|
437
|
+
title: 'Layout',
|
|
438
|
+
fields: [blocksFieldName, blocksLayoutFieldname],
|
|
439
|
+
},
|
|
440
|
+
],
|
|
441
|
+
properties: {
|
|
442
|
+
...(this.props.schema?.properties[blocksFieldName] || {}),
|
|
443
|
+
...(this.props.schema?.properties[blocksLayoutFieldname] || {}),
|
|
444
|
+
// ...this.props.schema.properties[blocksFieldName],
|
|
445
|
+
// ...this.props.schema.properties[blocksLayoutFieldname],
|
|
446
|
+
},
|
|
447
|
+
required: [],
|
|
448
|
+
}}
|
|
449
|
+
formData={this.state.content}
|
|
450
|
+
onSubmit={this.onSubmit}
|
|
451
|
+
onCancel={this.onCancel}
|
|
452
|
+
pathname={this.props.pathname}
|
|
453
|
+
visual={this.state.visual}
|
|
454
|
+
hideActions
|
|
455
|
+
/>
|
|
456
|
+
<Portal
|
|
457
|
+
node={this.state.isClient && document.getElementById('sidebar')}
|
|
458
|
+
>
|
|
459
|
+
<Sidebar settingsTab={true} documentTab={false} />
|
|
460
|
+
</Portal>
|
|
461
|
+
<Portal
|
|
462
|
+
node={this.state.isClient && document.getElementById('toolbar')}
|
|
463
|
+
>
|
|
464
|
+
<Toolbar
|
|
465
|
+
pathname={this.props.pathname}
|
|
466
|
+
hideDefaultViewButtons
|
|
467
|
+
inner={
|
|
468
|
+
<>
|
|
469
|
+
<Button
|
|
470
|
+
id="toolbar-save"
|
|
471
|
+
className="save"
|
|
472
|
+
aria-label={this.props.intl.formatMessage(messages.save)}
|
|
473
|
+
onClick={() => this.form.current.onSubmit()}
|
|
474
|
+
disabled={this.props.schemaRequest.update.loading}
|
|
475
|
+
loading={this.props.schemaRequest.update.loading}
|
|
476
|
+
>
|
|
477
|
+
<Icon
|
|
478
|
+
name={saveSVG}
|
|
479
|
+
className="circled"
|
|
480
|
+
size="30px"
|
|
481
|
+
title={this.props.intl.formatMessage(messages.save)}
|
|
482
|
+
/>
|
|
483
|
+
</Button>
|
|
484
|
+
<Button
|
|
485
|
+
className="cancel"
|
|
486
|
+
aria-label={this.props.intl.formatMessage(messages.cancel)}
|
|
487
|
+
onClick={() => this.onCancel()}
|
|
488
|
+
>
|
|
489
|
+
<Icon
|
|
490
|
+
name={clearSVG}
|
|
491
|
+
className="circled"
|
|
492
|
+
size="30px"
|
|
493
|
+
title={this.props.intl.formatMessage(messages.cancel)}
|
|
494
|
+
/>
|
|
495
|
+
</Button>
|
|
496
|
+
</>
|
|
497
|
+
}
|
|
498
|
+
/>
|
|
499
|
+
</Portal>
|
|
500
|
+
</div>
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export default compose(
|
|
506
|
+
injectIntl,
|
|
507
|
+
connect(
|
|
508
|
+
(state, props) => ({
|
|
509
|
+
schema: state.schema.schema,
|
|
510
|
+
schemaRequest: state.schema,
|
|
511
|
+
cpanelRequest: state.controlpanels,
|
|
512
|
+
controlpanel: state.controlpanels.controlpanel,
|
|
513
|
+
pathname: props.location.pathname,
|
|
514
|
+
id: nth(props.location.pathname.split('/'), -2),
|
|
515
|
+
parent: nth(props.location.pathname.split('/'), -3),
|
|
516
|
+
}),
|
|
517
|
+
{ getSchema, updateSchema, getControlpanel, updateControlpanel },
|
|
518
|
+
),
|
|
519
|
+
)(ContentTypeLayout);
|