mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Ensure eula field enabled when not using default eula
This commit is contained in:
parent
2e7aa01abe
commit
3fd0853fd0
|
@ -22,7 +22,7 @@ class CategoryEditForm extends Component
|
|||
$this->originalSendCheckInEmailValue = $this->sendCheckInEmail;
|
||||
|
||||
if ($this->eulaText || $this->useDefaultEula) {
|
||||
$this->sendCheckInEmail = true;
|
||||
$this->sendCheckInEmail = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ class CategoryEditForm extends Component
|
|||
return;
|
||||
}
|
||||
|
||||
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? true : $this->originalSendCheckInEmailValue;
|
||||
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? 1 : $this->originalSendCheckInEmailValue;
|
||||
}
|
||||
|
||||
public function getShouldDisplayEmailMessageProperty(): bool
|
||||
|
@ -56,7 +56,7 @@ class CategoryEditForm extends Component
|
|||
|
||||
public function getEulaTextDisabledProperty()
|
||||
{
|
||||
return $this->useDefaultEula;
|
||||
return (bool) $this->useDefaultEula;
|
||||
}
|
||||
|
||||
public function getSendCheckInEmailDisabledProperty()
|
||||
|
|
|
@ -93,4 +93,13 @@ class CategoryEditFormTest extends TestCase
|
|||
->assertSet('sendCheckInEmail', true)
|
||||
->assertSet('sendCheckInEmailDisabled', false);
|
||||
}
|
||||
|
||||
public function testEulaFieldEnabledOnLoadWhenNotUsingDefaultEula()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'sendCheckInEmail' => false,
|
||||
'eulaText' => '',
|
||||
'useDefaultEula' => false,
|
||||
])->assertSet('eulaTextDisabled', false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue