automatic IDE clean code

This commit is contained in:
Mathieu Jaumotte 2021-08-02 13:44:13 +02:00
parent 714d8b841c
commit ad55cc0477
7 changed files with 86 additions and 86 deletions

View File

@ -6,16 +6,16 @@
@click="openModal"> @click="openModal">
{{ buttonText }} {{ buttonText }}
</a> </a>
<teleport to="body"> <teleport to="body">
<modal v-if="modal.showModal" <modal v-if="modal.showModal"
:modalDialogClass="modal.modalDialogClass" :modalDialogClass="modal.modalDialogClass"
@close="modal.showModal = false"> @close="modal.showModal = false">
<template v-slot:header> <template v-slot:header>
<h3 class="modal-title">{{ $t(titleModal) }}</h3> <h3 class="modal-title">{{ $t(titleModal) }}</h3>
</template> </template>
<template v-slot:body v-if="type === 'person'"> <template v-slot:body v-if="type === 'person'">
<on-the-fly-person <on-the-fly-person
v-bind:id="id" v-bind:id="id"
@ -24,7 +24,7 @@
ref="castPerson"> ref="castPerson">
</on-the-fly-person> </on-the-fly-person>
</template> </template>
<template v-slot:body v-else-if="type === 'thirdparty'"> <template v-slot:body v-else-if="type === 'thirdparty'">
<on-the-fly-thirdparty <on-the-fly-thirdparty
v-bind:id="id" v-bind:id="id"
@ -33,14 +33,14 @@
ref="castThirdparty"> ref="castThirdparty">
</on-the-fly-thirdparty> </on-the-fly-thirdparty>
</template> </template>
<template v-slot:body v-else> <template v-slot:body v-else>
<on-the-fly-create <on-the-fly-create
v-bind:action="action" v-bind:action="action"
ref="castNew"> ref="castNew">
</on-the-fly-create> </on-the-fly-create>
</template> </template>
<template v-slot:footer> <template v-slot:footer>
<button v-if="action === 'show'" <button v-if="action === 'show'"
@click="changeActionTo('edit')" @click="changeActionTo('edit')"
@ -52,10 +52,10 @@
{{ $t('action.save')}} {{ $t('action.save')}}
</button> </button>
</template> </template>
</modal> </modal>
</teleport> </teleport>
</template> </template>
<script> <script>
@ -126,7 +126,7 @@ export default {
}, },
changeActionTo(action) { changeActionTo(action) {
// [BUG] clic first on show item button; in modal clic edit button; close modal; clic again on show item button // [BUG] clic first on show item button; in modal clic edit button; close modal; clic again on show item button
this.$data.action = action; this.$data.action = action;
}, },
saveAction() { saveAction() {
console.log('saveAction'); console.log('saveAction');

View File

@ -1,13 +1,13 @@
<template> <template>
<banner></banner> <banner></banner>
<sticky-nav></sticky-nav> <sticky-nav></sticky-nav>
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-md-11"> <div class="col-md-11">
<h1 v-if="accompanyingCourse.step === 'DRAFT'">{{ $t('course.title.draft') }}</h1> <h1 v-if="accompanyingCourse.step === 'DRAFT'">{{ $t('course.title.draft') }}</h1>
<h1 v-else>{{ $t('course.title.active') }}</h1> <h1 v-else>{{ $t('course.title.active') }}</h1>
<persons-associated></persons-associated> <persons-associated></persons-associated>
<origin-demand></origin-demand> <origin-demand></origin-demand>
<requestor></requestor> <requestor></requestor>
@ -17,7 +17,7 @@
<resources></resources> <resources></resources>
<comment v-if="accompanyingCourse.step === 'DRAFT'"></comment> <comment v-if="accompanyingCourse.step === 'DRAFT'"></comment>
<confirm v-if="accompanyingCourse.step === 'DRAFT'"></confirm> <confirm v-if="accompanyingCourse.step === 'DRAFT'"></confirm>
</div> </div>
</div> </div>
</template> </template>
@ -38,11 +38,11 @@ import Confirm from './components/Confirm.vue';
export default { export default {
name: 'App', name: 'App',
components: { components: {
Banner, Banner,
StickyNav, StickyNav,
OriginDemand, OriginDemand,
PersonsAssociated, PersonsAssociated,
Requestor, Requestor,
SocialIssue, SocialIssue,
CourseLocation, CourseLocation,
@ -81,12 +81,12 @@ export default {
} }
padding: 0em 0em; padding: 0em 0em;
margin: 1em 0; margin: 1em 0;
border: 1px dotted #718596ab; border: 1px dotted #718596ab;
border-radius: 5px; border-radius: 5px;
border-left: 1px dotted #718596ab; border-left: 1px dotted #718596ab;
border-right: 1px dotted #718596ab; border-right: 1px dotted #718596ab;
dd { dd {
margin-left: 1em; margin-left: 1em;
} }
& > div { & > div {
margin: 1em 3em 0; margin: 1em 3em 0;
@ -94,6 +94,6 @@ export default {
table { table {
} }
} }
} }
</style> </style>

View File

@ -31,7 +31,7 @@
</li> </li>
<!--li> <!--li>
<button class="btn btn-delete" <button class="btn btn-delete"
:title="$t('action.delete')" :title="$t('action.delete')"
@click.prevent="$emit('remove', participation)"> @click.prevent="$emit('remove', participation)">
</button> </button>
</li--> </li-->

View File

@ -1,40 +1,40 @@
<template> <template>
<div class="vue-component"> <div class="vue-component">
<h2><a name="section-20"></a>{{ $t('requestor.title') }}</h2> <h2><a name="section-20"></a>{{ $t('requestor.title') }}</h2>
<div v-if="accompanyingCourse.requestor" class="flex-table"> <div v-if="accompanyingCourse.requestor" class="flex-table">
<label> <label>
<input type="checkbox" v-model="isAnonymous" class="me-2" /><!-- :value="value" --> <input type="checkbox" v-model="isAnonymous" class="me-2" /><!-- :value="value" -->
{{ $t('requestor.is_anonymous') }} {{ $t('requestor.is_anonymous') }}
</label> </label>
<div class="item-bloc"> <div class="item-bloc">
<h4> <h4>
<span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span> <span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
{{ accompanyingCourse.requestor.text }} {{ accompanyingCourse.requestor.text }}
</h4> </h4>
<dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'person'"> <dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'person'">
<dt>{{ $t('requestor.birthdate') }}</dt> <dt>{{ $t('requestor.birthdate') }}</dt>
<dd>{{ $d(accompanyingCourse.requestor.birthdate.datetime, 'short') }}</dd> <dd>{{ $d(accompanyingCourse.requestor.birthdate.datetime, 'short') }}</dd>
<dt>{{ $t('requestor.center') }}</dt> <dt>{{ $t('requestor.center') }}</dt>
<dd>{{ accompanyingCourse.requestor.center.name }}</dd> <dd>{{ accompanyingCourse.requestor.center.name }}</dd>
<dt>{{ $t('requestor.phonenumber') }}</dt> <dt>{{ $t('requestor.phonenumber') }}</dt>
<dd>{{ accompanyingCourse.requestor.phonenumber }}</dd> <dd>{{ accompanyingCourse.requestor.phonenumber }}</dd>
<dt>{{ $t('requestor.mobilenumber') }}</dt> <dt>{{ $t('requestor.mobilenumber') }}</dt>
<dd>{{ accompanyingCourse.requestor.mobilenumber }}</dd> <dd>{{ accompanyingCourse.requestor.mobilenumber }}</dd>
</dl> </dl>
<dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'thirdparty'"> <dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'thirdparty'">
<dt>{{ $t('requestor.address') }}</dt> <dt>{{ $t('requestor.address') }}</dt>
<dd>{{ accompanyingCourse.requestor.address.text }}</dd> <dd>{{ accompanyingCourse.requestor.address.text }}</dd>
<dt>{{ $t('requestor.location') }}</dt> <dt>{{ $t('requestor.location') }}</dt>
<dd>{{ accompanyingCourse.requestor.address.postcode.name }}</dd> <dd>{{ accompanyingCourse.requestor.address.postcode.name }}</dd>
</dl> </dl>
@ -59,17 +59,17 @@
<ul class="record_actions"> <ul class="record_actions">
<li> <li>
<button class="btn btn-remove" <button class="btn btn-remove"
:title="$t('action.remove')" :title="$t('action.remove')"
@click="removeRequestor"> @click="removeRequestor">
{{ $t('action.remove') }} {{ $t('action.remove') }}
</button> </button>
</li> </li>
</ul> </ul>
</div> </div>
<div v-else> <div v-else>
<label>{{ $t('requestor.counter') }}</label> <label>{{ $t('requestor.counter') }}</label>
</div> </div>
<div> <div>
<add-persons v-if="accompanyingCourse.requestor === null" <add-persons v-if="accompanyingCourse.requestor === null"
buttonTitle="requestor.add_requestor" buttonTitle="requestor.add_requestor"
@ -139,7 +139,7 @@ export default {
div.flex-table { div.flex-table {
margin: 1em 0 0 !important; margin: 1em 0 0 !important;
& > label, & > label,
& > ul.record_actions { & > ul.record_actions {
margin: 1em 3em 0 !important; margin: 1em 3em 0 !important;
} }

View File

@ -1,15 +1,15 @@
<template> <template>
<tr> <tr>
<td> <td>
<span class="badge rounded-pill bg-secondary" <span class="badge rounded-pill bg-secondary"
v-bind:title="resource.resource.id"> v-bind:title="resource.resource.id">
<span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span> <span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span>
<span v-if="resource.resource.type === 'thirdparty'" >{{ $t('item.type_thirdparty') }}</span> <span v-if="resource.resource.type === 'thirdparty'" >{{ $t('item.type_thirdparty') }}</span>
</span> </span>
{{ resource.resource.text }} {{ resource.resource.text }}
</td> </td>
<td v-if="resource.resource.type === 'person'"> <td v-if="resource.resource.type === 'person'">
{{ $tc('person.born') }}{{ $d(resource.resource.birthdate.datetime, 'short') }} {{ $tc('person.born') }}{{ $d(resource.resource.birthdate.datetime, 'short') }}
</td> </td>
@ -17,7 +17,7 @@
{{ resource.resource.address.text }}<br> {{ resource.resource.address.text }}<br>
{{ resource.resource.address.postcode.name }} {{ resource.resource.address.postcode.name }}
</td> </td>
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
<button-location <button-location

View File

@ -20,7 +20,7 @@ const appMessages = {
active: "En file active" active: "En file active"
}, },
open_at: "ouvert le ", open_at: "ouvert le ",
by: "par ", by: "par ",
emergency: "urgent", emergency: "urgent",
confidential: "confidentiel", confidential: "confidentiel",
regular: "régulier", regular: "régulier",
@ -86,7 +86,7 @@ const appMessages = {
title: "Observations", title: "Observations",
label: "Ajout d'une note", label: "Ajout d'une note",
content: "Rédigez une première note…", content: "Rédigez une première note…",
created_by: "créé par {0}, le {1}" created_by: "créé par {0}, le {1}"
}, },
confirm: { confirm: {
title: "Confirmation", title: "Confirmation",

View File

@ -1,13 +1,13 @@
<template> <template>
<div v-if="action === 'show'"> <div v-if="action === 'show'">
<div class="flex-table"> <div class="flex-table">
<div class="item-bloc"> <div class="item-bloc">
<div class="item-row"> <div class="item-row">
<div class="item-col"> <div class="item-col">
<h3 :title="person.id">{{ person.text }}</h3> <h3 :title="person.id">{{ person.text }}</h3>
<p> <p>
<i class="fa fa-fw" <i class="fa fa-fw"
:class="genderClass"> :class="genderClass">
<!-- <!--
:title="$t(genderTranslation)" :title="$t(genderTranslation)"
@ -20,27 +20,27 @@
</p> </p>
</div> </div>
<div class="item-col"> <div class="item-col">
<dl class="list-content"> <dl class="list-content">
<dt>{{ $t('person.firstname') }}</dt> <dt>{{ $t('person.firstname') }}</dt>
<dd>{{ person.firstName }}</dd> <dd>{{ person.firstName }}</dd>
<dt>{{ $t('person.lastname') }}</dt> <dt>{{ $t('person.lastname') }}</dt>
<dd>{{ person.lastName }}</dd> <dd>{{ person.lastName }}</dd>
<dt>{{ $t('person.altnames') }}</dt> <dt>{{ $t('person.altnames') }}</dt>
<dd>{{ person.altNames }}</dd> <dd>{{ person.altNames }}</dd>
<span v-if="person.center"> <span v-if="person.center">
<dt>{{ $t('person.center_name') }}</dt> <dt>{{ $t('person.center_name') }}</dt>
<dd :title="person.center.id">{{ person.center.name }}</dd> <dd :title="person.center.id">{{ person.center.name }}</dd>
</span> </span>
<dt>{{ $t('person.phonenumber') }}</dt> <dt>{{ $t('person.phonenumber') }}</dt>
<dd>{{ person.phonenumber }}</dd> <dd>{{ person.phonenumber }}</dd>
<dt>{{ $t('person.mobilenumber') }}</dt> <dt>{{ $t('person.mobilenumber') }}</dt>
<dd>{{ person.mobilenumber }}</dd> <dd>{{ person.mobilenumber }}</dd>
<dt>{{ $t('person.gender.title') }}</dt> <dt>{{ $t('person.gender.title') }}</dt>
<!-- <!--
<dd>{{ $t(genderTranslation) }}</dd> <dd>{{ $t(genderTranslation) }}</dd>
@ -49,61 +49,61 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="action === 'edit' || action === 'create'"> <div v-else-if="action === 'edit' || action === 'create'">
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input class="form-control form-control-lg" id="firstname" v-model="firstName" v-bind:placeholder="$t('person.firstname')" /> <input class="form-control form-control-lg" id="firstname" v-model="firstName" v-bind:placeholder="$t('person.firstname')" />
<label for="firstname">{{ $t('person.firstname') }}</label> <label for="firstname">{{ $t('person.firstname') }}</label>
</div> </div>
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input class="form-control form-control-lg" id="lastname" v-model="lastName" v-bind:placeholder="$t('person.lastname')" /> <input class="form-control form-control-lg" id="lastname" v-model="lastName" v-bind:placeholder="$t('person.lastname')" />
<label for="lastname">{{ $t('person.lastname') }}</label> <label for="lastname">{{ $t('person.lastname') }}</label>
</div> </div>
<!-- TODO fix placeholder if undefined <!-- TODO fix placeholder if undefined
--> -->
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<select class="form-select form-select-lg" id="gender" v-model="gender"> <select class="form-select form-select-lg" id="gender" v-model="gender">
<option selected disabled >{{ $t('person.gender.placeholder') }}</option> <option selected disabled >{{ $t('person.gender.placeholder') }}</option>
<option value="woman">{{ $t('person.gender.woman') }}</option> <option value="woman">{{ $t('person.gender.woman') }}</option>
<option value="man">{{ $t('person.gender.man') }}</option> <option value="man">{{ $t('person.gender.man') }}</option>
<option value="neuter">{{ $t('person.gender.neuter') }}</option> <option value="neuter">{{ $t('person.gender.neuter') }}</option>
</select> </select>
<label for="gender">{{ $t('person.gender.title') }}</label> <label for="gender">{{ $t('person.gender.title') }}</label>
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text" id="birthdate"><i class="fa fa-fw fa-birthday-cake"></i></span> <span class="input-group-text" id="birthdate"><i class="fa fa-fw fa-birthday-cake"></i></span>
<input type="date" <input type="date"
class="form-control form-control-lg" class="form-control form-control-lg"
id="chill_personbundle_person_birthdate" id="chill_personbundle_person_birthdate"
name="chill_personbundle_person[birthdate]" name="chill_personbundle_person[birthdate]"
v-model="birthDate" v-model="birthDate"
aria-describedby="birthdate" /> aria-describedby="birthdate" />
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span> <span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
<input class="form-control form-control-lg" <input class="form-control form-control-lg"
v-model="phonenumber" v-model="phonenumber"
v-bind:placeholder="$t('person.phonenumber')" v-bind:placeholder="$t('person.phonenumber')"
v-bind:aria-label="$t('person.phonenumber')" v-bind:aria-label="$t('person.phonenumber')"
aria-describedby="phonenumber" /> aria-describedby="phonenumber" />
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text" id="mobilenumber"><i class="fa fa-fw fa-mobile"></i></span> <span class="input-group-text" id="mobilenumber"><i class="fa fa-fw fa-mobile"></i></span>
<input class="form-control form-control-lg" <input class="form-control form-control-lg"
v-model="mobilenumber" v-model="mobilenumber"
v-bind:placeholder="$t('person.mobilenumber')" v-bind:placeholder="$t('person.mobilenumber')"
v-bind:aria-label="$t('person.mobilenumber')" v-bind:aria-label="$t('person.mobilenumber')"
aria-describedby="mobilenumber" /> aria-describedby="mobilenumber" />
</div> </div>
</div> </div>
</template> </template>
@ -131,19 +131,19 @@ export default {
}, },
gender: { gender: {
set(value) { this.person.gender = value; }, set(value) { this.person.gender = value; },
get() { return this.person.gender; } get() { return this.person.gender; }
}, },
birthDate: { birthDate: {
set(value) { set(value) {
if (this.person.birthdate) { if (this.person.birthdate) {
this.person.birthdate.datetime = value + "T00:00:00+0100"; this.person.birthdate.datetime = value + "T00:00:00+0100";
} else { } else {
this.person.birthdate = { datetime: value + "T00:00:00+0100"}; this.person.birthdate = { datetime: value + "T00:00:00+0100"};
} }
}, },
get() { get() {
return (this.person.birthdate) ? this.person.birthdate.datetime.split('T')[0] : ''; return (this.person.birthdate) ? this.person.birthdate.datetime.split('T')[0] : '';
} }
}, },
phonenumber: { phonenumber: {
set(value) { this.person.phonenumber = value; }, set(value) { this.person.phonenumber = value; },
@ -174,7 +174,7 @@ export default {
} }
}, },
feminized() { feminized() {
return (this.person.gender === 'woman')? 'e' : ''; return (this.person.gender === 'woman')? 'e' : '';
} }
}, },
mounted() { mounted() {