mirror of
https://github.com/strapi/strapi.git
synced 2025-08-15 04:08:04 +00:00
Merge branch 'ctm/repeatable-list-view' of github.com:strapi/strapi into ctm/repeatable-list-view
This commit is contained in:
commit
d0ee52fdcc
@ -43,6 +43,8 @@ module.exports = {
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/fileTransformer.js',
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!(react-dnd|dnd-core|react-dnd-html5-backend)/)'],
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!(react-dnd|dnd-core|react-dnd-html5-backend)/)',
|
||||
],
|
||||
testURL: 'http://localhost:4000/admin',
|
||||
};
|
||||
|
@ -1,6 +1,5 @@
|
||||
import React, { useState, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Field, InfoLabel } from './components';
|
||||
import { DragSource, DropTarget } from 'react-dnd';
|
||||
|
||||
import GrabIcon from '../../assets/images/icon_grab.svg';
|
||||
@ -8,6 +7,7 @@ import GrabIconBlue from '../../assets/images/icon_grab_blue.svg';
|
||||
import ClickOverHint from '../../components/ClickOverHint';
|
||||
import RemoveIcon from '../../components/DraggedRemovedIcon';
|
||||
import EditIcon from '../../components/VariableEditIcon';
|
||||
import { Field, InfoLabel } from './components';
|
||||
|
||||
import ItemTypes from './itemsTypes';
|
||||
|
||||
@ -33,7 +33,6 @@ function ListField({
|
||||
connectDropTarget(ref);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Field
|
||||
onMouseEnter={() => setIsOver(true)}
|
||||
onMouseLeave={() => setIsOver(false)}
|
||||
@ -60,7 +59,6 @@ function ListField({
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ function ListLayout({
|
||||
<div className="col-lg-5 col-md-12" ref={ref}>
|
||||
{displayedData.map((data, index) => (
|
||||
<Fragment key={data}>
|
||||
<Wrapper style={{ display: 'flex' }}>
|
||||
<Wrapper>
|
||||
<div>{index + 1}.</div>
|
||||
<ListField
|
||||
findField={findField}
|
||||
|
@ -52,7 +52,7 @@ const InfoLabel = styled.div`
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 40px;
|
||||
// color: #858b9a;
|
||||
|
||||
font-weight: 400;
|
||||
color: #007eff;
|
||||
`;
|
||||
|
@ -134,7 +134,6 @@ function SettingViewModel({
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<BackHeader onClick={() => goBack()} />
|
||||
<Container className="container-fluid">
|
||||
@ -152,13 +151,11 @@ function SettingViewModel({
|
||||
<HeaderNav
|
||||
links={[
|
||||
{
|
||||
name:
|
||||
'content-manager.containers.SettingPage.listSettings.title',
|
||||
name: 'content-manager.containers.SettingPage.listSettings.title',
|
||||
to: getUrl(name, 'list-settings'),
|
||||
},
|
||||
{
|
||||
name:
|
||||
'content-manager.containers.SettingPage.editSettings.title',
|
||||
name: 'content-manager.containers.SettingPage.editSettings.title',
|
||||
to: getUrl(name, 'edit-settings'),
|
||||
},
|
||||
]}
|
||||
@ -247,11 +244,9 @@ function SettingViewModel({
|
||||
onConfirm={() => onSubmit(name, emitEvent)}
|
||||
/>
|
||||
</DndProvider>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
SettingViewModel.defaultProps = {};
|
||||
SettingViewModel.propTypes = {
|
||||
addFieldToList: PropTypes.func.isRequired,
|
||||
emitEvent: PropTypes.func.isRequired,
|
||||
|
@ -36,10 +36,14 @@ function settingViewModelReducer(state = initialState, action) {
|
||||
.update('isLoading', () => false)
|
||||
.update('modifiedData', () => fromJS(action.layout));
|
||||
case MOVE_FIELD_LIST:
|
||||
return state.updateIn(['modifiedData', 'layouts', 'list'], list => {
|
||||
return state
|
||||
.updateIn(['modifiedData', 'layouts', 'list'], list => {
|
||||
return list
|
||||
.delete(action.dragIndex)
|
||||
.insert(action.overIndex, list.get(action.dragIndex));
|
||||
})
|
||||
.update('listFieldToEditIndex', () => {
|
||||
return action.overIndex;
|
||||
});
|
||||
case ON_CHANGE:
|
||||
return state.updateIn(action.keys, () => action.value);
|
||||
|
@ -126,5 +126,5 @@
|
||||
"popUpWarning.warning.updateAllSettings": "Cela modifiera tous vos précédents paramètres.",
|
||||
"success.record.delete": "Supprimé",
|
||||
"success.record.save": "Sauvegardé",
|
||||
"notification.info.minimumFields": "Vous devez avoir au moins un champs d'affiché"
|
||||
"notification.info.minimumFields": "Vous devez avoir au moins un champ d'affiché"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user