EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
4.08k stars 1.02k forks source link

Body-Classes are different for dev and prod environment #3051

Closed florianrusch closed 4 years ago

florianrusch commented 4 years ago

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:

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

OskarStark commented 4 years ago

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

florianrusch commented 4 years ago

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?

smartiniRDR commented 4 years ago

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

Same question :)

florianrusch commented 4 years ago

It doesn't look so :-/ https://github.com/EasyCorp/EasyAdminBundle/blob/0ba0aa9f757f6e804cd5044ac0d7970da400624f/src/Resources/views/default/layout.html.twig#L43-L50

florianrusch commented 4 years ago

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.

smartiniRDR commented 4 years ago

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

javiereguiluz commented 4 years ago

@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.

daffoxdev commented 3 years ago

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.*

javiereguiluz commented 3 years ago

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