From 8de37a9ef3298dfeef10c9daa4c436c797889944 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 11 Apr 2024 16:45:22 +0200 Subject: [PATCH 01/28] Fix import of postal codes. URL changed + names of keys --- .../Service/Import/PostalCodeFRFromOpenData.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index e5934af3b..c073e5bdb 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -23,7 +23,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; */ class PostalCodeFRFromOpenData { - private const CSV = 'https://datanova.laposte.fr/data-fair/api/v1/datasets/laposte-hexasmal/data-files/019HexaSmal.csv'; + private const CSV = 'https://datanova.laposte.fr/data-fair/api/v1/datasets/laposte-hexasmal/metadata-attachments/base-officielle-codes-postaux.csv'; public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) { @@ -50,7 +50,7 @@ class PostalCodeFRFromOpenData fseek($tmpfile, 0); $csv = Reader::createFromStream($tmpfile); - $csv->setDelimiter(';'); + $csv->setDelimiter(','); $csv->setHeaderOffset(0); foreach ($csv as $offset => $record) { @@ -65,23 +65,23 @@ class PostalCodeFRFromOpenData private function handleRecord(array $record): void { - if ('' !== trim($record['coordonnees_geographiques'] ?? $record['coordonnees_gps'])) { - [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['coordonnees_geographiques'] ?? $record['coordonnees_gps'])); + if ('' !== trim($record['_geopoint'])) { + [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['_geopoint'])); } else { $lat = $lon = 0.0; } - $ref = trim((string) $record['Code_commune_INSEE']); + $ref = trim((string) $record['code_commune_insee']); if (str_starts_with($ref, '987')) { // some differences in French Polynesia - $ref .= '.'.trim((string) $record['Libellé_d_acheminement']); + $ref .= '.'.trim((string) $record['libelle_d_acheminement']); } $this->baseImporter->importCode( 'FR', - trim((string) $record['Libellé_d_acheminement']), - trim((string) $record['Code_postal']), + trim((string) $record['libelle_d_acheminement']), + trim((string) $record['code_postal']), $ref, 'INSEE', $lat, From e8b95f8491252e64050e9630998930eef3b2b419 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 11 Apr 2024 16:45:43 +0200 Subject: [PATCH 02/28] Add changie for fix import postal codes --- .changes/unreleased/Fixed-20240411-164104.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/unreleased/Fixed-20240411-164104.yaml diff --git a/.changes/unreleased/Fixed-20240411-164104.yaml b/.changes/unreleased/Fixed-20240411-164104.yaml new file mode 100644 index 000000000..aa63f022a --- /dev/null +++ b/.changes/unreleased/Fixed-20240411-164104.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: 'Postal codes import : fix the source URL and the keys to handle each record' +time: 2024-04-11T16:41:04.786062252+02:00 +custom: + Issue: "250" From dbb9feb12980f474698dd42a05f6a88bd73c1993 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 12 Apr 2024 12:35:52 +0200 Subject: [PATCH 03/28] rector correction: cast value to string --- .../Service/Import/PostalCodeFRFromOpenData.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index c073e5bdb..e40b4dff9 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -65,8 +65,8 @@ class PostalCodeFRFromOpenData private function handleRecord(array $record): void { - if ('' !== trim($record['_geopoint'])) { - [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['_geopoint'])); + if ('' !== trim((string) $record['_geopoint'])) { + [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', (string) $record['_geopoint'])); } else { $lat = $lon = 0.0; } From 4091efc72ec308931fcb3d0d740c0895b9c6ff6e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 12 Apr 2024 12:58:23 +0200 Subject: [PATCH 04/28] Update bundles version to 2.18.2 --- .changes/unreleased/Fixed-20240411-164104.yaml | 5 ----- .changes/v2.18.2.md | 3 +++ CHANGELOG.md | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 .changes/unreleased/Fixed-20240411-164104.yaml create mode 100644 .changes/v2.18.2.md diff --git a/.changes/unreleased/Fixed-20240411-164104.yaml b/.changes/unreleased/Fixed-20240411-164104.yaml deleted file mode 100644 index aa63f022a..000000000 --- a/.changes/unreleased/Fixed-20240411-164104.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: Fixed -body: 'Postal codes import : fix the source URL and the keys to handle each record' -time: 2024-04-11T16:41:04.786062252+02:00 -custom: - Issue: "250" diff --git a/.changes/v2.18.2.md b/.changes/v2.18.2.md new file mode 100644 index 000000000..42eff9e25 --- /dev/null +++ b/.changes/v2.18.2.md @@ -0,0 +1,3 @@ +## v2.18.2 - 2024-04-12 +### Fixed +* ([#250](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/250)) Postal codes import : fix the source URL and the keys to handle each record diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0a6b008..ae9407c8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## v2.18.2 - 2024-04-12 +### Fixed +* ([#250](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/250)) Postal codes import : fix the source URL and the keys to handle each record + ## v2.18.1 - 2024-03-26 ### Fixed * Fix layout issue in document generation for admin (minor) From 8516e89c9cac8b8be16a581ef9a55bafef03e9d7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 17 Apr 2024 16:16:56 +0200 Subject: [PATCH 05/28] update docs to include import of countries which is necessary to be able to import addresses --- docs/source/installation/load-addresses.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/installation/load-addresses.rst b/docs/source/installation/load-addresses.rst index 779032fd0..85c29d618 100644 --- a/docs/source/installation/load-addresses.rst +++ b/docs/source/installation/load-addresses.rst @@ -8,6 +8,16 @@ Chill can store a list of geolocated address references, which are used to sugge Those addresses may be load from a dedicated source. +Countries +========= + +In order to load addresses into the chill application we first have to make sure that a list of countries is present. +To import the countries run the following command. + +.. code-block:: bash + + bin/console chill:main:countries:populate + In France ========= From ab6feef371eda7885bd6ab80967389fb754303ef Mon Sep 17 00:00:00 2001 From: juminet Date: Thu, 18 Apr 2024 07:37:05 +0000 Subject: [PATCH 06/28] Do not display evaluation from closed accompanying period on homepage --- .changes/unreleased/Fixed-20240416-161817.yaml | 6 ++++++ .../AccompanyingPeriodWorkEvaluationRepository.php | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 .changes/unreleased/Fixed-20240416-161817.yaml diff --git a/.changes/unreleased/Fixed-20240416-161817.yaml b/.changes/unreleased/Fixed-20240416-161817.yaml new file mode 100644 index 000000000..6884c11fe --- /dev/null +++ b/.changes/unreleased/Fixed-20240416-161817.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Fix broken link in homepage when a evaluation from a closed acc period was present + in the homepage widget +time: 2024-04-16T16:18:17.888645172+02:00 +custom: + Issue: "270" diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php index 9c6ed19fc..6110f8bb0 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Repository\AccompanyingPeriod; use Chill\MainBundle\Entity\User; +use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; use Doctrine\ORM\EntityManagerInterface; @@ -88,6 +89,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository ->where( $qb->expr()->andX( $qb->expr()->isNull('e.endDate'), + $qb->expr()->neq('period.step', ':closed'), $qb->expr()->gte(':now', $qb->expr()->diff('e.maxDate', 'e.warningInterval')), $qb->expr()->orX( $qb->expr()->eq('period.user', ':user'), @@ -100,6 +102,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository ->setParameters([ 'user' => $user, 'now' => new \DateTimeImmutable('now'), + 'closed' => AccompanyingPeriod::STEP_CLOSED, ]); return $qb; From 800a952532b3c87a9246a1f6f900c879f90be77a Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Tue, 23 Apr 2024 20:41:32 +0200 Subject: [PATCH 07/28] Add base template --- .../Resources/public/vuejs/TicketApp/App.vue | 90 ++++++++++--------- .../components/ActionToolbarComponent.vue | 59 ++++++++++++ .../TicketApp/components/BannerComponent.vue | 65 ++++++++++++++ .../components/MotiveListComponent.vue | 43 +++++++++ .../components/TicketHistoryListComponent.vue | 61 +++++++++++++ .../components/TicketSelectorComponent.vue | 42 +++++++++ .../public/vuejs/TicketApp/i18n/messages.ts | 11 ++- .../Resources/public/vuejs/TicketApp/index.ts | 3 +- .../src/Resources/views/layout.html.twig | 6 +- 9 files changed, 330 insertions(+), 50 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/BannerComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveListComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index b6e28952e..cfe0b31bc 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -1,59 +1,65 @@ - - + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue new file mode 100644 index 000000000..96741bb34 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -0,0 +1,59 @@ + + + + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/BannerComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/BannerComponent.vue new file mode 100644 index 000000000..31c2f9f63 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/BannerComponent.vue @@ -0,0 +1,65 @@ + + + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveListComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveListComponent.vue new file mode 100644 index 000000000..12ae6705b --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveListComponent.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue new file mode 100644 index 000000000..42f5b071b --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue new file mode 100644 index 000000000..7d1326513 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts index 4065765f3..9bc5d751c 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts @@ -1,5 +1,12 @@ export const messages = { fr: { - hello: "Bonjour {name}" - } + ticket: { + previous_tickets: "Précédents tickets", + }, + history: { + person: "Ouverture par appel téléphonique de {text}", + user: "Prise en charge par {username}", + motive: "Motif indiqué: {motive}", + }, + }, }; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts index c63968469..e6f9011b0 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts @@ -2,12 +2,13 @@ import App from './App.vue'; import {createApp} from "vue"; import { _createI18n } from "../../../../../../ChillMainBundle/Resources/public/vuejs/_js/i18n"; -import {messages} from "./i18n/messages"; + import VueToast from 'vue-toast-notification'; import 'vue-toast-notification/dist/theme-sugar.css'; import { store } from "./store"; +import { messages } from './i18n/messages'; declare global { interface Window { diff --git a/src/Bundle/ChillTicketBundle/src/Resources/views/layout.html.twig b/src/Bundle/ChillTicketBundle/src/Resources/views/layout.html.twig index 7b397a0e5..8936d1c31 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/views/layout.html.twig +++ b/src/Bundle/ChillTicketBundle/src/Resources/views/layout.html.twig @@ -13,9 +13,5 @@ {% endblock %} {% block wrapping_content %} -
-
- {% block content %}{% endblock %} -
-
+ {% block content %}{% endblock %} {% endblock %} From 2a1963e993c3a53080e954ce839ba58d5df52dfb Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 25 Apr 2024 10:36:45 +0200 Subject: [PATCH 08/28] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20l'interface?= =?UTF-8?q?=20utilisateur=20pour=20le=20composant=20ActionToolbarComponent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/public/vuejs/TicketApp/App.vue | 2 +- .../components/ActionToolbarComponent.vue | 54 +++++++++++++++---- .../components/MotiveSelectorComponent.vue | 42 +++++++++++++++ .../components/TicketSelectorComponent.vue | 6 +-- .../Resources/public/vuejs/TicketApp/index.ts | 1 - 5 files changed, 89 insertions(+), 16 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveSelectorComponent.vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index cfe0b31bc..b44e84dc8 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -1,6 +1,6 @@ @@ -22,7 +21,6 @@ import TicketSelectorComponent from './components/TicketSelectorComponent.vue'; import TicketHistoryListComponent from './components/TicketHistoryListComponent.vue'; import ActionToolbarComponent from './components/ActionToolbarComponent.vue'; import BannerComponent from './components/BannerComponent.vue'; -import MotiveListComponent from './components/MotiveListComponent.vue'; export default defineComponent({ name: 'App', @@ -30,7 +28,6 @@ export default defineComponent({ BannerComponent, TicketSelectorComponent, TicketHistoryListComponent, - MotiveListComponent, ActionToolbarComponent }, setup() { @@ -44,8 +41,6 @@ export default defineComponent({ const ticket = computed(() => store.getters.getTicket as Ticket) onMounted(() => { - console.log(headline.value.textContent); - try { store.dispatch('fetchMotives') } catch (error) { diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index f53447c8a..2c5fc284d 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -4,29 +4,43 @@
- - + +
+ +
-
- -

This is the Transfert tab pane content.

+
+ + +
+ +
-
- -

This is the Motif tab pane content.

-
-
- -

This is the Fermer tab pane content.

+
+ +
+ +
+
+ +
-
diff --git a/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml b/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml index 6f2c57afa..bcc75537e 100644 --- a/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml +++ b/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml @@ -3,3 +3,4 @@ caller: Appelant speaker: Intervenant open: Ouvert since: Depuis +no_motive: Pas de motif From 7b8cd90cf17eda4f2beefe01394d99a014aeffec Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 12:03:10 +0200 Subject: [PATCH 15/28] Add user store --- .../public/vuejs/TicketApp/store/index.ts | 5 +- .../vuejs/TicketApp/store/modules/ticket.ts | 2 - .../vuejs/TicketApp/store/modules/user.ts | 70 +++++++++++++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts index 82dd600a9..61c13b9b9 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts @@ -1,12 +1,14 @@ import { createStore } from "vuex"; import { State as MotiveStates, moduleMotive } from "./modules/motive"; import { State as TicketStates, moduleTicket } from "./modules/ticket"; -import { State as CommentStates, moduleComment } from "./modules/comment"; +import { State as CommentStates, moduleComment } from "./modules/comment"; +import { State as UserStates, moduleUser } from "./modules/user"; export type RootState = { motive: MotiveStates; ticket: TicketStates; comment: CommentStates; + user: UserStates; }; export const store = createStore({ @@ -14,6 +16,7 @@ export const store = createStore({ motive:moduleMotive, ticket:moduleTicket, comment:moduleComment, + user:moduleUser, } }); diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts index 4e3a55762..c02b520eb 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts @@ -1,5 +1,3 @@ -import { fetchResults, makeFetch } from "../../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods"; - import { Module } from "vuex"; import { RootState } from ".."; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts new file mode 100644 index 000000000..5fa9e8be1 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts @@ -0,0 +1,70 @@ +import { + fetchResults, + makeFetch, +} from "../../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods"; + +import { Module } from "vuex"; +import { RootState } from ".."; + +import { + User, + UserGroup, + UserGroupOrUser, +} from "../../../../../../../../ChillMainBundle/Resources/public/types"; + +export interface State { + userGroups: Array; + users: Array; +} + +export const moduleUser: Module = { + state: () => ({ + userGroups: [] as Array, + users: [] as Array, + }), + getters: { + getUserGroups(state) { + return state.userGroups; + }, + getUsers(state) { + return state.users; + }, + }, + mutations: {}, + actions: { + getUserGroups({ commit }) { + try { + fetchResults("/api/1.0/main/user-group.json").then( + (results) => { + commit("setUserGroups", results); + } + ); + } catch (e: any) { + throw e.name; + } + }, + getUsers({ commit }) { + try { + fetchResults("/1.0/main/user.json").then((results) => { + commit("setUserGroups", results); + }); + } catch (e: any) { + throw e.name; + } + }, + + async setAdressees({ commit }, datas: { ticketId: number; addressees: Array}) { + const { ticketId, addressees } = datas; + try { + const result = await makeFetch( + "POST", + `/api/1.0/ticket/${ticketId}/addressees/set`, + addressees + ); + commit("setTicket", result); + } catch (e: any) { + throw e.name; + } + }, + }, +}; From eb0bf56cff7a1e8df36e6e38ba079efa43c74510 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 13:18:45 +0200 Subject: [PATCH 16/28] Add user group addressee --- .../src/Resources/public/types.ts | 2 +- .../Resources/public/vuejs/TicketApp/App.vue | 6 +- .../components/ActionToolbarComponent.vue | 49 ++++++++++---- .../components/AddresseeSelectorComponent.vue | 65 +++++++++++++++++++ .../components/MotiveSelectorComponent.vue | 10 +-- .../TicketHistoryAddresseeComponent .vue | 30 +++++++++ .../components/TicketHistoryListComponent.vue | 2 + .../public/vuejs/TicketApp/i18n/messages.ts | 1 + .../vuejs/TicketApp/store/modules/motive.ts | 19 +++--- .../vuejs/TicketApp/store/modules/user.ts | 28 ++++++-- .../Resources/views/Banner/banner.html.twig | 12 ++-- 11 files changed, 178 insertions(+), 46 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent .vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts index 2c347977c..9c0d467f8 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts @@ -52,7 +52,7 @@ export interface Comment { updatedAt: DateTime|null, } -interface AddresseeHistory { +export interface AddresseeHistory { type: "ticket_addressee_history", id: number, startDate: DateTime|null, diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index b993caa2f..cf4eff359 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -37,9 +37,11 @@ export default defineComponent({ const motives = computed(() => store.getters.getMotives as Motive[]) const ticket = computed(() => store.getters.getTicket as Ticket) - onMounted(() => { + onMounted(async () => { try { - store.dispatch('fetchMotives') + await store.dispatch('fetchMotives') + await store.dispatch('fetchUserGroups') + await store.dispatch('fetchUsers') } catch (error) { toast.error(error) }; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index 986e466eb..ed38bedae 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -24,19 +24,21 @@
-
- -
+
+ +
+ +
+
- +
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts index f1605c4a5..e320b84e7 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts @@ -10,6 +10,7 @@ const messages = { user: "Prise en charge par {username}", motive: "Motif indiqué: {motive}", comment: "Commentaire: {comment}", + user_group: "Transferer au group: {user_group}", }, comment: { title: "Commentaire", diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts index 296301fc2..1c2696106 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts @@ -20,12 +20,6 @@ export const moduleMotive: Module = { getMotives(state) { return state.motives; }, - getMotiveOptions(state) { - return state.motives.map((motive) => ({ - value: motive.id, - text: motive.label.fr, - })); - }, }, mutations: { setMotives(state, motives) { @@ -39,8 +33,7 @@ export const moduleMotive: Module = { "/api/1.0/ticket/motive.json" )) as Motive[]; commit("setMotives", results); - } - catch(e: any) { + } catch (e: any) { throw e.name; } }, @@ -54,11 +47,15 @@ export const moduleMotive: Module = { const result = await makeFetch( "POST", `/api/1.0/ticket/${ticketId}/motive/set`, - { motive } + { + motive: { + id: motive.id, + type: motive.type, + }, + } ); commit("setTicket", result); - } - catch(e: any) { + } catch (e: any) { throw e.name; } }, diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts index 5fa9e8be1..f4441e34b 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts @@ -30,9 +30,16 @@ export const moduleUser: Module = { return state.users; }, }, - mutations: {}, + mutations: { + setUserGroups(state, userGroups) { + state.userGroups = userGroups; + }, + setUsers(state, users) { + state.users = users; + }, + }, actions: { - getUserGroups({ commit }) { + fetchUserGroups({ commit }) { try { fetchResults("/api/1.0/main/user-group.json").then( (results) => { @@ -43,23 +50,30 @@ export const moduleUser: Module = { throw e.name; } }, - getUsers({ commit }) { + fetchUsers({ commit }) { try { - fetchResults("/1.0/main/user.json").then((results) => { - commit("setUserGroups", results); + fetchResults("/api/1.0/main/user.json").then((results) => { + commit("setUsers", results); }); } catch (e: any) { throw e.name; } }, - async setAdressees({ commit }, datas: { ticketId: number; addressees: Array}) { + async setAdressees( + { commit }, + datas: { ticketId: number; addressees: Array } + ) { const { ticketId, addressees } = datas; try { const result = await makeFetch( "POST", `/api/1.0/ticket/${ticketId}/addressees/set`, - addressees + { + addressees: addressees.map((addressee) => { + return { id: addressee.id, type: addressee.type }; + }), + } ); commit("setTicket", result); } catch (e: any) { diff --git a/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig b/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig index c8a7ff724..46f02d298 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig +++ b/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig @@ -36,7 +36,7 @@

{{'concerned_patient' | trans}}

{% for person in ticket.getPersons() %} - + {{ person.firstName }} {{ person.lastName }} @@ -51,12 +51,10 @@

{{'speaker' | trans}}

{% for addressee in ticket.getCurrentAddressee() %} - - {% if addressee.type=='chill_main_user_group' %} - {{ addressee.label.fr }} - {% else %} - {{ addressee.username }} - {% endif %} + + + {{ addressee.label.fr }} + {% endfor %}

From 1d0045714188f791a42a9fe95fdf68373cd66bda Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 14:09:52 +0200 Subject: [PATCH 17/28] =?UTF-8?q?Ajouter=20les=20propri=C3=A9t=C3=A9s=20cr?= =?UTF-8?q?eatedAt=20et=20updatedBy=20=C3=A0=20l'interface=20Ticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Bundle/ChillTicketBundle/src/Resources/public/types.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts index 9c0d467f8..6d8657f82 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts @@ -80,5 +80,7 @@ export interface Ticket { currentPersons: Person[], currentMotive: null|Motive, history: TicketHistoryLine[], + createdAt: DateTime|null, + updatedBy: User|null, } From 6500c24a7f436ced4bed0f1963c2f6fa7b7564d2 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 14:10:22 +0200 Subject: [PATCH 18/28] =?UTF-8?q?D=C3=A9placer=20le=20r=C3=A9pertoire=20tr?= =?UTF-8?q?anslation=20dans=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChillTicketBundle/{ => src}/translations/messages.fr.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Bundle/ChillTicketBundle/{ => src}/translations/messages.fr.yaml (100%) diff --git a/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml b/src/Bundle/ChillTicketBundle/src/translations/messages.fr.yaml similarity index 100% rename from src/Bundle/ChillTicketBundle/translations/messages.fr.yaml rename to src/Bundle/ChillTicketBundle/src/translations/messages.fr.yaml From 473765366a6c72f1bc78f2ec98272e095af8a647 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Mon, 6 May 2024 16:38:56 +0200 Subject: [PATCH 19/28] Add tranfert with AddPerson --- .../components/ActionToolbarComponent.vue | 10 +- .../components/AddresseeSelectorComponent.vue | 184 ++++++++++++++++-- .../TicketHistoryAddresseeComponent .vue | 30 --- .../TicketHistoryAddresseeComponent.vue | 48 +++++ .../components/TicketHistoryListComponent.vue | 67 ++++--- .../TicketHistoryPersonComponent.vue | 20 +- .../public/vuejs/TicketApp/i18n/messages.ts | 6 +- 7 files changed, 275 insertions(+), 90 deletions(-) delete mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent .vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent.vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index ed38bedae..d188bdab0 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -24,9 +24,9 @@
- + -
+
From f0045edd6c5cf9289c8bb9257de1b9a2a84d0adf Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Mon, 13 May 2024 12:33:11 +0200 Subject: [PATCH 28/28] FIX: Ouvert depuis --- .../src/Resources/public/vuejs/TicketApp/App.vue | 7 ++++--- .../src/Resources/public/vuejs/TicketApp/i18n/messages.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index 6a7ee99f0..305e22896 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -22,7 +22,7 @@

{{ $t("banner.since", { - days: getSince(ticket.createdAt), + count: getSince(ticket.createdAt), }) }}

@@ -128,9 +128,10 @@ export default defineComponent({ () => store.getters.getDistinctAddressesHistory ); - function getSince(createdAt: DateTime) { + function getSince(createdAt: any) { const today = new Date(); - const date = new Date(createdAt.datetime); + const date = new Date(createdAt.date); + const timeDiff = Math.abs(today.getTime() - date.getTime()); const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)); return daysDiff; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts index 219c834bf..7175a7fe3 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts @@ -42,7 +42,7 @@ const messages = { caller: "Appelant", speaker: "Intervenant", open: "Ouvert", - since: "Depuis 1 jour | Depuis {days} jour(s)", + since: "Aucun jour | Depuis 1 jour | Depuis {count} jours", no_motive: "Pas de motif", }, },