From 34b3c6fa327a40c99c7507ebcd24ca9f753aa18b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Mar 2022 14:15:20 +0100 Subject: [PATCH 01/71] bugfix when position of member is null --- .../vuejs/_components/Entity/HouseholdRenderBox.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue index 16d0fa2ff..163f49bcf 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue @@ -87,10 +87,14 @@ export default { currentMembers() { let members = this.household.members.filter(m => this.household.current_members_id.includes(m.id)) .sort((a, b) => { - if (a.position.ordering < b.position.ordering) { + + const orderA = a.position ? a.position.ordering : 0; + const orderB = b.position ? b.position.ordering : 0; + + if (orderA < orderB) { return -1; } - if (a.position.ordering > b.position.ordering) { + if (orderA > orderB) { return 1; } if (a.holder && !b.holder) { From 349db2142defe9cc6845e8ca7e7244997740da37 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 14:39:00 +0100 Subject: [PATCH 02/71] person: add url field to SocialWork Evaluation entity + populate with http title values --- .../Entity/SocialWork/Evaluation.php | 18 +++++++++ .../migrations/Version20220303113855.php | 38 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php index 1350ae6d8..9349c335e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -62,6 +62,12 @@ class Evaluation */ private array $title = []; + /** + * @ORM\Column(type="text", nullable=true) + * @Serializer\Groups({"read", "docgen:read"}) + */ + private ?string $url = null; + public function __construct() { $this->socialActions = new ArrayCollection(); @@ -101,6 +107,11 @@ class Evaluation return $this->title; } + public function getUrl(): ?string + { + return $this->url; + } + public function removeSocialAction(SocialAction $socialAction): self { if ($this->socialActions->contains($socialAction)) { @@ -130,4 +141,11 @@ class Evaluation return $this; } + + public function setUrl(?string $url): self + { + $this->url = $url; + + return $this; + } } diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php b/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php new file mode 100644 index 000000000..9991d2eca --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php @@ -0,0 +1,38 @@ +addSql('ALTER TABLE chill_person_social_work_evaluation ADD url TEXT DEFAULT NULL'); + $this->addSql("UPDATE chill_person_social_work_evaluation SET url = CASE WHEN title->>'fr' LIKE 'http%' THEN title->>'fr' ELSE null END;"); + } + + public function down(Schema $schema): void + { + + $this->addSql('ALTER TABLE chill_person_social_work_evaluation DROP url'); + } +} From 568a1d95f46544fff7040710359b5fd7ea91a634 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 15:10:05 +0100 Subject: [PATCH 03/71] AccompanyingCourseWorkEdit: add url to vuejs form --- .../components/AddEvaluation.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue index 579d0b306..d2b8c5b46 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue @@ -5,6 +5,11 @@ {{ evaluation.evaluation.title.fr }} + +
@@ -128,4 +133,11 @@ export default { } } } + div.item-url { + i { + color: unset!important; + margin-left: 1rem; + margin-right: 0.5rem; + } + } From a88e052eb64f06c4195f9a3b20f319ac291505d3 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 15:12:47 +0100 Subject: [PATCH 04/71] upd CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd743078..7de2c188a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to ## Unreleased +* [person] Add url in accompanying period work evaluations entity and form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/476) + + * [parcours] Toggle emergency/intensity only by referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442) * [docstore] Add an API entrypoint for StoredObject (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) * [person] Add the possibility of uploading existing documents to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) From c5eac09478e1b9bed3369182ce351f64420a0366 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 15:17:05 +0100 Subject: [PATCH 05/71] php cs fix on migration --- .../migrations/Version20220303113855.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php b/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php index 9991d2eca..7840cdfce 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php @@ -15,10 +15,15 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; /** - * Add url to SocialWork Evaluation + * Add url to SocialWork Evaluation. */ final class Version20220303113855 extends AbstractMigration { + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_social_work_evaluation DROP url'); + } + public function getDescription(): string { return 'Add url to SocialWork Evaluation'; @@ -29,10 +34,4 @@ final class Version20220303113855 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_social_work_evaluation ADD url TEXT DEFAULT NULL'); $this->addSql("UPDATE chill_person_social_work_evaluation SET url = CASE WHEN title->>'fr' LIKE 'http%' THEN title->>'fr' ELSE null END;"); } - - public function down(Schema $schema): void - { - - $this->addSql('ALTER TABLE chill_person_social_work_evaluation DROP url'); - } } From 892be425807ff901efcd593c764bab132cfd46ab Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Mar 2022 16:28:31 +0100 Subject: [PATCH 06/71] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd743078..8dd9bbbe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to * [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue) * [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474) * [template] do not list inactive templates (for doc generator) +* [household] bugfix if position of member is null, renderbox no longer throws an error (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/480) ## Test releases From 187c9d82b6cd499bc56547ab8f061042d71b4656 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 16:37:58 +0100 Subject: [PATCH 07/71] assign User to undsipatched acc period: filter users by job type --- .../public/mod/AccompanyingPeriod/setReferrer.js | 13 ++++++------- .../_components/AccompanyingPeriod/SetReferrer.vue | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js b/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js index b73c0afea..939075380 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js @@ -19,22 +19,21 @@ import {fetchResults} from 'ChillMainAssets/lib/api/apiMethods.js'; */ document.querySelectorAll('[data-set-referrer-app]').forEach(function (el) { - let - periodId = Number.parseInt(el.dataset.setReferrerAccompanyingPeriodId); - + const periodId = Number.parseInt(el.dataset.setReferrerAccompanyingPeriodId); + const jobId = Number.parseInt(el.dataset.setReferrerJobId); const url = `/api/1.0/person/accompanying-course/${periodId}/referrers-suggested.json`; fetchResults(url).then(suggested => { - + const filteredSuggested = suggested.filter((s) => s.user_job ? s.user_job.id === jobId : false); const app = createApp({ components: { SetReferrer, }, template: - '', + '', data() { return { - periodId, suggested, original: suggested, + periodId, filteredSuggested, original: filteredSuggested, } }, methods: { @@ -56,7 +55,7 @@ document.querySelectorAll('[data-set-referrer-app]').forEach(function (el) { label.textContent = ref.text; label.classList.remove('chill-no-data-statement'); - this.suggested = this.original.filter(user => user.id !== ref.id); + this.filteredSuggested = this.original.filter(user => user.id !== ref.id); } } }); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue index 3d3675c73..38418f305 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue @@ -1,12 +1,12 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig index 54a0b86b7..3dfc27d2f 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig @@ -59,7 +59,7 @@ must be shown in such list #} {%- if render == 'list' -%} -
  • +
  • {% if options['with_picto'] %} {% endif %} @@ -68,7 +68,7 @@ {%- endif -%} {%- if render == 'inline' -%} - + {% if options['with_picto'] %} {% endif %} @@ -77,7 +77,7 @@ {%- endif -%} {%- if render == 'bloc' -%} -
    +
    {% if options['has_no_address'] == true and address.isNoAddress == true %} {% if address.postCode is not empty %}
    diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index 92542f178..fba0516a7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -33,6 +33,8 @@ div.banner { padding-top: 1em; padding-bottom: 1em; div.contact { + display: flex; + align-content: center; & > * { margin-right: 1em; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue index 713693605..7cf0dcecc 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue @@ -9,7 +9,7 @@ {{ $t('requestor.is_anonymous') }} - + @@ -12,28 +12,24 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig index 54a0b86b7..3dfc27d2f 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig @@ -59,7 +59,7 @@ must be shown in such list #} {%- if render == 'list' -%} -
  • +
  • {% if options['with_picto'] %} {% endif %} @@ -68,7 +68,7 @@ {%- endif -%} {%- if render == 'inline' -%} - + {% if options['with_picto'] %} {% endif %} @@ -77,7 +77,7 @@ {%- endif -%} {%- if render == 'bloc' -%} -
    +
    {% if options['has_no_address'] == true and address.isNoAddress == true %} {% if address.postCode is not empty %}
    diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index 92542f178..fba0516a7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -33,6 +33,8 @@ div.banner { padding-top: 1em; padding-bottom: 1em; div.contact { + display: flex; + align-content: center; & > * { margin-right: 1em; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue index 713693605..7cf0dcecc 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue @@ -9,7 +9,7 @@ {{ $t('requestor.is_anonymous') }} - +