Merge branch 'fix-contact' into 'develop'

Fix contact

See merge request service-web-lab/le-gaulois-pro!66
This commit is contained in:
Vincent BRIDIER 2023-01-18 10:37:54 +00:00
commit 45ee252bad
4 changed files with 25 additions and 12 deletions

View file

@ -22,7 +22,7 @@ final class ContactActivityEnum extends BaseEnum
protected static function values(): array
{
return [
'Distributeur' => 1,
'distributeur' => 1,
'restaurationSociale' => 2,
'restaurationCommerciale' => 3,
'boulangeriePatisserie' => 4,

View file

@ -28,7 +28,7 @@ class ContactRequest extends FormRequest
{
try {
$this->merge([
'activityEnum' => ContactActivityEnum::make($this->activity)
'activityEnum' => ContactActivityEnum::toArray()[$this->activity]
]);
} catch (\Exception $e) {
$this->merge([
@ -37,7 +37,7 @@ class ContactRequest extends FormRequest
}
try {
$this->merge([
'callTimeEnum' => ContactTimeEnum::make($this->activity)
'callTimeEnum' => ContactTimeEnum::toArray()[$this->callTime]
]);
} catch (\Exception $e) {
$this->merge([

View file

@ -2,12 +2,13 @@
<div
class="contact-list-products-component contact-list-products row justify-content-center justify-content-sm-start w-100 px-2"
>
<div v-if="!basket.length">
<div v-if="basket.length <= 0">
<span class="h4">
{{ __("Vous n'avez aucun produits dans votre panier.") }}
</span>
</div>
<div
v-else
v-for="(item, itemIndex) in basket"
:key="itemIndex"
class="col-10 col-sm-6 col-md-4 contact-prod-container px-2"

View file

@ -25,8 +25,20 @@
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-end">
<input id="firstname" class="form-control black-square p-3 mb-3" type="text" name="firstname" placeholder="{{ __('Prénom') }}" value="{{ old('firstname') }}">
@include('fo.modules.input-error', ['inputName' => 'firstname'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<input id="lastname" class="form-control black-square p-3 mb-3" type="text" name="lastname" placeholder="{{ __('Nom *') }}" value="{{ old('lastname') }}" required>
@include('fo.modules.input-error', ['inputName' => 'lastname'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<input id="email" class="form-control black-square p-3 mb-3" type="email" name="email" placeholder="{{ __('Adresse e-mail *') }}" value="{{ old('email') }}" required>
@include('fo.modules.input-error', ['inputName' => 'email'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<input id="phone" class="form-control black-square p-3 mb-3" type="text" name="phone" placeholder="{{ __('N° de téléphone *') }}" value="{{ old('phone') }}" required>
@include('fo.modules.input-error', ['inputName' => 'phone'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<select class="contact-activity-container black-square position-relative w-100 p-3 mb-3" role="button" name="activity">
{{ __('Votre activité') }}
<option class="option-activity-item disabled p-3 px-3" @if(!old('activity')) selected @endif disabled>{{ __('Votre activité') }}</option>
@ -35,16 +47,16 @@
@endforeach
</select>
@include('fo.modules.input-error', ['inputName' => 'activity'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<input id="society" class="form-control black-square p-3 mb-3" type="text" name="society" placeholder="{{ __('Société') }}" value="{{ old('society') }}">
@include('fo.modules.input-error', ['inputName' => 'society'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<input id="postcode" class="form-control black-square p-3 mb-3" type="text" name="postcode" placeholder="{{ __('Code postal') }}" value="{{ old('postcode') }}">
@include('fo.modules.input-error', ['inputName' => 'postcode'])
</div>
<div class="col-12 col-sm-6 d-flex flex-wrap justify-content-center justify-content-sm-start">
<input id="lastname" class="form-control black-square p-3 mb-3" type="text" name="lastname" placeholder="{{ __('Nom *') }}" value="{{ old('lastname') }}" required>
@include('fo.modules.input-error', ['inputName' => 'lastname'])
<input id="phone" class="form-control black-square p-3 mb-3" type="text" name="phone" placeholder="{{ __('N° de téléphone *') }}" value="{{ old('phone') }}" required>
@include('fo.modules.input-error', ['inputName' => 'phone'])
<input id="society" class="form-control black-square p-3 mb-3" type="text" name="society" placeholder="{{ __('Société') }}" value="{{ old('society') }}">
@include('fo.modules.input-error', ['inputName' => 'society'])
<input id="city" class="form-control black-square p-3 mb-3" type="text" name="city" placeholder="{{ __('Ville') }}" value="{{ old('city') }}">
@include('fo.modules.input-error', ['inputName' => 'city'])
</div>
@ -74,10 +86,10 @@
@include('fo.modules.input-error', ['inputName' => 'callTime'])
</div>
<div class="row wrapper-sm mb-3">
@foreach(App\Enums\Contact\ContactTimeEnum::toArray() as $contactTime)
@foreach(App\Enums\Contact\ContactTimeEnum::toArray() as $key => $contactTime)
<div class="col">
<input id="call-time-{{ Str::slug($contactTime->value) }}" class="input-radio-contact d-none" type="radio"
value="{{ $contactTime->value }}" name="callTime" @if (old('callTime') == $contactTime->value) checked @endif>
value="{{ $key }}" name="callTime" @if (old('callTime') == $contactTime->value) checked @endif>
<label class="label-time-contact butn-cinq position-relative w-100 m-0" for="call-time-{{ Str::slug($contactTime->value) }}">
{{ $contactTime->label }}
</label>