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
|
||||
{
|
||||
public $checkinEmail;
|
||||
|
||||
public $defaultEulaText;
|
||||
|
||||
public $eulaText;
|
||||
|
||||
public $requireAcceptance;
|
||||
|
||||
public $sendCheckInEmail;
|
||||
|
||||
public $useDefaultEula;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if ($this->eulaText || $this->useDefaultEula) {
|
||||
$this->checkinEmail = true;
|
||||
$this->sendCheckInEmail = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class CategoryEditForm extends Component
|
|||
public function updated($property, $value)
|
||||
{
|
||||
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="col-md-9 col-md-offset-3">
|
||||
<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') }}
|
||||
</label>
|
||||
@if ($this->shouldDisplayEmailMessage)
|
||||
|
|
|
@ -16,56 +16,56 @@ class CategoryEditFormTest extends TestCase
|
|||
public function testSendEmailCheckboxIsCheckedOnLoadWhenSendEmailIsExistingSetting()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'checkinEmail' => true,
|
||||
'sendCheckInEmail' => true,
|
||||
'eulaText' => '',
|
||||
'useDefaultEula' => false,
|
||||
])->assertSet('checkinEmail', true);
|
||||
])->assertSet('sendCheckInEmail', true);
|
||||
}
|
||||
|
||||
public function testSendEmailCheckboxIsCheckedOnLoadWhenCategoryEulaSet()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'checkinEmail' => false,
|
||||
'sendCheckInEmail' => false,
|
||||
'eulaText' => 'Some Content',
|
||||
'useDefaultEula' => false,
|
||||
])->assertSet('checkinEmail', true);
|
||||
])->assertSet('sendCheckInEmail', true);
|
||||
}
|
||||
|
||||
public function testSendEmailCheckboxIsCheckedOnLoadWhenUsingDefaultEula()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'checkinEmail' => false,
|
||||
'sendCheckInEmail' => false,
|
||||
'eulaText' => '',
|
||||
'useDefaultEula' => true,
|
||||
])->assertSet('checkinEmail', true);
|
||||
])->assertSet('sendCheckInEmail', true);
|
||||
}
|
||||
|
||||
public function testSendEmailCheckBoxIsUncheckedOnLoadWhenSendEmailIsFalseNoCategoryEulaSetAndNotUsingDefaultEula()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'checkinEmail' => false,
|
||||
'sendCheckInEmail' => false,
|
||||
'eulaText' => '',
|
||||
'useDefaultEula' => false,
|
||||
])->assertSet('checkinEmail', false);
|
||||
])->assertSet('sendCheckInEmail', false);
|
||||
}
|
||||
|
||||
public function testSendEmailCheckboxIsCheckedWhenCategoryEulaEntered()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'checkinEmail' => false,
|
||||
'sendCheckInEmail' => false,
|
||||
'useDefaultEula' => false,
|
||||
])->assertSet('checkinEmail', false)
|
||||
])->assertSet('sendCheckInEmail', false)
|
||||
->set('eulaText', 'Some Content')
|
||||
->assertSet('checkinEmail', true);
|
||||
->assertSet('sendCheckInEmail', true);
|
||||
}
|
||||
|
||||
public function testSendEmailCheckboxCheckedWhenUseDefaultEulaSelected()
|
||||
{
|
||||
Livewire::test(CategoryEditForm::class, [
|
||||
'checkinEmail' => false,
|
||||
'sendCheckInEmail' => false,
|
||||
'useDefaultEula' => false,
|
||||
])->assertSet('checkinEmail', false)
|
||||
])->assertSet('sendCheckInEmail', false)
|
||||
->set('useDefaultEula', true)
|
||||
->assertSet('checkinEmail', true);
|
||||
->assertSet('sendCheckInEmail', true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue