diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 295eb3e0e..68b1bcf08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,9 @@ before_script: - curl -sS https://getcomposer.org/installer | php - php -d memory_limit=2G composer.phar install - php tests/app/bin/console doctrine:migrations:migrate -n - - php -d memory_limit=2G tests/app/bin/console doctrine:fixtures:load -n + - php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev + - php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n + - php -d memory_limit=2G tests/app/bin/console cache:clear --env=test - echo "before_script finished" # Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service diff --git a/.gitlab/merge_request_templates/Default merge request.md b/.gitlab/merge_request_templates/Default merge request.md new file mode 100644 index 000000000..5d62f91eb --- /dev/null +++ b/.gitlab/merge_request_templates/Default merge request.md @@ -0,0 +1,24 @@ + +# Description of changes + + + + +# Issues related + + + +* ... +* ... + +# Tests + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 94171e999..9c7821987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,17 @@ and this project adheres to ## Unreleased + * [activity] Bugfix: documents can now be added to an activity. +* [tasks] improve tasks with filter order +* [tasks] refactor singleControllerTasks: limit the number of conditions from the context +* [validations] validation of accompanying period added: no duplicate participations or resources (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/60). +* [renderbox] If gender of person is not defined, no icon is displayed instead of neuter-icon (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/129). +* [confidential information] module added to blur confidential information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/248). +* refactor `AuthorizationHelper` and `UserACLAwareRepository` to fix constructor, and separate logic for parent role helper into `ParentRoleHelper` +* [main]: filter location and locationType in backend: exclude NULL names, only active and availableToUsers +* [activity]: perform client-side validation & show/hide fields in the "new location" modal +* [admin]: links to activity admin section added again. ## Test releases diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 19d53c262..5ef08832d 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -313,7 +313,7 @@ class ActivityType extends AbstractType } return $location->getId(); }, - function (?string $id): Location { + function (?string $id): ?Location { return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]); } )) diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php new file mode 100644 index 000000000..ce7618b6d --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -0,0 +1,48 @@ +security = $security; + } + + public static function getMenuIds(): array + { + return ['admin_index', 'admin_section', 'admin_activity']; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->security->isGranted('ROLE_ADMIN')) { + return; + } + + if (in_array($menuId, ['admin_index', 'admin_section'])) { + $menu->addChild('Activities', [ + 'route' => 'chill_admin_activity_index' + ]) + ->setExtras([ + 'order' => 2000, + 'explain' => "Activity configuration" + ]); + } else { + $menu + ->addChild('Activities', [ + 'route' => 'chill_admin_activity_index' + ]) + ->setExtras([ + 'order' => '60' + ]); + } + } +} \ No newline at end of file diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue index 0dbf2652a..c8d1472bd 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue @@ -20,7 +20,7 @@ v-model="location"> - + @@ -30,7 +30,7 @@ import { mapState } from "vuex"; import VueMultiselect from 'vue-multiselect'; import NewLocation from './Location/NewLocation.vue'; -import { getLocations, postLocation } from '../api.js'; +import { getLocations } from '../api.js'; export default { name: "Location", @@ -66,30 +66,7 @@ export default { })) }, customLabel(value) { - return `${value.locationType.title.fr} ${value.name}`; - }, - saveNewLocation(selected) { - console.log('saveNewLocation', selected); - let body = { - type: 'location', - name: selected.name, - address: { - id: selected.addressId - }, - locationType: { - id: selected.type, - type: 'location-type' - }, - phonenumber1: selected.phonenumber1, - phonenumber2: selected.phonenumber2, - email: selected.email, - } - postLocation(body).then(location => new Promise(resolve => { - console.log('postLocation', location); - this.locations.push(location); - this.$store.dispatch('updateLocation', location); - resolve(); - })); + return `${value.locationType.title.fr} ${value.name ? value.name : ''}`; } } } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue index 3ffb2a33f..2920e15b2 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue @@ -1,75 +1,87 @@ + + + + + {{ $t('activity.create_new_location') }} + + + - - - - {{ $t('activity.create_new_location') }} - - - + + - - + + {{ $t('activity.create_new_location') }} + + + + + + {{ $t('activity.errors') }} + + {{ error }} + + + - - {{ $t('activity.create_new_location') }} - - + + + {{ $t('activity.choose_location_type') }} + + {{ t.title.fr }} + + + {{ $t('activity.location_fields.type') }} + - - + + + {{ $t('activity.location_fields.name') }} + - - - {{ $t('activity.location_fields.name') }} - + + - - - {{ $t('activity.choose_location_type') }} - - {{ t.title.fr }} - - - {{ $t('activity.location_fields.type') }} - + + + {{ $t('activity.location_fields.phonenumber1') }} + + + + {{ $t('activity.location_fields.phonenumber2') }} + + + + {{ $t('activity.location_fields.email') }} + + + + + + {{ $t('action.save') }} + + - - - {{ $t('activity.location_fields.phonenumber1') }} - - - - {{ $t('activity.location_fields.phonenumber2') }} - - - - {{ $t('activity.location_fields.email') }} - - - - - - {{ $t('action.save') }} - - - - - + + +
+ {{ $t('activity.errors') }} +