diff --git a/CHANGELOG.md b/CHANGELOG.md index e464bf451..5fcc5cd90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,14 @@ and this project adheres to * [person] accompanying course: optimisation: do not fetch some resources for the banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/409) * [person] accompanying course: close modal when edit participation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/420) * [person] accompanying course: treat validation error when editing on-the-fly entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/420) +* [activity] show activity attendee (présence) in the activity list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/412) +* [activity] admin: change validation rule for social action visible field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/413) +* [parcours]: component added to change the opening date of a parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/411) * [search]: listing of parcours display changed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/410) * [user]: page with accompanying periods to which is user is referent (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/408) +* [person] age added to renderstring + renderbox/ vue component created to display person text (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/389) +* [household member editor] allow to push to existing household + ## Test releases @@ -33,10 +39,10 @@ and this project adheres to ### test release 2021-01-26 +>>>>>>> origin/master * [parcours] comments truncated if too long + link added (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/406) * [person]: possibility to add person resources (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/382) * [person ressources]: module added -* [parcours] bugfix if deathdate is not defined (eg. for a thirdparty) parcours is still displayed. Gave error before. ### test release 2022-01-24 diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index c7448e07d..94f732a89 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -16,6 +16,7 @@ use InvalidArgumentException; use Symfony\Component\Serializer\Annotation as Serializer; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; +use Symfony\Component\Validator\Context\ExecutionContextInterface; /** * Class ActivityType. @@ -193,7 +194,6 @@ class ActivityType /** * @ORM\Column(type="smallint", nullable=false, options={"default": 1}) - * @Assert\EqualTo(propertyPath="socialIssuesVisible", message="This parameter must be equal to social issue parameter") */ private int $socialActionsVisible = self::FIELD_INVISIBLE; @@ -263,6 +263,23 @@ class ActivityType */ private int $userVisible = self::FIELD_REQUIRED; + /** + * @Assert\Callback + * + * @param mixed $payload + */ + public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload) + { + if ($this->socialIssuesVisible !== $this->socialActionsVisible) { + if (!($this->socialIssuesVisible === 2 && $this->socialActionsVisible === 1)) { + $context + ->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value') + ->atPath('socialActionsVisible') + ->addViolation(); + } + } + } + /** * Get active * return true if the type is active. diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue index f5057eb25..45483dc95 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue @@ -1,45 +1,48 @@ diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig index 6b2e33dfb..fadf7ff14 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig @@ -41,6 +41,17 @@ {% endif %} + {% if activity.attendee and t.attendeeVisible %} +
+

{{ 'Attendee'|trans }}

+
+

+ {{ activity.attendee.name|localize_translatable_string }} +

+
+
+ {% endif %} + {% if activity.sentReceived is not empty and t.sentReceivedVisible %}

{{ 'Sent received'|trans }}

diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig index 0f426c5a9..e8be2c49e 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig @@ -48,7 +48,7 @@
  • {{ 'Participants'|trans ~ ' : ' }} {% for p in activity.personsAssociated %} - {{ p|chill_entity_render_box }} + {{ p|chill_entity_render_box({'addAgeBadge': true}) }} {% endfor %}
  • diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index 546ba99ce..a5e3bd1fd 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -165,11 +165,7 @@
    {{ 'Attendee'|trans }}
    {% if entity.attendee is not null %} - {% if entity.attendee %} - {{ 'present'|trans|capitalize }} - {% else %} - {{ 'not present'|trans|capitalize }} - {% endif %} + {{ entity.attendee.name|localize_translatable_string }} {% else %} {{ 'None'|trans|capitalize }} {% endif %} diff --git a/src/Bundle/ChillActivityBundle/translations/validators.fr.yml b/src/Bundle/ChillActivityBundle/translations/validators.fr.yml index 072ac55d2..1f4f97a63 100644 --- a/src/Bundle/ChillActivityBundle/translations/validators.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/validators.fr.yml @@ -20,3 +20,4 @@ For this type of activity, you must add at least one social action: Pour ce type # admin This parameter must be equal to social issue parameter: Ce paramètre doit être égal au paramètre "Visibilité du champs Problématiques sociales" +The socialActionsVisible value is not compatible with the socialIssuesVisible value: Cette valeur du paramètre "Visibilité du champs Actions sociales" n'est pas compatible avec la valeur du paramètre "Visibilité du champs Problématiques sociales" \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss index 4d213645e..bfd43064b 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss @@ -12,6 +12,7 @@ display: block; top: calc(50% - 7px); right: 10px; + line-height: 11px; } } @@ -62,14 +63,19 @@ ul.list-suggest { & span:hover { color: $chill-l-gray; } + .person-text { + span { + padding-left: 0px; + } + } } } &.remove-items { li { position: relative; - span { + & > span { display: block; - padding-right: .75rem; + padding-right: 1.75rem; @include remove_link; } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss index 1eb437a2a..a95c4b993 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss @@ -22,6 +22,7 @@ $chill-theme-buttons: ( "cancel": $gray-300, "choose": $gray-300, "notify": $gray-300, + "search": $gray-300, "unlink": $chill-red, "tpchild": $chill-pink, ); @@ -80,6 +81,7 @@ $chill-theme-buttons: ( &.btn-notify::before, &.btn-tpchild::before, &.btn-download::before, + &.btn-search::before, &.btn-cancel::before { font: normal normal normal 14px/1 ForkAwesome; margin-right: 0.5em; @@ -108,6 +110,7 @@ $chill-theme-buttons: ( &.btn-notify::before { content: "\f1d8"; } // fa-paper-plane &.btn-tpchild::before { content: "\f007"; } // fa-user &.btn-download::before { content: "\f019"; } // fa-download + &.btn-search::before { content: "\f002"; } // fa-search } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue index 5dd770328..4e99b7fd3 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue @@ -24,6 +24,11 @@ {{ $t('user')}} + + {{ $t('household')}} + + + \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js index 297642c24..249cd7d41 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js @@ -151,6 +151,10 @@ const appMessages = { placeholder: "Choisir un métier", not_valid: "Sélectionnez un métier du référent" }, + startdate: { + change: "Modifier la date de début", + date: "Date de début", + }, // catch errors 'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.", 'Error while retriving AccompanyingPeriod Course.': "Erreur du serveur lors du chargement du parcours d'accompagnement.", diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index 7a353c828..ea8f3f556 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -8,6 +8,7 @@ import { getAccompanyingCourse, import { patchPerson } from "ChillPersonAssets/vuejs/_api/OnTheFly"; import { patchThirdparty } from "ChillThirdPartyAssets/vuejs/_api/OnTheFly"; import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; +import { datetimeToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js'; const debug = process.env.NODE_ENV !== 'production'; @@ -282,6 +283,10 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou if (scopeIds.includes(scope.id)) { state.scopesAtBackend = state.scopesAtBackend.filter(s => s.id !== scope.id); } + }, + updateStartDate(state, date) { + console.log('new state date', date) + state.accompanyingCourse.openingDate = date; } }, actions: { @@ -711,15 +716,30 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou throw error; }) }, + updateStartDate({commit}, payload) { + console.log('payload', payload) + const date = ISOToDate(payload); + const url = `/api/1.0/person/accompanying-course/${id}.json`; + const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(date) }}; + console.log('body', body) + return makeFetch('PATCH', url, body) + .then((response) => { + commit('updateStartDate', response.openingDate); + }) + .catch((error) => { + commit('catchError', error); + throw error; + }) + }, async fetchReferrersSuggested({ state, commit}) { let users = await getReferrersSuggested(state.accompanyingCourse); commit('setReferrersSuggested', users); commit('setFilteredReferrersSuggested'); if ( - null === state.accompanyingCourse.user - && !state.accompanyingCourse.confidential - && !state.accompanyingCourse.step === 'DRAFT' - && users.length === 1 + null === state.accompanyingCourse.user + && !state.accompanyingCourse.confidential + && !state.accompanyingCourse.step === 'DRAFT' + && users.length === 1 ) { // set the user if unique commit('updateReferrer', users[0]); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 74ed0467c..503a00c59 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -5,7 +5,7 @@
    -
    +

    {{ $t('pick_social_issue_linked_with_action') }}

    {{ si.text }} @@ -33,7 +33,7 @@
    -
    +

    {{ $t('pick_an_action') }}

    -
    +

    {{ $t('persons_involved') }}

    • - - +
      + + +
    -
    + +
    +
    + +
    + +
    -
    + +
    + +
    + +
    +
    -

    {{ $t('form_has_errors') }}

    @@ -111,7 +128,7 @@ import { mapState, mapActions, mapGetters } from 'vuex'; import VueMultiselect from 'vue-multiselect'; import { dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js'; -import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue'; +import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; const i18n = { messages: { @@ -133,7 +150,7 @@ export default { name: 'App', components: { VueMultiselect, - PersonRenderBox, + PersonText, }, methods: { submit() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index e43608895..5237dc7e2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -141,10 +141,12 @@
    • -
    @@ -281,6 +283,7 @@ import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue'; import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue'; import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue'; +import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; const i18n = { messages: { @@ -329,7 +332,8 @@ export default { ThirdPartyRenderBox, PickTemplate, PickWorkflow, - OnTheFly + OnTheFly, + PersonText, }, i18n, data() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue index 74271954f..57d9ee3aa 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue @@ -11,7 +11,7 @@
    • - {{ c.person.text }} +
    @@ -57,12 +57,14 @@ import { mapState, mapGetters } from 'vuex'; import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'; import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue'; +import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; export default { name: 'Concerned', components: { AddPersons, PersonRenderBox, + PersonText, }, computed: { ...mapState([ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Household.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Household.vue index 493092d81..5a8fe9c8d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Household.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Household.vue @@ -61,6 +61,16 @@
  • +
  • + + +
  • @@ -77,16 +87,30 @@ import { mapGetters, mapState } from 'vuex'; import HouseholdRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/HouseholdRenderBox.vue'; import CurrentHousehold from './CurrentHousehold'; +import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons'; export default { name: 'Household', components: { + AddPersons, CurrentHousehold, HouseholdRenderBox, }, emits: ['readyToGo'], data() { return { + addPersons: { + key: 'household_find', + options: { + type: ['household'], + priority: null, + uniq: true, + button: { + size: 'btn-sm', + type: 'btn-search', + } + } + }, addAddress: { key: 'household_new', options: { @@ -166,6 +190,13 @@ export default { this.$store.dispatch('selectHousehold', h); this.$emit('readyToGo'); }, + pickHouseholdFound({selected, modal}) { + selected.forEach(function(item) { + this.selectHousehold(item.result); + }, this); + this.$refs.pickHousehold.resetSearch(); // to cast child method + modal.showModal = false; + }, removeHouseholdAddress() { this.$store.commit('removeHouseholdAddress'); }, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue index 487fb230e..005d46122 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue @@ -6,12 +6,13 @@
    -

    {{ conc.person.text }}

    + +

    @@ -34,6 +39,7 @@ import SuggestionPerson from './TypePerson'; import SuggestionThirdParty from './TypeThirdParty'; import SuggestionUser from './TypeUser'; +import SuggestionHousehold from './TypeHousehold'; export default { name: 'PersonSuggestion', @@ -41,6 +47,7 @@ export default { SuggestionPerson, SuggestionThirdParty, SuggestionUser, + SuggestionHousehold, }, props: [ 'item', @@ -70,7 +77,7 @@ export default { }; -