Skip to content

Commit

Permalink
Merge branch '8.3' into bugfix/5085-error-by-delete-assets-still-inuse
Browse files Browse the repository at this point in the history
  • Loading branch information
KommunikativCh authored Jun 21, 2024
2 parents bc3eaf0 + 59d4af2 commit 4f227fd
Show file tree
Hide file tree
Showing 84 changed files with 12,313 additions and 10,923 deletions.
2 changes: 1 addition & 1 deletion Neos.Media.Browser/Resources/Private/Layouts/Default.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
<div class="neos-media-content{f:if(condition: '{tags -> f:count()} > 25', then: ' neos-media-aside-condensed')}">
<div class="neos-media-assets">
<div id="neos-notification-container">
<div id="neos-notification-container" class="neos-notification-container">
<f:render partial="FlashMessages"/>
</div>
<f:render section="Content"/>
Expand Down
755 changes: 455 additions & 300 deletions Neos.Media.Browser/Resources/Private/Translations/de/Main.xlf

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,12 @@
<trans-unit id="createMissingVariants" xml:space="preserve">
<source>Create missing variants</source>
</trans-unit>
<trans-unit id="assetImport.importInfo" xml:space="preserve">
<source>Asset is being imported. Please wait.</source>
</trans-unit>
<trans-unit id="assetImport.importInProcess" xml:space="preserve">
<source>Import still in process. Please wait.</source>
</trans-unit>
</body>
</file>
</xliff>
296 changes: 153 additions & 143 deletions Neos.Media.Browser/Resources/Private/Translations/es/Main.xlf

Large diffs are not rendered by default.

