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)$':
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||||
'<rootDir>/fileTransformer.js',
|
'<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',
|
testURL: 'http://localhost:4000/admin',
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React, { useState, useRef } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Field, InfoLabel } from './components';
|
|
||||||
import { DragSource, DropTarget } from 'react-dnd';
|
import { DragSource, DropTarget } from 'react-dnd';
|
||||||
|
|
||||||
import GrabIcon from '../../assets/images/icon_grab.svg';
|
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 ClickOverHint from '../../components/ClickOverHint';
|
||||||
import RemoveIcon from '../../components/DraggedRemovedIcon';
|
import RemoveIcon from '../../components/DraggedRemovedIcon';
|
||||||
import EditIcon from '../../components/VariableEditIcon';
|
import EditIcon from '../../components/VariableEditIcon';
|
||||||
|
import { Field, InfoLabel } from './components';
|
||||||
|
|
||||||
import ItemTypes from './itemsTypes';
|
import ItemTypes from './itemsTypes';
|
||||||
|
|
||||||
@ -33,7 +33,6 @@ function ListField({
|
|||||||
connectDropTarget(ref);
|
connectDropTarget(ref);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Field
|
<Field
|
||||||
onMouseEnter={() => setIsOver(true)}
|
onMouseEnter={() => setIsOver(true)}
|
||||||
onMouseLeave={() => setIsOver(false)}
|
onMouseLeave={() => setIsOver(false)}
|
||||||
@ -60,7 +59,6 @@ function ListField({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ function ListLayout({
|
|||||||
<div className="col-lg-5 col-md-12" ref={ref}>
|
<div className="col-lg-5 col-md-12" ref={ref}>
|
||||||
{displayedData.map((data, index) => (
|
{displayedData.map((data, index) => (
|
||||||
<Fragment key={data}>
|
<Fragment key={data}>
|
||||||
<Wrapper style={{ display: 'flex' }}>
|
<Wrapper>
|
||||||
<div>{index + 1}.</div>
|
<div>{index + 1}.</div>
|
||||||
<ListField
|
<ListField
|
||||||
findField={findField}
|
findField={findField}
|
||||||
|
@ -52,7 +52,7 @@ const InfoLabel = styled.div`
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 40px;
|
right: 40px;
|
||||||
// color: #858b9a;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #007eff;
|
color: #007eff;
|
||||||
`;
|
`;
|
||||||
|
@ -134,7 +134,6 @@ function SettingViewModel({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<DndProvider backend={HTML5Backend}>
|
<DndProvider backend={HTML5Backend}>
|
||||||
<BackHeader onClick={() => goBack()} />
|
<BackHeader onClick={() => goBack()} />
|
||||||
<Container className="container-fluid">
|
<Container className="container-fluid">
|
||||||
@ -152,13 +151,11 @@ function SettingViewModel({
|
|||||||
<HeaderNav
|
<HeaderNav
|
||||||
links={[
|
links={[
|
||||||
{
|
{
|
||||||
name:
|
name: 'content-manager.containers.SettingPage.listSettings.title',
|
||||||
'content-manager.containers.SettingPage.listSettings.title',
|
|
||||||
to: getUrl(name, 'list-settings'),
|
to: getUrl(name, 'list-settings'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:
|
name: 'content-manager.containers.SettingPage.editSettings.title',
|
||||||
'content-manager.containers.SettingPage.editSettings.title',
|
|
||||||
to: getUrl(name, 'edit-settings'),
|
to: getUrl(name, 'edit-settings'),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@ -247,11 +244,9 @@ function SettingViewModel({
|
|||||||
onConfirm={() => onSubmit(name, emitEvent)}
|
onConfirm={() => onSubmit(name, emitEvent)}
|
||||||
/>
|
/>
|
||||||
</DndProvider>
|
</DndProvider>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingViewModel.defaultProps = {};
|
|
||||||
SettingViewModel.propTypes = {
|
SettingViewModel.propTypes = {
|
||||||
addFieldToList: PropTypes.func.isRequired,
|
addFieldToList: PropTypes.func.isRequired,
|
||||||
emitEvent: PropTypes.func.isRequired,
|
emitEvent: PropTypes.func.isRequired,
|
||||||
|
@ -36,10 +36,14 @@ function settingViewModelReducer(state = initialState, action) {
|
|||||||
.update('isLoading', () => false)
|
.update('isLoading', () => false)
|
||||||
.update('modifiedData', () => fromJS(action.layout));
|
.update('modifiedData', () => fromJS(action.layout));
|
||||||
case MOVE_FIELD_LIST:
|
case MOVE_FIELD_LIST:
|
||||||
return state.updateIn(['modifiedData', 'layouts', 'list'], list => {
|
return state
|
||||||
|
.updateIn(['modifiedData', 'layouts', 'list'], list => {
|
||||||
return list
|
return list
|
||||||
.delete(action.dragIndex)
|
.delete(action.dragIndex)
|
||||||
.insert(action.overIndex, list.get(action.dragIndex));
|
.insert(action.overIndex, list.get(action.dragIndex));
|
||||||
|
})
|
||||||
|
.update('listFieldToEditIndex', () => {
|
||||||
|
return action.overIndex;
|
||||||
});
|
});
|
||||||
case ON_CHANGE:
|
case ON_CHANGE:
|
||||||
return state.updateIn(action.keys, () => action.value);
|
return state.updateIn(action.keys, () => action.value);
|
||||||
|
@ -126,5 +126,5 @@
|
|||||||
"popUpWarning.warning.updateAllSettings": "Cela modifiera tous vos précédents paramètres.",
|
"popUpWarning.warning.updateAllSettings": "Cela modifiera tous vos précédents paramètres.",
|
||||||
"success.record.delete": "Supprimé",
|
"success.record.delete": "Supprimé",
|
||||||
"success.record.save": "Sauvegardé",
|
"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