Easyadminbundle: Body-Classes are different for dev and prod environment

Created on 21 Jan 2020  路  9Comments  路  Source: EasyCorp/EasyAdminBundle

Describe the bug
I've done nothing special for the design of easyAdmin, but in the prod environment the css class easyadmin-content-width-full is missing:

Dev:

<body id="easyadmin-list-Exhibit" class="easyadmin list list-exhibit easyadmin-content-width-full easyadmin-sidebar-width-normal">

Prod:

<body id="easyadmin-list-Exhibit" class="easyadmin list list-exhibit easyadmin-content-width-normal easyadmin-sidebar-width-normal">

I've already checked if there is maybe different versions installed, but the installed packages are all the same as on dev.

To Reproduce
I've running on this versions:

  • Symfony: 4.4.2
  • easyAdmin-Bundle: 2.3.5

This is the first part of my easy_admin.yaml:

easy_admin:
  site_name: foobar

  user:
    display_name: true
    display_avatar: false

  design:
    assets:
      css:
        - /css/admin.css
    form_theme:
      - '@EasyAdmin/form/bootstrap_4.html.twig'
      - '@FOSCKEditor/Form/ckeditor_widget.html.twig'
    menu:...

  entities: ...

In the admin.css I've just styled the pagination a little bit - nothing special.

I've updated the prod installation with this commands:

$ php74 composer install --no-dev --optimize-autoloader
$ php74 bin/console cache:clear --env=prod --no-debug
$ php74 bin/console cache:warmup --env=prod --no-debug

And this is my composer.json:

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.4",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "easycorp/easyadmin-bundle": "^2.3",
        "friendsofsymfony/ckeditor-bundle": "^2.2",
        "sensio/framework-extra-bundle": "^5.1",
        "symfony/apache-pack": "^1.0",
        "symfony/asset": "4.4.*",
        "symfony/console": "4.4.*",
        "symfony/dotenv": "4.4.*",
        "symfony/expression-language": "4.4.*",
        "symfony/flex": "^1.3.1",
        "symfony/form": "4.4.*",
        "symfony/framework-bundle": "4.4.*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/orm-pack": "1.0.*",
        "symfony/process": "4.4.*",
        "symfony/security-bundle": "4.4.*",
        "symfony/serializer-pack": "1.0.*",
        "symfony/swiftmailer-bundle": "^3.1",
        "symfony/translation": "4.4.*",
        "symfony/twig-bundle": "4.4.*",
        "symfony/validator": "4.4.*",
        "symfony/web-link": "4.4.*",
        "symfony/yaml": "4.4.*"
    },
    "require-dev": {
        "pixers/doctrine-profiler-bundle": "^1.0",
        "symfony/debug-pack": "1.0.*",
        "symfony/maker-bundle": "^1.0",
        "symfony/profiler-pack": "1.0.*",
        "symfony/test-pack": "1.0.*",
        "symfony/web-server-bundle": "4.0.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "ckeditor:install --clear=drop": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.4.*"
        }
    }
}

(OPTIONAL) Additional context
Dev:
image

Prod:
image

Most helpful comment

@smartiniRDR @florianrusch we prefer to keep the current behavior and let the end user decide if they want to see the backend full-wide or normal-wide. Even if you have a strong decision about which width to use ... sometimes you may need to change it to better browse the information.

Also, we think this option has a nice and unobtrusive user experience because it's almost invisible (it doesn't bother you much) but it's always there when you need it. Thanks for understanding this decision.

All 9 comments

I guess if you change the view on prod it gets somehow persistet in the session?
So its done manually by you

Oh sh**t... I forgot that there are this resizer things on the left and right 馃檲
With just a click on it, it spread to the full width.

Is there any way, to disable this resizer and use always the full width?

Is there any way, to disable this resizer and use always the full width?

Same question :)

The only possibility seems to be to overwrite this template with a custom one without this script block and this css classes for the body tag easyadmin-content-width-full easyadmin-sidebar-width-normal.

Yes, thank you, I found that too, but I expected better.

@smartiniRDR @florianrusch we prefer to keep the current behavior and let the end user decide if they want to see the backend full-wide or normal-wide. Even if you have a strong decision about which width to use ... sometimes you may need to change it to better browse the information.

Also, we think this option has a nice and unobtrusive user experience because it's almost invisible (it doesn't bother you much) but it's always there when you need it. Thanks for understanding this decision.

But what do if I want to make screen "full" by default, not "normal"? Can't find the clean way to do this. Have any idea?

P.S. I'm using 3.*

There is a pending pull request (#3905) which adds this feature and we might merge it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukasluecke picture lukasluecke  路  3Comments

ziobudda picture ziobudda  路  4Comments

nickicool picture nickicool  路  4Comments

SirMishaa picture SirMishaa  路  3Comments

Ealenn picture Ealenn  路  3Comments