mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Eslint fixes and phpcs fixer
This commit is contained in:
parent
5d0fc7a189
commit
1af3e4c7ec
@ -68,7 +68,7 @@ function loadDynamicPicker(element) {
|
|||||||
as_id,
|
as_id,
|
||||||
submit_on_adding_new_entity,
|
submit_on_adding_new_entity,
|
||||||
label,
|
label,
|
||||||
isCurrentUserPicker
|
isCurrentUserPicker,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -97,7 +97,7 @@ function loadDynamicPicker(element) {
|
|||||||
const ids = this.picked.map((el) => el.id);
|
const ids = this.picked.map((el) => el.id);
|
||||||
input.value = ids.join(",");
|
input.value = ids.join(",");
|
||||||
}
|
}
|
||||||
console.log(this.picked)
|
console.log(this.picked);
|
||||||
// console.log(entity);
|
// console.log(entity);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul :class="listClasses" v-if="picked.length && displayPicked">
|
<ul :class="listClasses" v-if="picked.length && displayPicked">
|
||||||
<li v-for="p in picked" @click="removeEntity(p)" :key="p.type + p.id">
|
<li v-for="p in picked" @click="removeEntity(p)" :key="p.type + p.id">
|
||||||
<span v-if="'me' === p" class="chill_denomination current-user updatedBy">{{ trans(USER_CURRENT_USER) }}</span>
|
<span
|
||||||
|
v-if="'me' === p"
|
||||||
|
class="chill_denomination current-user updatedBy"
|
||||||
|
>{{ trans(USER_CURRENT_USER) }}</span
|
||||||
|
>
|
||||||
<span v-else class="chill_denomination">{{ p.text }}</span>
|
<span v-else class="chill_denomination">{{ p.text }}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -36,8 +40,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from "vue";
|
||||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue"; // eslint-disable-line
|
||||||
import { appMessages } from "./i18n";
|
import { appMessages } from "./i18n";
|
||||||
import { trans, USER_CURRENT_USER } from "translator";
|
import { trans, USER_CURRENT_USER } from "translator";
|
||||||
|
|
||||||
@ -50,10 +54,14 @@ const props = defineProps({
|
|||||||
displayPicked: { type: Boolean, default: true },
|
displayPicked: { type: Boolean, default: true },
|
||||||
suggested: { type: Array, default: () => [] },
|
suggested: { type: Array, default: () => [] },
|
||||||
label: String,
|
label: String,
|
||||||
isCurrentUserPicker: { type: Boolean, default: false }
|
isCurrentUserPicker: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["addNewEntity", "removeEntity", "addNewEntityProcessEnded"]);
|
const emit = defineEmits([
|
||||||
|
"addNewEntity",
|
||||||
|
"removeEntity",
|
||||||
|
"addNewEntityProcessEnded",
|
||||||
|
]);
|
||||||
|
|
||||||
const itsMeCheckbox = ref(null);
|
const itsMeCheckbox = ref(null);
|
||||||
const addPersons = ref(null);
|
const addPersons = ref(null);
|
||||||
@ -67,10 +75,14 @@ const addPersonsOptions = computed(() => ({
|
|||||||
|
|
||||||
const translatedListOfTypes = computed(() => {
|
const translatedListOfTypes = computed(() => {
|
||||||
if (props.label) return props.label;
|
if (props.label) return props.label;
|
||||||
let trans = props.types.map(t =>
|
let trans = props.types.map((t) =>
|
||||||
props.multiple ? appMessages.fr.pick_entity[t].toLowerCase() : appMessages.fr.pick_entity[t + "_one"].toLowerCase()
|
props.multiple
|
||||||
|
? appMessages.fr.pick_entity[t].toLowerCase()
|
||||||
|
: appMessages.fr.pick_entity[t + "_one"].toLowerCase(),
|
||||||
);
|
);
|
||||||
return props.multiple ? appMessages.fr.pick_entity.modal_title + trans.join(", ") : appMessages.fr.pick_entity.modal_title_one + trans.join(", ");
|
return props.multiple
|
||||||
|
? appMessages.fr.pick_entity.modal_title + trans.join(", ")
|
||||||
|
: appMessages.fr.pick_entity.modal_title_one + trans.join(", ");
|
||||||
});
|
});
|
||||||
|
|
||||||
const listClasses = computed(() => ({
|
const listClasses = computed(() => ({
|
||||||
@ -78,16 +90,15 @@ const listClasses = computed(() => ({
|
|||||||
"remove-items": props.removableIfSet,
|
"remove-items": props.removableIfSet,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const selectItsMe = (event) => {
|
const selectItsMe = (event) =>
|
||||||
event.target.checked ? addNewSuggested('me') : removeEntity('me');
|
event.target.checked ? addNewSuggested("me") : removeEntity("me");
|
||||||
};
|
|
||||||
|
|
||||||
const addNewSuggested = (entity) => {
|
const addNewSuggested = (entity) => {
|
||||||
emit("addNewEntity", { entity });
|
emit("addNewEntity", { entity });
|
||||||
};
|
};
|
||||||
|
|
||||||
const addNewEntity = ({ selected, modal }) => {
|
const addNewEntity = ({ selected, modal }) => {
|
||||||
selected.forEach(item => emit("addNewEntity", { entity: item.result }));
|
selected.forEach((item) => emit("addNewEntity", { entity: item.result }));
|
||||||
addPersons.value?.resetSearch();
|
addPersons.value?.resetSearch();
|
||||||
modal.showModal = false;
|
modal.showModal = false;
|
||||||
emit("addNewEntityProcessEnded");
|
emit("addNewEntityProcessEnded");
|
||||||
@ -95,7 +106,7 @@ const addNewEntity = ({ selected, modal }) => {
|
|||||||
|
|
||||||
const removeEntity = (entity) => {
|
const removeEntity = (entity) => {
|
||||||
if (!props.removableIfSet) return;
|
if (!props.removableIfSet) return;
|
||||||
if (entity === 'me' && itsMeCheckbox.value) {
|
if (entity === "me" && itsMeCheckbox.value) {
|
||||||
itsMeCheckbox.value.checked = false;
|
itsMeCheckbox.value.checked = false;
|
||||||
}
|
}
|
||||||
emit("removeEntity", { entity });
|
emit("removeEntity", { entity });
|
||||||
|
@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
|||||||
|
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
|
||||||
use Chill\MainBundle\Form\Type\PickUserOrMeDynamicType;
|
use Chill\MainBundle\Form\Type\PickUserOrMeDynamicType;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user