Skip to content

Commit

Permalink
TASK: Update readme with information about disabling the old Media mo…
Browse files Browse the repository at this point in the history
…dule

This also fixes some minor language issues.
  • Loading branch information
lorenzulrich authored Oct 12, 2023
1 parent 901bd74 commit 86d37f2
Showing 1 changed file with 45 additions and 27 deletions.
72 changes: 45 additions & 27 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Neos Media Ui
Neos Media UI
-------------

This package contains the new interface to manage media in Neos CMS (5.2+).
This package contains the new interface to manage media in Neos CMS (7.3+).

During the initial development the package will be in the Flowpack namespace and will
later replace `neos/media-browser`. Having two modules allows us currently to install
later replace `neos/media-browser`. Having two modules allows us to currently install
them both and be able to test them without losing features.

If you want to use Neos, please have a look at the [Neos documentation](http://neos.readthedocs.org/en/stable/).
Expand All @@ -19,7 +19,26 @@ Run the following command to install it:

This package will currently add a second media backend module called `Media (new)` and a new
media selection screen for asset and image editors.
The old media module will still be available until this package replaces it completely with Neos 8.0 (planned).
The old media module will still be available until this package replaces it completely with a later, major
release of Neos.

#### Disabling the old Media module

If you don't need the old Media module, you can disable it in `Settings.yaml`:

```yaml
Neos:
Neos:
modules:
management:
submodules:
media:
# Disable the default media module and use the new media ui
enabled: false
mediaui:
# Moves the new module to top
position: start
```
#### Disabling the new media selection
Expand All @@ -40,15 +59,16 @@ Neos:

This package will enable a hierarchical asset collection structure via AOP (until the feature is in the Neos core).
With this feature you can add a collection in another collection or assign existing ones to another and
this way create a structure comparable with folders in your computers filesystem.
this way create a structure comparable with folders in your computer's file system.

It is recommended to enable the feature flag `limitToSingleAssetCollectionPerAsset` (see below) for a better experience.
It is recommended to enable the feature flag `limitToSingleAssetCollectionPerAsset` (see below) for a better experience -
see below.

## Optional features

### Limit assets to be only assigned to one AssetCollection

By limiting assets to only be in one collection you can enforce a more folder like experience:
By limiting assets to only be in one collection you can enforce a more folder-like experience:

```yaml
Neos:
Expand All @@ -62,18 +82,17 @@ Neos:

### Fast asset usage calculation & unused assets view

The default asset usage in Neos is very slow as it is calculated when required. For that it checks
your whole project where an asset might be used. For the new media ui a new method has been implemented via the package
The default asset usage in Neos is very slow as it is calculated when at runtime. For that it checks
your whole project where an asset might be used. For the new Media UI, a new method has been implemented via the package
[Flowpack.Neos.AssetUsage](https://github.com/Flowpack/Flowpack.Neos.AssetUsage).


The package provides a service that stores all asset usage references in a database table (other storages can be implemented).
After you install the package and its peer dependencies you should therefore update the usage reference index:
After installing the package and its peer dependencies, you should therefore update the usage reference index:

./flow assetusage:update

You have to do this only once for each instance of the application, f.e. dev / staging / production.
Afterwards the index will be automatically be kept up-to-date. Make sure you run the command manually again after you run imports or
Afterwards the index will automatically be kept up-to-date. Make sure you run the command manually again after you run imports or
change the content repository in any other unusual way. This will clean up any outdated usage.

You can now enable the feature via the following setting:
Expand All @@ -93,7 +112,7 @@ Selecting it will switch the main view to show all unused assets.
### Customise usage details

The usage calculation mechanism in Neos already supports custom usage providers via the `AssetUsageStrategyInterface`.
When your strategy implements this interface the Media UI will show the usages separately for each strategy.
If your strategy implements this interface, the Media UI will show the usages separately for each strategy.

By also implementing the `UsageDetailsProviderInterface` you can provide a custom label for the strategy
and also custom headers and values for each entry.
Expand All @@ -106,7 +125,6 @@ other assets based on a given asset.

Example for this could be perceptually similar images or assets with similar filenames.


Given that you installed a package with a strategy, enable the feature in the ui with the following setting:

```yaml
Expand All @@ -120,7 +138,7 @@ Neos:

### Disable asset redirect checkbox

If you don't want to or can't use the automatic generation of redirects for assets you can disable it with the following setting:
If you don't want to or can't use the automatic generation of redirects for assets, you can disable it with the following setting:

```yaml
Neos:
Expand Down Expand Up @@ -164,7 +182,7 @@ Some of those variables are then persisted into the localstorage of the browser.

The MediaUI provider currently stores the results in its state and provides them to
all child components via provider values.
This will be probably changed to only set shared states than all components can access.
This will probably be changed to only set shared states that all components can access.

#### Component states

Expand All @@ -180,11 +198,11 @@ the GraphQL queries.

## Fund the development

We need your help to develop this package. You can find supporter badges on the official [Neos funding site](https://neosfunding.sandstorm.de/en).
We need your help to develop this package. You can find supporter badges on the official [Neos funding site](https://shop.neos.io/neosfunding/onetime-badges/).

## Contributing

To start with development make sure you have `nvm` and `yarn` installed and run the following command in the package's folder:
To start with development, make sure you have `nvm` and `yarn` installed and run the following command in the package's folder:

```console
yarn
Expand All @@ -199,7 +217,7 @@ This is also the basis for running most tests and implementing new features.
yarn dev
```

Enter `localhost:8000` in your browser, and you will have a running media ui instance without neos.
Enter `localhost:8000` in your browser, and you will have a running media ui instance without Neos.

### Building the module assets

Expand Down Expand Up @@ -247,39 +265,39 @@ yarn e2e

The test configuration is defined in `.testcaferc.json`.

To use a different browser you can define it when running the tests:
To use a different browser, you can define it when running the tests:

```console
yarn test firefox
```

Checkout the [Testcafe documentation](https://testcafe.io/documentation/402828/guides/intermediate-guides/browsers#browser-support) for more information and supported browsers.
Check out the [Testcafe documentation](https://testcafe.io/documentation/402828/guides/intermediate-guides/browsers#browser-support) for more information and supported browsers.

### Run phpstan for codestyle checks

First make sure you have [phpstan](https://phpstan.org) installed.
First, make sure you have [phpstan](https://phpstan.org) installed.

When the package is installed in a Neos distribution:
If the package is installed in a Neos distribution:

```console
composer run codestyle
```

When the package is standalone
If the package is standalone

```console
composer run codestyle:ci
```

### Run PHPUnit for unit tests

When the package is installed in a Neos distribution:
If the package is installed in a Neos distribution:

```console
composer run test
```

When the package is standalone
If the package is standalone

```console
composer run test:ci
Expand All @@ -293,7 +311,7 @@ Please don't add the compiled frontend assets to your commits/PRs.

We will build the assets when a new release is due.

When you want to build the assets for a release, use the following command to prevent cache issues:
If you want to build the assets for a release, use the following command to prevent cache issues:

```console
yarn build:no-cache
Expand Down

0 comments on commit 86d37f2

Please sign in to comment.