114 changes: 83 additions & 31 deletions Neos.Media.Browser/Resources/Public/JavaScript/select.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,84 @@
window.addEventListener('DOMContentLoaded', (event) => {
$(function() {
if (window.parent !== window && window.parent.NeosMediaBrowserCallbacks) {
// we are inside iframe
$('.asset-list').on('click', '[data-asset-identifier]', function(e) {
if (
$(e.target).closest('a, button').not('[data-asset-identifier]').length === 0 &&
window.parent.NeosMediaBrowserCallbacks &&
typeof window.parent.NeosMediaBrowserCallbacks.assetChosen === 'function'
) {
let localAssetIdentifier = $(this).attr('data-local-asset-identifier');
if (localAssetIdentifier !== '') {
window.parent.NeosMediaBrowserCallbacks.assetChosen(localAssetIdentifier);
} else {
$.post(
$('link[rel="neos-media-browser-service-assetproxies-import"]').attr('href'),
{
assetSourceIdentifier: $(this).attr('data-asset-source-identifier'),
assetIdentifier: $(this).attr('data-asset-identifier'),
__csrfToken: $('body').attr('data-csrf-token')
},
function(data) {
window.parent.NeosMediaBrowserCallbacks.assetChosen(data.localAssetIdentifier);
}
);
}
e.preventDefault();
}
});
}
});
window.addEventListener('DOMContentLoaded', () => {
(function () {
const NeosMediaBrowserCallbacks = window.parent.NeosMediaBrowserCallbacks;
const NeosCMS = window.NeosCMS;

if (window.parent === window || !NeosCMS || !NeosMediaBrowserCallbacks || typeof NeosMediaBrowserCallbacks.assetChosen !== 'function') {
return;
}

function importAsset(asset) {
const params = new URLSearchParams();
params.append('assetSourceIdentifier', asset.dataset.assetSourceIdentifier);
params.append('assetIdentifier', asset.dataset.assetIdentifier);
params.append('__csrfToken', document.querySelector('body').dataset.csrfToken);

fetch(
document
.querySelector('link[rel="neos-media-browser-service-assetproxies-import"]')
.getAttribute('href'),
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
method: 'POST',
credentials: 'include',
body: params.toString(),
}
)
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
})
.then((data) => {
NeosMediaBrowserCallbacks.assetChosen(data.localAssetIdentifier);
asset.removeAttribute('data-import-in-process');
})
.catch((error) => {
NeosCMS.Notification.error(NeosCMS.I18n.translate(
'assetImport.importError',
'Asset could not be imported. Please try again.',
'Neos.Media.Browser'
), error);
console.error('Error:', error);
})
}

const assets = document.querySelectorAll('[data-asset-identifier]');
assets.forEach((asset) => {
asset.addEventListener('click', (e) => {
const assetLink = e.target.closest('a[data-asset-identifier], button[data-asset-identifier]');
if (!assetLink) {
return;
}

const localAssetIdentifier = asset.dataset.localAssetIdentifier;
if (localAssetIdentifier !== '' && !NeosCMS.Helper.isNil(localAssetIdentifier)) {
NeosMediaBrowserCallbacks.assetChosen(localAssetIdentifier);
} else {
if (asset.dataset.importInProcess !== 'true') {
asset.dataset.importInProcess = 'true';
const message = NeosCMS.I18n.translate(
'assetImport.importInfo',
'Asset is being imported. Please wait.',
'Neos.Media.Browser'
);
NeosCMS.Notification.ok(message);

importAsset(asset);
} else {
const message = NeosCMS.I18n.translate(
'assetImport.importInProcess',
'Import still in process. Please wait.',
'Neos.Media.Browser'
);
NeosCMS.Notification.warning(message);
}
}
e.preventDefault();
});
});
})();
});
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected function registerAllTagsToFlushForNodeInWorkspace(NodeInterface $node,
{
// Ensure that we're dealing with the variant of the given node that actually
// lives in the given workspace
if ($node->getWorkspace()->getName() !== $workspace->getName()) {
if ($node->isRemoved() === false && $node->getWorkspace()->getName() !== $workspace->getName()) {
$workspaceContext = $this->contextFactory->create(
array_merge(
$node->getContext()->getProperties(),
Expand Down
65 changes: 65 additions & 0 deletions Neos.Neos/Documentation/Appendixes/ChangeLogs/8314.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
`8.3.14 (2024-06-11) <https://github.com/neos/neos-development-collection/releases/tag/8.3.14>`_
================================================================================================

Overview of merged pull requests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`BUGFIX: Prevent multiple imports of the same remote asset in the frontend <https://github.com/neos/neos-development-collection/pull/5117>`_
--------------------------------------------------------------------------------------------------------------------------------------------

This is a frontend fix for `#5116 <https://github.com/neos/neos-development-collection/issues/5116>`_and prevents users from triggering multiple import processes for the same remote asset. It is not a sufficient fix to only prevent this in the frontend though, since it doesn't catch it, if two or more different users trigger the import for the same asset at the same time.

Changes:
- ``select.js``: add data attribute ``data-import-in-process`` to asset once import process has started and remove it when import is done
- ``select.js``: check for new data attribute and only start import process if attribute does not exist
- ``select.js``: add notification to inform user that asset is being imported
- ``select.js``: add notification as warning for user if import is already in process
- ``Main.xlf``: add new notification messages for english
- ``Default.html``: add id for notification container to be able to send notifications to it via js
- ``Configuration.js``: update ``hasConfiguration`` after configuration object was created, because otherwise it will always be false and the translations don't work

``related:`` https://github.com/neos/neos-development-collection/issues/5116

**Info for testing:**
You need to bundle the Neos.Neos assets to get the text for the notification messages.
- navigate to the Neos.Neos package
- run ``yarn``
- run ``yarn build``

* Packages: ``Media.Browser``

`BUGFIX: Flush cache also for deleted nodes <https://github.com/neos/neos-development-collection/pull/5124>`_
-------------------------------------------------------------------------------------------------------------

Removed nodes can't get found, so they regarding caches don't get flushed.

The bug was introduced with `#4291 <https://github.com/neos/neos-development-collection/issues/4291>`_
* Fixes: `#5105 <https://github.com/neos/neos-development-collection/issues/5105>`_

* Packages: ``Neos``

`BUGFIX: Fix title attribute for impersonate button in user management <https://github.com/neos/neos-development-collection/pull/5121>`_
----------------------------------------------------------------------------------------------------------------------------------------

With this change the localized text is rendered instead of always defaulting to english.

Changes:

- ImpersonateButton.js change postion of const localizedTooltip inside ImpersonateButton function and change isNil(window.Typo3Neos) to isNil(window.NeosCMS)
- RestoreButton.js it was always fallback text used change isNil(window.NeosCMS) to !isNil(window.NeosCMS)

* Fixes: `#4511 <https://github.com/neos/neos-development-collection/issues/4511>`_

Checklist

- [ ] Code follows the PSR-2 coding style
- [ ] Tests have been created, run and adjusted as needed
- [x] The PR is created against the `lowest maintained branch <https://www.neos.io/features/release-roadmap.html>`_
- [x] Reviewer - PR Title is brief but complete and starts with ``FEATURE|TASK|BUGFIX``
- [ ] Reviewer - The first section explains the change briefly for change-logs
- [ ] Reviewer - Breaking Changes are marked with ``!!!`` and have upgrade-instructions

* Packages: ``Neos``

`Detailed log <https://github.com/neos/neos-development-collection/compare/8.3.13...8.3.14>`_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 changes: 38 additions & 0 deletions Neos.Neos/Documentation/Appendixes/ChangeLogs/8315.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
`8.3.15 (2024-06-14) <https://github.com/neos/neos-development-collection/releases/tag/8.3.15>`_
================================================================================================

Overview of merged pull requests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`BUGFIX: Access isNil function from Helper function to apply selected image to property <https://github.com/neos/neos-development-collection/pull/5140>`_
---------------------------------------------------------------------------------------------------------------------------------------------------------

**Upgrade instructions**

_None_

**Review instructions**

Follow-up to: `#5117 <https://github.com/neos/neos-development-collection/issues/5117>`_

With the latest Bugfix release of Neos 8.3.14 currently when selecting an image from the media browser it not will be applyied to the image property as the ``IsNil`` function has to be accessed inside of the ``Helper`` function.

```javascript
NeosCMS.isNil()
```
In this case, leads to an unresolved function or method.

### Before

https://github.com/neos/neos-development-collection/assets/39345336/ed761221-924d-467f-bd9f-6eb6c97dd553

### After

https://github.com/neos/neos-development-collection/assets/39345336/2c78211a-c8a8-4f55-808a-15b495fde586



* Packages: ``Neos`` ``Media.Browser``

`Detailed log <https://github.com/neos/neos-development-collection/compare/8.3.14...8.3.15>`_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/CommandReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ commands that may be available, use::

./flow help

The following reference was automatically generated from code on 2024-05-24
The following reference was automatically generated from code on 2024-06-14


.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/EelHelpersReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Eel Helpers Reference
=====================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Eel Helpers Reference: Api`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FlowQuery Operation Reference
=============================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`FlowQuery Operation Reference: add`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Content Repository Signals Reference
====================================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/Signals/Flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Flow Signals Reference
======================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/Signals/Media.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Media Signals Reference
=======================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/Signals/Neos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Neos Signals Reference
======================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/Validators/Flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Flow Validator Reference
========================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Flow Validator Reference: AggregateBoundaryValidator`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/Validators/Media.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Media Validator Reference
=========================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Media Validator Reference: ImageOrientationValidator`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/Validators/Party.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Party Validator Reference
=========================

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Party Validator Reference: AimAddressValidator`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Content Repository ViewHelper Reference
#######################################

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Content Repository ViewHelper Reference: PaginateViewHelper`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FluidAdaptor ViewHelper Reference
#################################

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`FluidAdaptor ViewHelper Reference: f:debug`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Form ViewHelper Reference
#########################

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Form ViewHelper Reference: neos.form:form`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Fusion ViewHelper Reference
###########################

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Fusion ViewHelper Reference: fusion:render`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Media.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Media ViewHelper Reference
##########################

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Media ViewHelper Reference: neos.media:fileTypeIcon`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Neos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Neos ViewHelper Reference
#########################

This reference was automatically generated from code on 2024-05-24
This reference was automatically generated from code on 2024-06-14


.. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`:
Expand Down
Loading

0 comments on commit 4f227fd

Please sign in to comment.