DependsOnNot bug fix with strict check#184
Open
xUJYx wants to merge 8 commits intoepartment:masterfrom
Open
Conversation
…se all form values are always strings (error when checking for integer values)
…properly (was error when picking undefined or null)
Depends on null or zero fix
|
Ran into this issue with the unforked epartment/nova-dependency-container as well, here's a quick repro: <?php
namespace App\Nova\Actions;
use Epartment\NovaDependencyContainer\NovaDependencyContainer;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
class SampleDependsOnNot44 extends Action
{
const SOME_OPTION_A = 1;
const SOME_OPTION_B = 2;
const SOME_OPTION_C = 3;
public function fields()
{
return [
Select::make('Option', 'option')
->options([
self::SOME_OPTION_A => 'A, show dependency field',
self::SOME_OPTION_B => 'B, hide dependency field',
self::SOME_OPTION_C => 'C, show dependency field',
]),
NovaDependencyContainer::make([
Text::make('Hide me for option B'),
])->dependsOnNot('option', self::SOME_OPTION_B),
];
}
}Expected result: |
Author
Sorry, just from epartment/nova-dependency-container. I'll update my above comment |
Author
That functionality wasn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


For 'dependsOnNot' - changed 'strict check' to 'check with coercion' cause all form values are always strings.
Error occurs when checking for integer values and they comparing with string equivalents from html form.