Skip to content

Commit

Permalink
Merge pull request #3 from samuelhauser/feature/upgrade
Browse files Browse the repository at this point in the history
TASK: Upgrade to newest neos-ui
  • Loading branch information
dimaip authored Aug 27, 2019
2 parents 81d7a68 + e7cbc85 commit e542f7b
Show file tree
Hide file tree
Showing 7 changed files with 2,526 additions and 69 deletions.
3 changes: 3 additions & 0 deletions Resources/Private/RestrictCreation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
},
"neos": {
"buildTargetDirectory": "../../Public/JavaScript/RestrictCreation"
},
"dependencies": {
"lodash.reduce": "^4.6.0"
}
}
2 changes: 1 addition & 1 deletion Resources/Private/RestrictCreation/src/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ manifest('Flowpack.RestrictCreation:RestrictCreation', {}, globalRegistry => {

const originalAddNodeSaga = sagasRegistry.get('neos-ui/CR/NodeOperations/addNode');
sagasRegistry.set('neos-ui/CR/NodeOperations/addNode', {
saga: makeAddNode(originalAddNodeSaga.nodeCreationWorkflow)
saga: makeAddNode(originalAddNodeSaga.saga.nodeCreationWorkflow)
});

const reducersRegistry = globalRegistry.get('reducers');
Expand Down
34 changes: 16 additions & 18 deletions Resources/Private/RestrictCreation/src/redux.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createAction} from 'redux-actions';
import {handleActions} from '@neos-project/utils-redux';
import reduce from 'lodash.reduce';
import {$get, $set} from 'plow-js';
import {createSelector} from 'reselect';
import {selectors as foreignSelectors, actionTypes as foreignActionTypes} from '@neos-project/neos-ui-redux-store';
Expand All @@ -11,24 +12,21 @@ const restrictCreationSelector = createSelector(
foreignSelectors.CR.ContentDimensions.activePresets
],
activePresets => {
return activePresets.reduce(
(reduction, dimensionConfig, dimensionName) => {
const restrictCreationConfig = $set(
'dimensionName',
dimensionName,
dimensionConfig
);
const restrictCreationMode = $get('restrictCreation.mode', dimensionConfig);
if ($get('restrictCreation.mode', reduction) === 'disallow') {
return reduction;
}
if (restrictCreationMode === 'disallow' || restrictCreationMode === 'warn') {
return restrictCreationConfig;
}
return reduction;
},
null
);
return reduce(activePresets, (reduction, dimensionConfig, dimensionName) => {
const restrictCreationConfig = $set(
'dimensionName',
dimensionName,
dimensionConfig
);
const restrictCreationMode = $get('restrictCreation.mode', dimensionConfig);
if ($get('restrictCreation.mode', reduction) === 'disallow') {
return reduction;
}
if (restrictCreationMode === 'disallow' || restrictCreationMode === 'warn') {
return restrictCreationConfig;
}
return reduction;
}, null);
}
);

Expand Down
12 changes: 7 additions & 5 deletions Resources/Private/RestrictCreation/src/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function makeAddNode(nodeCreationWorkflow) {
const nodeTypesRegistry = globalRegistry.get('@neos-project/neos-ui-contentrepository');

yield takeLatest(actionTypes.CR.Nodes.COMMENCE_CREATION, function* (action) {
const {referenceNodeContextPath, referenceNodeFusionPath} = action.payload;
const {referenceNodeContextPath, referenceNodeFusionPath, preferredMode, nodeType} = action.payload;

const state = yield select();
const restrictCreationPreset = localSelectors.restrictCreationSelector(state);
Expand All @@ -26,10 +26,12 @@ export function makeAddNode(nodeCreationWorkflow) {
}

const context = {
nodeTypesRegistry,
referenceNodeContextPath,
referenceNodeFusionPath
};
nodeTypesRegistry,
referenceNodeContextPath,
referenceNodeFusionPath,
preferredMode,
nodeType
};
if (showRestrictCreationDialog) {
yield put(localActions.openDialog());
const waitForNextAction = yield race([
Expand Down
36 changes: 25 additions & 11 deletions Resources/Private/RestrictCreation/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"

"@neos-project/build-essentials@1.3.4":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@neos-project/build-essentials/-/build-essentials-1.3.4.tgz#eb1b7780a419cbaaa97cb34273f63c17db7840a6"
"@neos-project/build-essentials@1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@neos-project/build-essentials/-/build-essentials-1.4.1.tgz#3152cf5f0ea0507133a0d6d939ecd07bc7a75a2d"
integrity sha512-HqTSwon6trWuzBOEpwJlalXSdL69ubBR00nLJbpj0RGF0AVkT1aJ2bhG7YGWQMCw1CL1vOhzUKQHPQHCdTvbKQ==
dependencies:
"@ckeditor/ckeditor5-dev-utils" "^9.0"
babel-core "^6.13.2"
Expand All @@ -144,6 +145,7 @@
cross-env "^5.1.3"
eslint "^5.3.0"
extract-text-webpack-plugin "^3.0.2"
lodash.upperfirst "^4.3.0"
postcss-css-variables "^0.9.0"
postcss-hexrgba "^1.0.0"
postcss-import "^11.0.0"
Expand All @@ -156,12 +158,13 @@
webpack "^3.8.1"
webpack-livereload-plugin "^1.0.0"

"@neos-project/neos-ui-extensibility@*":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@neos-project/neos-ui-extensibility/-/neos-ui-extensibility-1.3.4.tgz#b27325592fa7668f3cb1bc1095c010ff5a4e90bd"
"@neos-project/neos-ui-extensibility@^1.4.0":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@neos-project/neos-ui-extensibility/-/neos-ui-extensibility-1.4.1.tgz#1a4548e54ccb402ff88fef312d65a01839eab8da"
integrity sha512-qFsQDMpZd8Ruf7XUq9QkfGBKzYejPVpUhJ1IlXMTwxP3B6ODieOm2bblbSes2F5qiKk+5O27p/s6ChTCDMX4sw==
dependencies:
"@neos-project/build-essentials" "1.3.4"
"@neos-project/positional-array-sorter" "1.3.4"
"@neos-project/build-essentials" "1.4.1"
"@neos-project/positional-array-sorter" "1.4.1"
babel-core "^6.13.2"
babel-eslint "^7.1.1"
babel-loader "^7.1.2"
Expand All @@ -179,9 +182,10 @@
react-dev-utils "^0.5.0"
style-loader "^0.21.0"

"@neos-project/positional-array-sorter@1.3.4":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@neos-project/positional-array-sorter/-/positional-array-sorter-1.3.4.tgz#38c58db6ab98b844a0664f2601655cb7f00ae118"
"@neos-project/positional-array-sorter@1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@neos-project/positional-array-sorter/-/positional-array-sorter-1.4.1.tgz#8352ed0e6b9b8a7d76ef8a662af388866f1dccb2"
integrity sha512-lx8I1QW5vC4NGc4dx0BLvaMm50fto4vcfScubtAFNRUM1MfXzMulDUYxFDEdea/rkAj3iouNUlwQild+4THHfg==

"@nodelib/fs.stat@^1.0.1":
version "1.1.2"
Expand Down Expand Up @@ -3389,6 +3393,11 @@ lodash.memoize@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"

lodash.reduce@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b"
integrity sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=

lodash.some@^4.5.1:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d"
Expand All @@ -3410,6 +3419,11 @@ lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"

lodash.upperfirst@^4.3.0:
version "4.3.1"
resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce"
integrity sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=

lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
Expand Down
Loading

0 comments on commit e542f7b

Please sign in to comment.