diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js
new file mode 100644
index 0000000000..eeeadebbb2
--- /dev/null
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js
@@ -0,0 +1,152 @@
+import React, { useRef } from 'react';
+import styled from 'styled-components';
+import PropTypes from 'prop-types';
+import { useIntl } from 'react-intl';
+import { Row } from '@strapi/parts/Row';
+import { Box } from '@strapi/parts/Box';
+import { ButtonText } from '@strapi/parts/Text';
+import { Stack } from '@strapi/parts/Stack';
+import EditIcon from '@strapi/icons/EditIcon';
+import CloseAlertIcon from '@strapi/icons/CloseAlertIcon';
+import Drag from '@strapi/icons/Drag';
+import { getTrad } from '../../../utils';
+
+const ActionButton = styled.button`
+ display: flex;
+ align-items: center;
+ height: ${({ theme }) => theme.spaces[7]};
+
+ &:last-child {
+ padding: 0 ${({ theme }) => theme.spaces[3]};
+ }
+`;
+
+const DragButton = styled(ActionButton)`
+ padding: 0 ${({ theme }) => theme.spaces[3]};
+ border-right: 1px solid ${({ theme }) => theme.colors.neutral150};
+ cursor: all-scroll;
+
+ svg {
+ width: ${12 / 16}rem;
+ height: ${12 / 16}rem;
+ }
+`;
+
+const FieldContainer = styled(Row)`
+ max-height: ${32 / 16}rem;
+ cursor: pointer;
+
+ svg {
+ width: ${10 / 16}rem;
+ height: ${10 / 16}rem;
+
+ path {
+ fill: ${({ theme }) => theme.colors.neutral600};
+ }
+ }
+
+ &:hover {
+ background-color: ${({ theme }) => theme.colors.primary100};
+ border-color: ${({ theme }) => theme.colors.primary200};
+
+ svg {
+ path {
+ fill: ${({ theme }) => theme.colors.primary600};
+ }
+ }
+
+ ${ButtonText} {
+ color: ${({ theme }) => theme.colors.primary600};
+ }
+
+ ${DragButton} {
+ border-right: 1px solid ${({ theme }) => theme.colors.primary200};
+ }
+ }
+`;
+
+const FieldWrapper = styled(Box)`
+ &:last-child {
+ padding-right: ${({ theme }) => theme.spaces[3]};
+ }
+`;
+
+const DraggableCard = ({ title, onRemoveField }) => {
+ const { formatMessage } = useIntl();
+ const editButtonRef = useRef();
+ const cardTitle = title.length > 20 ? `${title.substring(0, 20)}...` : title;
+
+ const handleClickEditRow = () => {
+ if (editButtonRef.current) {
+ editButtonRef.current.click();
+ }
+ };
+
+ return (
+
+
+
+
+
+
+ {cardTitle}
+
+
+ {
+ e.stopPropagation();
+ console.log('edit');
+ }}
+ aria-label={formatMessage(
+ {
+ id: getTrad('components.DraggableCard.edit.field'),
+ defaultMessage: 'Edit {item}',
+ },
+ { item: title }
+ )}
+ type="button"
+ >
+
+
+
+
+
+
+
+
+ );
+};
+
+DraggableCard.propTypes = {
+ onRemoveField: PropTypes.func.isRequired,
+ title: PropTypes.string.isRequired,
+};
+
+export default DraggableCard;
diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/components/View.js b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/components/View.js
new file mode 100644
index 0000000000..a9791777c9
--- /dev/null
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/components/View.js
@@ -0,0 +1,91 @@
+import React from 'react';
+import styled from 'styled-components';
+import { PropTypes } from 'prop-types';
+import { useIntl } from 'react-intl';
+import { Box } from '@strapi/parts/Box';
+import { Row } from '@strapi/parts/Row';
+import { Stack } from '@strapi/parts/Stack';
+import { H3 } from '@strapi/parts/Text';
+import { SimpleMenu, MenuItem } from '@strapi/parts/SimpleMenu';
+import { IconButton } from '@strapi/parts/IconButton';
+import AddIcon from '@strapi/icons/AddIcon';
+import DraggableCard from './DraggableCard';
+import { getTrad } from '../../../utils';
+
+const Flex = styled(Box)`
+ flex: ${({ size }) => size};
+`;
+
+const ScrollableContainer = styled(Flex)`
+ overflow-x: scroll;
+ overflow-y: hidden;
+`;
+
+const SelectContainer = styled(Flex)`
+ max-width: ${32 / 16}rem;
+`;
+
+const View = ({ listRemainingFields, displayedFields, handleAddField, handleRemoveField }) => {
+ const { formatMessage } = useIntl();
+
+ return (
+ <>
+
+
+ {formatMessage({
+ id: getTrad('containers.SettingPage.view'),
+ defaultMessage: 'View',
+ })}
+
+
+
+
+
+ {displayedFields.map((field, index) => (
+ handleRemoveField(e, index)}
+ key={field}
+ title={field}
+ />
+ ))}
+
+
+
+ }
+ disabled={listRemainingFields.length <= 0}
+ data-testid="add-field"
+ >
+ {listRemainingFields.map(field => (
+
+ ))}
+
+
+
+ >
+ );
+};
+
+View.propTypes = {
+ displayedFields: PropTypes.array.isRequired,
+ handleAddField: PropTypes.func.isRequired,
+ handleRemoveField: PropTypes.func.isRequired,
+ listRemainingFields: PropTypes.array.isRequired,
+};
+
+export default View;
diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/index.js b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/index.js
index 1454658535..c656058c73 100644
--- a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/index.js
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/index.js
@@ -1,10 +1,4 @@
-import React, {
- memo,
- useContext,
- // useMemo,
- useReducer,
- useState,
-} from 'react';
+import React, { memo, useContext, useReducer, useState } from 'react';
import PropTypes from 'prop-types';
import { useMutation } from 'react-query';
import isEqual from 'lodash/isEqual';
@@ -21,35 +15,39 @@ import { Main } from '@strapi/parts/Main';
import { Button } from '@strapi/parts/Button';
import CheckIcon from '@strapi/icons/CheckIcon';
import BackIcon from '@strapi/icons/BackIcon';
+// import LayoutDndProvider from '../../components/LayoutDndProvider';
+import { checkIfAttributeIsDisplayable, getTrad } from '../../utils';
import ModelsContext from '../../contexts/ModelsContext';
import { usePluginsQueryParams } from '../../hooks';
import putCMSettingsLV from './utils/api';
import Settings from './components/Settings';
-// import LayoutDndProvider from '../../components/LayoutDndProvider';
+import View from './components/View';
import init from './init';
import reducer, { initialState } from './reducer';
import { EXCLUDED_SORT_OPTIONS } from './utils/excludedSortOptions';
const ListSettingsView = ({ layout, slug }) => {
+ const { formatMessage } = useIntl();
+ const { trackUsage } = useTracking();
const pluginsQueryParams = usePluginsQueryParams();
const toggleNotification = useNotification();
const { refetchData } = useContext(ModelsContext);
+ const [showWarningSubmit, setWarningSubmit] = useState(false);
+ const toggleWarningSubmit = () => setWarningSubmit(prevState => !prevState);
const [reducerState, dispatch] = useReducer(reducer, initialState, () =>
init(initialState, layout)
);
// const [isOpen, setIsOpen] = useState(false);
// const [isModalFormOpen, setIsModalFormOpen] = useState(false);
// const [isDraggingSibling, setIsDraggingSibling] = useState(false);
- const { formatMessage } = useIntl();
- const { trackUsage } = useTracking();
// const toggleModalForm = () => setIsModalFormOpen(prevState => !prevState);
+
const {
// labelForm,
// labelToEdit,
initialData,
modifiedData,
} = reducerState;
- // const metadatas = get(modifiedData, ['metadatas'], {});
// const attributes = useMemo(() => {
// return get(modifiedData, ['attributes'], {});
@@ -57,11 +55,7 @@ const ListSettingsView = ({ layout, slug }) => {
const { attributes } = layout;
- // const displayedFields = useMemo(() => {
- // return get(modifiedData, ['layouts', 'list'], []);
- // }, [modifiedData]);
-
- // const excludedSortOptions = ['media', 'richtext', 'dynamiczone', 'relation', 'component', 'json'];
+ const displayedFields = modifiedData.layouts.list;
const sortOptions = Object.entries(attributes).reduce((acc, cur) => {
const [name, { type }] = cur;
@@ -73,19 +67,6 @@ const ListSettingsView = ({ layout, slug }) => {
return acc;
}, []);
- // const listRemainingFields = useMemo(() => {
- // return Object.keys(metadatas)
- // .filter(key => {
- // return checkIfAttributeIsDisplayable(get(attributes, key, {}));
- // })
- // .filter(field => {
- // return !displayedFields.includes(field);
- // })
- // .sort();
- // }, [displayedFields, attributes, metadatas]);
-
- // console.log(displayedFields, listRemainingFields);
-
// const handleClickEditLabel = labelToEdit => {
// dispatch({
// type: 'SET_LABEL_TO_EDIT',
@@ -108,15 +89,6 @@ const ListSettingsView = ({ layout, slug }) => {
});
};
- const [showWarningSubmit, setWarningSubmit] = useState(false);
- const toggleWarningSubmit = () => setWarningSubmit(prevState => !prevState);
-
- const handleSubmit = e => {
- e.preventDefault();
- toggleWarningSubmit();
- trackUsage('willSaveContentTypeLayout');
- };
-
const goBackUrl = () => {
const {
settings: { pageSize, defaultSortBy, defaultSortOrder },
@@ -136,24 +108,42 @@ const ListSettingsView = ({ layout, slug }) => {
return `/content-manager/${kind}/${uid}?${goBackSearch}`;
};
- // const handleChangeEditLabel = ({ target: { name, value } }) => {
- // dispatch({
- // type: 'ON_CHANGE_LABEL_METAS',
- // name,
- // value,
- // });
- // };
-
const handleConfirm = async () => {
const body = pick(modifiedData, ['layouts', 'settings', 'metadatas']);
- submitMutation.mutateAsync(body);
+ submitMutation.mutate(body);
+ };
+
+ const handleAddField = item => {
+ dispatch({
+ type: 'ADD_FIELD',
+ item,
+ });
+ };
+
+ const handleRemoveField = (e, index) => {
+ e.stopPropagation();
+
+ if (displayedFields.length === 1) {
+ toggleNotification({
+ type: 'info',
+ message: { id: getTrad('notification.info.minimumFields') },
+ });
+ } else {
+ dispatch({
+ type: 'REMOVE_FIELD',
+ index,
+ });
+ }
+ };
+
+ const handleSubmit = e => {
+ e.preventDefault();
+ toggleWarningSubmit();
+ trackUsage('willSaveContentTypeLayout');
};
const submitMutation = useMutation(body => putCMSettingsLV(body, slug), {
- onSuccess: async () => {
- dispatch({
- type: 'SUBMIT_SUCCEEDED',
- });
+ onSuccess: () => {
trackUsage('didEditListSettings');
refetchData();
},
@@ -163,11 +153,46 @@ const ListSettingsView = ({ layout, slug }) => {
message: { id: 'notification.error' },
});
},
- refetchActive: true,
});
-
const { isLoading: isSubmittingForm } = submitMutation;
+ const listRemainingFields = Object.entries(attributes)
+ .reduce((acc, cur) => {
+ const [attrName, fieldSchema] = cur;
+
+ const isDisplayable = checkIfAttributeIsDisplayable(fieldSchema);
+ const isAlreadyDisplayed = displayedFields.includes(attrName);
+
+ if (isDisplayable && !isAlreadyDisplayed) {
+ acc.push(attrName);
+ }
+
+ return acc;
+ }, [])
+ .sort();
+
+ // const handleClickEditLabel = labelToEdit => {
+ // dispatch({
+ // type: 'SET_LABEL_TO_EDIT',
+ // labelToEdit,
+ // });
+ // toggleModalForm();
+ // };
+
+ // const handleClosed = () => {
+ // dispatch({
+ // type: 'UNSET_LABEL_TO_EDIT',
+ // });
+ // };
+
+ // const handleChangeEditLabel = ({ target: { name, value } }) => {
+ // dispatch({
+ // type: 'ON_CHANGE_LABEL_METAS',
+ // name,
+ // value,
+ // });
+ // };
+
// const move = (originalIndex, atIndex) => {
// dispatch({
// type: 'MOVE_FIELD',
@@ -238,12 +263,12 @@ const ListSettingsView = ({ layout, slug }) => {
}
subtitle={formatMessage({
- id: `components.SettingsViewWrapper.pluginHeader.description.list-settings`,
- defaultMessage: `Define the settings of the list view.`,
+ id: getTrad('components.SettingsViewWrapper.pluginHeader.description.list-settings'),
+ defaultMessage: 'Define the settings of the list view.',
})}
title={formatMessage(
{
- id: 'components.SettingsViewWrapper.pluginHeader.title',
+ id: getTrad('components.SettingsViewWrapper.pluginHeader.title'),
defaultMessage: 'Configure the view - {name}',
},
{ name: upperFirst(modifiedData.info.label) }
@@ -264,14 +289,20 @@ const ListSettingsView = ({ layout, slug }) => {
onChange={handleChange}
sortOptions={sortOptions}
/>
-
+
+
}
diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/reducer.js b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/reducer.js
index 7d7162828b..7a3d5c39e1 100644
--- a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/reducer.js
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/reducer.js
@@ -1,6 +1,6 @@
import produce from 'immer'; // current
import set from 'lodash/set';
-// import get from 'lodash/get';
+import get from 'lodash/get';
// import { arrayMoveItem } from '../../utils';
const initialState = {
@@ -14,13 +14,13 @@ const initialState = {
const reducer = (state = initialState, action) =>
// eslint-disable-next-line consistent-return
produce(state, draftState => {
- // const layoutFieldListPath = ['modifiedData', 'layouts', 'list'];
+ const layoutFieldListPath = ['modifiedData', 'layouts', 'list'];
switch (action.type) {
- // case 'ADD_FIELD': {
- // const layoutFieldList = get(state, layoutFieldListPath, []);
- // set(draftState, layoutFieldListPath, [...layoutFieldList, action.item]);
- // break;
- // }
+ case 'ADD_FIELD': {
+ const layoutFieldList = get(state, layoutFieldListPath, []);
+ set(draftState, layoutFieldListPath, [action.item, ...layoutFieldList]);
+ break;
+ }
// case 'MOVE_FIELD': {
// const layoutFieldList = get(state, layoutFieldListPath, []);
// const { originalIndex, atIndex } = action;
@@ -43,15 +43,15 @@ const reducer = (state = initialState, action) =>
// draftState.modifiedData = state.initialData;
// break;
// }
- // case 'REMOVE_FIELD': {
- // const layoutFieldList = get(state, layoutFieldListPath, []);
- // set(
- // draftState,
- // layoutFieldListPath,
- // layoutFieldList.filter((_, index) => action.index !== index)
- // );
- // break;
- // }
+ case 'REMOVE_FIELD': {
+ const layoutFieldList = get(state, layoutFieldListPath, []);
+ set(
+ draftState,
+ layoutFieldListPath,
+ layoutFieldList.filter((_, index) => action.index !== index)
+ );
+ break;
+ }
// case 'SET_LABEL_TO_EDIT': {
// const { labelToEdit } = action;
// draftState.labelToEdit = labelToEdit;
@@ -78,10 +78,6 @@ const reducer = (state = initialState, action) =>
// set(draftState, [...fieldMetadataPath, 'sortable'], state.labelForm.sortable);
// break;
// }
- case 'SUBMIT_SUCCEEDED': {
- draftState.initialData = state.modifiedData;
- break;
- }
default:
return draftState;
}
diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/__snapshots__/index.test.js.snap b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/__snapshots__/index.test.js.snap
new file mode 100644
index 0000000000..778b05a330
--- /dev/null
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/__snapshots__/index.test.js.snap
@@ -0,0 +1,3895 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ADMIN | CM | LV | Configure the view renders and matches the snapshot 1`] = `
+.c26 {
+ background: #ffffff;
+ padding-top: 24px;
+ padding-right: 32px;
+ padding-bottom: 24px;
+ padding-left: 32px;
+ border-radius: 4px;
+ box-shadow: 0px 1px 4px rgba(33,33,52,0.1);
+}
+
+.c27 {
+ padding-bottom: 16px;
+}
+
+.c64 {
+ padding-top: 24px;
+ padding-bottom: 24px;
+}
+
+.c21 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c22 {
+ font-weight: 600;
+ line-height: 1.14;
+}
+
+.c18 {
+ padding-right: 8px;
+}
+
+.c15 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ cursor: pointer;
+ padding: 8px;
+ border-radius: 4px;
+ background: #ffffff;
+ border: 1px solid #dcdce4;
+ position: relative;
+ outline: none;
+}
+
+.c15 svg {
+ height: 12px;
+ width: 12px;
+}
+
+.c15 svg > g,
+.c15 svg path {
+ fill: #ffffff;
+}
+
+.c15[aria-disabled='true'] {
+ pointer-events: none;
+}
+
+.c15:after {
+ -webkit-transition-property: all;
+ transition-property: all;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -4px;
+ bottom: -4px;
+ left: -4px;
+ right: -4px;
+ border: 2px solid transparent;
+}
+
+.c15:focus-visible {
+ outline: none;
+}
+
+.c15:focus-visible:after {
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ border: 2px solid #4945ff;
+}
+
+.c19 {
+ height: 100%;
+}
+
+.c16 {
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ padding: 10px 16px;
+ background: #4945ff;
+ border: none;
+ border: 1px solid #4945ff;
+ background: #4945ff;
+}
+
+.c16 .c17 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c16 .c20 {
+ color: #ffffff;
+}
+
+.c16[aria-disabled='true'] {
+ border: 1px solid #dcdce4;
+ background: #eaeaef;
+}
+
+.c16[aria-disabled='true'] .c20 {
+ color: #666687;
+}
+
+.c16[aria-disabled='true'] svg > g,
+.c16[aria-disabled='true'] svg path {
+ fill: #666687;
+}
+
+.c16[aria-disabled='true']:active {
+ border: 1px solid #dcdce4;
+ background: #eaeaef;
+}
+
+.c16[aria-disabled='true']:active .c20 {
+ color: #666687;
+}
+
+.c16[aria-disabled='true']:active svg > g,
+.c16[aria-disabled='true']:active svg path {
+ fill: #666687;
+}
+
+.c16:hover {
+ border: 1px solid #7b79ff;
+ background: #7b79ff;
+}
+
+.c16:active {
+ border: 1px solid #4945ff;
+ background: #4945ff;
+}
+
+.c86 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ cursor: pointer;
+ padding: 8px;
+ border-radius: 4px;
+ background: #ffffff;
+ border: 1px solid #dcdce4;
+ position: relative;
+ outline: none;
+}
+
+.c86 svg {
+ height: 12px;
+ width: 12px;
+}
+
+.c86 svg > g,
+.c86 svg path {
+ fill: #ffffff;
+}
+
+.c86[aria-disabled='true'] {
+ pointer-events: none;
+}
+
+.c86:after {
+ -webkit-transition-property: all;
+ transition-property: all;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -4px;
+ bottom: -4px;
+ left: -4px;
+ right: -4px;
+ border: 2px solid transparent;
+}
+
+.c86:focus-visible {
+ outline: none;
+}
+
+.c86:focus-visible:after {
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ border: 2px solid #4945ff;
+}
+
+.c87 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ height: 2rem;
+ width: 2rem;
+}
+
+.c87 svg > g,
+.c87 svg path {
+ fill: #8e8ea9;
+}
+
+.c87:hover svg > g,
+.c87:hover svg path {
+ fill: #666687;
+}
+
+.c87:active svg > g,
+.c87:active svg path {
+ fill: #a5a5ba;
+}
+
+.c87[aria-disabled='true'] {
+ background-color: #eaeaef;
+}
+
+.c87[aria-disabled='true'] svg path {
+ fill: #666687;
+}
+
+.c29 {
+ padding-bottom: 24px;
+}
+
+.c67 {
+ padding-top: 16px;
+ padding-right: 16px;
+ padding-left: 16px;
+ border-radius: 4px;
+ border-style: dashed;
+ border-width: 1px;
+ border-color: #c0c0cf;
+}
+
+.c74 {
+ background: #f6f6f9;
+ border-radius: 4px;
+ border-color: #eaeaef;
+ border: 1px solid #eaeaef;
+}
+
+.c83 {
+ padding-left: 12px;
+}
+
+.c30 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-flex-wrap: wrap;
+ -ms-flex-wrap: wrap;
+ flex-wrap: wrap;
+}
+
+.c68 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c75 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c54 {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ width: 100%;
+ background: transparent;
+ border: none;
+}
+
+.c54:focus {
+ outline: none;
+}
+
+.c51 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #32324d;
+}
+
+.c58 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c62 {
+ font-weight: 400;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #666687;
+}
+
+.c57 {
+ padding-right: 16px;
+ padding-left: 16px;
+}
+
+.c59 {
+ padding-left: 12px;
+}
+
+.c52 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c55 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c50 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+}
+
+.c50 > * {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.c50 > * + * {
+ margin-top: 4px;
+}
+
+.c53 {
+ position: relative;
+ border: 1px solid #dcdce4;
+ padding-right: 12px;
+ border-radius: 4px;
+ background: #ffffff;
+ overflow: hidden;
+ min-height: 2.5rem;
+ outline: none;
+ box-shadow: 0;
+ -webkit-transition-property: border-color,box-shadow,fill;
+ transition-property: border-color,box-shadow,fill;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+}
+
+.c53:focus-within {
+ border: 1px solid #4945ff;
+ box-shadow: #4945ff 0px 0px 0px 2px;
+}
+
+.c60 {
+ background: transparent;
+ border: none;
+ position: relative;
+ z-index: 1;
+}
+
+.c60 svg {
+ height: 0.6875rem;
+ width: 0.6875rem;
+}
+
+.c60 svg path {
+ fill: #666687;
+}
+
+.c61 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ background: none;
+ border: none;
+}
+
+.c61 svg {
+ width: 0.375rem;
+}
+
+.c56 {
+ width: 100%;
+}
+
+.c71 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c72 > * {
+ margin-left: 0;
+ margin-right: 0;
+}
+
+.c72 > * + * {
+ margin-left: 12px;
+}
+
+.c28 {
+ font-weight: 500;
+ font-size: 1rem;
+ line-height: 1.25;
+ color: #32324d;
+}
+
+.c81 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c82 {
+ font-weight: 600;
+ line-height: 1.14;
+}
+
+.c35 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #32324d;
+}
+
+.c44 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #271fe0;
+}
+
+.c47 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #b72b1a;
+}
+
+.c38 {
+ background: #ffffff;
+ border-radius: 4px;
+}
+
+.c40 {
+ background: #ffffff;
+ padding-right: 32px;
+ padding-left: 32px;
+}
+
+.c42 {
+ background: #f0f0ff;
+ padding-right: 32px;
+ padding-left: 32px;
+}
+
+.c46 {
+ background: #fcecea;
+ padding-right: 32px;
+ padding-left: 32px;
+}
+
+.c34 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c33 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+}
+
+.c33 > * {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.c33 > * + * {
+ margin-top: 4px;
+}
+
+.c37 {
+ border: 0;
+ -webkit-clip: rect(0 0 0 0);
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+
+.c36 {
+ position: relative;
+ display: inline-block;
+}
+
+.c39 {
+ height: 2.5rem;
+ border: 1px solid #dcdce4;
+ display: -webkit-inline-box;
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
+ display: inline-flex;
+ overflow: hidden;
+ outline: none;
+ box-shadow: 0;
+ -webkit-transition-property: border-color,box-shadow,fill;
+ transition-property: border-color,box-shadow,fill;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+}
+
+.c39:focus-within {
+ border: 1px solid #4945ff;
+ box-shadow: #4945ff 0px 0px 0px 2px;
+}
+
+.c43 {
+ text-transform: uppercase;
+ position: relative;
+ z-index: 2;
+}
+
+.c41 {
+ text-transform: uppercase;
+ border-right: 1px solid #dcdce4;
+ position: relative;
+ z-index: 2;
+}
+
+.c45 {
+ position: absolute;
+ z-index: 1;
+ left: 4px;
+ top: 4px;
+}
+
+.c32 {
+ width: -webkit-fit-content;
+ width: -moz-fit-content;
+ width: fit-content;
+}
+
+.c65 {
+ background: #eaeaef;
+}
+
+.c66 {
+ height: 1px;
+ border: none;
+ margin: 0;
+}
+
+.c1 {
+ padding-bottom: 56px;
+}
+
+.c4 {
+ background: #f6f6f9;
+ padding-top: 24px;
+ padding-right: 56px;
+ padding-bottom: 56px;
+ padding-left: 56px;
+}
+
+.c5 {
+ padding-bottom: 12px;
+}
+
+.c25 {
+ padding-right: 56px;
+ padding-left: 56px;
+}
+
+.c0 {
+ display: grid;
+ grid-template-columns: 1fr;
+}
+
+.c2 {
+ overflow-x: hidden;
+}
+
+.c12 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c13 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c14 {
+ font-weight: 600;
+ font-size: 2rem;
+ line-height: 1.25;
+ color: #32324d;
+}
+
+.c23 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #666687;
+}
+
+.c24 {
+ font-size: 1rem;
+ line-height: 1.5;
+}
+
+.c9 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #4945ff;
+}
+
+.c10 {
+ font-weight: 600;
+ line-height: 1.14;
+}
+
+.c11 {
+ font-weight: 600;
+ font-size: 0.6875rem;
+ line-height: 1.45;
+ text-transform: uppercase;
+}
+
+.c7 {
+ padding-right: 8px;
+}
+
+.c6 {
+ display: -webkit-inline-box;
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
+ display: inline-flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ text-transform: uppercase;
+ -webkit-text-decoration: none;
+ text-decoration: none;
+ position: relative;
+ outline: none;
+}
+
+.c6 svg path {
+ fill: #4945ff;
+}
+
+.c6 svg {
+ font-size: 0.625rem;
+}
+
+.c6:after {
+ -webkit-transition-property: all;
+ transition-property: all;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -4px;
+ bottom: -4px;
+ left: -4px;
+ right: -4px;
+ border: 2px solid transparent;
+}
+
+.c6:focus-visible {
+ outline: none;
+}
+
+.c6:focus-visible:after {
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ border: 2px solid #4945ff;
+}
+
+.c8 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+}
+
+.c3 {
+ outline: none;
+}
+
+.c48 {
+ display: grid;
+ grid-template-columns: repeat(12,1fr);
+ gap: 16px;
+}
+
+.c49 {
+ grid-column: span 6;
+}
+
+.c63 {
+ grid-column: span 3;
+}
+
+.c31 {
+ gap: 16px;
+}
+
+.c78 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ height: 32px;
+}
+
+.c78:last-child {
+ padding: 0 12px;
+}
+
+.c79 {
+ padding: 0 12px;
+ border-right: 1px solid #eaeaef;
+ cursor: all-scroll;
+}
+
+.c79 svg {
+ width: 0.75rem;
+ height: 0.75rem;
+}
+
+.c76 {
+ max-height: 2rem;
+ cursor: pointer;
+}
+
+.c76 svg {
+ width: 0.625rem;
+ height: 0.625rem;
+}
+
+.c76 svg path {
+ fill: #666687;
+}
+
+.c76:hover {
+ background-color: #f0f0ff;
+ border-color: #d9d8ff;
+}
+
+.c76:hover svg path {
+ fill: #4945ff;
+}
+
+.c76:hover .c80 {
+ color: #4945ff;
+}
+
+.c76:hover .c77 {
+ border-right: 1px solid #d9d8ff;
+}
+
+.c73:last-child {
+ padding-right: 12px;
+}
+
+.c69 {
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+}
+
+.c84 {
+ -webkit-flex: auto;
+ -ms-flex: auto;
+ flex: auto;
+}
+
+.c70 {
+ overflow-x: scroll;
+ overflow-y: hidden;
+}
+
+.c85 {
+ max-width: 2rem;
+}
+
+@media (max-width:68.75rem) {
+ .c49 {
+ grid-column: span 12;
+ }
+}
+
+@media (max-width:34.375rem) {
+ .c49 {
+ grid-column: span;
+ }
+}
+
+@media (max-width:68.75rem) {
+ .c63 {
+ grid-column: span 12;
+ }
+}
+
+@media (max-width:34.375rem) {
+ .c63 {
+ grid-column: span;
+ }
+}
+
+
+`;
+
+exports[`ADMIN | CM | LV | Configure the view should add field 1`] = `
+.c88 {
+ border: 0;
+ -webkit-clip: rect(0 0 0 0);
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+
+.c26 {
+ background: #ffffff;
+ padding-top: 24px;
+ padding-right: 32px;
+ padding-bottom: 24px;
+ padding-left: 32px;
+ border-radius: 4px;
+ box-shadow: 0px 1px 4px rgba(33,33,52,0.1);
+}
+
+.c27 {
+ padding-bottom: 16px;
+}
+
+.c64 {
+ padding-top: 24px;
+ padding-bottom: 24px;
+}
+
+.c21 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c22 {
+ font-weight: 600;
+ line-height: 1.14;
+}
+
+.c18 {
+ padding-right: 8px;
+}
+
+.c15 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ cursor: pointer;
+ padding: 8px;
+ border-radius: 4px;
+ background: #ffffff;
+ border: 1px solid #dcdce4;
+ position: relative;
+ outline: none;
+}
+
+.c15 svg {
+ height: 12px;
+ width: 12px;
+}
+
+.c15 svg > g,
+.c15 svg path {
+ fill: #ffffff;
+}
+
+.c15[aria-disabled='true'] {
+ pointer-events: none;
+}
+
+.c15:after {
+ -webkit-transition-property: all;
+ transition-property: all;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -4px;
+ bottom: -4px;
+ left: -4px;
+ right: -4px;
+ border: 2px solid transparent;
+}
+
+.c15:focus-visible {
+ outline: none;
+}
+
+.c15:focus-visible:after {
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ border: 2px solid #4945ff;
+}
+
+.c19 {
+ height: 100%;
+}
+
+.c16 {
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ padding: 10px 16px;
+ background: #4945ff;
+ border: none;
+ border: 1px solid #4945ff;
+ background: #4945ff;
+}
+
+.c16 .c17 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c16 .c20 {
+ color: #ffffff;
+}
+
+.c16[aria-disabled='true'] {
+ border: 1px solid #dcdce4;
+ background: #eaeaef;
+}
+
+.c16[aria-disabled='true'] .c20 {
+ color: #666687;
+}
+
+.c16[aria-disabled='true'] svg > g,
+.c16[aria-disabled='true'] svg path {
+ fill: #666687;
+}
+
+.c16[aria-disabled='true']:active {
+ border: 1px solid #dcdce4;
+ background: #eaeaef;
+}
+
+.c16[aria-disabled='true']:active .c20 {
+ color: #666687;
+}
+
+.c16[aria-disabled='true']:active svg > g,
+.c16[aria-disabled='true']:active svg path {
+ fill: #666687;
+}
+
+.c16:hover {
+ border: 1px solid #7b79ff;
+ background: #7b79ff;
+}
+
+.c16:active {
+ border: 1px solid #4945ff;
+ background: #4945ff;
+}
+
+.c89 {
+ background: #212134;
+ padding: 8px;
+ border-radius: 4px;
+}
+
+.c91 {
+ font-weight: 400;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #ffffff;
+}
+
+.c90 {
+ position: absolute;
+ z-index: 4;
+ display: none;
+}
+
+.c86 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ cursor: pointer;
+ padding: 8px;
+ border-radius: 4px;
+ background: #ffffff;
+ border: 1px solid #dcdce4;
+ position: relative;
+ outline: none;
+}
+
+.c86 svg {
+ height: 12px;
+ width: 12px;
+}
+
+.c86 svg > g,
+.c86 svg path {
+ fill: #ffffff;
+}
+
+.c86[aria-disabled='true'] {
+ pointer-events: none;
+}
+
+.c86:after {
+ -webkit-transition-property: all;
+ transition-property: all;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -4px;
+ bottom: -4px;
+ left: -4px;
+ right: -4px;
+ border: 2px solid transparent;
+}
+
+.c86:focus-visible {
+ outline: none;
+}
+
+.c86:focus-visible:after {
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ border: 2px solid #4945ff;
+}
+
+.c87 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ height: 2rem;
+ width: 2rem;
+}
+
+.c87 svg > g,
+.c87 svg path {
+ fill: #8e8ea9;
+}
+
+.c87:hover svg > g,
+.c87:hover svg path {
+ fill: #666687;
+}
+
+.c87:active svg > g,
+.c87:active svg path {
+ fill: #a5a5ba;
+}
+
+.c87[aria-disabled='true'] {
+ background-color: #eaeaef;
+}
+
+.c87[aria-disabled='true'] svg path {
+ fill: #666687;
+}
+
+.c29 {
+ padding-bottom: 24px;
+}
+
+.c67 {
+ padding-top: 16px;
+ padding-right: 16px;
+ padding-left: 16px;
+ border-radius: 4px;
+ border-style: dashed;
+ border-width: 1px;
+ border-color: #c0c0cf;
+}
+
+.c74 {
+ background: #f6f6f9;
+ border-radius: 4px;
+ border-color: #eaeaef;
+ border: 1px solid #eaeaef;
+}
+
+.c83 {
+ padding-left: 12px;
+}
+
+.c30 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-flex-wrap: wrap;
+ -ms-flex-wrap: wrap;
+ flex-wrap: wrap;
+}
+
+.c68 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c75 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c54 {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ width: 100%;
+ background: transparent;
+ border: none;
+}
+
+.c54:focus {
+ outline: none;
+}
+
+.c51 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #32324d;
+}
+
+.c58 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c62 {
+ font-weight: 400;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #666687;
+}
+
+.c57 {
+ padding-right: 16px;
+ padding-left: 16px;
+}
+
+.c59 {
+ padding-left: 12px;
+}
+
+.c52 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c55 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c50 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+}
+
+.c50 > * {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.c50 > * + * {
+ margin-top: 4px;
+}
+
+.c53 {
+ position: relative;
+ border: 1px solid #dcdce4;
+ padding-right: 12px;
+ border-radius: 4px;
+ background: #ffffff;
+ overflow: hidden;
+ min-height: 2.5rem;
+ outline: none;
+ box-shadow: 0;
+ -webkit-transition-property: border-color,box-shadow,fill;
+ transition-property: border-color,box-shadow,fill;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+}
+
+.c53:focus-within {
+ border: 1px solid #4945ff;
+ box-shadow: #4945ff 0px 0px 0px 2px;
+}
+
+.c60 {
+ background: transparent;
+ border: none;
+ position: relative;
+ z-index: 1;
+}
+
+.c60 svg {
+ height: 0.6875rem;
+ width: 0.6875rem;
+}
+
+.c60 svg path {
+ fill: #666687;
+}
+
+.c61 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ background: none;
+ border: none;
+}
+
+.c61 svg {
+ width: 0.375rem;
+}
+
+.c56 {
+ width: 100%;
+}
+
+.c71 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c72 > * {
+ margin-left: 0;
+ margin-right: 0;
+}
+
+.c72 > * + * {
+ margin-left: 12px;
+}
+
+.c28 {
+ font-weight: 500;
+ font-size: 1rem;
+ line-height: 1.25;
+ color: #32324d;
+}
+
+.c81 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c82 {
+ font-weight: 600;
+ line-height: 1.14;
+}
+
+.c35 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #32324d;
+}
+
+.c44 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #271fe0;
+}
+
+.c47 {
+ font-weight: 500;
+ font-size: 0.75rem;
+ line-height: 1.33;
+ color: #b72b1a;
+}
+
+.c38 {
+ background: #ffffff;
+ border-radius: 4px;
+}
+
+.c40 {
+ background: #ffffff;
+ padding-right: 32px;
+ padding-left: 32px;
+}
+
+.c42 {
+ background: #f0f0ff;
+ padding-right: 32px;
+ padding-left: 32px;
+}
+
+.c46 {
+ background: #fcecea;
+ padding-right: 32px;
+ padding-left: 32px;
+}
+
+.c34 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c33 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+}
+
+.c33 > * {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.c33 > * + * {
+ margin-top: 4px;
+}
+
+.c37 {
+ border: 0;
+ -webkit-clip: rect(0 0 0 0);
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+
+.c36 {
+ position: relative;
+ display: inline-block;
+}
+
+.c39 {
+ height: 2.5rem;
+ border: 1px solid #dcdce4;
+ display: -webkit-inline-box;
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
+ display: inline-flex;
+ overflow: hidden;
+ outline: none;
+ box-shadow: 0;
+ -webkit-transition-property: border-color,box-shadow,fill;
+ transition-property: border-color,box-shadow,fill;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+}
+
+.c39:focus-within {
+ border: 1px solid #4945ff;
+ box-shadow: #4945ff 0px 0px 0px 2px;
+}
+
+.c43 {
+ text-transform: uppercase;
+ position: relative;
+ z-index: 2;
+}
+
+.c41 {
+ text-transform: uppercase;
+ border-right: 1px solid #dcdce4;
+ position: relative;
+ z-index: 2;
+}
+
+.c45 {
+ position: absolute;
+ z-index: 1;
+ left: 4px;
+ top: 4px;
+}
+
+.c32 {
+ width: -webkit-fit-content;
+ width: -moz-fit-content;
+ width: fit-content;
+}
+
+.c65 {
+ background: #eaeaef;
+}
+
+.c66 {
+ height: 1px;
+ border: none;
+ margin: 0;
+}
+
+.c1 {
+ padding-bottom: 56px;
+}
+
+.c4 {
+ background: #f6f6f9;
+ padding-top: 24px;
+ padding-right: 56px;
+ padding-bottom: 56px;
+ padding-left: 56px;
+}
+
+.c5 {
+ padding-bottom: 12px;
+}
+
+.c25 {
+ padding-right: 56px;
+ padding-left: 56px;
+}
+
+.c0 {
+ display: grid;
+ grid-template-columns: 1fr;
+}
+
+.c2 {
+ overflow-x: hidden;
+}
+
+.c12 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c13 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c14 {
+ font-weight: 600;
+ font-size: 2rem;
+ line-height: 1.25;
+ color: #32324d;
+}
+
+.c23 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #666687;
+}
+
+.c24 {
+ font-size: 1rem;
+ line-height: 1.5;
+}
+
+.c9 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #4945ff;
+}
+
+.c10 {
+ font-weight: 600;
+ line-height: 1.14;
+}
+
+.c11 {
+ font-weight: 600;
+ font-size: 0.6875rem;
+ line-height: 1.45;
+ text-transform: uppercase;
+}
+
+.c7 {
+ padding-right: 8px;
+}
+
+.c6 {
+ display: -webkit-inline-box;
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
+ display: inline-flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ text-transform: uppercase;
+ -webkit-text-decoration: none;
+ text-decoration: none;
+ position: relative;
+ outline: none;
+}
+
+.c6 svg path {
+ fill: #4945ff;
+}
+
+.c6 svg {
+ font-size: 0.625rem;
+}
+
+.c6:after {
+ -webkit-transition-property: all;
+ transition-property: all;
+ -webkit-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -4px;
+ bottom: -4px;
+ left: -4px;
+ right: -4px;
+ border: 2px solid transparent;
+}
+
+.c6:focus-visible {
+ outline: none;
+}
+
+.c6:focus-visible:after {
+ border-radius: 8px;
+ content: '';
+ position: absolute;
+ top: -5px;
+ bottom: -5px;
+ left: -5px;
+ right: -5px;
+ border: 2px solid #4945ff;
+}
+
+.c8 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+}
+
+.c3 {
+ outline: none;
+}
+
+.c48 {
+ display: grid;
+ grid-template-columns: repeat(12,1fr);
+ gap: 16px;
+}
+
+.c49 {
+ grid-column: span 6;
+}
+
+.c63 {
+ grid-column: span 3;
+}
+
+.c31 {
+ gap: 16px;
+}
+
+.c99 {
+ font-weight: 400;
+ font-size: 0.875rem;
+ line-height: 1.43;
+ color: #32324d;
+}
+
+.c92 {
+ background: #ffffff;
+ padding: 4px;
+ border-radius: 4px;
+}
+
+.c95 {
+ padding: 4px;
+}
+
+.c98 {
+ padding: 8px;
+}
+
+.c96 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c93 {
+ box-shadow: 0px 1px 4px rgba(33,33,52,0.1);
+ position: absolute;
+ z-index: 4;
+ border: 1px solid #eaeaef;
+ background: #ffffff;
+}
+
+.c94 {
+ max-height: 15rem;
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.c94::-webkit-scrollbar {
+ -webkit-appearance: none;
+ width: 4px;
+}
+
+.c94::-webkit-scrollbar-track {
+ background: #ffffff;
+}
+
+.c94::-webkit-scrollbar-thumb {
+ background: #eaeaef;
+ border-radius: 4px;
+ margin-right: 10px;
+}
+
+.c97 {
+ border: none;
+ padding: 0;
+ background: transparent;
+ cursor: pointer;
+ text-align: left;
+ width: 100%;
+ color: #32324d;
+ border-radius: 4px;
+}
+
+.c97:focus {
+ background-color: #f0f0ff;
+}
+
+.c97:hover {
+ background-color: #f0f0ff;
+}
+
+.c78 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ height: 32px;
+}
+
+.c78:last-child {
+ padding: 0 12px;
+}
+
+.c79 {
+ padding: 0 12px;
+ border-right: 1px solid #eaeaef;
+ cursor: all-scroll;
+}
+
+.c79 svg {
+ width: 0.75rem;
+ height: 0.75rem;
+}
+
+.c76 {
+ max-height: 2rem;
+ cursor: pointer;
+}
+
+.c76 svg {
+ width: 0.625rem;
+ height: 0.625rem;
+}
+
+.c76 svg path {
+ fill: #666687;
+}
+
+.c76:hover {
+ background-color: #f0f0ff;
+ border-color: #d9d8ff;
+}
+
+.c76:hover svg path {
+ fill: #4945ff;
+}
+
+.c76:hover .c80 {
+ color: #4945ff;
+}
+
+.c76:hover .c77 {
+ border-right: 1px solid #d9d8ff;
+}
+
+.c73:last-child {
+ padding-right: 12px;
+}
+
+.c69 {
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+}
+
+.c84 {
+ -webkit-flex: auto;
+ -ms-flex: auto;
+ flex: auto;
+}
+
+.c70 {
+ overflow-x: scroll;
+ overflow-y: hidden;
+}
+
+.c85 {
+ max-width: 2rem;
+}
+
+@media (max-width:68.75rem) {
+ .c49 {
+ grid-column: span 12;
+ }
+}
+
+@media (max-width:34.375rem) {
+ .c49 {
+ grid-column: span;
+ }
+}
+
+@media (max-width:68.75rem) {
+ .c63 {
+ grid-column: span 12;
+ }
+}
+
+@media (max-width:34.375rem) {
+ .c63 {
+ grid-column: span;
+ }
+}
+
+
+
+
+
+
+
+`;
diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/index.test.js b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/index.test.js
index 785fdb55c0..12499f6efe 100644
--- a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/index.test.js
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/index.test.js
@@ -43,10 +43,26 @@ const layout = {
info: {
label: 'michka',
},
- uid: 'api::restaurant.restaurant',
- settings: {},
- metadatas: {},
+ metadatas: {
+ address: {},
+ averagePrice: {},
+ cover: {},
+ id: {},
+ since: {},
+ },
+ layouts: {
+ list: ['id', 'address'],
+ },
options: {},
+ settings: {
+ bulkable: false,
+ defaultSortBy: 'id',
+ defaultSortOrder: 'ASC',
+ filterable: true,
+ pageSize: 10,
+ searchable: true,
+ },
+ uid: 'api::restaurant.restaurant',
};
const makeApp = history => (
@@ -70,1259 +86,13 @@ const makeApp = history => (
describe('ADMIN | CM | LV | Configure the view', () => {
it('renders and matches the snapshot', async () => {
const history = createMemoryHistory();
- history.push('/content-manager');
const { container } = render(makeApp(history));
- await waitFor(() => {
- expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument();
- });
+ await waitFor(() =>
+ expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument()
+ );
- expect(container.firstChild).toMatchInlineSnapshot(`
- .c26 {
- background: #ffffff;
- padding-top: 24px;
- padding-right: 32px;
- padding-bottom: 24px;
- padding-left: 32px;
- border-radius: 4px;
- box-shadow: 0px 1px 4px rgba(33,33,52,0.1);
- }
-
- .c27 {
- padding-bottom: 16px;
- }
-
- .c62 {
- padding: 24px;
- }
-
- .c21 {
- font-weight: 400;
- font-size: 0.875rem;
- line-height: 1.43;
- color: #32324d;
- }
-
- .c22 {
- font-weight: 600;
- line-height: 1.14;
- }
-
- .c18 {
- padding-right: 8px;
- }
-
- .c15 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- cursor: pointer;
- padding: 8px;
- border-radius: 4px;
- background: #ffffff;
- border: 1px solid #dcdce4;
- position: relative;
- outline: none;
- }
-
- .c15 svg {
- height: 12px;
- width: 12px;
- }
-
- .c15 svg > g,
- .c15 svg path {
- fill: #ffffff;
- }
-
- .c15[aria-disabled='true'] {
- pointer-events: none;
- }
-
- .c15:after {
- -webkit-transition-property: all;
- transition-property: all;
- -webkit-transition-duration: 0.2s;
- transition-duration: 0.2s;
- border-radius: 8px;
- content: '';
- position: absolute;
- top: -4px;
- bottom: -4px;
- left: -4px;
- right: -4px;
- border: 2px solid transparent;
- }
-
- .c15:focus-visible {
- outline: none;
- }
-
- .c15:focus-visible:after {
- border-radius: 8px;
- content: '';
- position: absolute;
- top: -5px;
- bottom: -5px;
- left: -5px;
- right: -5px;
- border: 2px solid #4945ff;
- }
-
- .c19 {
- height: 100%;
- }
-
- .c16 {
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- padding: 10px 16px;
- background: #4945ff;
- border: none;
- border: 1px solid #4945ff;
- background: #4945ff;
- }
-
- .c16 .c17 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- }
-
- .c16 .c20 {
- color: #ffffff;
- }
-
- .c16[aria-disabled='true'] {
- border: 1px solid #dcdce4;
- background: #eaeaef;
- }
-
- .c16[aria-disabled='true'] .c20 {
- color: #666687;
- }
-
- .c16[aria-disabled='true'] svg > g,
- .c16[aria-disabled='true'] svg path {
- fill: #666687;
- }
-
- .c16[aria-disabled='true']:active {
- border: 1px solid #dcdce4;
- background: #eaeaef;
- }
-
- .c16[aria-disabled='true']:active .c20 {
- color: #666687;
- }
-
- .c16[aria-disabled='true']:active svg > g,
- .c16[aria-disabled='true']:active svg path {
- fill: #666687;
- }
-
- .c16:hover {
- border: 1px solid #7b79ff;
- background: #7b79ff;
- }
-
- .c16:active {
- border: 1px solid #4945ff;
- background: #4945ff;
- }
-
- .c29 {
- padding-bottom: 24px;
- }
-
- .c30 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-box-pack: justify;
- -webkit-justify-content: space-between;
- -ms-flex-pack: justify;
- justify-content: space-between;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-flex-wrap: wrap;
- -ms-flex-wrap: wrap;
- flex-wrap: wrap;
- }
-
- .c52 {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- width: 100%;
- background: transparent;
- border: none;
- }
-
- .c52:focus {
- outline: none;
- }
-
- .c49 {
- font-weight: 500;
- font-size: 0.75rem;
- line-height: 1.33;
- color: #32324d;
- }
-
- .c56 {
- font-weight: 400;
- font-size: 0.875rem;
- line-height: 1.43;
- color: #666687;
- }
-
- .c60 {
- font-weight: 400;
- font-size: 0.75rem;
- line-height: 1.33;
- color: #666687;
- }
-
- .c55 {
- padding-right: 16px;
- padding-left: 16px;
- }
-
- .c57 {
- padding-left: 12px;
- }
-
- .c50 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- }
-
- .c53 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-box-pack: justify;
- -webkit-justify-content: space-between;
- -ms-flex-pack: justify;
- justify-content: space-between;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- }
-
- .c48 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
- flex-direction: column;
- }
-
- .c48 > * {
- margin-top: 0;
- margin-bottom: 0;
- }
-
- .c48 > * + * {
- margin-top: 4px;
- }
-
- .c51 {
- position: relative;
- border: 1px solid #dcdce4;
- padding-right: 12px;
- border-radius: 4px;
- background: #ffffff;
- overflow: hidden;
- min-height: 2.5rem;
- outline: none;
- box-shadow: 0;
- -webkit-transition-property: border-color,box-shadow,fill;
- transition-property: border-color,box-shadow,fill;
- -webkit-transition-duration: 0.2s;
- transition-duration: 0.2s;
- }
-
- .c51:focus-within {
- border: 1px solid #4945ff;
- box-shadow: #4945ff 0px 0px 0px 2px;
- }
-
- .c58 {
- background: transparent;
- border: none;
- position: relative;
- z-index: 1;
- }
-
- .c58 svg {
- height: 0.6875rem;
- width: 0.6875rem;
- }
-
- .c58 svg path {
- fill: #666687;
- }
-
- .c59 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- background: none;
- border: none;
- }
-
- .c59 svg {
- width: 0.375rem;
- }
-
- .c54 {
- width: 100%;
- }
-
- .c28 {
- font-weight: 500;
- font-size: 1rem;
- line-height: 1.25;
- color: #32324d;
- }
-
- .c35 {
- font-weight: 500;
- font-size: 0.75rem;
- line-height: 1.33;
- color: #32324d;
- }
-
- .c42 {
- font-weight: 500;
- font-size: 0.75rem;
- line-height: 1.33;
- color: #b72b1a;
- }
-
- .c38 {
- background: #ffffff;
- border-radius: 4px;
- }
-
- .c40 {
- background: #fcecea;
- padding-right: 32px;
- padding-left: 32px;
- }
-
- .c43 {
- background: #ffffff;
- padding-right: 32px;
- padding-left: 32px;
- }
-
- .c34 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- }
-
- .c33 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
- flex-direction: column;
- }
-
- .c33 > * {
- margin-top: 0;
- margin-bottom: 0;
- }
-
- .c33 > * + * {
- margin-top: 4px;
- }
-
- .c37 {
- border: 0;
- -webkit-clip: rect(0 0 0 0);
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
- }
-
- .c36 {
- position: relative;
- display: inline-block;
- }
-
- .c39 {
- height: 2.5rem;
- border: 1px solid #dcdce4;
- display: -webkit-inline-box;
- display: -webkit-inline-flex;
- display: -ms-inline-flexbox;
- display: inline-flex;
- overflow: hidden;
- outline: none;
- box-shadow: 0;
- -webkit-transition-property: border-color,box-shadow,fill;
- transition-property: border-color,box-shadow,fill;
- -webkit-transition-duration: 0.2s;
- transition-duration: 0.2s;
- }
-
- .c39:focus-within {
- border: 1px solid #4945ff;
- box-shadow: #4945ff 0px 0px 0px 2px;
- }
-
- .c44 {
- text-transform: uppercase;
- position: relative;
- z-index: 2;
- }
-
- .c41 {
- text-transform: uppercase;
- border-right: 1px solid #dcdce4;
- position: relative;
- z-index: 2;
- }
-
- .c45 {
- position: absolute;
- z-index: 1;
- left: 4px;
- top: 4px;
- }
-
- .c32 {
- width: -webkit-fit-content;
- width: -moz-fit-content;
- width: fit-content;
- }
-
- .c63 {
- background: #eaeaef;
- }
-
- .c64 {
- height: 1px;
- border: none;
- margin: 0;
- }
-
- .c1 {
- padding-bottom: 56px;
- }
-
- .c4 {
- background: #f6f6f9;
- padding-top: 24px;
- padding-right: 56px;
- padding-bottom: 56px;
- padding-left: 56px;
- }
-
- .c5 {
- padding-bottom: 12px;
- }
-
- .c25 {
- padding-right: 56px;
- padding-left: 56px;
- }
-
- .c0 {
- display: grid;
- grid-template-columns: 1fr;
- }
-
- .c2 {
- overflow-x: hidden;
- }
-
- .c12 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-box-pack: justify;
- -webkit-justify-content: space-between;
- -ms-flex-pack: justify;
- justify-content: space-between;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- }
-
- .c13 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- }
-
- .c14 {
- font-weight: 600;
- font-size: 2rem;
- line-height: 1.25;
- color: #32324d;
- }
-
- .c23 {
- font-weight: 400;
- font-size: 0.875rem;
- line-height: 1.43;
- color: #666687;
- }
-
- .c24 {
- font-size: 1rem;
- line-height: 1.5;
- }
-
- .c9 {
- font-weight: 400;
- font-size: 0.875rem;
- line-height: 1.43;
- color: #4945ff;
- }
-
- .c10 {
- font-weight: 600;
- line-height: 1.14;
- }
-
- .c11 {
- font-weight: 600;
- font-size: 0.6875rem;
- line-height: 1.45;
- text-transform: uppercase;
- }
-
- .c7 {
- padding-right: 8px;
- }
-
- .c6 {
- display: -webkit-inline-box;
- display: -webkit-inline-flex;
- display: -ms-inline-flexbox;
- display: inline-flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- text-transform: uppercase;
- -webkit-text-decoration: none;
- text-decoration: none;
- position: relative;
- outline: none;
- }
-
- .c6 svg path {
- fill: #4945ff;
- }
-
- .c6 svg {
- font-size: 0.625rem;
- }
-
- .c6:after {
- -webkit-transition-property: all;
- transition-property: all;
- -webkit-transition-duration: 0.2s;
- transition-duration: 0.2s;
- border-radius: 8px;
- content: '';
- position: absolute;
- top: -4px;
- bottom: -4px;
- left: -4px;
- right: -4px;
- border: 2px solid transparent;
- }
-
- .c6:focus-visible {
- outline: none;
- }
-
- .c6:focus-visible:after {
- border-radius: 8px;
- content: '';
- position: absolute;
- top: -5px;
- bottom: -5px;
- left: -5px;
- right: -5px;
- border: 2px solid #4945ff;
- }
-
- .c8 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- }
-
- .c3 {
- outline: none;
- }
-
- .c46 {
- display: grid;
- grid-template-columns: repeat(12,1fr);
- gap: 16px;
- }
-
- .c47 {
- grid-column: span 6;
- }
-
- .c61 {
- grid-column: span 3;
- }
-
- .c31 {
- gap: 16px;
- }
-
- @media (max-width:68.75rem) {
- .c47 {
- grid-column: span 12;
- }
- }
-
- @media (max-width:34.375rem) {
- .c47 {
- grid-column: span;
- }
- }
-
- @media (max-width:68.75rem) {
- .c61 {
- grid-column: span 12;
- }
- }
-
- @media (max-width:34.375rem) {
- .c61 {
- grid-column: span;
- }
- }
-
-
- `);
+ expect(container.firstChild).toMatchSnapshot();
});
it('should keep plugins query params when arriving on the page and going back', async () => {
@@ -1332,14 +102,48 @@ describe('ADMIN | CM | LV | Configure the view', () => {
);
const { container } = render(makeApp(history));
- await waitFor(() => {
- expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument();
- });
+ await waitFor(() =>
+ expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument()
+ );
expect(history.location.search).toEqual('?plugins[i18n][locale]=fr');
fireEvent.click(container.querySelector('#go-back'));
expect(history.location.search).toEqual(
- '?page=1&sort=undefined:undefined&plugins[i18n][locale]=fr'
+ '?page=1&pageSize=10&sort=id:ASC&plugins[i18n][locale]=fr'
);
});
+
+ it('should add field', async () => {
+ const history = createMemoryHistory();
+
+ const { container } = render(makeApp(history), { container: document.body });
+
+ await waitFor(() =>
+ expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument()
+ );
+
+ fireEvent.mouseDown(screen.getByTestId('add-field'));
+
+ await waitFor(() => expect(screen.getByText('cover')).toBeInTheDocument());
+
+ fireEvent.mouseDown(screen.getByText('cover'));
+ fireEvent.mouseDown(screen.getByTestId('add-field'));
+
+ expect(container).toMatchSnapshot();
+ });
+
+ it('should delete field', async () => {
+ const history = createMemoryHistory();
+
+ const { queryByTestId } = render(makeApp(history));
+ await waitFor(() =>
+ expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument()
+ );
+
+ expect(queryByTestId('delete-id')).toBeInTheDocument();
+
+ fireEvent.click(screen.getByTestId('delete-id'));
+
+ expect(queryByTestId('delete-id')).not.toBeInTheDocument();
+ });
});
diff --git a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/reducer.test.js b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/reducer.test.js
index 90505406e9..bd5c45a5a6 100644
--- a/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/reducer.test.js
+++ b/packages/core/admin/admin/src/content-manager/pages/ListSettingsView/tests/reducer.test.js
@@ -19,21 +19,21 @@ describe('CONTENT MANAGER | CONTAINERS | ListSettingsView | reducer', () => {
expect(reducer(state, {})).toEqual(expected);
});
- // describe('ADD_FIELD', () => {
- // it('should add a field to the layout correctly', () => {
- // const expected = {
- // ...state,
- // modifiedData: {
- // layouts: {
- // list: ['title'],
- // },
- // },
- // };
- // const action = { type: 'ADD_FIELD', item: 'title' };
+ describe('ADD_FIELD', () => {
+ it('should add a field to the layout correctly', () => {
+ const expected = {
+ ...state,
+ modifiedData: {
+ layouts: {
+ list: ['title'],
+ },
+ },
+ };
+ const action = { type: 'ADD_FIELD', item: 'title' };
- // expect(reducer(state, action)).toEqual(expected);
- // });
- // });
+ expect(reducer(state, action)).toEqual(expected);
+ });
+ });
// describe('MOVE_FIELD', () => {
// it('should replace the title by the description and vice-versa', () => {
@@ -103,32 +103,32 @@ describe('CONTENT MANAGER | CONTAINERS | ListSettingsView | reducer', () => {
// });
// });
- // describe('REMOVE_FIELD', () => {
- // it('should remove the field', () => {
- // state.modifiedData = {
- // layouts: {
- // list: ['id', 'description', 'title'],
- // },
- // settings: {
- // defaultSortBy: 'id',
- // },
- // };
- // const expected = {
- // ...state,
- // modifiedData: {
- // layouts: {
- // list: ['id', 'title'],
- // },
- // settings: {
- // defaultSortBy: 'id',
- // },
- // },
- // };
- // const action = { type: 'REMOVE_FIELD', index: 1 };
+ describe('REMOVE_FIELD', () => {
+ it('should remove the field', () => {
+ state.modifiedData = {
+ layouts: {
+ list: ['id', 'description', 'title'],
+ },
+ settings: {
+ defaultSortBy: 'id',
+ },
+ };
+ const expected = {
+ ...state,
+ modifiedData: {
+ layouts: {
+ list: ['id', 'title'],
+ },
+ settings: {
+ defaultSortBy: 'id',
+ },
+ },
+ };
+ const action = { type: 'REMOVE_FIELD', index: 1 };
- // expect(reducer(state, action)).toEqual(expected);
- // });
- // });
+ expect(reducer(state, action)).toEqual(expected);
+ });
+ });
// describe('SET_LABEL_TO_EDIT', () => {
// it('should set the label form data of the field to edit', () => {
@@ -250,45 +250,4 @@ describe('CONTENT MANAGER | CONTAINERS | ListSettingsView | reducer', () => {
// expect(reducer(state, action)).toEqual(expected);
// });
// });
-
- describe('SUBMIT_SUCCEEDED', () => {
- it('should submit the label and the sortable value of the field to edit', () => {
- state.modifiedData = {
- metadatas: {
- cover: {
- list: {
- label: 'Cover',
- sortable: false,
- },
- },
- },
- };
- const expected = {
- ...state,
- initialData: {
- metadatas: {
- cover: {
- list: {
- label: 'Cover',
- sortable: false,
- },
- },
- },
- },
- modifiedData: {
- metadatas: {
- cover: {
- list: {
- label: 'Cover',
- sortable: false,
- },
- },
- },
- },
- };
- const action = { type: 'SUBMIT_SUCCEEDED' };
-
- expect(reducer(state, action)).toEqual(expected);
- });
- });
});
diff --git a/packages/core/admin/admin/src/translations/en.json b/packages/core/admin/admin/src/translations/en.json
index c96653947b..bc4ece2add 100644
--- a/packages/core/admin/admin/src/translations/en.json
+++ b/packages/core/admin/admin/src/translations/en.json
@@ -432,6 +432,9 @@
"content-manager.api.id": "API ID",
"content-manager.components.AddFilterCTA.add": "Filters",
"content-manager.components.AddFilterCTA.hide": "Filters",
+ "content-manager.components.DraggableCard.edit.field": "Edit {item}",
+ "content-manager.components.DraggableCard.delete.field": "Delete {item}",
+ "content-manager.components.DraggableCard.move.field": "Move {item}",
"content-manager.components.DragHandle-label": "Drag",
"content-manager.components.DraggableAttr.edit": "Click to edit",
"content-manager.components.DynamicTable.row-line": "item line {number}",
@@ -445,6 +448,7 @@
"content-manager.components.DynamicZone.required": "Component is required",
"content-manager.components.EmptyAttributesBlock.button": "Go to settings page",
"content-manager.components.EmptyAttributesBlock.description": "You can change your settings",
+ "content-manager.components.FieldSelect.label": "Add a field",
"content-manager.components.FieldItem.linkToComponentLayout": "Set the component's layout",
"content-manager.components.FilterOptions.button.apply": "Apply",
"content-manager.components.FiltersPickWrapper.PluginHeader.actions.apply": "Apply",