Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.16k stars 894 forks source link

[Bug] Save Buttons without text-white class #5362

Closed mrinaldidfs closed 1 year ago

mrinaldidfs commented 1 year ago

Bug report

What I did

I removed all save actions except one

What I expected to happen

In create and in update operation the save button must has the label colored white and the background colored green

What happened

The save button has the label colored black and the background colored green.

What I've already tried to fix it

Customize the vendor\backpack\crud\src\resources\views\crud\inc\form_save_buttons.blade.php layout modifing this:

@if(empty($saveAction['options']))
            <button type="submit" class="btn btn-success text-white">
                <span class="la la-save" role="presentation" aria-hidden="true"></span> &nbsp;
                <span data-value="{{ $saveAction['active']['value'] }}">{{ $saveAction['active']['label'] }}</span>
            </button>
        @else
            <div class="btn-group" role="group">
                <button type="submit" class="btn btn-success text-white">
                    <span class="la la-save" role="presentation" aria-hidden="true"></span> &nbsp;
                    <span data-value="{{ $saveAction['active']['value'] }}">{{ $saveAction['active']['label'] }}</span>
                </button>
                <button id="bpSaveButtonsGroup" type="button" class="btn btn-success text-white dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" data-bs-toggle="dropdown" aria-expanded="false">
                    <span class="d-none visually-hidden">Toggle Dropdown</span>
                </button>
                <ul class="dropdown-menu" aria-labelledby="bpSaveButtonsGroup">
                    @foreach( $saveAction['options'] as $value => $label)
                        <li><button class="dropdown-item" type="button" data-value="{{ $value }}">{{ $label }}</button></li>
                    @endforeach
                </ul>
            </div>
        @endif

The text-white class present in the first submit button is added from me, because there isn't in the default backpack view.

Is it a bug in the latest version of Backpack?

After I run composer update backpack/crud the bug... is it still there?

yes

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

PHP 8.1.2 (cli) (built: Jan 19 2022 10:13:52) (NTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies

LARAVEL VERSION:

10.29.0.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.2.1 backpack/crud: 6.3.0 backpack/generators: v4.0.2 backpack/pro: 2.0.18

welcome[bot] commented 1 year ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

phpfour commented 1 year ago

Hey @mrinaldidfs,

Thanks for reporting this. After some investigation, I've found that it only impacts the CoreUI v4 theme. Nevertheless, it should be fixed in an upcoming release.

PR: https://github.com/Laravel-Backpack/CRUD/pull/5365

Cheers