Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/7.0' into 7.1
Browse files Browse the repository at this point in the history
# Conflicts:
#	.circleci/config.yml
#	Classes/Fusion/ExceptionHandler/PageExceptionHandler.php
#	lerna.json
#	packages/babel-preset-neos-ui/package.json
#	packages/build-essentials/package.json
#	packages/debug-reason-for-rendering/package.json
#	packages/jest-preset-neos-ui/package.json
#	packages/neos-ts-interfaces/package.json
#	packages/neos-ui-backend-connector/package.json
#	packages/neos-ui-ckeditor-bindings/package.json
#	packages/neos-ui-ckeditor5-bindings/package.json
#	packages/neos-ui-constants/package.json
#	packages/neos-ui-containers/package.json
#	packages/neos-ui-contentrepository/package.json
#	packages/neos-ui-decorators/package.json
#	packages/neos-ui-editors/package.json
#	packages/neos-ui-extensibility/package.json
#	packages/neos-ui-guest-frame/package.json
#	packages/neos-ui-i18n/package.json
#	packages/neos-ui-inspector/package.json
#	packages/neos-ui-redux-store/package.json
#	packages/neos-ui-sagas/package.json
#	packages/neos-ui-validators/package.json
#	packages/neos-ui-views/package.json
#	packages/neos-ui/package.json
#	packages/positional-array-sorter/package.json
#	packages/react-proptypes/package.json
#	packages/react-ui-components/package.json
#	packages/utils-helpers/package.json
#	packages/utils-helpers/src/getVersion.ts
#	packages/utils-logger/package.json
#	packages/utils-redux/package.json
  • Loading branch information
markusguenther committed Oct 20, 2021
2 parents 2f9452f + 42435a3 commit f9f31e5
Show file tree
Hide file tree
Showing 20 changed files with 227 additions and 29 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ aliases:
keys:
- full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}-{{ checksum "Tests/IntegrationTests/TestDistribution/Configuration/Settings.yaml" }}
- full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}-
- full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-

- &save_composer_cache
key: composer-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}
Expand All @@ -30,7 +29,6 @@ aliases:
- &restore_composer_cache
keys:
- composer-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}
- composer-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-

- &attach_workspace
at: *workspace_root
Expand All @@ -54,7 +52,7 @@ jobs:
- run: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
- run: chmod +x ~/.nvm/nvm.sh
- run: ~/.nvm/nvm.sh install && ~/.nvm/nvm.sh use
- run: sudo apt-get update && sudo apt-get install -y rsync
- run: sudo apt-get update --allow-releaseinfo-change && sudo apt-get install -y rsync
- run: make install && make build-production

