mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Improve variable name
This commit is contained in:
parent
269414e4f2
commit
6400034435
|
@ -6,20 +6,20 @@ use Livewire\Component;
|
||||||
|
|
||||||
class CategoryEditForm extends Component
|
class CategoryEditForm extends Component
|
||||||
{
|
{
|
||||||
public $checkinEmail;
|
|
||||||
|
|
||||||
public $defaultEulaText;
|
public $defaultEulaText;
|
||||||
|
|
||||||
public $eulaText;
|
public $eulaText;
|
||||||
|
|
||||||
public $requireAcceptance;
|
public $requireAcceptance;
|
||||||
|
|
||||||
|
public $sendCheckInEmail;
|
||||||
|
|
||||||
public $useDefaultEula;
|
public $useDefaultEula;
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
if ($this->eulaText || $this->useDefaultEula) {
|
if ($this->eulaText || $this->useDefaultEula) {
|
||||||
$this->checkinEmail = true;
|
$this->sendCheckInEmail = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class CategoryEditForm extends Component
|
||||||
public function updated($property, $value)
|
public function updated($property, $value)
|
||||||
{
|
{
|
||||||
if (in_array($property, ['eulaText', 'useDefaultEula']) && ($this->eulaText || $this->useDefaultEula)) {
|
if (in_array($property, ['eulaText', 'useDefaultEula']) && ($this->eulaText || $this->useDefaultEula)) {
|
||||||
$this->checkinEmail = (bool)$value;
|
$this->sendCheckInEmail = (bool)$value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
<label class="form-control">
|
<label class="form-control">
|
||||||
{{ Form::checkbox('checkin_email', '1', null, ['wire:model' => 'checkinEmail', 'aria-label'=>'checkin_email']) }}
|
{{ Form::checkbox('checkin_email', '1', null, ['wire:model' => 'sendCheckInEmail', 'aria-label'=>'checkin_email']) }}
|
||||||
{{ trans('admin/categories/general.checkin_email') }}
|
{{ trans('admin/categories/general.checkin_email') }}
|
||||||
</label>
|
</label>
|
||||||
@if ($this->shouldDisplayEmailMessage)
|
@if ($this->shouldDisplayEmailMessage)
|
||||||
|
|
|
@ -16,56 +16,56 @@ class CategoryEditFormTest extends TestCase
|
||||||
public function testSendEmailCheckboxIsCheckedOnLoadWhenSendEmailIsExistingSetting()
|
public function testSendEmailCheckboxIsCheckedOnLoadWhenSendEmailIsExistingSetting()
|
||||||
{
|
{
|
||||||
Livewire::test(CategoryEditForm::class, [
|
Livewire::test(CategoryEditForm::class, [
|
||||||
'checkinEmail' => true,
|
'sendCheckInEmail' => true,
|
||||||
'eulaText' => '',
|
'eulaText' => '',
|
||||||
'useDefaultEula' => false,
|
'useDefaultEula' => false,
|
||||||
])->assertSet('checkinEmail', true);
|
])->assertSet('sendCheckInEmail', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSendEmailCheckboxIsCheckedOnLoadWhenCategoryEulaSet()
|
public function testSendEmailCheckboxIsCheckedOnLoadWhenCategoryEulaSet()
|
||||||
{
|
{
|
||||||
Livewire::test(CategoryEditForm::class, [
|
Livewire::test(CategoryEditForm::class, [
|
||||||
'checkinEmail' => false,
|
'sendCheckInEmail' => false,
|
||||||
'eulaText' => 'Some Content',
|
'eulaText' => 'Some Content',
|
||||||
'useDefaultEula' => false,
|
'useDefaultEula' => false,
|
||||||
])->assertSet('checkinEmail', true);
|
])->assertSet('sendCheckInEmail', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSendEmailCheckboxIsCheckedOnLoadWhenUsingDefaultEula()
|
public function testSendEmailCheckboxIsCheckedOnLoadWhenUsingDefaultEula()
|
||||||
{
|
{
|
||||||
Livewire::test(CategoryEditForm::class, [
|
Livewire::test(CategoryEditForm::class, [
|
||||||
'checkinEmail' => false,
|
'sendCheckInEmail' => false,
|
||||||
'eulaText' => '',
|
'eulaText' => '',
|
||||||
'useDefaultEula' => true,
|
'useDefaultEula' => true,
|
||||||
])->assertSet('checkinEmail', true);
|
])->assertSet('sendCheckInEmail', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSendEmailCheckBoxIsUncheckedOnLoadWhenSendEmailIsFalseNoCategoryEulaSetAndNotUsingDefaultEula()
|
public function testSendEmailCheckBoxIsUncheckedOnLoadWhenSendEmailIsFalseNoCategoryEulaSetAndNotUsingDefaultEula()
|
||||||
{
|
{
|
||||||
Livewire::test(CategoryEditForm::class, [
|
Livewire::test(CategoryEditForm::class, [
|
||||||
'checkinEmail' => false,
|
'sendCheckInEmail' => false,
|
||||||
'eulaText' => '',
|
'eulaText' => '',
|
||||||
'useDefaultEula' => false,
|
'useDefaultEula' => false,
|
||||||
])->assertSet('checkinEmail', false);
|
])->assertSet('sendCheckInEmail', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSendEmailCheckboxIsCheckedWhenCategoryEulaEntered()
|
public function testSendEmailCheckboxIsCheckedWhenCategoryEulaEntered()
|
||||||
{
|
{
|
||||||
Livewire::test(CategoryEditForm::class, [
|
Livewire::test(CategoryEditForm::class, [
|
||||||
'checkinEmail' => false,
|
'sendCheckInEmail' => false,
|
||||||
'useDefaultEula' => false,
|
'useDefaultEula' => false,
|
||||||
])->assertSet('checkinEmail', false)
|
])->assertSet('sendCheckInEmail', false)
|
||||||
->set('eulaText', 'Some Content')
|
->set('eulaText', 'Some Content')
|
||||||
->assertSet('checkinEmail', true);
|
->assertSet('sendCheckInEmail', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSendEmailCheckboxCheckedWhenUseDefaultEulaSelected()
|
public function testSendEmailCheckboxCheckedWhenUseDefaultEulaSelected()
|
||||||
{
|
{
|
||||||
Livewire::test(CategoryEditForm::class, [
|
Livewire::test(CategoryEditForm::class, [
|
||||||
'checkinEmail' => false,
|
'sendCheckInEmail' => false,
|
||||||
'useDefaultEula' => false,
|
'useDefaultEula' => false,
|
||||||
])->assertSet('checkinEmail', false)
|
])->assertSet('sendCheckInEmail', false)
|
||||||
->set('useDefaultEula', true)
|
->set('useDefaultEula', true)
|
||||||
->assertSet('checkinEmail', true);
|
->assertSet('sendCheckInEmail', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue