@plone/volto 18.0.0-alpha.26 → 18.0.0-alpha.28
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 +25 -0
- package/cypress/support/commands.js +1 -4
- package/cypress/support/e2e.js +9 -0
- package/locales/pt_BR/LC_MESSAGES/volto.po +1 -1
- package/locales/pt_BR.json +1 -1
- package/package.json +21 -19
- package/src/components/index.js +104 -73
- package/src/components/manage/Actions/Actions.jsx +2 -1
- package/src/components/manage/Actions/Actions.test.jsx +1 -3
- package/src/components/manage/Add/Add.jsx +1 -1
- package/src/components/manage/Blocks/Block/DefaultEdit.jsx +1 -1
- package/src/components/manage/Blocks/Block/Settings.jsx +1 -1
- package/src/components/manage/Blocks/Block/Settings.test.jsx +2 -0
- package/src/components/manage/Blocks/Container/Data.jsx +1 -1
- package/src/components/manage/Blocks/Container/Edit.jsx +2 -1
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +2 -1
- package/src/components/manage/Blocks/Image/ImageSidebar.test.jsx +2 -0
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +2 -3
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +2 -0
- package/src/components/manage/Blocks/Listing/ListingData.jsx +1 -1
- package/src/components/manage/Blocks/Maps/MapsSidebar.jsx +1 -1
- package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +2 -0
- package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +2 -1
- package/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx +1 -1
- package/src/components/manage/Blocks/Teaser/Data.jsx +2 -1
- package/src/components/manage/Blocks/ToC/Edit.jsx +1 -1
- package/src/components/manage/Blocks/Video/VideoSidebar.jsx +1 -1
- package/src/components/manage/Blocks/Video/VideoSidebar.test.jsx +2 -0
- package/src/components/manage/ConditionalLink/ConditionalLink.jsx +1 -1
- package/src/components/manage/Contents/Contents.jsx +8 -8
- package/src/components/manage/Contents/ContentsIndexHeader.test.jsx +1 -1
- package/src/components/manage/Contents/ContentsPropertiesModal.jsx +1 -1
- package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +1 -1
- package/src/components/manage/Contents/ContentsRenameModal.jsx +1 -1
- package/src/components/manage/Contents/ContentsRenameModal.test.jsx +1 -1
- package/src/components/manage/Contents/ContentsTagsModal.jsx +1 -1
- package/src/components/manage/Contents/ContentsTagsModal.test.jsx +1 -1
- package/src/components/manage/Contents/ContentsWorkflowModal.jsx +1 -1
- package/src/components/manage/Contents/ContentsWorkflowModal.test.jsx +1 -1
- package/src/components/manage/Contents/__mocks__/index.tsx +5 -0
- package/src/components/manage/Contents/index.tsx +64 -0
- package/src/components/manage/Controlpanels/Aliases.jsx +1 -1
- package/src/components/manage/Controlpanels/Aliases.test.jsx +1 -0
- package/src/components/manage/Controlpanels/ContentType.jsx +2 -1
- package/src/components/manage/Controlpanels/ContentType.test.jsx +1 -1
- package/src/components/manage/Controlpanels/ContentTypeLayout.jsx +2 -8
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +2 -1
- package/src/components/manage/Controlpanels/ContentTypes.jsx +3 -8
- package/src/components/manage/Controlpanels/Controlpanel.jsx +2 -1
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +1 -2
- package/src/components/manage/Controlpanels/Controlpanels.jsx +12 -49
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +36 -32
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +2 -2
- package/src/components/manage/Controlpanels/ModerateComments.jsx +2 -6
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +1 -4
- package/src/components/manage/Controlpanels/Relations/RelationsListing.jsx +2 -2
- package/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +2 -2
- package/src/components/manage/Controlpanels/Rules/AddRule.jsx +2 -2
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +1 -0
- package/src/components/manage/Controlpanels/Rules/EditRule.jsx +2 -2
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +2 -0
- package/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx +1 -1
- package/src/components/manage/Controlpanels/UndoControlpanel.jsx +2 -1
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +1 -2
- package/src/components/manage/Controlpanels/UpgradeControlPanel.jsx +2 -1
- package/src/components/manage/Controlpanels/Users/RenderUsers.jsx +2 -1
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +1 -1
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +2 -2
- package/src/components/manage/Controlpanels/index.tsx +181 -0
- package/src/components/manage/Diff/Diff.jsx +1 -1
- package/src/components/manage/Display/Display.jsx +2 -1
- package/src/components/manage/Display/Display.test.jsx +1 -0
- package/src/components/manage/Edit/Edit.jsx +1 -1
- package/src/components/manage/Edit/Edit.test.jsx +1 -2
- package/src/components/manage/Form/BlockDataForm.jsx +1 -1
- package/src/components/manage/Form/BlockDataForm.test.jsx +2 -0
- package/src/components/manage/Form/Form.jsx +4 -2
- package/src/components/manage/Form/Form.test.jsx +1 -1
- package/src/components/manage/Form/InlineForm.jsx +2 -1
- package/src/components/manage/Form/InlineForm.test.jsx +2 -0
- package/src/components/manage/Form/ModalForm.jsx +2 -1
- package/src/components/manage/Form/ModalForm.test.jsx +1 -1
- package/src/components/manage/Form/__mocks__/index.tsx +74 -0
- package/src/components/manage/Form/index.tsx +50 -0
- package/src/components/manage/Multilingual/TranslationObject.jsx +2 -1
- package/src/components/manage/Preferences/ChangePassword.jsx +2 -1
- package/src/components/manage/Preferences/ChangePassword.test.jsx +1 -0
- package/src/components/manage/Preferences/PersonalInformation.jsx +2 -1
- package/src/components/manage/Preferences/PersonalPreferences.jsx +2 -1
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +3 -5
- package/src/components/manage/Rules/index.tsx +5 -0
- package/src/components/manage/Toolbar/PersonalTools.jsx +2 -2
- package/src/components/manage/Widgets/ArrayWidget.jsx +1 -1
- package/src/components/manage/Widgets/ButtonsWidget.jsx +1 -1
- package/src/components/manage/Widgets/CheckboxWidget.jsx +1 -1
- package/src/components/manage/Widgets/ColorPickerWidget.tsx +7 -7
- package/src/components/manage/Widgets/DatetimeWidget.jsx +2 -1
- package/src/components/manage/Widgets/EmailWidget.jsx +1 -1
- package/src/components/manage/Widgets/FileWidget.jsx +2 -1
- package/src/components/manage/Widgets/IdWidget.jsx +2 -1
- package/src/components/manage/Widgets/ImageSizeWidget.jsx +1 -1
- package/src/components/manage/Widgets/InternalUrlWidget.jsx +3 -3
- package/src/components/manage/Widgets/NumberWidget.jsx +1 -1
- package/src/components/manage/Widgets/ObjectListWidget.jsx +2 -1
- package/src/components/manage/Widgets/ObjectListWidget.test.js +2 -0
- package/src/components/manage/Widgets/ObjectWidget.jsx +1 -2
- package/src/components/manage/Widgets/ObjectWidget.test.jsx +2 -0
- package/src/components/manage/Widgets/PasswordWidget.jsx +1 -1
- package/src/components/manage/Widgets/QuerySortOnWidget.jsx +1 -1
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +3 -2
- package/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx +12 -3
- package/src/components/manage/Widgets/ReferenceWidget.jsx +1 -1
- package/src/components/manage/Widgets/RegistryImageWidget.jsx +2 -1
- package/src/components/manage/Widgets/SchemaWidget.jsx +2 -5
- package/src/components/manage/Widgets/SelectAutoComplete.jsx +1 -1
- package/src/components/manage/Widgets/SelectWidget.jsx +1 -1
- package/src/components/manage/Widgets/TextWidget.jsx +2 -1
- package/src/components/manage/Widgets/TextareaWidget.jsx +1 -1
- package/src/components/manage/Widgets/TokenWidget.jsx +1 -1
- package/src/components/manage/Widgets/UrlWidget.jsx +3 -3
- package/src/components/manage/Widgets/VocabularyTermsWidget.jsx +5 -8
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +2 -0
- package/src/components/manage/Widgets/__mocks__/index.tsx +43 -0
- package/src/components/manage/Widgets/index.tsx +232 -0
- package/src/components/manage/Workflow/Workflow.jsx +2 -1
- package/src/components/manage/Workflow/Workflow.test.jsx +2 -3
- package/src/components/theme/Comments/CommentEditModal.jsx +1 -1
- package/src/components/theme/Comments/CommentEditModal.test.jsx +1 -3
- package/src/components/theme/Comments/Comments.jsx +3 -1
- package/src/components/theme/Comments/Comments.test.jsx +2 -0
- package/src/components/theme/Comments/__mocks__/index.tsx +1 -0
- package/src/components/theme/Comments/index.tsx +5 -0
- package/src/components/theme/ContactForm/ContactForm.jsx +2 -1
- package/src/components/theme/ContactForm/ContactForm.test.jsx +2 -0
- package/src/components/theme/PasswordReset/PasswordReset.jsx +1 -1
- package/src/components/theme/PasswordReset/RequestPasswordReset.jsx +1 -1
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +2 -0
- package/src/components/theme/Register/Register.jsx +2 -1
- package/src/components/theme/Register/Register.test.jsx +2 -0
- package/src/config/ControlPanels.js +1 -1
- package/src/config/Widgets.jsx +33 -46
- package/src/reducers/navigation/navigation.js +1 -2
- package/src/reducers/navigation/navigation.test.js +6 -0
- package/src/routes.js +22 -20
- package/theme/themes/pastanaga/elements/input.overrides +2 -0
- package/types/components/index.d.ts +11 -63
- package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +5 -0
- package/types/components/manage/ConditionalLink/ConditionalLink.d.ts +1 -1
- package/types/components/manage/Contents/__mocks__/index.d.ts +3 -0
- package/types/components/manage/Contents/index.d.ts +9 -0
- package/types/components/manage/Controlpanels/Controlpanels.d.ts +6 -2
- package/types/components/manage/Controlpanels/Relations/RelationsListing.d.ts +2 -2
- package/types/components/manage/Controlpanels/index.d.ts +32 -0
- package/types/components/manage/Form/__mocks__/index.d.ts +9 -0
- package/types/components/manage/Form/index.d.ts +14 -0
- package/types/components/manage/Rules/index.d.ts +1 -0
- package/types/components/manage/Widgets/ColorPickerWidget.d.ts +5 -5
- package/types/components/manage/Widgets/RecurrenceWidget/SelectInput.d.ts +2 -34
- package/types/components/manage/Widgets/__mocks__/index.d.ts +34 -0
- package/types/components/manage/Widgets/index.d.ts +120 -0
- package/types/components/theme/Comments/__mocks__/index.d.ts +1 -0
- package/types/components/theme/Comments/index.d.ts +1 -0
- package/types/config/ControlPanels.d.ts +1 -1
- package/types/config/Loadables.d.ts +151 -9
- package/types/config/Views.d.ts +1 -1
- package/types/config/Widgets.d.ts +33 -39
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module components/manage/Widgets/EmailWidget
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Input } from 'semantic-ui-react';
|
|
@@ -9,7 +9,8 @@ import { Button, Image, Dimmer } from 'semantic-ui-react';
|
|
|
9
9
|
import { readAsDataURL } from 'promise-file-reader';
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
11
|
import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
12
|
-
import { Icon,
|
|
12
|
+
import { Icon, UniversalLink } from '@plone/volto/components';
|
|
13
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
13
14
|
import loadable from '@loadable/component';
|
|
14
15
|
import { flattenToAppURL, validateFileUploadSize } from '@plone/volto/helpers';
|
|
15
16
|
import { defineMessages, useIntl } from 'react-intl';
|
|
@@ -11,7 +11,8 @@ import { Input } from 'semantic-ui-react';
|
|
|
11
11
|
import { compact, concat, keys, map, union, uniq } from 'lodash';
|
|
12
12
|
|
|
13
13
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
14
|
-
import { Icon
|
|
14
|
+
import { Icon } from '@plone/volto/components';
|
|
15
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
15
16
|
import config from '@plone/volto/registry';
|
|
16
17
|
import { getQuerystring } from '@plone/volto/actions';
|
|
17
18
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Button, Grid } from 'semantic-ui-react';
|
|
5
|
-
import
|
|
5
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
6
6
|
|
|
7
7
|
const messages = defineMessages({
|
|
8
8
|
small: {
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
|
-
import { compose } from 'redux';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import { Input, Button } from 'semantic-ui-react';
|
|
10
|
-
import {
|
|
9
|
+
import { Icon } from '@plone/volto/components';
|
|
10
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
11
11
|
import { isInternalURL, flattenToAppURL, URLUtils } from '@plone/volto/helpers';
|
|
12
12
|
import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
|
|
13
13
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
@@ -177,4 +177,4 @@ InternalUrlWidget.defaultProps = {
|
|
|
177
177
|
maxLength: null,
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
export default
|
|
180
|
+
export default withObjectBrowser(InternalUrlWidget);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { Input } from 'semantic-ui-react';
|
|
9
|
-
import
|
|
9
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { defineMessages, useIntl } from 'react-intl';
|
|
3
3
|
import { Accordion, Button, Segment } from 'semantic-ui-react';
|
|
4
|
-
import { DragDropList,
|
|
4
|
+
import { DragDropList, Icon } from '@plone/volto/components';
|
|
5
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
5
6
|
import { applySchemaDefaults, reorderArray } from '@plone/volto/helpers';
|
|
6
7
|
import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget';
|
|
7
8
|
|
|
@@ -5,6 +5,8 @@ import configureStore from 'redux-mock-store';
|
|
|
5
5
|
import ObjectListWidget from './ObjectListWidget';
|
|
6
6
|
|
|
7
7
|
jest.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
8
|
+
jest.mock('@plone/volto/components/manage/Form');
|
|
9
|
+
|
|
8
10
|
beforeAll(
|
|
9
11
|
async () =>
|
|
10
12
|
await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { Tab } from 'semantic-ui-react';
|
|
9
|
-
|
|
10
|
-
import Field from '@plone/volto/components/manage/Form/Field';
|
|
9
|
+
import { Field } from '@plone/volto/components/manage/Form';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Renders a field set. Passes some of the values in the schema to the Field
|
|
@@ -5,6 +5,8 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
import { render, fireEvent } from '@testing-library/react';
|
|
6
6
|
import ObjectWidget from './ObjectWidget';
|
|
7
7
|
|
|
8
|
+
jest.mock('@plone/volto/components/manage/Form');
|
|
9
|
+
|
|
8
10
|
const mockStore = configureStore();
|
|
9
11
|
|
|
10
12
|
const LinkSchema = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { Input } from 'semantic-ui-react';
|
|
9
|
-
import
|
|
9
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
3
3
|
import { toPairs, groupBy, map } from 'lodash';
|
|
4
4
|
import { defineMessages, useIntl } from 'react-intl';
|
|
5
5
|
import { useSelector } from 'react-redux';
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import React, { Component } from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { compose } from 'redux';
|
|
9
|
-
//import { RRule, RRuleSet, rrulestr } from 'rrule';
|
|
10
9
|
import { connect } from 'react-redux';
|
|
11
10
|
|
|
12
11
|
import cx from 'classnames';
|
|
@@ -22,7 +21,9 @@ import {
|
|
|
22
21
|
Header,
|
|
23
22
|
} from 'semantic-ui-react';
|
|
24
23
|
|
|
25
|
-
import {
|
|
24
|
+
import { Icon } from '@plone/volto/components';
|
|
25
|
+
import DatetimeWidget from '@plone/volto/components/manage/Widgets/DatetimeWidget';
|
|
26
|
+
import SelectWidget from '@plone/volto/components/manage/Widgets/SelectWidget';
|
|
26
27
|
import { toBackendLang } from '@plone/volto/helpers';
|
|
27
28
|
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
28
29
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import Select from 'react-select';
|
|
9
8
|
import { find } from 'lodash';
|
|
10
9
|
import {
|
|
11
10
|
Option,
|
|
@@ -13,12 +12,22 @@ import {
|
|
|
13
12
|
selectTheme,
|
|
14
13
|
customSelectStyles,
|
|
15
14
|
} from '@plone/volto/components/manage/Widgets/SelectStyling';
|
|
15
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* SelectInput component class.
|
|
18
19
|
* @function SelectInput
|
|
19
20
|
* @returns {string} Markup of the component.
|
|
20
21
|
*/
|
|
21
|
-
const SelectInput = ({
|
|
22
|
+
const SelectInput = ({
|
|
23
|
+
name,
|
|
24
|
+
disabled,
|
|
25
|
+
options,
|
|
26
|
+
value,
|
|
27
|
+
onChange,
|
|
28
|
+
reactSelect,
|
|
29
|
+
}) => {
|
|
30
|
+
const Select = reactSelect.default;
|
|
22
31
|
const inlineSelectStyles = {
|
|
23
32
|
...customSelectStyles,
|
|
24
33
|
control: (styles, state) => ({
|
|
@@ -78,4 +87,4 @@ SelectInput.defaultProps = {
|
|
|
78
87
|
onChange: null,
|
|
79
88
|
};
|
|
80
89
|
|
|
81
|
-
export default SelectInput;
|
|
90
|
+
export default injectLazyLibs('reactSelect')(SelectInput);
|
|
@@ -11,7 +11,7 @@ import { Label, Dropdown, Popup, Icon } from 'semantic-ui-react';
|
|
|
11
11
|
import { compact, concat, fromPairs, map, values, uniqBy } from 'lodash';
|
|
12
12
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
15
15
|
import { resetSearchContent, searchContent } from '@plone/volto/actions';
|
|
16
16
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
17
17
|
|
|
@@ -9,7 +9,8 @@ import { Button, Image, Dimmer } from 'semantic-ui-react';
|
|
|
9
9
|
import { readAsDataURL } from 'promise-file-reader';
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
11
|
import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
12
|
-
import { Icon
|
|
12
|
+
import { Icon } from '@plone/volto/components';
|
|
13
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
13
14
|
import loadable from '@loadable/component';
|
|
14
15
|
import { defineMessages, useIntl } from 'react-intl';
|
|
15
16
|
import { toPublicURL, validateFileUploadSize } from '@plone/volto/helpers';
|
|
@@ -14,11 +14,8 @@ import { defineMessages, injectIntl } from 'react-intl';
|
|
|
14
14
|
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
15
15
|
import { slugify } from '@plone/volto/helpers/Utils/Utils';
|
|
16
16
|
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
ModalForm,
|
|
20
|
-
SchemaWidgetFieldset,
|
|
21
|
-
} from '@plone/volto/components';
|
|
17
|
+
import SchemaWidgetFieldset from '@plone/volto/components/manage/Widgets/SchemaWidgetFieldset';
|
|
18
|
+
import { Field, ModalForm } from '@plone/volto/components/manage/Form';
|
|
22
19
|
|
|
23
20
|
const messages = defineMessages({
|
|
24
21
|
add: {
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
MenuList,
|
|
33
33
|
} from '@plone/volto/components/manage/Widgets/SelectStyling';
|
|
34
34
|
|
|
35
|
-
import
|
|
35
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
36
36
|
|
|
37
37
|
const messages = defineMessages({
|
|
38
38
|
select: {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getVocabFromField,
|
|
15
15
|
getVocabFromItems,
|
|
16
16
|
} from '@plone/volto/helpers';
|
|
17
|
-
import
|
|
17
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
18
18
|
import { getVocabulary, getVocabularyTokenTitle } from '@plone/volto/actions';
|
|
19
19
|
import { normalizeValue } from '@plone/volto/components/manage/Widgets/SelectUtils';
|
|
20
20
|
|
|
@@ -8,7 +8,8 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { Input } from 'semantic-ui-react';
|
|
9
9
|
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
|
-
import { Icon
|
|
11
|
+
import { Icon } from '@plone/volto/components';
|
|
12
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* The simple text widget.
|
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { Label, TextArea } from 'semantic-ui-react';
|
|
9
9
|
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
|
-
import
|
|
11
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* TextareaWidget, a widget for multiple lines text
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
customSelectStyles,
|
|
25
25
|
} from '@plone/volto/components/manage/Widgets/SelectStyling';
|
|
26
26
|
|
|
27
|
-
import
|
|
27
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
28
28
|
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
29
29
|
|
|
30
30
|
const messages = defineMessages({
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
|
-
import { compose } from 'redux';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import { Input, Button } from 'semantic-ui-react';
|
|
10
|
-
import {
|
|
9
|
+
import { Icon } from '@plone/volto/components';
|
|
10
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
11
11
|
import {
|
|
12
12
|
addAppURL,
|
|
13
13
|
isInternalURL,
|
|
@@ -182,4 +182,4 @@ UrlWidget.defaultProps = {
|
|
|
182
182
|
maxLength: null,
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
-
export default
|
|
185
|
+
export default withObjectBrowser(UrlWidget);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* VocabularyTermsWidget
|
|
3
3
|
* @module components/manage/Widgets/VocabularyTermsWidget
|
|
4
4
|
* Widget for plone.schema.JSONField field meant for a SimpleVocabulary source
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
|
|
7
7
|
VOCABULARY_SCHEMA = json.dumps(
|
|
8
8
|
{
|
|
@@ -68,7 +68,7 @@ def TalkTypesVocabulary(context):
|
|
|
68
68
|
|
|
69
69
|
* titles are editable
|
|
70
70
|
* tokens are generated
|
|
71
|
-
*
|
|
71
|
+
*
|
|
72
72
|
* Purpose: Use this widget for a controlpanel field
|
|
73
73
|
* that acts as a source of a vocabulary for a zope.schema.Choice field.
|
|
74
74
|
* Vocabulary terms should change over time only in title, not value,
|
|
@@ -90,12 +90,9 @@ import { v4 as uuid } from 'uuid';
|
|
|
90
90
|
|
|
91
91
|
import { Button } from 'semantic-ui-react';
|
|
92
92
|
|
|
93
|
-
import {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Icon,
|
|
97
|
-
ObjectWidget,
|
|
98
|
-
} from '@plone/volto/components';
|
|
93
|
+
import { DragDropList, Icon } from '@plone/volto/components';
|
|
94
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
95
|
+
import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget';
|
|
99
96
|
import { langmap } from '@plone/volto/helpers';
|
|
100
97
|
|
|
101
98
|
import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
@@ -6,6 +6,8 @@ import { Provider } from 'react-intl-redux';
|
|
|
6
6
|
import VocabularyTermsWidget from './VocabularyTermsWidget';
|
|
7
7
|
|
|
8
8
|
jest.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
9
|
+
jest.mock('@plone/volto/components/manage/Form');
|
|
10
|
+
|
|
9
11
|
beforeAll(
|
|
10
12
|
async () =>
|
|
11
13
|
await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const AlignWidget = jest.fn(() => <div id="AlignWidget" />);
|
|
2
|
+
export const ButtonsWidget = jest.fn(() => <div id="ButtonsWidget" />);
|
|
3
|
+
export const ArrayWidget = jest.fn(() => <div id="ArrayWidget" />);
|
|
4
|
+
export const CheckboxWidget = jest.fn(() => <div id="CheckboxWidget" />);
|
|
5
|
+
export const FileWidget = jest.fn(() => <div id="FileWidget" />);
|
|
6
|
+
export const IdWidget = jest.fn(() => <div id="IdWidget" />);
|
|
7
|
+
export const PasswordWidget = jest.fn(() => <div id="PasswordWidget" />);
|
|
8
|
+
export const QueryWidget = jest.fn(() => <div id="QueryWidget" />);
|
|
9
|
+
export const QuerySortOnWidget = jest.fn(() => <div id="QuerySortOnWidget" />);
|
|
10
|
+
export const QuerystringWidget = jest.fn(() => <div id="QuerystringWidget" />);
|
|
11
|
+
export const SchemaWidget = jest.fn(() => <div id="SchemaWidget" />);
|
|
12
|
+
export const SelectWidget = jest.fn(() => <div id="SelectWidget" />);
|
|
13
|
+
export const TextareaWidget = jest.fn(() => <div id="TextareaWidget" />);
|
|
14
|
+
export const TextWidget = jest.fn(() => <div id="TextWidget" />);
|
|
15
|
+
export const TokenWidget = jest.fn(() => <div id="TokenWidget" />);
|
|
16
|
+
export const WysiwygWidget = jest.fn(() => <div id="WysiwygWidget" />);
|
|
17
|
+
export const UrlWidget = jest.fn(() => <div id="UrlWidget" />);
|
|
18
|
+
export const InternalUrlWidget = jest.fn(() => <div id="InternalUrlWidget" />);
|
|
19
|
+
export const EmailWidget = jest.fn(() => <div id="EmailWidget" />);
|
|
20
|
+
export const NumberWidget = jest.fn(() => <div id="NumberWidget" />);
|
|
21
|
+
export const ImageSizeWidget = jest.fn(() => <div id="ImageSizeWidget" />);
|
|
22
|
+
export const RegistryImageWidget = jest.fn(() => (
|
|
23
|
+
<div id="RegistryImageWidget" />
|
|
24
|
+
));
|
|
25
|
+
export const ReferenceWidget = jest.fn(() => <div id="ReferenceWidget" />);
|
|
26
|
+
export const ObjectBrowserWidget = jest.fn(() => (
|
|
27
|
+
<div id="ObjectBrowserWidget" />
|
|
28
|
+
));
|
|
29
|
+
export const ObjectWidget = jest.fn(() => <div id="ObjectWidget" />);
|
|
30
|
+
export const ObjectListWidget = jest.fn(() => <div id="ObjectListWidget" />);
|
|
31
|
+
export const VocabularyTermsWidget = jest.fn(() => (
|
|
32
|
+
<div id="VocabularyTermsWidget" />
|
|
33
|
+
));
|
|
34
|
+
export const SelectMetadataWidget = jest.fn(() => (
|
|
35
|
+
<div id="SelectMetadataWidget" />
|
|
36
|
+
));
|
|
37
|
+
export const SelectAutoComplete = jest.fn(() => (
|
|
38
|
+
<div id="SelectAutoComplete" />
|
|
39
|
+
));
|
|
40
|
+
export const ColorPickerWidget = jest.fn(() => <div id="ColorPickerWidget" />);
|
|
41
|
+
export const DatetimeWidget = jest.fn(() => <div id="DatetimeWidget" />);
|
|
42
|
+
export const RecurrenceWidget = jest.fn(() => <div id="RecurrenceWidget" />);
|
|
43
|
+
export const FormFieldWrapper = jest.fn(() => <div id="FormFieldWrapper" />);
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import loadable from '@loadable/component';
|
|
2
|
+
|
|
3
|
+
export const AlignWidget = loadable(
|
|
4
|
+
() =>
|
|
5
|
+
import(
|
|
6
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/AlignWidget'
|
|
7
|
+
),
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export const ButtonsWidget = loadable(
|
|
11
|
+
() =>
|
|
12
|
+
import(
|
|
13
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ButtonsWidget'
|
|
14
|
+
),
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const ArrayWidget = loadable(
|
|
18
|
+
() =>
|
|
19
|
+
import(
|
|
20
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ArrayWidget'
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const CheckboxWidget = loadable(
|
|
25
|
+
() =>
|
|
26
|
+
import(
|
|
27
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/CheckboxWidget'
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const FileWidget = loadable(
|
|
32
|
+
() =>
|
|
33
|
+
import(
|
|
34
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/FileWidget'
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const IdWidget = loadable(
|
|
39
|
+
() =>
|
|
40
|
+
import(
|
|
41
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/IdWidget'
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const PasswordWidget = loadable(
|
|
46
|
+
() =>
|
|
47
|
+
import(
|
|
48
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/PasswordWidget'
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export const QueryWidget = loadable(
|
|
53
|
+
() =>
|
|
54
|
+
import(
|
|
55
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/QueryWidget'
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const QuerySortOnWidget = loadable(
|
|
60
|
+
() =>
|
|
61
|
+
import(
|
|
62
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/QuerySortOnWidget'
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export const QuerystringWidget = loadable(
|
|
67
|
+
() =>
|
|
68
|
+
import(
|
|
69
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/QuerystringWidget'
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
export const SchemaWidget = loadable(
|
|
74
|
+
() =>
|
|
75
|
+
import(
|
|
76
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/SchemaWidget'
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const SelectWidget = loadable(
|
|
81
|
+
() =>
|
|
82
|
+
import(
|
|
83
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/SelectWidget'
|
|
84
|
+
),
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export const TextareaWidget = loadable(
|
|
88
|
+
() =>
|
|
89
|
+
import(
|
|
90
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/TextareaWidget'
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export const TextWidget = loadable(
|
|
95
|
+
() =>
|
|
96
|
+
import(
|
|
97
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/TextWidget'
|
|
98
|
+
),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
export const TokenWidget = loadable(
|
|
102
|
+
() =>
|
|
103
|
+
import(
|
|
104
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/TokenWidget'
|
|
105
|
+
),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
export const WysiwygWidget = loadable(
|
|
109
|
+
() =>
|
|
110
|
+
import(
|
|
111
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/WysiwygWidget'
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
export const UrlWidget = loadable(
|
|
116
|
+
() =>
|
|
117
|
+
import(
|
|
118
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/UrlWidget'
|
|
119
|
+
),
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export const InternalUrlWidget = loadable(
|
|
123
|
+
() =>
|
|
124
|
+
import(
|
|
125
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/InternalUrlWidget'
|
|
126
|
+
),
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
export const EmailWidget = loadable(
|
|
130
|
+
() =>
|
|
131
|
+
import(
|
|
132
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/EmailWidget'
|
|
133
|
+
),
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
export const NumberWidget = loadable(
|
|
137
|
+
() =>
|
|
138
|
+
import(
|
|
139
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/NumberWidget'
|
|
140
|
+
),
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
export const ImageSizeWidget = loadable(
|
|
144
|
+
() =>
|
|
145
|
+
import(
|
|
146
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ImageSizeWidget'
|
|
147
|
+
),
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
export const RegistryImageWidget = loadable(
|
|
151
|
+
() =>
|
|
152
|
+
import(
|
|
153
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/RegistryImageWidget'
|
|
154
|
+
),
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
export const ReferenceWidget = loadable(
|
|
158
|
+
() =>
|
|
159
|
+
import(
|
|
160
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ReferenceWidget'
|
|
161
|
+
),
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
export const ObjectBrowserWidget = loadable(
|
|
165
|
+
() =>
|
|
166
|
+
import(
|
|
167
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ObjectBrowserWidget'
|
|
168
|
+
),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
export const ObjectWidget = loadable(
|
|
172
|
+
() =>
|
|
173
|
+
import(
|
|
174
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ObjectWidget'
|
|
175
|
+
),
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
export const ObjectListWidget = loadable(
|
|
179
|
+
() =>
|
|
180
|
+
import(
|
|
181
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ObjectListWidget'
|
|
182
|
+
),
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
export const VocabularyTermsWidget = loadable(
|
|
186
|
+
() =>
|
|
187
|
+
import(
|
|
188
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/VocabularyTermsWidget'
|
|
189
|
+
),
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
export const SelectMetadataWidget = loadable(
|
|
193
|
+
() =>
|
|
194
|
+
import(
|
|
195
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Blocks/Search/widgets/SelectMetadataField'
|
|
196
|
+
),
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
export const SelectAutoComplete = loadable(
|
|
200
|
+
() =>
|
|
201
|
+
import(
|
|
202
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/SelectAutoComplete'
|
|
203
|
+
),
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
export const ColorPickerWidget = loadable(
|
|
207
|
+
() =>
|
|
208
|
+
import(
|
|
209
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ColorPickerWidget'
|
|
210
|
+
),
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
export const DatetimeWidget = loadable(
|
|
214
|
+
() =>
|
|
215
|
+
import(
|
|
216
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/DatetimeWidget'
|
|
217
|
+
),
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
export const RecurrenceWidget = loadable(
|
|
221
|
+
() =>
|
|
222
|
+
import(
|
|
223
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget'
|
|
224
|
+
),
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
export const FormFieldWrapper = loadable(
|
|
228
|
+
() =>
|
|
229
|
+
import(
|
|
230
|
+
/* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/FormFieldWrapper'
|
|
231
|
+
),
|
|
232
|
+
);
|
|
@@ -6,7 +6,8 @@ import { uniqBy } from 'lodash';
|
|
|
6
6
|
import { toast } from 'react-toastify';
|
|
7
7
|
import { defineMessages, useIntl } from 'react-intl';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Icon, Toast } from '@plone/volto/components';
|
|
10
|
+
import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets';
|
|
10
11
|
import {
|
|
11
12
|
flattenToAppURL,
|
|
12
13
|
getWorkflowOptions,
|