- save_cache: *store_yarn_package_cache
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ protected function initializeRedirectToAction(): void
*/
public function redirectToAction(NodeInterface $node, string $presetBaseNodeType = null): void
{
$this->response->setComponentParameter(SetHeaderComponent::class, 'Cache-Control', [
$this->response->setHttpHeader('Cache-Control', [
'no-cache',
'no-store'
]);
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Neos:
otherName: '${q(user).property(''name.otherName'')}'
fullName: '${q(user).property(''name.fullName'')}'
preferences:
interfaceLanguage: '${q(user).property(''preferences.interfaceLanguage'')}'
interfaceLanguage: '${q(user).property(''preferences.interfaceLanguage'') || Configuration.setting(''Neos.Neos.userInterface.defaultLanguage'')}'
settings:
isAutoPublishingEnabled: false
targetWorkspace: 'live'
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ test-e2e-saucelabs: ## Executes integration tests on saucelabs.
test-e2e: ## Executes integration tests locally.
bash Tests/IntegrationTests/e2e.sh chrome

test-e2e-docker: ## Executes integration tests locally in a docker-compose setup.
@bash Tests/IntegrationTests/e2e-docker.sh $(or $(browser),chromium)

lint: lint-js lint-editorconfig ## Executes make lint-js and make lint-editorconfig.

lint-js: ## Runs lint test in all subpackages via lerna.
Expand Down
1 change: 0 additions & 1 deletion Tests/IntegrationTests/TestDistribution/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
},
"require-dev": {
"neos/buildessentials": "@dev",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^8.1"
},
"repositories": {
Expand Down
22 changes: 22 additions & 0 deletions Tests/IntegrationTests/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.4"
services:

php:
image: thecodingmachine/php:7.4-v4-cli
command: tail -f /dev/null
ports:
- 8081:8081
volumes:
- composer_cache:/home/circleci/.composer/cache
environment:
# Enable GD
PHP_EXTENSION_GD: 1

db:
image: circleci/mariadb:10.2
environment:
MYSQL_DATABASE: neos
MYSQL_ROOT_PASSWORD: not_a_real_password

volumes:
composer_cache:
91 changes: 91 additions & 0 deletions Tests/IntegrationTests/e2e-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash

set -e

if [ -z "$1" ]
then
echo "No testcafe browser supplied, e.g. 'chrome:headless'"
exit 1
fi

function dc() {
docker-compose -f ./Tests/IntegrationTests/docker-compose.yaml $@
}

echo "#############################################################################"
echo "# Start docker environment... #"
echo "#############################################################################"
dc down
dc up -d
dc exec -T php bash <<-'BASH'
rm -rf /usr/src/app/*
BASH
docker cp $(pwd)/Tests/IntegrationTests/. $(dc ps -q php):/usr/src/app
sleep 2

echo ""
echo "#############################################################################"
echo "# Install dependencies... #"
echo "#############################################################################"
dc exec -T php bash <<-'BASH'
cd TestDistribution
composer install
BASH

echo ""
echo "#############################################################################"
echo "# Initialize Neos... #"
echo "#############################################################################"
docker cp $(pwd)/. $(dc ps -q php):/usr/src/app/TestDistribution/Packages/Application/neos-ui
dc exec -T php bash <<-'BASH'
cd TestDistribution
rm -rf Packages/Application/Neos.Neos.Ui
mv Packages/Application/neos-ui Packages/Application/Neos.Neos.Ui
sed -i 's/host: 127.0.0.1/host: db/g' Configuration/Settings.yaml
./flow flow:cache:flush
./flow flow:cache:warmup
./flow doctrine:migrate
./flow user:create --username=admin --password=password --first-name=John --last-name=Doe --roles=Administrator || true
BASH

echo ""
echo "#############################################################################"
echo "# Start Flow Server... #"
echo "#############################################################################"
dc exec -T php bash <<-'BASH'
cd TestDistribution
./flow server:run --port 8081 --host 0.0.0.0 &
BASH

echo ""
echo "#############################################################################"
echo "# Run E2E tests... #"
echo "#############################################################################"
for fixture in $(pwd)/Tests/IntegrationTests/Fixtures/*/; do
echo ""
echo "########################################"
echo "# Fixture '$(basename $fixture)'"
echo "########################################"
dc exec -T php bash <<-BASH
mkdir -p ./TestDistribution/DistributionPackages
rm -rf ./TestDistribution/DistributionPackages/Neos.TestNodeTypes
ln -s "../../SharedNodeTypesPackage" ./TestDistribution/DistributionPackages/Neos.TestNodeTypes
rm -rf ./TestDistribution/DistributionPackages/Neos.TestSite
ln -s "../../Fixtures/$(basename $fixture)/SitePackage" ./TestDistribution/DistributionPackages/Neos.TestSite
# TODO: optimize this
cd TestDistribution
./flow flow:package:rescan > /dev/null
./flow flow:cache:flush > /dev/null
if ./flow site:list | grep -q 'Node name'; then
./flow site:prune '*' > /dev/null
fi
./flow site:import --package-key=Neos.TestSite
./flow resource:publish > /dev/null
BASH

yarn run testcafe "$1" "${fixture}*.e2e.js" \
--selector-timeout=10000 --assertion-timeout=30000 --debug-on-fail
done
4 changes: 3 additions & 1 deletion packages/neos-ui-editors/src/Editors/CodeMirror/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ export default class CodeMirror extends PureComponent {

handleOpenCodeEditor = () => {
const {secondaryEditorsRegistry} = this.props;
const highlightingModeFromOptions = $get('options.highlightingMode', this.props);
const highlightingMode = highlightingModeFromOptions ? highlightingModeFromOptions : this.props.highlightingMode;
const {component: CodeMirrorWrap} = secondaryEditorsRegistry.get('Neos.Neos/Inspector/Secondary/Editors/CodeMirrorWrap');

this.props.renderSecondaryInspector('CODEMIRROR_EDIT', () =>
<CodeMirrorWrap onChange={this.handleChange} value={this.props.value} highlightingMode={this.props.highlightingMode}/>
<CodeMirrorWrap onChange={this.handleChange} value={this.props.value} highlightingMode={highlightingMode}/>
);
}
}
14 changes: 10 additions & 4 deletions packages/neos-ui-guest-frame/src/InlineUI/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ export default class InlineUI extends PureComponent {
render() {
const {focused} = this.props;
const {nodeTypesRegistry, focusedNode, focusedNodesContextPaths, clipboardNodesContextPaths, shouldScrollIntoView, requestScrollIntoView, destructiveOperationsAreDisabled, clipboardMode} = this.props;
const focusedNodeContextPath = focusedNode.contextPath;

// If there's no focused node, we won't render the Inline UI
if (!focusedNode) {
return null;
}

const focusedNodeContextPath = focusedNode ? focusedNode.contextPath : null;
const isDocument = nodeTypesRegistry.hasRole($get('nodeType', focusedNode), 'document');
const allFocusedNodesAreInClipboard = isEqualSet(focusedNodesContextPaths, clipboardNodesContextPaths);
const isCut = allFocusedNodesAreInClipboard && clipboardMode === 'Move';
const isCopied = allFocusedNodesAreInClipboard && clipboardMode === 'Copy';
const canBeDeleted = $get('policy.canRemove', this.props.focusedNode) || false;
const canBeEdited = $get('policy.canEdit', this.props.focusedNode) || false;
const visibilityCanBeToggled = !$contains('_hidden', 'policy.disallowedProperties', this.props.focusedNode);
const canBeDeleted = $get('policy.canRemove', focusedNode) || false;
const canBeEdited = $get('policy.canEdit', focusedNode) || false;
const visibilityCanBeToggled = !$contains('_hidden', 'policy.disallowedProperties', focusedNode);

return (
<div className={style.inlineUi} data-__neos__inline-ui="TRUE">
Expand Down
6 changes: 6 additions & 0 deletions packages/neos-ui-guest-frame/src/initializeGuestFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export default ({globalRegistry, store}) => function * initializeGuestFrame() {
return;
}

// If we don't have access to the document due to a NodeTreePrivilege, the serialized document
// information is going to be null. In that case, we stop initializing the guest frame.
if (documentInformation.metaData.documentNodeSerialization === null) {
return;
}

const nodes = Object.assign({}, guestFrameWindow['@Neos.Neos.Ui:Nodes'], {
[documentInformation.metaData.documentNode]: documentInformation.metaData.documentNodeSerialization
});
Expand Down
5 changes: 5 additions & 0 deletions packages/neos-ui-sagas/src/UI/PageTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ export function * watchCurrentDocument({configuration}) {
const getParentNodeByContextPathSelector = selectors.CR.Nodes.makeGetNodeByContextPathSelector(parentContextPath);
const parentNode = yield select(getParentNodeByContextPathSelector);

// It's possible we're not allowed to access the parent node due to a NodeTreePrivilege
if (!parentNode) {
return;
}

parentContextPath = parentNode.parent;
const getNodeByContextPathSelector = selectors.CR.Nodes.makeGetNodeByContextPathSelector(parentContextPath);
let node = yield select(getNodeByContextPathSelector);
Expand Down
20 changes: 19 additions & 1 deletion packages/neos-ui/src/Containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,25 @@ const App = ({globalRegistry, menu}) => {
};
App.propTypes = {
globalRegistry: PropTypes.object.isRequired,
menu: PropTypes.object.isRequired
menu: PropTypes.arrayOf(
PropTypes.shape({
icon: PropTypes.string,
label: PropTypes.string.isRequired,
uri: PropTypes.string.isRequired,
target: PropTypes.string,

children: PropTypes.arrayOf(
PropTypes.shape({
icon: PropTypes.string,
label: PropTypes.string.isRequired,
uri: PropTypes.string,
target: PropTypes.string,
isActive: PropTypes.bool.isReqired,
skipI18n: PropTypes.bool.isReqired
})
)
})
).isRequired
};

export default App;
7 changes: 6 additions & 1 deletion packages/neos-ui/src/Containers/ContentCanvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import style from './style.css';
backgroundColor: $get('ui.contentCanvas.backgroundColor'),
src: $get('ui.contentCanvas.src'),
baseNodeType: $get('ui.pageTree.filterNodeType'),
currentEditPreviewMode: selectors.UI.EditPreviewMode.currentEditPreviewMode
currentEditPreviewMode: selectors.UI.EditPreviewMode.currentEditPreviewMode,
isDiscarding: $get('ui.remote.isDiscarding'),
isLoading: $get('ui.contentCanvas.isLoading')
}), {
startLoading: actions.UI.ContentCanvas.startLoading,
stopLoading: actions.UI.ContentCanvas.stopLoading,
Expand Down Expand Up @@ -71,6 +73,8 @@ export default class ContentCanvas extends PureComponent {
isFringeLeft,
isFringeRight,
isFullScreen,
isDiscarding,
isLoading,
src,
currentEditPreviewMode,
editPreviewModes,
Expand All @@ -83,6 +87,7 @@ export default class ContentCanvas extends PureComponent {
[style['contentCanvas--isFringeLeft']]: isFringeLeft,
[style['contentCanvas--isFringeRight']]: isFringeRight,
[style['contentCanvas--isFullScreen']]: isFullScreen,
[style['contentCanvas--isTemporaryDisabled']]: isDiscarding || isLoading,
[style['contentCanvas--isHidden']]: !isVisible
});
const InlineUI = guestFrameRegistry.get('InlineUIComponent');
Expand Down
15 changes: 15 additions & 0 deletions packages/neos-ui/src/Containers/ContentCanvas/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@
background-color: white;
}
}

.contentCanvas--isTemporaryDisabled {
&::before {
position: absolute;
display: flex;
content: ' ';
width: inherit;
height: inherit;
background: var(--colors-ContrastDarkest);
z-index: var(--zIndex-Dialog-Context);
opacity: .1;
transition: var(--transition-Fast) ease opacity;
cursor: wait;
}
}
.contentCanvas__itemWrapper {
width: 100%;
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion packages/neos-ui/src/Containers/Drawer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class Drawer extends PureComponent {

containerRegistry: PropTypes.object.isRequired,

menuData: PropTypes.objectOf(
menuData: PropTypes.arrayOf(
PropTypes.shape({
icon: PropTypes.string,
label: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {neos} from '@neos-project/neos-ui-decorators';

import {hasNestedNodes} from '@neos-project/neos-ui/src/Containers/LeftSideBar/NodeTree/helpers';

import animate from 'amator';
import hashSum from 'hash-sum';
import moment from 'moment';
import {urlWithParams} from '@neos-project/utils-helpers/src/urlWithParams';
Expand Down Expand Up @@ -118,12 +117,7 @@ export default class Node extends PureComponent {
const scrollingElementPosition = scrollingElement.getBoundingClientRect();
const nodeIsNotInView = nodeTopPosition < scrollingElementPosition.top + offset || nodeTopPosition > scrollingElementPosition.bottom - offset;
if (nodeIsNotInView) {
const scrollTop = nodeTopPosition - scrollingElement.firstElementChild.getBoundingClientRect().top - offset;
animate({scrollTop: scrollingElement.scrollTop}, {scrollTop}, {
step: ({scrollTop}) => {
scrollingElement.scrollTop = scrollTop;
}
});
scrollingElement.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'nearest'});
}
this.setState({
shouldScrollIntoView: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,15 @@ const makeMapStateToProps = isDocument => (state, {nodeTypesRegistry}) => {
const getNodeByContextPathSelector = selectors.CR.Nodes.makeGetNodeByContextPathSelector(focusedNodeContextPath);
const focusedNode = getNodeByContextPathSelector(state);
const clipboardNodesContextPaths = selectors.CR.Nodes.clipboardNodesContextPathsSelector(state);
const canBePasted = clipboardNodesContextPaths.every(clipboardNodeContextPath => {
return canBePastedSelector(state, {
subject: clipboardNodeContextPath,
reference: focusedNodeContextPath
let canBePasted = false;
if (clipboardNodesContextPaths && clipboardNodesContextPaths.length) {
canBePasted = clipboardNodesContextPaths.every(clipboardNodeContextPath => {
return canBePastedSelector(state, {
subject: clipboardNodeContextPath,
reference: focusedNodeContextPath
});
});
});
}

const selectionHasNestedNodes = hasNestedNodes(focusedNodesContextPaths);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default class SelectNodeType extends PureComponent {
this.setState({
filterSearchTerm: ''
});
this.handleCloseHelpMessage();
cancel();
}

Expand Down
Loading

0 comments on commit f9f31e5

Please sign in to comment.