mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -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;
|
$this->originalSendCheckInEmailValue = $this->sendCheckInEmail;
|
||||||
|
|
||||||
if ($this->eulaText || $this->useDefaultEula) {
|
if ($this->eulaText || $this->useDefaultEula) {
|
||||||
$this->sendCheckInEmail = true;
|
$this->sendCheckInEmail = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class CategoryEditForm extends Component
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? true : $this->originalSendCheckInEmailValue;
|
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? 1 : $this->originalSendCheckInEmailValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShouldDisplayEmailMessageProperty(): bool
|
public function getShouldDisplayEmailMessageProperty(): bool
|
||||||
|
@ -56,7 +56,7 @@ class CategoryEditForm extends Component
|
||||||
|
|
||||||
public function getEulaTextDisabledProperty()
|
public function getEulaTextDisabledProperty()
|
||||||
{
|
{
|
||||||
return $this->useDefaultEula;
|
return (bool) $this->useDefaultEula;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSendCheckInEmailDisabledProperty()
|
public function getSendCheckInEmailDisabledProperty()
|
||||||
|
|
|
@ -93,4 +93,13 @@ class CategoryEditFormTest extends TestCase
|
||||||
->assertSet('sendCheckInEmail', true)
|
->assertSet('sendCheckInEmail', true)
|
||||||
->assertSet('sendCheckInEmailDisabled', false);
|
->assertSet('sendCheckInEmailDisabled', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testEulaFieldEnabledOnLoadWhenNotUsingDefaultEula()
|
||||||
|
{
|
||||||
|
Livewire::test(CategoryEditForm::class, [
|
||||||
|
'sendCheckInEmail' => false,
|
||||||
|
'eulaText' => '',
|
||||||
|
'useDefaultEula' => false,
|
||||||
|
])->assertSet('eulaTextDisabled', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue