@plone/volto 18.0.0-alpha.42 → 18.0.0-alpha.43
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 +72 -0
- package/finalreleasechangelog.py +48 -0
- package/locales/ca/LC_MESSAGES/volto.po +8 -12
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +9 -13
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +8 -12
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +9 -13
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +9 -13
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +9 -13
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +9 -13
- package/locales/fr.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +9 -13
- package/locales/hi.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +9 -13
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +8 -12
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +8 -12
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +8 -12
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +9 -13
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +8 -12
- package/locales/ro.json +1 -1
- package/locales/volto.pot +9 -13
- package/locales/zh_CN/LC_MESSAGES/volto.po +9 -13
- package/locales/zh_CN.json +1 -1
- package/package.json +3 -3
- package/razzle.config.js +1 -1
- package/src/components/manage/Actions/Actions.stories.jsx +138 -0
- package/src/components/manage/Add/Add.jsx +7 -4
- package/src/components/manage/BlockChooser/BlockChooser.jsx +9 -1
- package/src/components/manage/Blocks/Block/Edit.jsx +24 -8
- package/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +17 -1
- package/src/components/manage/Blocks/Block/Order/Item.jsx +3 -1
- package/src/components/manage/Blocks/Grid/View.jsx +3 -0
- package/src/components/manage/Blocks/LeadImage/Edit.jsx +74 -126
- package/src/components/manage/Blocks/Search/components/SortOn.jsx +82 -55
- package/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx +107 -176
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +15 -8
- package/src/components/manage/Blocks/ToC/Edit.jsx +36 -29
- package/src/components/manage/Blocks/Video/Edit.jsx +105 -172
- package/src/components/manage/Blocks/Video/Edit.stories.jsx +57 -0
- package/src/components/manage/Contents/Contents.jsx +3 -0
- package/src/components/manage/Contents/ContentsBreadcrumbs.stories.jsx +46 -0
- package/src/components/manage/Contents/ContentsPropertiesModal.jsx +85 -52
- package/src/components/manage/Contents/ContentsUploadModal.jsx +230 -323
- package/src/components/manage/Contents/ContentsUploadModal.stories.jsx +56 -0
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +323 -441
- package/src/components/manage/Controlpanels/Aliases.jsx +452 -580
- package/src/components/manage/Controlpanels/Aliases.stories.jsx +74 -0
- package/src/components/manage/Controlpanels/Controlpanel.jsx +41 -2
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +55 -24
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +162 -229
- package/src/components/manage/Controlpanels/Groups/RenderGroups.jsx +74 -122
- package/src/components/manage/Display/Display.jsx +92 -148
- package/src/components/manage/Display/Display.stories.jsx +46 -0
- package/src/components/manage/Edit/Edit.jsx +2 -4
- package/src/components/manage/Preferences/ChangePassword.jsx +94 -172
- package/src/components/manage/Preferences/ChangePassword.stories.jsx +41 -0
- package/src/components/manage/Preferences/PersonalInformation.jsx +50 -115
- package/src/components/manage/Preferences/PersonalPreferences.jsx +46 -100
- package/src/components/manage/Preferences/PersonalPreferences.stories.jsx +48 -0
- package/src/components/manage/Toolbar/More.jsx +308 -399
- package/src/components/manage/Widgets/DatetimeWidget.jsx +121 -175
- package/src/components/manage/Widgets/ReferenceWidget.jsx +134 -210
- package/src/components/theme/Register/Register.jsx +70 -142
- package/src/components/theme/Register/Register.stories.jsx +49 -0
- package/src/components/theme/Tags/Tags.jsx +19 -10
- package/src/components/theme/Tags/Tags.test.jsx +9 -11
- package/src/components/theme/View/AlbumView.jsx +122 -167
- package/src/components/theme/View/LinkView.jsx +4 -0
- package/src/components/theme/View/LinkView.test.jsx +2 -0
- package/src/components/theme/View/View.jsx +0 -6
- package/src/config/ControlPanels.js +49 -43
- package/src/config/config.test.js +1 -0
- package/src/config/index.js +16 -0
- package/src/config/slots.js +12 -0
- package/src/helpers/Blocks/Blocks.js +12 -7
- package/src/helpers/Blocks/Blocks.test.js +15 -0
- package/src/helpers/Blocks/cloneBlocks.ts +1 -1
- package/src/helpers/FormValidation/FormValidation.jsx +19 -2
- package/src/helpers/FormValidation/validators.ts +1 -1
- package/src/helpers/Url/Url.test.js +15 -2
- package/src/helpers/Url/urlRegex.js +1 -1
- package/src/helpers/index.js +2 -0
- package/src/middleware/api.js +4 -2
- package/src/middleware/index.js +1 -0
- package/src/middleware/userSessionReset.js +46 -0
- package/src/store.js +2 -0
- package/test-setup-config.jsx +3 -0
- package/theme/themes/pastanaga/extras/blocks.less +6 -0
- package/types/components/manage/Actions/Actions.stories.d.ts +8 -0
- package/types/components/manage/Blocks/LeadImage/Edit.d.ts +14 -5
- package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +0 -5
- package/types/components/manage/Blocks/ToC/Edit.d.ts +1 -6
- package/types/components/manage/Blocks/Video/Edit.d.ts +1 -1
- package/types/components/manage/Blocks/Video/Edit.stories.d.ts +8 -0
- package/types/components/manage/Contents/ContentsBreadcrumbs.stories.d.ts +8 -0
- package/types/components/manage/Contents/ContentsUploadModal.d.ts +14 -2
- package/types/components/manage/Contents/ContentsUploadModal.stories.d.ts +8 -0
- package/types/components/manage/Contents/index.d.ts +1 -1
- package/types/components/manage/Controlpanels/AddonsControlpanel.d.ts +2 -2
- package/types/components/manage/Controlpanels/Aliases.d.ts +2 -2
- package/types/components/manage/Controlpanels/Aliases.stories.d.ts +8 -0
- package/types/components/manage/Controlpanels/DatabaseInformation.d.ts +2 -2
- package/types/components/manage/Controlpanels/Groups/RenderGroups.d.ts +10 -5
- package/types/components/manage/Controlpanels/index.d.ts +4 -4
- package/types/components/manage/Display/Display.stories.d.ts +8 -0
- package/types/components/manage/Preferences/ChangePassword.d.ts +2 -2
- package/types/components/manage/Preferences/ChangePassword.stories.d.ts +8 -0
- package/types/components/manage/Preferences/PersonalInformation.d.ts +7 -2
- package/types/components/manage/Preferences/PersonalPreferences.d.ts +5 -1
- package/types/components/manage/Preferences/PersonalPreferences.stories.d.ts +8 -0
- package/types/components/manage/Toolbar/More.d.ts +8 -5
- package/types/components/manage/Widgets/DatetimeWidget.d.ts +0 -85
- package/types/components/manage/Widgets/DatetimeWidget.stories.d.ts +0 -1
- package/types/components/manage/Widgets/ReferenceWidget.d.ts +27 -2
- package/types/components/manage/Widgets/index.d.ts +1 -1
- package/types/components/theme/Register/Register.d.ts +2 -2
- package/types/components/theme/Register/Register.stories.d.ts +9 -0
- package/types/components/theme/Tags/Tags.d.ts +15 -7
- package/types/components/theme/View/AlbumView.d.ts +3 -17
- package/types/config/ControlPanels.d.ts +8 -0
- package/types/config/Widgets.d.ts +1 -1
- package/types/config/slots.d.ts +21 -0
- package/types/helpers/Blocks/Blocks.d.ts +6 -0
- package/types/helpers/FormValidation/FormValidation.d.ts +1 -0
- package/types/helpers/index.d.ts +2 -2
- package/types/middleware/index.d.ts +1 -0
- package/types/middleware/userSessionReset.d.ts +5 -0
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @module components/manage/Controlpanels/AddonsControlpanel
|
|
4
|
-
*/
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { connect } from 'react-redux';
|
|
8
|
-
import { compose } from 'redux';
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
|
|
9
3
|
import { Link } from 'react-router-dom';
|
|
10
4
|
import { createPortal } from 'react-dom';
|
|
5
|
+
import { useClient } from '@plone/volto/hooks';
|
|
11
6
|
import {
|
|
12
7
|
Accordion,
|
|
13
8
|
Button,
|
|
@@ -20,7 +15,7 @@ import {
|
|
|
20
15
|
Dimmer,
|
|
21
16
|
Loader,
|
|
22
17
|
} from 'semantic-ui-react';
|
|
23
|
-
import { FormattedMessage, defineMessages,
|
|
18
|
+
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
24
19
|
|
|
25
20
|
import {
|
|
26
21
|
installAddon,
|
|
@@ -131,461 +126,348 @@ const messages = defineMessages({
|
|
|
131
126
|
},
|
|
132
127
|
});
|
|
133
128
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
version: PropTypes.string,
|
|
155
|
-
description: PropTypes.string,
|
|
156
|
-
uninstall_profile_id: PropTypes.string,
|
|
157
|
-
upgrade_info: PropTypes.shape({
|
|
158
|
-
available: PropTypes.boolean,
|
|
159
|
-
}),
|
|
160
|
-
}),
|
|
161
|
-
).isRequired,
|
|
162
|
-
availableAddons: PropTypes.arrayOf(
|
|
163
|
-
PropTypes.shape({
|
|
164
|
-
'@id': PropTypes.string,
|
|
165
|
-
id: PropTypes.string,
|
|
166
|
-
title: PropTypes.string,
|
|
167
|
-
version: PropTypes.string,
|
|
168
|
-
description: PropTypes.string,
|
|
169
|
-
uninstall_profile_id: PropTypes.string,
|
|
170
|
-
upgrade_info: PropTypes.shape({
|
|
171
|
-
available: PropTypes.boolean,
|
|
172
|
-
}),
|
|
173
|
-
}),
|
|
174
|
-
).isRequired,
|
|
175
|
-
upgradableAddons: PropTypes.arrayOf(
|
|
176
|
-
PropTypes.shape({
|
|
177
|
-
'@id': PropTypes.string,
|
|
178
|
-
id: PropTypes.string,
|
|
179
|
-
title: PropTypes.string,
|
|
180
|
-
version: PropTypes.string,
|
|
181
|
-
description: PropTypes.string,
|
|
182
|
-
uninstall_profile_id: PropTypes.string,
|
|
183
|
-
upgrade_info: PropTypes.shape({
|
|
184
|
-
available: PropTypes.boolean,
|
|
185
|
-
}),
|
|
186
|
-
}),
|
|
187
|
-
).isRequired,
|
|
188
|
-
};
|
|
129
|
+
const AddonsControlpanel = (props) => {
|
|
130
|
+
const { title } = props;
|
|
131
|
+
const intl = useIntl();
|
|
132
|
+
const dispatch = useDispatch();
|
|
133
|
+
const pathname = props.location.pathname;
|
|
134
|
+
const [activeIndex, setactiveIndex] = useState(-1);
|
|
135
|
+
const isClient = useClient();
|
|
136
|
+
const installedAddons = useSelector(
|
|
137
|
+
(state) => state.addons.installedAddons,
|
|
138
|
+
shallowEqual,
|
|
139
|
+
);
|
|
140
|
+
const availableAddons = useSelector(
|
|
141
|
+
(state) => state.addons.availableAddons,
|
|
142
|
+
shallowEqual,
|
|
143
|
+
);
|
|
144
|
+
const upgradableAddons = useSelector(
|
|
145
|
+
(state) => state.addons.upgradableAddons,
|
|
146
|
+
shallowEqual,
|
|
147
|
+
);
|
|
148
|
+
const loadingAddons = useSelector((state) => state.addons.loading);
|
|
189
149
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
* @param {Object} props Component properties
|
|
194
|
-
* @constructs Sharing
|
|
195
|
-
*/
|
|
196
|
-
constructor(props) {
|
|
197
|
-
super(props);
|
|
198
|
-
this.onAccordionClick = this.onAccordionClick.bind(this);
|
|
199
|
-
this.onInstall = this.onInstall.bind(this);
|
|
200
|
-
this.onUninstall = this.onUninstall.bind(this);
|
|
201
|
-
this.onUpgrade = this.onUpgrade.bind(this);
|
|
202
|
-
this.state = {
|
|
203
|
-
activeIndex: -1,
|
|
204
|
-
installedAddons: [],
|
|
205
|
-
availableAddons: [],
|
|
206
|
-
upgradableAddons: [],
|
|
207
|
-
isClient: false,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
dispatch(listAddons());
|
|
152
|
+
}, [dispatch]);
|
|
210
153
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* @returns {undefined}
|
|
215
|
-
*/
|
|
216
|
-
componentDidMount() {
|
|
217
|
-
this.props.listAddons();
|
|
218
|
-
this.setState({ isClient: true });
|
|
219
|
-
}
|
|
154
|
+
const onInstall = useCallback(
|
|
155
|
+
(event, { value }) => {
|
|
156
|
+
event.preventDefault();
|
|
220
157
|
|
|
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
|
-
|
|
246
|
-
error
|
|
247
|
-
title={this.props.intl.formatMessage(messages.error)}
|
|
248
|
-
content={this.props.intl.formatMessage(messages.addonNotInstalled)}
|
|
249
|
-
/>,
|
|
250
|
-
);
|
|
251
|
-
})
|
|
252
|
-
.finally(() => this.props.listAddons());
|
|
253
|
-
}
|
|
158
|
+
dispatch(installAddon(value))
|
|
159
|
+
.then(() => {
|
|
160
|
+
toast.success(
|
|
161
|
+
<Toast
|
|
162
|
+
success
|
|
163
|
+
title={intl.formatMessage(messages.success)}
|
|
164
|
+
content={intl.formatMessage(messages.addonInstalled, {
|
|
165
|
+
title: title,
|
|
166
|
+
})}
|
|
167
|
+
/>,
|
|
168
|
+
);
|
|
169
|
+
})
|
|
170
|
+
.catch(() => {
|
|
171
|
+
toast.error(
|
|
172
|
+
<Toast
|
|
173
|
+
error
|
|
174
|
+
title={intl.formatMessage(messages.error)}
|
|
175
|
+
content={intl.formatMessage(messages.addonNotInstalled)}
|
|
176
|
+
/>,
|
|
177
|
+
);
|
|
178
|
+
})
|
|
179
|
+
.finally(() => dispatch(listAddons()));
|
|
180
|
+
},
|
|
181
|
+
[dispatch, title, intl],
|
|
182
|
+
);
|
|
254
183
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
title: this.props.title,
|
|
284
|
-
},
|
|
285
|
-
)}
|
|
286
|
-
/>,
|
|
287
|
-
);
|
|
288
|
-
})
|
|
289
|
-
.finally(() => this.props.listAddons());
|
|
290
|
-
}
|
|
184
|
+
const onUninstall = useCallback(
|
|
185
|
+
(event, { value }) => {
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
dispatch(uninstallAddon(value))
|
|
188
|
+
.then(() => {
|
|
189
|
+
toast.success(
|
|
190
|
+
<Toast
|
|
191
|
+
success
|
|
192
|
+
title={intl.formatMessage(messages.success)}
|
|
193
|
+
content={intl.formatMessage(messages.addonUninstalled)}
|
|
194
|
+
/>,
|
|
195
|
+
);
|
|
196
|
+
})
|
|
197
|
+
.catch(() => {
|
|
198
|
+
toast.error(
|
|
199
|
+
<Toast
|
|
200
|
+
error
|
|
201
|
+
title={intl.formatMessage(messages.error)}
|
|
202
|
+
content={intl.formatMessage(messages.addonNotUninstalled, {
|
|
203
|
+
title: title,
|
|
204
|
+
})}
|
|
205
|
+
/>,
|
|
206
|
+
);
|
|
207
|
+
})
|
|
208
|
+
.finally(() => dispatch(listAddons()));
|
|
209
|
+
},
|
|
210
|
+
[dispatch, intl, title],
|
|
211
|
+
);
|
|
291
212
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
* @param {Object} event Event object.
|
|
296
|
-
* @param {string} value Id of package to update.
|
|
297
|
-
* @returns {undefined}
|
|
298
|
-
*/
|
|
299
|
-
onUpgrade(event, { value }) {
|
|
300
|
-
event.preventDefault();
|
|
301
|
-
this.props
|
|
302
|
-
.upgradeAddon(value)
|
|
303
|
-
.then(() => {
|
|
304
|
-
toast.success(
|
|
305
|
-
<Toast
|
|
306
|
-
success
|
|
307
|
-
title={this.props.intl.formatMessage(messages.success)}
|
|
308
|
-
content={this.props.intl.formatMessage(messages.addonUpgraded)}
|
|
309
|
-
/>,
|
|
310
|
-
);
|
|
311
|
-
})
|
|
312
|
-
.catch(() => {
|
|
313
|
-
toast.error(
|
|
314
|
-
<Toast
|
|
315
|
-
error
|
|
316
|
-
title={this.props.intl.formatMessage(messages.error)}
|
|
317
|
-
content={this.props.intl.formatMessage(messages.addonNotUpgraded)}
|
|
318
|
-
/>,
|
|
319
|
-
);
|
|
320
|
-
})
|
|
321
|
-
.finally(() => this.props.listAddons());
|
|
322
|
-
}
|
|
213
|
+
const onUpgrade = useCallback(
|
|
214
|
+
(event, { value }) => {
|
|
215
|
+
event.preventDefault();
|
|
323
216
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
217
|
+
dispatch(upgradeAddon(value))
|
|
218
|
+
.then(() => {
|
|
219
|
+
toast.success(
|
|
220
|
+
<Toast
|
|
221
|
+
success
|
|
222
|
+
title={intl.formatMessage(messages.success)}
|
|
223
|
+
content={intl.formatMessage(messages.addonUpgraded)}
|
|
224
|
+
/>,
|
|
225
|
+
);
|
|
226
|
+
})
|
|
227
|
+
.catch(() => {
|
|
228
|
+
toast.error(
|
|
229
|
+
<Toast
|
|
230
|
+
error
|
|
231
|
+
title={intl.formatMessage(messages.error)}
|
|
232
|
+
content={intl.formatMessage(messages.addonNotUpgraded)}
|
|
233
|
+
/>,
|
|
234
|
+
);
|
|
235
|
+
})
|
|
236
|
+
.finally(() => dispatch(listAddons()));
|
|
237
|
+
},
|
|
238
|
+
[dispatch, intl],
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
const onAccordionClick = (event, item) => {
|
|
333
242
|
const newIndex = activeIndex === item.index ? -1 : item.index;
|
|
334
|
-
|
|
335
|
-
}
|
|
243
|
+
setactiveIndex(newIndex);
|
|
244
|
+
};
|
|
336
245
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<Segment className="primary">
|
|
348
|
-
<FormattedMessage
|
|
349
|
-
id="Add-ons Settings"
|
|
350
|
-
defaultMessage="Add-ons Settings"
|
|
351
|
-
/>
|
|
352
|
-
</Segment>
|
|
246
|
+
return (
|
|
247
|
+
<Container id="page-addons" className="controlpanel-addons">
|
|
248
|
+
<Helmet title={intl.formatMessage(messages.addOns)} />
|
|
249
|
+
<Segment.Group raised>
|
|
250
|
+
<Segment className="primary">
|
|
251
|
+
<FormattedMessage
|
|
252
|
+
id="Add-ons Settings"
|
|
253
|
+
defaultMessage="Add-ons Settings"
|
|
254
|
+
/>
|
|
255
|
+
</Segment>
|
|
353
256
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<FormattedMessage
|
|
364
|
-
id="Updates available"
|
|
365
|
-
defaultMessage="Updates available"
|
|
366
|
-
/>
|
|
367
|
-
</Message.Header>
|
|
257
|
+
{loadingAddons ? (
|
|
258
|
+
<Dimmer active>
|
|
259
|
+
<Loader />
|
|
260
|
+
</Dimmer>
|
|
261
|
+
) : (
|
|
262
|
+
<>
|
|
263
|
+
{upgradableAddons.length > 0 && (
|
|
264
|
+
<Message attached>
|
|
265
|
+
<Message.Header>
|
|
368
266
|
<FormattedMessage
|
|
369
|
-
id="
|
|
370
|
-
defaultMessage="
|
|
267
|
+
id="Updates available"
|
|
268
|
+
defaultMessage="Updates available"
|
|
371
269
|
/>
|
|
372
|
-
</Message>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
270
|
+
</Message.Header>
|
|
271
|
+
<FormattedMessage
|
|
272
|
+
id="Update installed addons"
|
|
273
|
+
defaultMessage="Update installed addons"
|
|
274
|
+
/>
|
|
275
|
+
</Message>
|
|
276
|
+
)}
|
|
277
|
+
<Segment>
|
|
278
|
+
<Header as="h3">
|
|
381
279
|
<FormattedMessage
|
|
382
|
-
id="
|
|
383
|
-
defaultMessage="
|
|
280
|
+
id="Activate and deactivate"
|
|
281
|
+
defaultMessage="Activate and deactivate add-ons in the lists below."
|
|
384
282
|
/>
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
283
|
+
</Header>
|
|
284
|
+
<FormattedMessage
|
|
285
|
+
id="Add Addons"
|
|
286
|
+
defaultMessage="To make new add-ons show up here, add them to your configuration, build, and restart the server process. For detailed instructions see"
|
|
287
|
+
/>
|
|
288
|
+
|
|
289
|
+
<a
|
|
290
|
+
href="https://6.docs.plone.org/install/"
|
|
291
|
+
target="_blank"
|
|
292
|
+
rel="noopener noreferrer"
|
|
293
|
+
>
|
|
294
|
+
{intl.formatMessage(messages.installingAnAddon)}
|
|
295
|
+
</a>
|
|
296
|
+
.
|
|
297
|
+
</Segment>
|
|
298
|
+
<Segment key="header-available" secondary>
|
|
299
|
+
<FormattedMessage id="Available" defaultMessage="Available" />:
|
|
300
|
+
<Label circular>{availableAddons.length}</Label>
|
|
301
|
+
</Segment>
|
|
302
|
+
<Segment key="body-available" attached>
|
|
303
|
+
<Accordion>
|
|
304
|
+
<Divider />
|
|
305
|
+
{availableAddons.map((item) => (
|
|
306
|
+
<div key={item.id}>
|
|
307
|
+
<Accordion.Title
|
|
308
|
+
active={activeIndex === item.id}
|
|
309
|
+
index={item.id}
|
|
310
|
+
onClick={onAccordionClick}
|
|
311
|
+
>
|
|
312
|
+
{item.title}
|
|
313
|
+
<Icon
|
|
314
|
+
name={
|
|
315
|
+
activeIndex === item.id
|
|
316
|
+
? circleTopSVG
|
|
317
|
+
: circleBottomSVG
|
|
318
|
+
}
|
|
319
|
+
size="23px"
|
|
320
|
+
className={`accordionToggle ${item.title}`}
|
|
321
|
+
/>
|
|
322
|
+
</Accordion.Title>
|
|
323
|
+
<Accordion.Content active={activeIndex === item.id}>
|
|
324
|
+
<div className="description">{item.description}</div>
|
|
325
|
+
{item.uninstall_profile_id === '' && (
|
|
326
|
+
<div>
|
|
327
|
+
<Message icon="warning" warning>
|
|
328
|
+
<FormattedMessage
|
|
329
|
+
id="No uninstall profile"
|
|
330
|
+
defaultMessage="This addon does not provide an uninstall profile."
|
|
331
|
+
/>
|
|
332
|
+
</Message>
|
|
333
|
+
</div>
|
|
334
|
+
)}
|
|
335
|
+
<Button.Group floated="right">
|
|
336
|
+
<Button
|
|
337
|
+
primary
|
|
338
|
+
onClick={onInstall}
|
|
339
|
+
value={item.id}
|
|
340
|
+
className="installAction"
|
|
341
|
+
>
|
|
342
|
+
<FormattedMessage
|
|
343
|
+
id="Install"
|
|
344
|
+
defaultMessage="Install"
|
|
345
|
+
className="button-label"
|
|
346
|
+
/>
|
|
347
|
+
</Button>
|
|
348
|
+
</Button.Group>
|
|
349
|
+
<div className="version">
|
|
350
|
+
<FormattedMessage
|
|
351
|
+
id="Latest version"
|
|
352
|
+
defaultMessage="Latest version"
|
|
418
353
|
/>
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
354
|
+
:
|
|
355
|
+
{item.version}
|
|
356
|
+
</div>
|
|
357
|
+
</Accordion.Content>
|
|
358
|
+
<Divider />
|
|
359
|
+
</div>
|
|
360
|
+
))}
|
|
361
|
+
</Accordion>
|
|
362
|
+
</Segment>
|
|
363
|
+
<Segment key="header-installed" secondary>
|
|
364
|
+
<FormattedMessage id="Installed" defaultMessage="Installed" />:
|
|
365
|
+
<Label circular>{installedAddons.length}</Label>
|
|
366
|
+
</Segment>
|
|
367
|
+
<Segment key="body-installed" attached>
|
|
368
|
+
<Accordion>
|
|
369
|
+
<Divider />
|
|
370
|
+
{installedAddons.map((item) => (
|
|
371
|
+
<div key={item.id}>
|
|
372
|
+
<Accordion.Title
|
|
373
|
+
active={activeIndex === item.id}
|
|
374
|
+
index={item.id}
|
|
375
|
+
onClick={onAccordionClick}
|
|
376
|
+
className={
|
|
377
|
+
item.upgrade_info.available ? 'updateAvailable' : ''
|
|
378
|
+
}
|
|
379
|
+
>
|
|
380
|
+
{item.title}
|
|
381
|
+
|
|
382
|
+
{item.upgrade_info.available && (
|
|
383
|
+
<Label>
|
|
384
|
+
<FormattedMessage
|
|
385
|
+
id="Update"
|
|
386
|
+
defaultMessage="Update"
|
|
387
|
+
/>
|
|
388
|
+
</Label>
|
|
389
|
+
)}
|
|
390
|
+
<Icon
|
|
391
|
+
name={
|
|
392
|
+
activeIndex === item.id
|
|
393
|
+
? circleTopSVG
|
|
394
|
+
: circleBottomSVG
|
|
395
|
+
}
|
|
396
|
+
size="24px"
|
|
397
|
+
className={`accordionToggle ${item.title}`}
|
|
398
|
+
color="#878f93"
|
|
399
|
+
/>
|
|
400
|
+
</Accordion.Title>
|
|
401
|
+
<Accordion.Content active={activeIndex === item.id}>
|
|
402
|
+
<div className="description">{item.description}</div>
|
|
403
|
+
<Button.Group floated="right">
|
|
404
|
+
{item.upgrade_info.available && (
|
|
405
|
+
<Button primary onClick={onUpgrade} value={item.id}>
|
|
406
|
+
<FormattedMessage
|
|
407
|
+
id="upgradeVersions"
|
|
408
|
+
defaultMessage="Update from version {origin} to {destination}"
|
|
409
|
+
values={{
|
|
410
|
+
origin: item.upgrade_info.installedVersion,
|
|
411
|
+
destination: item.upgrade_info.newVersion,
|
|
412
|
+
}}
|
|
413
|
+
/>
|
|
414
|
+
</Button>
|
|
433
415
|
)}
|
|
434
|
-
|
|
416
|
+
{item.uninstall_profile_id && (
|
|
435
417
|
<Button
|
|
436
|
-
|
|
437
|
-
onClick={
|
|
418
|
+
negative
|
|
419
|
+
onClick={onUninstall}
|
|
438
420
|
value={item.id}
|
|
439
|
-
className="
|
|
421
|
+
className="uninstallAction"
|
|
440
422
|
>
|
|
441
423
|
<FormattedMessage
|
|
442
|
-
id="
|
|
443
|
-
defaultMessage="
|
|
424
|
+
id="Uninstall"
|
|
425
|
+
defaultMessage="Uninstall"
|
|
444
426
|
className="button-label"
|
|
445
427
|
/>
|
|
446
428
|
</Button>
|
|
447
|
-
</Button.Group>
|
|
448
|
-
<div className="version">
|
|
449
|
-
<FormattedMessage
|
|
450
|
-
id="Latest version"
|
|
451
|
-
defaultMessage="Latest version"
|
|
452
|
-
/>
|
|
453
|
-
:
|
|
454
|
-
{item.version}
|
|
455
|
-
</div>
|
|
456
|
-
</Accordion.Content>
|
|
457
|
-
<Divider />
|
|
458
|
-
</div>
|
|
459
|
-
))}
|
|
460
|
-
</Accordion>
|
|
461
|
-
</Segment>
|
|
462
|
-
<Segment key="header-installed" secondary>
|
|
463
|
-
<FormattedMessage id="Installed" defaultMessage="Installed" />:
|
|
464
|
-
<Label circular>{this.props.installedAddons.length}</Label>
|
|
465
|
-
</Segment>
|
|
466
|
-
<Segment key="body-installed" attached>
|
|
467
|
-
<Accordion>
|
|
468
|
-
<Divider />
|
|
469
|
-
{this.props.installedAddons.map((item) => (
|
|
470
|
-
<div key={item.id}>
|
|
471
|
-
<Accordion.Title
|
|
472
|
-
active={this.state.activeIndex === item.id}
|
|
473
|
-
index={item.id}
|
|
474
|
-
onClick={this.onAccordionClick}
|
|
475
|
-
className={
|
|
476
|
-
item.upgrade_info.available ? 'updateAvailable' : ''
|
|
477
|
-
}
|
|
478
|
-
>
|
|
479
|
-
{item.title}
|
|
480
|
-
|
|
481
|
-
{item.upgrade_info.available && (
|
|
482
|
-
<Label>
|
|
483
|
-
<FormattedMessage
|
|
484
|
-
id="Update"
|
|
485
|
-
defaultMessage="Update"
|
|
486
|
-
/>
|
|
487
|
-
</Label>
|
|
488
429
|
)}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}
|
|
495
|
-
size="24px"
|
|
496
|
-
className={`accordionToggle ${item.title}`}
|
|
497
|
-
color="#878f93"
|
|
430
|
+
</Button.Group>
|
|
431
|
+
<div className="version">
|
|
432
|
+
<FormattedMessage
|
|
433
|
+
id="Installed version"
|
|
434
|
+
defaultMessage="Installed version"
|
|
498
435
|
/>
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
>
|
|
511
|
-
<FormattedMessage
|
|
512
|
-
id="upgradeVersions"
|
|
513
|
-
defaultMessage="Update from version {origin} to {destination}"
|
|
514
|
-
values={{
|
|
515
|
-
origin: item.upgrade_info.installedVersion,
|
|
516
|
-
destination: item.upgrade_info.newVersion,
|
|
517
|
-
}}
|
|
518
|
-
/>
|
|
519
|
-
</Button>
|
|
520
|
-
)}
|
|
521
|
-
{item.uninstall_profile_id && (
|
|
522
|
-
<Button
|
|
523
|
-
negative
|
|
524
|
-
onClick={this.onUninstall}
|
|
525
|
-
value={item.id}
|
|
526
|
-
className="uninstallAction"
|
|
527
|
-
>
|
|
528
|
-
<FormattedMessage
|
|
529
|
-
id="Uninstall"
|
|
530
|
-
defaultMessage="Uninstall"
|
|
531
|
-
className="button-label"
|
|
532
|
-
/>
|
|
533
|
-
</Button>
|
|
534
|
-
)}
|
|
535
|
-
</Button.Group>
|
|
536
|
-
<div className="version">
|
|
537
|
-
<FormattedMessage
|
|
538
|
-
id="Installed version"
|
|
539
|
-
defaultMessage="Installed version"
|
|
540
|
-
/>
|
|
541
|
-
: {item.version}
|
|
542
|
-
</div>
|
|
543
|
-
</Accordion.Content>
|
|
544
|
-
<Divider />
|
|
545
|
-
</div>
|
|
546
|
-
))}
|
|
547
|
-
</Accordion>
|
|
548
|
-
</Segment>
|
|
549
|
-
</>
|
|
550
|
-
)}
|
|
551
|
-
</Segment.Group>
|
|
436
|
+
: {item.version}
|
|
437
|
+
</div>
|
|
438
|
+
</Accordion.Content>
|
|
439
|
+
<Divider />
|
|
440
|
+
</div>
|
|
441
|
+
))}
|
|
442
|
+
</Accordion>
|
|
443
|
+
</Segment>
|
|
444
|
+
</>
|
|
445
|
+
)}
|
|
446
|
+
</Segment.Group>
|
|
552
447
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
448
|
+
{isClient &&
|
|
449
|
+
createPortal(
|
|
450
|
+
<Toolbar
|
|
451
|
+
pathname={pathname}
|
|
452
|
+
hideDefaultViewButtons
|
|
453
|
+
inner={
|
|
454
|
+
<>
|
|
455
|
+
<Link to="/controlpanel" className="item">
|
|
456
|
+
<Icon
|
|
457
|
+
name={backSVG}
|
|
458
|
+
aria-label={intl.formatMessage(messages.back)}
|
|
459
|
+
className="contents circled"
|
|
460
|
+
size="30px"
|
|
461
|
+
title={intl.formatMessage(messages.back)}
|
|
462
|
+
/>
|
|
463
|
+
</Link>
|
|
464
|
+
</>
|
|
465
|
+
}
|
|
466
|
+
/>,
|
|
467
|
+
document.getElementById('toolbar'),
|
|
468
|
+
)}
|
|
469
|
+
</Container>
|
|
470
|
+
);
|
|
471
|
+
};
|
|
578
472
|
|
|
579
|
-
export default
|
|
580
|
-
injectIntl,
|
|
581
|
-
connect(
|
|
582
|
-
(state, props) => ({
|
|
583
|
-
installedAddons: state.addons.installedAddons,
|
|
584
|
-
availableAddons: state.addons.availableAddons,
|
|
585
|
-
upgradableAddons: state.addons.upgradableAddons,
|
|
586
|
-
loadingAddons: state.addons.loading,
|
|
587
|
-
pathname: props.location.pathname,
|
|
588
|
-
}),
|
|
589
|
-
{ installAddon, listAddons, uninstallAddon, upgradeAddon },
|
|
590
|
-
),
|
|
591
|
-
)(AddonsControlpanel);
|
|
473
|
+
export default AddonsControlpanel;
|