From 63d0a52ea1f2a56f688146b4a5aafb712b3e5657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Jul 2025 14:06:40 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20commentaires=20suppl=C3=A9mentaire?= =?UTF-8?q?s=20aux=20motifs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unreleased/Feature-20240530-160003.yaml | 6 + .../unreleased/Feature-20240531-190242.yaml | 6 + .editorconfig | 8 +- .eslint-baseline.json | 902 +++----- .prettierrc | 4 + .vscode/launch.json | 30 + .vscode/tasks.json | 23 + CONVENTIONS-fr.md | 2 +- composer.json | 1 + config/bundles.php | 1 + config/packages/chill_ticket.yaml | 4 + .../packages/doctrine_migrations_chill.yaml | 1 + config/routes/chill_ticket.yaml | 2 + .../development/create-a-new-bundle.rst | 98 +- package.json | 4 +- phpunit.xml.dist | 4 + .../Resources/public/vuejs/Activity/App.vue | 20 +- .../Activity/components/ConcernedGroups.vue | 461 ++-- .../ConcernedGroups/PersonBadge.vue | 38 +- .../ConcernedGroups/PersonsBloc.vue | 54 +- .../vuejs/Activity/components/Location.vue | 154 +- .../components/Location/NewLocation.vue | 664 +++--- .../Activity/components/SocialIssuesAcc.vue | 462 ++-- .../SocialIssuesAcc/CheckSocialAction.vue | 74 +- .../SocialIssuesAcc/CheckSocialIssue.vue | 64 +- .../Resources/public/types.ts | 88 +- .../Resources/public/vuejs/Calendar/App.vue | 675 +++--- .../Calendar/Components/CalendarActive.vue | 186 +- .../Resources/public/vuejs/Calendar/api.ts | 42 +- .../Resources/public/vuejs/Calendar/const.ts | 26 +- .../public/vuejs/Calendar/store/utils.ts | 150 +- .../Resources/public/vuejs/Invite/Answer.vue | 208 +- .../public/vuejs/MyCalendarRange/App2.vue | 652 +++--- .../Components/EditLocation.vue | 86 +- .../public/vuejs/MyCalendarRange/i18n.ts | 46 +- .../public/vuejs/MyCalendarRange/index2.ts | 16 +- .../vuejs/MyCalendarRange/store/index.ts | 60 +- .../store/modules/calendarLocals.ts | 172 +- .../store/modules/calendarRanges.ts | 667 +++--- .../store/modules/calendarRemotes.ts | 175 +- .../store/modules/fullcalendar.ts | 132 +- .../MyCalendarRange/store/modules/location.ts | 98 +- .../vuejs/MyCalendarRange/store/modules/me.ts | 26 +- .../CalendarUserSelector.vue | 451 ++-- .../public/vuejs/_components/PickTemplate.vue | 239 ++- .../public/js/async-upload/uploader.ts | 104 +- .../Resources/public/js/generic-doc-api.ts | 8 +- .../public/module/async_upload/index.ts | 187 +- .../public/module/button_download/index.ts | 42 +- .../document_action_buttons_group/index.ts | 118 +- .../Resources/public/types/generic_doc.ts | 54 +- .../Resources/public/types/index.ts | 172 +- .../vuejs/DocumentActionButtonsGroup.vue | 334 ++- .../public/vuejs/DocumentSignature/App.vue | 1472 +++++++------ .../public/vuejs/DocumentSignature/index.ts | 54 +- .../public/vuejs/DropFileWidget/DropFile.vue | 274 ++- .../vuejs/DropFileWidget/DropFileModal.vue | 108 +- .../vuejs/DropFileWidget/DropFileWidget.vue | 122 +- .../Resources/public/vuejs/FileIcon.vue | 70 +- .../StoredObjectButton/ConvertButton.vue | 56 +- .../StoredObjectButton/DesktopEditButton.vue | 116 +- .../StoredObjectButton/DownloadButton.vue | 175 +- .../StoredObjectButton/HistoryButton.vue | 64 +- .../HistoryButton/HistoryButtonList.vue | 70 +- .../HistoryButton/HistoryButtonListItem.vue | 270 ++- .../HistoryButton/HistoryButtonModal.vue | 50 +- .../HistoryButton/RestoreVersionButton.vue | 28 +- .../StoredObjectButton/HistoryButton/api.ts | 40 +- .../StoredObjectButton/WopiEditButton.vue | 56 +- .../vuejs/StoredObjectButton/helpers.ts | 414 ++-- src/Bundle/ChillMainBundle/Entity/User.php | 10 + .../Formatter/SpreadsheetListFormatter.php | 2 + .../Phonenumber/PhonenumberHelper.php | 18 + .../Resources/public/chill/js/date.ts | 208 +- .../Resources/public/lib/api/address.ts | 64 +- .../Resources/public/lib/api/apiMethods.ts | 388 ++-- .../Resources/public/lib/api/export.ts | 20 +- .../Resources/public/lib/api/locations.ts | 4 +- .../Resources/public/lib/api/return_path.ts | 2 +- .../Resources/public/lib/api/user.ts | 30 +- .../public/lib/entity-notification/api.ts | 28 +- .../public/lib/entity-workflow/api.ts | 22 +- .../localizationHelper/localizationHelper.ts | 54 +- .../public/lib/workflow/attachments.ts | 20 +- .../public/module/address-details/index.ts | 76 +- .../public/module/ckeditor5/editor_config.ts | 96 +- .../public/module/ckeditor5/index.ts | 46 +- .../public/module/collection/index.ts | 236 +-- .../module/notification/toggle_read_all.ts | 68 +- .../public/module/pick-entity/index.js | 7 +- .../ChillMainBundle/Resources/public/types.ts | 331 +-- .../Resources/public/vuejs/Address/App.vue | 230 +- .../Address/components/ActionButtons.vue | 48 +- .../vuejs/Address/components/AddAddress.vue | 1722 ++++++++------- .../components/AddAddress/AddressMap.vue | 191 +- .../components/AddAddress/AddressMore.vue | 280 +-- .../AddAddress/AddressSelection.vue | 414 ++-- .../components/AddAddress/CitySelection.vue | 459 ++-- .../AddAddress/CountrySelection.vue | 140 +- .../vuejs/Address/components/DatePane.vue | 332 ++- .../vuejs/Address/components/EditPane.vue | 343 ++- .../vuejs/Address/components/ShowPane.vue | 359 ++-- .../vuejs/Address/components/SuggestPane.vue | 155 +- .../public/vuejs/DownloadExport/App.vue | 157 +- .../public/vuejs/DownloadExport/index.ts | 4 +- .../public/vuejs/HomepageWidget/App.vue | 252 ++- .../HomepageWidget/DashboardWidgets/News.vue | 42 +- .../DashboardWidgets/NewsItem.vue | 250 ++- .../HomepageWidget/MyAccompanyingCourses.vue | 175 +- .../public/vuejs/HomepageWidget/MyCustoms.vue | 268 ++- .../vuejs/HomepageWidget/MyEvaluations.vue | 227 +- .../vuejs/HomepageWidget/MyNotifications.vue | 196 +- .../public/vuejs/HomepageWidget/MyTasks.vue | 203 +- .../vuejs/HomepageWidget/MyWorkflows.vue | 30 +- .../vuejs/HomepageWidget/MyWorkflowsTable.vue | 156 +- .../public/vuejs/HomepageWidget/MyWorks.vue | 202 +- .../vuejs/HomepageWidget/TabCounter.vue | 18 +- .../public/vuejs/HomepageWidget/TabTable.vue | 24 +- .../Resources/public/vuejs/OnTheFly/App.vue | 60 +- .../vuejs/OnTheFly/components/Create.vue | 200 +- .../vuejs/OnTheFly/components/OnTheFly.vue | 638 +++--- .../public/vuejs/PickEntity/PickEntity.vue | 391 +++- .../vuejs/PickPostalCode/PickPostalCode.vue | 174 +- .../public/vuejs/SavedExportButtons/App.vue | 8 +- .../Component/GenerateButton.vue | 208 +- .../public/vuejs/SavedExportButtons/index.ts | 6 +- .../public/vuejs/WorkflowAttachment/App.vue | 72 +- .../Component/AttachmentList.vue | 66 +- .../Component/GenericDocItemBox.vue | 10 +- .../Component/PickGenericDoc.vue | 420 ++-- .../Component/PickGenericDocItem.vue | 132 +- .../Component/PickGenericDocModal.vue | 128 +- .../public/vuejs/WorkflowAttachment/index.ts | 177 +- .../AddressDetails/AddressDetailsButton.vue | 82 +- .../AddressDetails/AddressDetailsContent.vue | 28 +- .../AddressDetails/AddressModal.vue | 40 +- .../AddressDetailsGeographicalLayers.vue | 60 +- .../Parts/AddressDetailsMap.vue | 127 +- .../Parts/AddressDetailsRefMatching.vue | 262 ++- .../public/vuejs/_components/BadgeEntity.vue | 99 +- .../CommentEditor/CommentEditor.vue | 136 +- .../public/vuejs/_components/Confidential.vue | 52 +- .../_components/Entity/AddressRenderBox.vue | 218 +- .../Entity/GenderIconRenderBox.vue | 23 +- .../_components/Entity/UserGroupRenderBox.vue | 16 +- .../_components/Entity/UserRenderBoxBadge.vue | 42 +- .../EntityWorkflowVueSubscriber.vue | 126 +- .../EntityWorkflow/ListWorkflow.vue | 209 +- .../EntityWorkflow/ListWorkflowModal.vue | 142 +- .../EntityWorkflow/PickWorkflow.vue | 277 ++- .../public/vuejs/_components/Modal.vue | 128 +- .../NotificationReadAllToggle.vue | 70 +- .../Notification/NotificationReadToggle.vue | 184 +- .../Resources/public/vuejs/_js/i18n.ts | 145 +- .../public/vuejs/i18n/datetimeFormats.ts | 48 +- .../Resources/views/layout.html.twig | 52 +- .../Phonenumber/PhonenumberHelperTest.php | 45 + .../Validator/UserGroupDoNotExcludeTest.php | 91 + .../ChillMainBundle/chill.api.specs.yaml | 25 + .../translations/messages+intl-icu.fr.yaml | 55 + .../translations/messages.fr.yml | 31 + .../Repository/PersonACLAwareRepository.php | 25 + .../PersonACLAwareRepositoryInterface.php | 10 + .../Repository/PersonRepository.php | 39 + .../AccompanyingPeriodWorkSelector.ts | 74 +- .../Resources/public/types.ts | 478 +++-- .../public/vuejs/AccompanyingCourse/App.vue | 194 +- .../components/AdminLocation.vue | 170 +- .../AccompanyingCourse/components/Banner.vue | 257 +-- .../components/Banner/PersonsAssociated.vue | 210 +- .../components/Banner/SocialIssue.vue | 14 +- .../components/Banner/ToggleFlags.vue | 261 ++- .../components/ButtonLocation.vue | 151 +- .../AccompanyingCourse/components/Comment.vue | 302 ++- .../AccompanyingCourse/components/Confirm.vue | 431 ++-- .../components/CourseLocation.vue | 482 +++-- .../components/OriginDemand.vue | 143 +- .../components/PersonsAssociated.vue | 525 +++-- .../PersonsAssociated/ParticipationItem.vue | 431 ++-- .../components/Referrer.vue | 439 ++-- .../components/Requestor.vue | 869 ++++---- .../components/Resources.vue | 321 ++- .../components/Resources/ResourceItem.vue | 444 ++-- .../components/Resources/WriteComment.vue | 182 +- .../AccompanyingCourse/components/Scopes.vue | 93 +- .../components/SocialIssue.vue | 167 +- .../components/StartDate.vue | 137 +- .../components/StickyNav.vue | 350 ++-- .../components/StickyNav/Item.vue | 32 +- .../AccompanyingCourse/components/Test.vue | 277 ++- .../AccompanyingCourseWorkCreate/App.vue | 551 +++-- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 1859 ++++++++--------- .../components/AddEvaluation.vue | 309 ++- .../components/AddResult.vue | 290 ++- .../components/FormEvaluation.vue | 1292 ++++++------ .../vuejs/ExportFormActionGoalResult/App.vue | 834 ++++---- .../vuejs/HouseholdMembersEditor/App.vue | 320 +-- .../components/Concerned.vue | 239 +-- .../components/Confirmation.vue | 46 +- .../components/CurrentHousehold.vue | 80 +- .../components/Dates.vue | 277 ++- .../components/Household.vue | 482 +++-- .../components/HouseholdAddress.vue | 131 +- .../components/MemberDetails.vue | 242 ++- .../components/PersonComment.vue | 38 +- .../components/Positioning.vue | 190 +- .../Resources/public/vuejs/VisGraph/App.vue | 1287 ++++++------ .../_api/{AddPersons.js => AddPersons.ts} | 37 +- ...ccompanyingCourseWorkEvaluationDocument.ts | 10 +- .../AccompanyingPeriod/SetReferrer.vue | 79 +- .../AccompanyingPeriodWorkItem.vue | 92 +- .../AccompanyingPeriodWorkList.vue | 42 +- .../AccompanyingPeriodWorkSelectorModal.vue | 140 +- .../public/vuejs/_components/AddPersons.vue | 954 ++++----- .../AddPersons/PersonSuggestion.vue | 228 +- .../_components/AddPersons/TypeHousehold.vue | 35 +- .../_components/AddPersons/TypePerson.vue | 73 +- .../_components/AddPersons/TypeThirdParty.vue | 223 +- .../vuejs/_components/AddPersons/TypeUser.vue | 52 +- .../_components/AddPersons/TypeUserGroup.vue | 36 +- .../_components/Entity/HouseholdRenderBox.vue | 295 ++- .../_components/Entity/PersonRenderBox.vue | 873 ++++---- .../vuejs/_components/Entity/PersonText.vue | 116 +- .../vuejs/_components/OnTheFly/Person.vue | 960 ++++----- .../Resources/public/vuejs/_js/i18n.ts | 117 +- .../PersonACLAwareRepositoryTest.php | 66 + .../translations/messages+intl-icu.fr.yaml | 56 + .../translations/messages.fr.yml | 45 + .../Repository/ThirdPartyRepository.php | 42 +- .../Resources/public/types.ts | 74 +- .../Entity/ThirdPartyRenderBox.vue | 382 ++-- .../_components/Entity/ThirdPartyText.vue | 38 +- .../vuejs/_components/OnTheFly/ThirdParty.vue | 841 ++++---- .../translations/messages.fr.yml | 13 + .../ChillTicketBundle/chill.api.specs.yaml | 521 +++++ .../ChillTicketBundle/chill.webpack.config.js | 4 + .../UpdateCommentContentCommandHandler.php | 26 + ...eCommentContentCommandHandlerInterface.php | 20 + ...dateCommentDeletedStatusCommandHandler.php | 26 + ...ntDeletedStatusCommandHandlerInterface.php | 20 + .../Comment/UpdateCommentContentCommand.php | 30 + .../UpdateCommentDeletedStatusCommand.php | 27 + .../src/Action/Ticket/AddAddresseeCommand.php | 29 + .../src/Action/Ticket/AddCommentCommand.php | 25 + .../Ticket/AssociateByPhonenumberCommand.php | 19 + .../Ticket/ChangeEmergencyStateCommand.php | 24 + .../src/Action/Ticket/ChangeStateCommand.php | 24 + .../src/Action/Ticket/CreateTicketCommand.php | 19 + .../Handler/AddCommentCommandHandler.php | 33 + .../AssociateByPhonenumberCommandHandler.php | 46 + .../ChangeEmergencyStateCommandHandler.php | 49 + .../Handler/ChangeStateCommandHandler.php | 49 + .../Handler/CreateTicketCommandHandler.php | 37 + .../Handler/ReplaceMotiveCommandHandler.php | 63 + .../Handler/SetAddresseesCommandHandler.php | 56 + .../Handler/SetCallerCommandHandler.php | 50 + .../Handler/SetPersonsCommandHandler.php | 56 + .../Action/Ticket/ReplaceMotiveCommand.php | 25 + .../Action/Ticket/SetAddresseesCommand.php | 40 + .../src/Action/Ticket/SetCallerCommand.php | 29 + .../src/Action/Ticket/SetPersonsCommand.php | 30 + .../src/ChillTicketBundle.php | 16 + .../src/Controller/AddCommentController.php | 73 + .../ChangeEmergencyStateApiController.php | 73 + .../Controller/ChangeStateApiController.php | 73 + .../src/Controller/CreateTicketController.php | 75 + .../src/Controller/EditTicketController.php | 45 + .../src/Controller/FindCallerController.php | 58 + .../src/Controller/MotiveApiController.php | 25 + .../Controller/ReplaceMotiveController.php | 69 + .../Controller/SetAddresseesController.php | 85 + .../src/Controller/SetCallerApiController.php | 66 + .../src/Controller/SetPersonsController.php | 72 + .../SuggestPersonForTicketApiController.php | 45 + .../src/Controller/TicketControllerApi.php | 31 + .../Controller/TicketListApiController.php | 81 + .../src/Controller/TicketListController.php | 84 + .../Controller/UpdateCommentController.php | 69 + .../UpdateCommentDeletedStatusController.php | 66 + .../src/DataFixtures/ORM/LoadMotives.php | 98 + .../ChillTicketExtension.php | 69 + .../src/DependencyInjection/Configuration.php | 42 + .../src/Entity/AddresseeHistory.php | 137 ++ .../src/Entity/CallerHistory.php | 148 ++ .../ChillTicketBundle/src/Entity/Comment.php | 85 + .../src/Entity/EmergencyStatusEnum.php | 21 + .../src/Entity/EmergencyStatusHistory.php | 85 + .../src/Entity/InputHistory.php | 96 + .../ChillTicketBundle/src/Entity/Motive.php | 101 + .../src/Entity/MotiveHistory.php | 86 + .../src/Entity/PersonHistory.php | 103 + .../src/Entity/StateEnum.php | 30 + .../src/Entity/StateHistory.php | 85 + .../ChillTicketBundle/src/Entity/Ticket.php | 336 +++ .../src/Menu/SectionMenuBuilder.php | 29 + .../src/Repository/MotiveRepository.php | 27 + .../PersonTicketACLAwareRepository.php | 60 + ...ersonTicketACLAwareRepositoryInterface.php | 29 + .../Repository/TicketACLAwareRepository.php | 79 + .../TicketACLAwareRepositoryInterface.php | 38 + .../src/Repository/TicketRepository.php | 64 + .../Repository/TicketRepositoryInterface.php | 28 + .../Resources/public/page/ticket/banner.scss | 24 + .../src/Resources/public/page/ticket/index.ts | 1 + .../src/Resources/public/types.ts | 157 ++ .../Resources/public/vuejs/TicketApp/App.vue | 44 + .../components/ActionToolbarComponent.vue | 356 ++++ .../components/AddCommentComponent.vue | 27 + .../components/AddresseeComponent.vue | 68 + .../components/AddresseeSelectorComponent.vue | 87 + .../TicketApp/components/BannerComponent.vue | 190 ++ .../components/CallerSelectorComponent.vue | 85 + .../components/MotiveSelectorComponent.vue | 71 + .../components/PersonsSelectorComponent.vue | 90 + .../TicketHistoryAddresseeComponent.vue | 18 + .../TicketHistoryCommentComponent.vue | 46 + .../TicketHistoryCreateComponent.vue | 16 + .../TicketHistoryEmergencyComponent.vue | 18 + .../components/TicketHistoryListComponent.vue | 151 ++ .../TicketHistoryMotiveComponent.vue | 14 + .../TicketHistoryPersonComponent.vue | 37 + .../TicketHistoryStateComponent.vue | 56 + .../components/TicketSelectorComponent.vue | 36 + .../TicketApp/components/ToggleFlags.vue | 67 + .../Resources/public/vuejs/TicketApp/index.ts | 25 + .../public/vuejs/TicketApp/store/index.ts | 24 + .../TicketApp/store/modules/addressee.ts | 86 + .../vuejs/TicketApp/store/modules/comment.ts | 38 + .../vuejs/TicketApp/store/modules/motive.ts | 66 + .../vuejs/TicketApp/store/modules/persons.ts | 86 + .../vuejs/TicketApp/store/modules/ticket.ts | 91 + .../Resources/views/Banner/banner.html.twig | 8 + .../src/Resources/views/Ticket/edit.html.twig | 19 + .../src/Resources/views/Ticket/list.html.twig | 99 + .../src/Resources/views/layout.html.twig | 17 + .../src/Security/Voter/CommentVoter.php | 50 + .../src/Security/Voter/TicketVoter.php | 37 + .../SetAddresseesCommandDenormalizer.php | 56 + .../SetPersonsCommandDenormalizer.php | 51 + .../Normalizer/TicketNormalizer.php | 275 +++ .../Service/Ticket/SuggestPersonForTicket.php | 30 + .../SuggestPersonForTicketInterface.php | 26 + .../Validator/SetPersonCommandConstraint.php | 25 + .../SetPersonCommandConstraintValidator.php | 47 + .../ChillTicketBundle/src/config/routes.yaml | 3 + .../src/config/services.yaml | 36 + .../src/migrations/Version20240416145919.php | 139 ++ .../src/migrations/Version20240423212824.php | 40 + .../src/migrations/Version20250603085035.php | 89 + .../src/migrations/Version20250620145414.php | 82 + .../src/migrations/Version20250620164517.php | 37 + .../src/migrations/Version20250624105842.php | 93 + .../src/migrations/Version20250711115128.php | 33 + .../src/migrations/Version20250711131126.php | 33 + .../src/translations/messages+intl-icu.fr.yml | 86 + ...UpdateCommentContentCommandHandlerTest.php | 50 + ...CommentDeletedStatusCommandHandlerTest.php | 55 + .../Handler/AddCommentCommandHandlerTest.php | 52 + ...sociateByPhonenumberCommandHandlerTest.php | 96 + ...ChangeEmergencyStateCommandHandlerTest.php | 118 ++ .../Handler/ChangeStateCommandHandlerTest.php | 118 ++ .../CreateTicketCommandHandlerTest.php | 55 + .../ReplaceMotiveCommandHandlerTest.php | 181 ++ .../SetAddressesCommandHandlerTest.php | 112 + .../Handler/SetCallerCommandHandlerTest.php | 178 ++ .../Handler/SetPersonsCommandHandlerTest.php | 112 + .../Controller/AddCommentControllerTest.php | 106 + .../ChangeEmergencyStateApiControllerTest.php | 144 ++ .../ChangeStateApiControllerTest.php | 144 ++ .../Controller/FindCallerControllerTest.php | 128 ++ .../ReplaceMotiveControllerTest.php | 119 ++ .../SetAddresseesControllerTest.php | 212 ++ .../Controller/SetCallerApiControllerTest.php | 200 ++ .../TicketListApiControllerTest.php | 302 +++ .../Controller/TicketListControllerTest.php | 34 + .../UpdateCommentControllerTest.php | 134 ++ ...dateCommentDeletedStatusControllerTest.php | 114 + .../tests/Entity/CallerHistoryTest.php | 63 + .../tests/Entity/TicketCallerTest.php | 82 + .../tests/Entity/TicketTest.php | 161 ++ .../PersonTicketACLAwareRepositoryTest.php | 64 + .../TicketACLAwareRepositoryTest.php | 81 + .../SetAddresseesCommandDenormalizerTest.php | 66 + .../Normalizer/TicketNormalizerTest.php | 408 ++++ .../Ticket/SuggestPersonForTicketTest.php | 70 + ...etPersonCommandConstraintValidatorTest.php | 90 + .../Resources/public/module/pending/index.ts | 44 +- src/shims-vue.d.ts | 6 +- src/vue-multiselect.d.ts | 18 +- src/vuex.d.ts | 8 +- tests/app/config/routes/chill_ticket.yaml | 3 + tsconfig.json | 3 +- 392 files changed, 35466 insertions(+), 24054 deletions(-) create mode 100644 .changes/unreleased/Feature-20240530-160003.yaml create mode 100644 .changes/unreleased/Feature-20240531-190242.yaml create mode 100644 .prettierrc create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 config/packages/chill_ticket.yaml create mode 100644 config/routes/chill_ticket.yaml create mode 100644 src/Bundle/ChillMainBundle/Tests/Validation/Validator/UserGroupDoNotExcludeTest.php rename src/Bundle/ChillPersonBundle/Resources/public/vuejs/_api/{AddPersons.js => AddPersons.ts} (57%) create mode 100644 src/Bundle/ChillTicketBundle/chill.api.specs.yaml create mode 100644 src/Bundle/ChillTicketBundle/chill.webpack.config.js create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Comment/Handler/UpdateCommentContentCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Comment/Handler/UpdateCommentContentCommandHandlerInterface.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Comment/Handler/UpdateCommentDeletedStatusCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Comment/Handler/UpdateCommentDeletedStatusCommandHandlerInterface.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Comment/UpdateCommentContentCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Comment/UpdateCommentDeletedStatusCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/AddAddresseeCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/AddCommentCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/AssociateByPhonenumberCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/ChangeEmergencyStateCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/ChangeStateCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/CreateTicketCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/AddCommentCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/AssociateByPhonenumberCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/ChangeEmergencyStateCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/ChangeStateCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/CreateTicketCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/ReplaceMotiveCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/SetAddresseesCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/SetCallerCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/SetPersonsCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/ReplaceMotiveCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/SetAddresseesCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/SetCallerCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Action/Ticket/SetPersonsCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/AddCommentController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/ChangeEmergencyStateApiController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/ChangeStateApiController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/CreateTicketController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/EditTicketController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/FindCallerController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/MotiveApiController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/ReplaceMotiveController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/SetAddresseesController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/SetCallerApiController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/SetPersonsController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/SuggestPersonForTicketApiController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/TicketControllerApi.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/TicketListApiController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/TicketListController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/UpdateCommentController.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/UpdateCommentDeletedStatusController.php create mode 100644 src/Bundle/ChillTicketBundle/src/DataFixtures/ORM/LoadMotives.php create mode 100644 src/Bundle/ChillTicketBundle/src/DependencyInjection/ChillTicketExtension.php create mode 100644 src/Bundle/ChillTicketBundle/src/DependencyInjection/Configuration.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/AddresseeHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/CallerHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/Comment.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/EmergencyStatusEnum.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/EmergencyStatusHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/InputHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/Motive.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/MotiveHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/PersonHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/StateEnum.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/StateHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/Ticket.php create mode 100644 src/Bundle/ChillTicketBundle/src/Menu/SectionMenuBuilder.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/MotiveRepository.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/PersonTicketACLAwareRepository.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/PersonTicketACLAwareRepositoryInterface.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/TicketACLAwareRepository.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/TicketACLAwareRepositoryInterface.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/TicketRepository.php create mode 100644 src/Bundle/ChillTicketBundle/src/Repository/TicketRepositoryInterface.php create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/page/ticket/banner.scss create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/page/ticket/index.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/types.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue 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/AddCommentComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeComponent.vue 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/BannerComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/CallerSelectorComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveSelectorComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/PersonsSelectorComponent.vue create 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/TicketHistoryCommentComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryCreateComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryEmergencyComponent.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/TicketHistoryMotiveComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryPersonComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryStateComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ToggleFlags.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/addressee.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/comment.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/persons.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/views/Ticket/edit.html.twig create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/views/Ticket/list.html.twig create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/views/layout.html.twig create mode 100644 src/Bundle/ChillTicketBundle/src/Security/Voter/CommentVoter.php create mode 100644 src/Bundle/ChillTicketBundle/src/Security/Voter/TicketVoter.php create mode 100644 src/Bundle/ChillTicketBundle/src/Serializer/Normalizer/SetAddresseesCommandDenormalizer.php create mode 100644 src/Bundle/ChillTicketBundle/src/Serializer/Normalizer/SetPersonsCommandDenormalizer.php create mode 100644 src/Bundle/ChillTicketBundle/src/Serializer/Normalizer/TicketNormalizer.php create mode 100644 src/Bundle/ChillTicketBundle/src/Service/Ticket/SuggestPersonForTicket.php create mode 100644 src/Bundle/ChillTicketBundle/src/Service/Ticket/SuggestPersonForTicketInterface.php create mode 100644 src/Bundle/ChillTicketBundle/src/Validation/Validator/SetPersonCommandConstraint.php create mode 100644 src/Bundle/ChillTicketBundle/src/Validation/Validator/SetPersonCommandConstraintValidator.php create mode 100644 src/Bundle/ChillTicketBundle/src/config/routes.yaml create mode 100644 src/Bundle/ChillTicketBundle/src/config/services.yaml create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20240416145919.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20240423212824.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20250603085035.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20250620145414.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20250620164517.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20250624105842.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20250711115128.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20250711131126.php create mode 100644 src/Bundle/ChillTicketBundle/src/translations/messages+intl-icu.fr.yml create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Comment/Handler/UpdateCommentContentCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Comment/Handler/UpdateCommentDeletedStatusCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/AddCommentCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/ChangeEmergencyStateCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/ChangeStateCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/CreateTicketCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/ReplaceMotiveCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/SetAddressesCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/SetCallerCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/SetPersonsCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/AddCommentControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/ChangeEmergencyStateApiControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/ChangeStateApiControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/FindCallerControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/ReplaceMotiveControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/SetAddresseesControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/SetCallerApiControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/TicketListApiControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/TicketListControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/UpdateCommentControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/UpdateCommentDeletedStatusControllerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Entity/CallerHistoryTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Entity/TicketCallerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Entity/TicketTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Repository/PersonTicketACLAwareRepositoryTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Repository/TicketACLAwareRepositoryTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Serializer/Normalizer/SetAddresseesCommandDenormalizerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Serializer/Normalizer/TicketNormalizerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Service/Ticket/SuggestPersonForTicketTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Validation/Validator/SetPersonCommandConstraintValidatorTest.php create mode 100644 tests/app/config/routes/chill_ticket.yaml diff --git a/.changes/unreleased/Feature-20240530-160003.yaml b/.changes/unreleased/Feature-20240530-160003.yaml new file mode 100644 index 000000000..6b6baedc5 --- /dev/null +++ b/.changes/unreleased/Feature-20240530-160003.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: | + Upgrade import of address list to the last version of compiled addresses of belgian-best-address +time: 2024-05-30T16:00:03.440767606+02:00 +custom: + Issue: "" diff --git a/.changes/unreleased/Feature-20240531-190242.yaml b/.changes/unreleased/Feature-20240531-190242.yaml new file mode 100644 index 000000000..083298a26 --- /dev/null +++ b/.changes/unreleased/Feature-20240531-190242.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: | + Upgrade CKEditor and refactor configuration with use of typescript +time: 2024-05-31T19:02:42.776662753+02:00 +custom: + Issue: "" diff --git a/.editorconfig b/.editorconfig index bede621e3..49ea12528 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,11 +19,11 @@ max_line_length = 80 [COMMIT_EDITMSG] max_line_length = 0 -[*.{js, vue, ts}] +[*.{js,vue,ts}] indent_size = 2 indent_style = space -[.rst] -ident_size = 3 -ident_style = space +[*.rst] +indent_size = 3 +indent_style = space diff --git a/.eslint-baseline.json b/.eslint-baseline.json index 6483e47b3..7b5d29c67 100644 --- a/.eslint-baseline.json +++ b/.eslint-baseline.json @@ -7,14 +7,6 @@ "message": "'app' is assigned a value but never used.", "hash": "f8c2979921289906e3baabae31ba101ead91504f" }, - { - "path": "src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js", - "line": 57, - "column": 23, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'event' is defined but never used.", - "hash": "cf0cf378f71403f62a6425f384ccbbdec433d1f2" - }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/module/Invite/answer.js", "line": 7, @@ -25,19 +17,19 @@ }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/Components/CalendarActive.vue", - "line": 19, - "column": 30, + "line": 10, + "column": 22, "ruleId": "vue/valid-v-else", "message": "'v-else' directives require no attribute value.", - "hash": "505f99b24500a684eec3c6bf870426fcd841c20b" + "hash": "c4d34a0df38baaf72092179b2e066c91b6f6733a" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/Components/CalendarActive.vue", - "line": 54, + "line": 45, "column": 10, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'mapGetters' is defined but never used.", - "hash": "01e3928f7d9be0accb6db3894b158dd683a685ff" + "hash": "8e80aff377fdd5af9686df6a89a4ba650911f02a" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/index.js", @@ -90,90 +82,50 @@ { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/utils.ts", "line": 4, - "column": 5, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'DateTime' is defined but never used.", - "hash": "fdf38ad15813c4a931b93f4a85db985ca71105fc" + "hash": "88be21db222be347a0cf7f8fbfaba531d5cb0418" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/utils.ts", "line": 14, - "column": 27, + "column": 25, "ruleId": "@typescript-eslint/no-empty-object-type", "message": "The `{}` (\"empty object\") type allows any non-nullish value, including literals like `0` and `\"\"`.\n- If that's what you want, disable this lint rule with an inline comment or configure the 'allowObjectTypes' rule option.\n- If you want a type meaning \"any object\", you probably want `object` instead.\n- If you want a type meaning \"any value\", you probably want `unknown` instead.", - "hash": "9602ec11eda8f46ff5712d69dcd87419babcd6f0" + "hash": "6c1437cbb501093bde9c9f7eeda4e4853e558c1a" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/utils.ts", "line": 16, - "column": 20, + "column": 18, "ruleId": "@typescript-eslint/no-empty-object-type", "message": "The `{}` (\"empty object\") type allows any non-nullish value, including literals like `0` and `\"\"`.\n- If that's what you want, disable this lint rule with an inline comment or configure the 'allowObjectTypes' rule option.\n- If you want a type meaning \"any object\", you probably want `object` instead.\n- If you want a type meaning \"any value\", you probably want `unknown` instead.", - "hash": "23f7a8a1c3cba955077ddbd604bad6805ce30ad2" + "hash": "f03d8114bfe562d84f8160f5d122562e484b5de1" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/utils.ts", "line": 18, - "column": 19, + "column": 17, "ruleId": "@typescript-eslint/no-empty-object-type", "message": "The `{}` (\"empty object\") type allows any non-nullish value, including literals like `0` and `\"\"`.\n- If that's what you want, disable this lint rule with an inline comment or configure the 'allowObjectTypes' rule option.\n- If you want a type meaning \"any object\", you probably want `object` instead.\n- If you want a type meaning \"any value\", you probably want `unknown` instead.", - "hash": "abbc89e186c74d0f71f45cfda31c490339e39078" + "hash": "de706baa154ead33e72ce520c50cdd16a85d1265" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Invite/Answer.vue", - "line": 95, - "column": 13, + "line": 86, + "column": 19, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'payload' is defined but never used.", - "hash": "66c545917093ba30f1d6ca10ddaa676140e749bd" - }, - { - "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue", - "line": 224, - "column": 10, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'reactive' is defined but never used.", - "hash": "96ed76a9828138fb125fc36c4b55e900bbfe87c2" - }, - { - "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue", - "line": 230, - "column": 5, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'DropArg' is defined but never used.", - "hash": "bd405399a4091d65e8391404bfb0c4611816c8e0" - }, - { - "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue", - "line": 251, - "column": 9, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'t' is assigned a value but never used.", - "hash": "bc09207a496405f7a71c178e522b89aeb1f7ebd3" - }, - { - "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue", - "line": 356, - "column": 32, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'arg' is defined but never used.", - "hash": "aeae152f0669b946a1ad681dd52b0ef03393ae79" - }, - { - "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue", - "line": 434, - "column": 11, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'changedEvent' is assigned a value but never used.", - "hash": "a7a81a6bf09d00c0364e3aa8207ffad853f0547b" + "hash": "8c189da3c258c22dfdd1e0a72d0f0ef5464c26eb" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue", "line": 77, - "column": 16, + "column": 12, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'_' is defined but never used.", - "hash": "d29fb2fc9299c48082167b2fa4c427c569716bd6" + "hash": "8040b05fb0422e91d049dd0d7fb4604b4455bf5e" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue", @@ -202,50 +154,50 @@ { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/index2.ts", "line": 12, - "column": 11, + "column": 9, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'app' is assigned a value but never used.", - "hash": "6422c0876b992a3c5174faa99ef06d8339b74b4e" + "hash": "3ebdc6637bc62a230176a4dff37a5900061e6eed" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/store/index.ts", - "line": 46, - "column": 20, + "line": 44, + "column": 74, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'_' is defined but never used.", - "hash": "5bf7ba0b0200fb6788d50df669e6b7701f8a87bb" + "hash": "7ac3276b20b1029e510bcbbbc8572fc34400e204" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/store/modules/fullcalendar.ts", "line": 57, - "column": 32, + "column": 20, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'_' is defined but never used.", - "hash": "a733a5edfe4c434ed63682bcbd5fe65f175a1b85" + "hash": "d25bbc0a04099c361d99f34b0c731892c7b008a7" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/store/modules/fullcalendar.ts", "line": 64, - "column": 32, + "column": 20, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'_' is defined but never used.", - "hash": "d83b1879b5fc6179c045ad1981421f46a7cbbd56" + "hash": "7c53ad6034cebccfe119a1ee7dd011984a720676" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/store/modules/fullcalendar.ts", "line": 71, - "column": 32, + "column": 20, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'_' is defined but never used.", - "hash": "222eed84495212735a60fa05e0c7f298c7bc33e1" + "hash": "110e12e976ae0f8fe15cd70b974d99ee381bb6fb" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/store/modules/fullcalendar.ts", "line": 72, - "column": 26, + "column": 18, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'_' is defined but never used.", - "hash": "0cf85eccce08b65a8590f7318cace58cbb21ea08" + "hash": "7919b6b2becd817e0fad8c51602b0f8c2fc0f5f2" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/store/modules/me.ts", @@ -258,90 +210,90 @@ { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", "line": 108, - "column": 47, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "1a771f9f65375cac2002ed7d706184355685d378" + "hash": "e57ca97296d09e44a8e19573138a4f39f7777778" + }, + { + "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", + "line": 145, + "column": 15, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"users\" prop.", + "hash": "26378799855b04bc15aa3e030b9ede95f3139c4d" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", "line": 148, - "column": 29, + "column": 15, "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"users\" prop.", - "hash": "d9f7e517892b6588be17516fd077c3149ccbefd9" + "message": "Unexpected mutation of \"calendarEvents\" prop.", + "hash": "279aee22cdc99740903c9fee736897a65074a8bb" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", "line": 151, - "column": 29, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"calendarEvents\" prop.", - "hash": "47c270d8c0bcda67ea04a83ba267eca3e70fa7fb" - }, - { - "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 154, - "column": 59, + "column": 41, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "7cf30f0d2dc567ea0dfb44dadfc9ecf4977e7b95" + "hash": "2c597422f93f4b397bfe96365007c602d349ad0c" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 155, - "column": 41, + "line": 152, + "column": 21, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"users\" prop.", - "hash": "7876348a3eee16be7effd3e992a6aaa2334cfd24" + "hash": "75af3ee3d935ce4d62c037461e552cef3ab0f291" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 164, - "column": 63, + "line": 158, + "column": 47, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "0f308d7417bfc294b28eea6890666a2d91e31ecd" + "hash": "6ffe789bbd1d731daaf5c2bff4582372fd342dc1" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 185, - "column": 57, + "line": 170, + "column": 27, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"calendarEvents\" prop.", - "hash": "5a021a581a33d3aeea21c65e023902f2123bb562" + "hash": "ef1795af6c50719c19ec3bffd8e511d06a9bfac2" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 218, - "column": 17, + "line": 197, + "column": 9, "ruleId": "@typescript-eslint/prefer-for-of", "message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.", - "hash": "655811d4dad8de23b3d37dfbf02f7fca18b6d8f2" + "hash": "bc4a3fd50f5afd095d8e938885291d948c4ba689" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 235, - "column": 13, + "line": 214, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"calendarEvents\" prop.", - "hash": "19317d9a564b8b10355cac1eeb9308c7d49c0dd1" + "hash": "6a27b96c77fc2747b4fd0f82ccfedc44138b0aa5" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 240, - "column": 13, + "line": 219, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"users\" prop.", - "hash": "95e478eca53a2acfa8edd0aa5747e73b0da01d0c" + "hash": "61c0ca5de675766483584b7363b048356f9c55f8" }, { "path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue", - "line": 246, - "column": 13, + "line": 225, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"users\" prop.", - "hash": "0b66e38f0c0bbe17aa7c548dc127be033133ce06" + "hash": "d87ce5e7fbcefc884fb7be907d3c3fef53921ab4" }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/js/async-upload/uploader.ts", @@ -399,14 +351,6 @@ "message": "'error' is defined but never used.", "hash": "e26e5e101e90d2b7ee84d6f5de8c819e52129c17" }, - { - "path": "src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/index.ts", - "line": 29, - "column": 14, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'vm' is defined but never used.", - "hash": "8e7f5e89dd72c54459cf82156389b88988f97d63" - }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js", "line": 39, @@ -545,11 +489,11 @@ }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue", - "line": 80, - "column": 5, + "line": 78, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'StoredObjectVersion' is defined but never used.", - "hash": "2fadbe9e331a66f44b54782acc1420c4b487e1f6" + "hash": "da2ec95bcd2bb80819ef2032e40b0d7237acba31" }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts", @@ -578,10 +522,10 @@ { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue", "line": 11, - "column": 5, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'download_and_decrypt_doc' is defined but never used.", - "hash": "9a803f1fe608ec60ab065aa8f76e50e2ef1fa4c2" + "hash": "ddc9ed7c384b9da6ed1398551cefe7d244cb0c9e" }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue", @@ -593,11 +537,11 @@ }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue", - "line": 50, - "column": 11, + "line": 48, + "column": 9, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reset_pending' is assigned a value but never used.", - "hash": "96fde3634a150f1253fac2f2f2bdcfe6e0daf82a" + "hash": "9919afcb6b2724f5b6be69caa1b487026b9260fe" }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton.vue", @@ -615,29 +559,21 @@ "message": "'ref' is defined but never used.", "hash": "2a27cd6d06a26e1326654c929068e3704137e24b" }, - { - "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue", - "line": 57, - "column": 17, - "ruleId": "vue/valid-v-for", - "message": "Custom elements in iteration require 'v-bind:key' directives.", - "hash": "cce787939524e83dd135869e13738ef332d7156c" - }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue", - "line": 15, + "line": 13, "column": 8, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'WopiEditButton' is defined but never used.", - "hash": "80cb06a18ac4db47e8d120103704ec6988696b79" + "hash": "f197263cc1b8a5eeadd87e2e2c44eccc618375ec" }, { "path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers.ts", "line": 3, - "column": 5, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'StoredObjectStatus' is defined but never used.", - "hash": "e868cee022cd1499bb54f7b5503a8a822773e097" + "hash": "ceb106361b5267900ff8852f6ff191698e065e13" }, { "path": "src/Bundle/ChillJobBundle/src/Resources/public/module/cv_edit/index.js", @@ -761,27 +697,27 @@ }, { "path": "src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts", - "line": 73, - "column": 5, + "line": 71, + "column": 3, "ruleId": "prefer-const", "message": "'cal' is never reassigned. Use 'const' instead.", - "hash": "53586ea7ec719f07750a8874db79f5e76583d5e0" + "hash": "f6bce9a9d62ca55fec76a414f36ad445ffbb5f17" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts", - "line": 79, - "column": 5, + "line": 77, + "column": 3, "ruleId": "prefer-const", "message": "'time' is never reassigned. Use 'const' instead.", - "hash": "19821279c0b2d7e69418db6877c317f8c6e2dacc" + "hash": "7bb4fae8b43da52f82f65b50a87b22d0375b517f" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts", - "line": 85, - "column": 5, + "line": 83, + "column": 3, "ruleId": "prefer-const", "message": "'offset' is never reassigned. Use 'const' instead.", - "hash": "244b65de0ab0791ec89219058c5cb4f2e11622c7" + "hash": "f91a4b071f6ad88a8408dfa241b3cec00c7d54db" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/lib/download-report/download-report.js", @@ -914,26 +850,26 @@ { "path": "src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts", "line": 141, - "column": 5, + "column": 3, "ruleId": "@typescript-eslint/prefer-for-of", "message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.", - "hash": "cd5fc994be294fde5fef27ba841c9af454b81dc0" + "hash": "c280bbe030fe9a793f531ce00c1a4a6c6fdcfdc0" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts", "line": 153, - "column": 5, + "column": 3, "ruleId": "@typescript-eslint/prefer-for-of", "message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.", - "hash": "381830dd078845aeab5ea366757541cd7c77ca3f" + "hash": "98e7c2f525eddcfd8d0f839c9bf69b7c56c9d537" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts", "line": 162, - "column": 9, + "column": 5, "ruleId": "@typescript-eslint/prefer-for-of", "message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.", - "hash": "768b1976fb935d4a4b0890f00be2299b7ff60170" + "hash": "66a4dba7d1d666cbac1ed22eb2a7916cf97ca5ec" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/module/disable-buttons/index.js", @@ -983,22 +919,6 @@ "message": "'_e' is defined but never used.", "hash": "1d6448401778e8c56554020fe5abd47851ed33f3" }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js", - "line": 21, - "column": 55, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'e' is defined but never used.", - "hash": "eae499e4f6e9f43a9d17f9cd917cb6d3d97be25c" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/page/export/download-export.js", - "line": 3, - "column": 55, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'e' is defined but never used.", - "hash": "088fd383e7807e484aefc9825209bc7c8942bd22" - }, { "path": "src/Bundle/ChillMainBundle/Resources/public/page/homepage_widget/index.js", "line": 9, @@ -1074,514 +994,514 @@ { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue", "line": 79, - "column": 55, + "column": 39, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "29ea9ef3f1b2cb970e8103383bcde12a4ab66c25" + "hash": "3014fecdefbab379cc54e6abe7532c892cc788f6" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue", "line": 101, - "column": 55, + "column": 39, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "b81ee6947049c6876f81410cfbb499dc43da4374" + "hash": "03336dded33c9831e1f8c4b950591b0a24eac678" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 247, - "column": 5, + "line": 244, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'postAddressToPerson' is defined but never used.", - "hash": "8a41c437cf2b5554cbbe1704cd51f3102b3d5994" + "hash": "0a60babcbc24fd0a410901c25994e93f1cd88acc" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 248, - "column": 5, + "line": 245, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'postAddressToHousehold' is defined but never used.", - "hash": "66dec84b2ece299daf21308e5e60d497ba442b27" + "hash": "6022bfb8f8d94a3ce0fb2aca7a846c084c2170af" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 490, - "column": 21, + "line": 486, + "column": 11, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"context\" prop.", - "hash": "0d3f40c47974a4371072b3b9ee04b197c830162d" + "hash": "26b7b1a24fd66b1763e131ad372ea9e9246ed2ca" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 491, - "column": 21, + "line": 487, + "column": 11, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"context\" prop.", - "hash": "8e877b7e588c30e182f7b572bdb9685360f9cf99" + "hash": "1c8c8b1de3e43ec62a8193b0fa6efdfeade74677" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 508, - "column": 47, + "line": 501, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "5a3e3401bc3c765d91faaf4cfde57697af1262b7" + "hash": "eca7f49f652654fcffdbe10ac410f108ff3fb28e" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 525, - "column": 47, + "line": 518, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "35a741d90379574b9323279f5802193d0c98a9dc" + "hash": "31097431dfeb6ebcaa0893d89aa5309de9ee774e" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 553, - "column": 47, + "line": 546, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "c23d1ddf6c0d10ae97948e74aee9c14b9320b86c" + "hash": "142f4ce9e45cf10df3d74345496c2a8919a138bc" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 572, - "column": 47, + "line": 565, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "4322e81c6ea9d9734c680633a724d5bd4fabacb2" + "hash": "e9973c9eb1f151f71f6386d2a0ce83f322ff2cf5" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 803, - "column": 47, + "line": 787, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "7928a6461b9d394c7d97f048933553936f7d8963" + "hash": "78f1d0e8d3b2fa2489f4e311db2d1215d77b1c46" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue", - "line": 852, - "column": 47, + "line": 836, + "column": 35, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "e5afdb8efccb5470a08dde48f755b1268fa947b5" + "hash": "cbabc9b1434c9a5690bc269aabd001c8841aeb1b" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 93, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "68f5e1cf5c03f9ada59c9e0afca0b74c7f3fca4b" + "hash": "9c66b7ec84cc786856badd8498414379ef4056ed" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 101, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "50d730f6109092baff2db66adc44dc1315e2bda2" + "hash": "92d482ada1514212e710c366a7700111eda96f1e" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 109, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "573e4c041ce663f28b933d7a675c2a525aba644c" + "hash": "f5c902853071084dfe7fd9a1c50e1c653e4c6a19" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 117, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "293f845eeab515b1df4649d136c2d8219ed59c4d" + "hash": "409c69e33cdf563b7bc2d0c074f413f8d12c0307" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 125, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "792310bc5def2c7b45f50da97cd8818d82862e8a" + "hash": "ea78eb9d3d49445fc131568291b4d777e2e8d271" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 133, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "a69e5335393f67a83d89720af34a4385a7d7e665" + "hash": "db792e379fcff91ef9388fbf88492552885efb66" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue", "line": 141, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "2d5a5e680ff207ad97c7e7b7d999064b561dfd8a" + "hash": "dbba8af7379ffc65a6d80b4fffd00ca658251fbe" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 106, - "column": 17, + "line": 104, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "d52356f2af31d0167c02330ec22d09fbfa6b2b9f" + "hash": "7c28ce533e2011e4f052d5ca0c7d57610b0461da" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 114, - "column": 17, + "line": 112, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "c8e8e06f370f93bf05867e93b5f037dfa46937b1" + "hash": "c40ccbcab1e9ceccd5a350ddd88ff7dd5c468ec3" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 128, - "column": 13, + "line": 126, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "9abaf71ca4b4f292b3b01e724d0a7733365e71f1" + "hash": "f407cd7f81bc5d33ed0831a592870074e6a4d6f1" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 129, - "column": 13, + "line": 127, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "0b0743959778a9e3d93089b132608816ee4e6646" + "hash": "5d974adadc72bf10bfa1a863bdc44fdc43c2207f" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", + "line": 130, + "column": 7, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "1fbda9c797af826dbadcfd16dc945b8d21e3ddf0" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", + "line": 131, + "column": 7, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "b0ff83b3f077f1a6143654e5914321e3cf29ac95" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", "line": 132, - "column": 13, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "9759da7b7859b8ee8efaf74876430658ac6b6fe2" + "hash": "19b7e3498b9e90d6a86b3be74338d040247465ab" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 133, - "column": 13, + "line": 137, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "dba8be9a27ab74ec743b7d9e07c05d857b407dd3" + "hash": "d7c45fd73ad1721055f23116102655bdd90a9528" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 134, - "column": 13, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "9b1f5bce779aafc46b19d7a5d266eaa29f8f9be9" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 139, - "column": 13, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "fe6fc4aea0994ba9da15b7c09d308842b67958cb" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 153, - "column": 55, + "line": 151, + "column": 39, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'reject' is defined but never used.", - "hash": "bd0e024fcad2e3f4566f15293e3c25c840f6dd3e" + "hash": "bb2767a02ef0c4cd4598702d06ee95d7e79fced3" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 154, - "column": 37, + "line": 152, + "column": 19, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "596c4b180b926b7829f987384328bf5636cd367a" + "hash": "ce6c91b98e94605fe9c5b6c4e358a42da79a3150" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 171, - "column": 59, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'reject' is defined but never used.", - "hash": "5b41d5f9b45da074fb7bbbbd45e0da501da72071" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 172, + "line": 168, "column": 41, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "d92b92a25043244cca809bd129633b7e024e26b4" + "ruleId": "@typescript-eslint/no-unused-vars", + "message": "'reject' is defined but never used.", + "hash": "28a03efbb5ade5a575393d46f4ec87fd3ab3af57" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 190, - "column": 17, + "line": 169, + "column": 21, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "dd9a85ea740742d620e864796f67c5bff834486d" + "hash": "7eede2e283dcaeeeba01fba092100c0839eacb37" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 191, - "column": 17, + "line": 186, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "e3e59960d0d50709a57b336f66b586710b774892" + "hash": "a7ff3bc5466588198108718a166980b73e87ee40" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 192, - "column": 17, + "line": 187, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "fe11b0e54396511e7b3b08615a78d22fc27e2fad" + "hash": "c87deccee6f42a977abbf54b25c12af2543c4ba6" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", - "line": 222, - "column": 13, + "line": 188, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "63c14c2150c33ec701bc4a0ff94efde69537d490" + "hash": "83029bfbb4c6e6e76f097dedad5c95b7efbf1d54" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue", + "line": 218, + "column": 7, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "f8cc21c434f3a41e97c1e659f3e3e41bc8ea3015" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 96, - "column": 20, + "column": 14, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "d2a9fdaeef0e2810f480022d4c6f99e4f76a818e" + "hash": "9f4994768baeedde467d8a6a594eddb96c8d4f35" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 96, - "column": 20, + "column": 14, "ruleId": "vue/no-side-effects-in-computed-properties", "message": "Unexpected side effect in \"cities\" computed property.", - "hash": "dd92a60a9b1ebefeb9a90941d45326fbfa483733" + "hash": "efdf2f0fa3127580834a1a71c05cc412cdffc17a" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 102, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "04be01ab638ce01f568fb0216929e65e1175ca23" + "hash": "331da5bdcdaca996b5a86bbf9d074172d9a97de5" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 110, - "column": 17, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "8619c8e0b63e87d09268832f90e4fba06b87e41f" + "hash": "1503a521d5aac26de71708193d5efe381fce1a91" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 124, - "column": 13, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "281f918da00635079501418b1e6b2c05b62eb4a7" + "hash": "b7099b57a857083cd18ffca20e489fcc894675f0" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 125, - "column": 13, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "c131b09fa67ab1d069f1d04a54582d6b0f206153" + "hash": "577790a8bd8c6081fe75e4d4ebbb99d251e7cf5a" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 126, - "column": 13, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "3d3a2a4add64c291b8f5f1cddd90a173cd6a819d" + "hash": "744ba1d220a69ca2c63c9b7dc1478ef71af0ec8e" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 131, - "column": 21, + "column": 11, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "ed48f4988914d7897018a2e06830a97e6740b3e8" + "hash": "e8134808053567607222487fcb4144183e0ffe86" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", + "line": 143, + "column": 7, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "fab57266818588096de456916ebe3fa88e89a4e4" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", + "line": 144, + "column": 7, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "f3d04b5c0a3a29bfa65e7eeeb1c50e989ec4821e" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 145, - "column": 13, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "744f3a7610d4d6015e50e25149bceffd6c6e2763" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 146, - "column": 13, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "eaaaaee5fb2e324ffe0a68eefe340dabdf162324" + "hash": "90b3e9a1ba5be62bd6894796ecc2e33e2f29329d" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 147, - "column": 13, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "2de47b4a4ddbe546b3fce9898af48b72853364bf" + "hash": "8a90e844f524ba01cc1c64806eeda052ab88957d" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", "line": 149, - "column": 17, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "1e7b1ad55866f708baaca72dfa4ff26d6f8e5d21" + "hash": "e83c3118bc20776c00437d7edc3deaf24915bd66" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 152, - "column": 13, + "line": 158, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "84779331536ffceec8d4a8c5ca4307310b882549" + "hash": "378ccd9fa7cf74e41c905f1a21bdbf1f74c4015f" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 161, - "column": 13, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "0789999841be671a4d8ab080d6fdb679f843eb52" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 170, - "column": 51, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'reject' is defined but never used.", - "hash": "bbb17afa114f016e2058d90aa32d2a625804f0d1" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 171, - "column": 33, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "5fbe407ceceb37bff2ac800ceddd7942540132f1" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 190, - "column": 55, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'reject' is defined but never used.", - "hash": "e2af91def877befbabef8e93deba4c58a3ee2ded" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 191, + "line": 167, "column": 37, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "ee8544ee45681a650ed7d4918ae979685cdd8f0f" + "ruleId": "@typescript-eslint/no-unused-vars", + "message": "'reject' is defined but never used.", + "hash": "5bbe7140e1370b411abbdfc0554d58d62472d0d7" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 210, + "line": 168, "column": 17, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "5d9d2217c8c7e6571bc9f72a98ea5b370edb4968" + "hash": "b712ccec63c177608e199b9bc63f30bba6e6ecfe" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 211, - "column": 17, - "ruleId": "vue/no-mutating-props", - "message": "Unexpected mutation of \"entity\" prop.", - "hash": "6e04619b373c23c91f6c36c2aad314ac16cdb697" + "line": 186, + "column": 39, + "ruleId": "@typescript-eslint/no-unused-vars", + "message": "'reject' is defined but never used.", + "hash": "9a5b009d8e7f30e61c1991c97d390f0735d19968" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 212, - "column": 17, + "line": 187, + "column": 19, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "39df045639a62f64ccdb03a80e286bc3ad772587" + "hash": "831be7f044c74b2c1a4244ffe3a065dd21e6247d" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 213, - "column": 17, + "line": 205, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "c399a43fa797a8ce61c9d96a644a39cc84a387b7" + "hash": "6c0fc8e55e3132c27cbaeabd2e84ca2838008247" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", - "line": 245, - "column": 13, + "line": 206, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "04337a07944caaa4819cfebcf29e1a7cbfdf248b" + "hash": "4b66a3e1cf5476e4a0e2f1b3f3546222572abf8f" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", + "line": 207, + "column": 9, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "c685acbb0d48bab6c55b0af2dcc701f5edf993fe" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", + "line": 208, + "column": 9, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "0059a00f9459b29cb4a54eb2b273d9f59d7890af" + }, + { + "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue", + "line": 240, + "column": 7, + "ruleId": "vue/no-mutating-props", + "message": "Unexpected mutation of \"entity\" prop.", + "hash": "e66f10f1d6116821b3f0fb066bcbf50772ba5374" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue", - "line": 76, - "column": 13, + "line": 72, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "373a2e31f110d138c66d77f1faf5dc61545c55af" + "hash": "037d3140ebf15fc52a0f58f7844a9a2af44a3d9c" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue", - "line": 81, - "column": 13, + "line": 77, + "column": 7, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "421eb6a63224b4b1d81b216677a710c5c99ddee3" + "hash": "936e5eed1f826a51d129d97580bfb5084a6a4a48" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue", - "line": 95, - "column": 17, + "line": 92, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "84e13d1fdc79f4568634a78df281adbe81739cbd" + "hash": "2058a778c66e3d4005cdfb4354ede1d93e8e1ab6" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue", - "line": 103, - "column": 17, + "line": 100, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "1eed832462e52537402a2825655733f0f2d391d9" + "hash": "20b24f03b3260f915df456ce4d54775f2dda68b6" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue", - "line": 155, - "column": 17, + "line": 152, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "b3a822914fcb5e2fcf28efc331a45b9205002eeb" + "hash": "849bea4394a838c6f9c75cb93a29049d9c7a3c9e" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue", - "line": 164, - "column": 17, + "line": 161, + "column": 9, "ruleId": "vue/no-mutating-props", "message": "Unexpected mutation of \"entity\" prop.", - "hash": "72c7d850f6cdeaf65b373a33234222f9766ee30b" + "hash": "56abd4aa323bb35e94cbd0264603b6d1848298d1" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js", @@ -1609,19 +1529,11 @@ }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue", - "line": 142, - "column": 57, + "line": 136, + "column": 55, "ruleId": "@typescript-eslint/no-explicit-any", "message": "Unexpected any. Specify a different type.", - "hash": "a68eeba7b2e1e603d83da0946c94cd221134aa99" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue", - "line": 204, - "column": 22, - "ruleId": "vue/return-in-computed-property", - "message": "Expected to return a value in \"buttonMessage\" computed property.", - "hash": "b101c861dc11bc7024857fa2977118cb9f99c02c" + "hash": "2ca5e2fd1fccea428a772ad7d2dd0d001bdc413b" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js", @@ -1631,77 +1543,53 @@ "message": "'app' is assigned a value but never used.", "hash": "9e6125f4fc387dc362c69cc6e3ce360eb2851f1b" }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue", - "line": 60, - "column": 22, - "ruleId": "vue/require-valid-default-prop", - "message": "Type of the default value for 'suggested' prop must be a function.", - "hash": "d30212820bc2e97fa02d75dbc3a014558693f169" - }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/Parts/AddressDetailsMap.vue", - "line": 24, + "line": 21, "column": 13, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'LatLngExpression' is defined but never used.", - "hash": "78f5a83dddf05b38aa9472ab93871e976719ef30" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue", - "line": 6, - "column": 7, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'props' is assigned a value but never used.", - "hash": "29fe0a5d52e46c479aa2e7bb23fb55c53df7b22e" + "hash": "96b45c0371542f6e2a5b6f1b2d4f598698faff68" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue", - "line": 114, - "column": 34, + "line": 107, + "column": 32, "ruleId": "vue/require-valid-default-prop", "message": "Type of the default value for 'goToGenerateWorkflowPayload' prop must be a function.", - "hash": "d686fa87cfdc801aaaa08b24e827e503e81e86be" + "hash": "d86b61c318c09e12544ded19f252f6e281e8f985" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue", - "line": 170, + "line": 163, "column": 7, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'goToDuplicateRelatedEntity' is assigned a value but never used.", - "hash": "224ddf3abcff96e3e20a0facc7493883958d5a80" + "hash": "a6b7b632e663f282e0f4951d95a6987fa70f4046" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue", - "line": 171, - "column": 5, + "line": 164, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'event' is defined but never used.", - "hash": "aa87fd5511528b5a45713fe1eaeda9ae0a8c0975" + "hash": "dd3f0de245d7a2107ad5526965d1a0c29df0ef26" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue", - "line": 172, - "column": 5, + "line": 165, + "column": 3, "ruleId": "@typescript-eslint/no-unused-vars", "message": "'workflowName' is defined but never used.", - "hash": "e34bbcf245552e9329efdf7bd64ea3a56f0d4538" + "hash": "d12891a4cc2df02d4b15f30b474edf8b01fd9766" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue", - "line": 173, + "line": 166, "column": 12, "ruleId": "@typescript-eslint/no-empty-function", "message": "Unexpected empty arrow function.", - "hash": "8bdff7a5b3a7ac1506966a6066a1deb556d30efe" - }, - { - "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue", - "line": 3, - "column": 9, - "ruleId": "vue/require-toggle-inside-transition", - "message": "The element inside `` is expected to have a `v-if` or `v-show` directive.", - "hash": "0594fb9d0984f4dd1612671aca21b571087ab8ee" + "hash": "3977a54eb58bc5c558dfb1ce043b14377a746441" }, { "path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts", @@ -1727,14 +1615,6 @@ "message": "'tags' is assigned a value but never used.", "hash": "ae9bb2e0651c118ed9efd227e88b86cc83f5d80d" }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue", - "line": 116, - "column": 18, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'event' is defined but never used.", - "hash": "201f182769c6dfb87148b841e7d9b592be429669" - }, { "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js", "line": 19, @@ -1767,14 +1647,6 @@ "message": "'app' is assigned a value but never used.", "hash": "aaaaa63e7a60443b8cbf8191feb9142852ebdf1c" }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue", - "line": 79, - "column": 13, - "ruleId": "vue/require-v-for-key", - "message": "Elements in iteration expect to have 'v-bind:key' directives.", - "hash": "422f53925922e59655d0f71624c19af75d41628c" - }, { "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js", "line": 12, @@ -1815,22 +1687,6 @@ "message": "'evalFQDN' is assigned a value but never used.", "hash": "7fc32caafa23addddf44f3acbc5045b4523a0271" }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js", - "line": 611, - "column": 9, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'errors' is assigned a value but never used.", - "hash": "c41cf979fc1626c38328dbf1028800c3395496bd" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/ExportFormActionGoalResult/App.vue", - "line": 282, - "column": 7, - "ruleId": "@typescript-eslint/no-unused-expressions", - "message": "Expected an assignment or function call and instead saw an expression.", - "hash": "de3a6e2bb10a80a2bacba665be74266c7efc7d64" - }, { "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/ExportFormActionGoalResult/index.js", "line": 16, @@ -1847,38 +1703,6 @@ "message": "'app' is assigned a value but never used.", "hash": "2f161e663689e3e4dfe2c53b0d64c91a4d2b1a60" }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue", - "line": 263, - "column": 19, - "ruleId": "vue/return-in-computed-property", - "message": "Expected to return a value in \"refreshNetwork\" computed property.", - "hash": "2c1b08a49098c83b09058cedc0a962126e91e544" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue", - "line": 270, - "column": 7, - "ruleId": "vue/no-side-effects-in-computed-properties", - "message": "Unexpected side effect in \"legendLayers\" computed property.", - "hash": "760948d2187c853f17ac9a1bd7107e883092d4f4" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue", - "line": 281, - "column": 5, - "ruleId": "vue/no-dupe-keys", - "message": "Duplicate key 'checkedLayers'. May cause name collision in script or template tag.", - "hash": "447edb461e15e3ff5c60c8ecba88131e442539aa" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue", - "line": 353, - "column": 7, - "ruleId": "@typescript-eslint/no-unused-expressions", - "message": "Expected an assignment or function call and instead saw an expression.", - "hash": "9cf656cbf1eb3d7cc0082e63adcd320b6093d14f" - }, { "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/index.js", "line": 20, @@ -1886,77 +1710,5 @@ "ruleId": "@typescript-eslint/no-unused-vars", "message": "'app' is assigned a value but never used.", "hash": "9e94e6412b8a44e47bfe8e66218cad09cff5bed4" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue", - "line": 42, - "column": 16, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'response' is defined but never used.", - "hash": "62de07b13c662e32332bb062038acee23978ea70" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue", - "line": 356, - "column": 28, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'_response' is defined but never used.", - "hash": "097e7788a2b5dea500b80b8a3cf968e57063a66a" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue", - "line": 6, - "column": 8, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'BadgeEntity' is defined but never used.", - "hash": "951a1b012bdec10c4b859af8b34dd894f63add23" - }, - { - "path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue", - "line": 7, - "column": 8, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'UserRenderBoxBadge' is defined but never used.", - "hash": "99eba0d8633b2c9497417f4f61ec4194dbb2a96b" - }, - { - "path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts", - "line": 4, - "column": 3, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'StoredObjectStatus' is defined but never used.", - "hash": "63f8c4572293916850d6165647774b27d4b732c6" - }, - { - "path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts", - "line": 5, - "column": 3, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'StoredObjectStatusChange' is defined but never used.", - "hash": "a87c178e3eb5999bf0f46b3fa1c6da77e1be08b9" - }, - { - "path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts", - "line": 30, - "column": 61, - "ruleId": "@typescript-eslint/no-unused-vars", - "message": "'e' is defined but never used.", - "hash": "02953121583f4f73742a19adab099ab63df9076e" - }, - { - "path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts", - "line": 31, - "column": 32, - "ruleId": "@typescript-eslint/no-explicit-any", - "message": "Unexpected any. Specify a different type.", - "hash": "af48e21a1651b6017ede882dab249c00a818a44d" - }, - { - "path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts", - "line": 37, - "column": 16, - "ruleId": "@typescript-eslint/no-explicit-any", - "message": "Unexpected any. Specify a different type.", - "hash": "7513ea552a0a649ce4ab93b6cf9d40bfef4f68d9" } -] \ No newline at end of file +] diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..222861c34 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "tabWidth": 2, + "useTabs": false +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..d7a227605 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Chill Debug", + "type": "php", + "request": "launch", + "port": 9000, + "pathMappings": { + "/var/www/html": "${workspaceFolder}" + }, + "preLaunchTask": "symfony" + }, + { + "name": "Yarn Encore Dev (Watch)", + "type": "node-terminal", + "request": "launch", + "command": "yarn encore dev --watch", + "cwd": "${workspaceFolder}" + } + ], + "compounds": [ + { + "name": "Chill Debug + Yarn Encore Dev (Watch)", + "configurations": ["Chill Debug", "Yarn Encore Dev (Watch)"] + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..a652cfe03 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "tasks": [ + { + "type": "shell", + "command": "symfony", + "args": [ + "server:start", + "--allow-http", + "--no-tls", + "--port=8000", + "--allow-all-ip", + "-d" + ], + "label": "symfony" + }, + { + "type": "shell", + "command": "yarn", + "args": ["encore", "dev", "--watch"], + "label": "webpack" + } + ] +} diff --git a/CONVENTIONS-fr.md b/CONVENTIONS-fr.md index 028971ef2..4462f4e08 100644 --- a/CONVENTIONS-fr.md +++ b/CONVENTIONS-fr.md @@ -54,7 +54,7 @@ Arborescence: - person - personvendee - household_edit_metadata - - index.js + - index.ts ``` ## Organisation des feuilles de styles diff --git a/composer.json b/composer.json index 8d36d4d07..94338ce42 100644 --- a/composer.json +++ b/composer.json @@ -133,6 +133,7 @@ "Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle", "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle", "Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src", + "Chill\\TicketBundle\\": "src/Bundle/ChillTicketBundle/src", "Chill\\Utils\\Rector\\": "utils/rector/src" } }, diff --git a/config/bundles.php b/config/bundles.php index ec11bc0b6..2eb99868b 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -35,6 +35,7 @@ return [ Chill\ThirdPartyBundle\ChillThirdPartyBundle::class => ['all' => true], Chill\BudgetBundle\ChillBudgetBundle::class => ['all' => true], Chill\WopiBundle\ChillWopiBundle::class => ['all' => true], + Chill\TicketBundle\ChillTicketBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true], ]; diff --git a/config/packages/chill_ticket.yaml b/config/packages/chill_ticket.yaml new file mode 100644 index 000000000..acb5571dc --- /dev/null +++ b/config/packages/chill_ticket.yaml @@ -0,0 +1,4 @@ +chill_ticket: + ticket: + person_per_ticket: one # One of "one"; "many" + diff --git a/config/packages/doctrine_migrations_chill.yaml b/config/packages/doctrine_migrations_chill.yaml index 8b8bf539b..29acb8a49 100644 --- a/config/packages/doctrine_migrations_chill.yaml +++ b/config/packages/doctrine_migrations_chill.yaml @@ -14,6 +14,7 @@ doctrine_migrations: 'Chill\Migrations\Calendar': '@ChillCalendarBundle/migrations' 'Chill\Migrations\Budget': '@ChillBudgetBundle/migrations' 'Chill\Migrations\Report': '@ChillReportBundle/migrations' + 'Chill\Migrations\Ticket': '@ChillTicketBundle/migrations' all_or_nothing: true diff --git a/config/routes/chill_ticket.yaml b/config/routes/chill_ticket.yaml new file mode 100644 index 000000000..311a51992 --- /dev/null +++ b/config/routes/chill_ticket.yaml @@ -0,0 +1,2 @@ +chill_ticket_bundle: + resource: '@ChillTicketBundle/config/routes.yaml' diff --git a/docs/source/development/create-a-new-bundle.rst b/docs/source/development/create-a-new-bundle.rst index 087487ff0..8206acee8 100644 --- a/docs/source/development/create-a-new-bundle.rst +++ b/docs/source/development/create-a-new-bundle.rst @@ -11,24 +11,94 @@ Create a new bundle ******************* -Create your own bundle is not a trivial task. - -The easiest way to achieve this is seems to be : - -1. Prepare a fresh installation of the chill project, in a new directory -2. Create a new bundle in this project, in the src directory -3. Initialize a git repository **at the root bundle**, and create your initial commit. -4. Register the bundle with composer/packagist. If you do not plan to distribute your bundle with packagist, you may use a custom repository for achieve this [#f1]_ -5. Move to a development installation, made as described in the :ref:`installation-for-development` section, and add your new repository to the composer.json file -6. Work as :ref:`usual ` - .. warning:: This part of the doc is not yet tested -TODO +Create a new directory with Bundle class +---------------------------------------- + +.. code-block:: bash + + mkdir -p src/Bundle/ChillSomeBundle/src/config + mkdir -p src/Bundle/ChillSomeBundle/src/Controller + +Add a bundle file + +.. code-block:: php + + ['all' => true], + +And import routes in :code:`config/routes/chill_some_bundle.yaml`: + +.. code-block:: yaml + + chill_ticket_bundle: + resource: '@ChillSomeBundle/config/routes.yaml' + +Add the doctrine_migration namespace +------------------------------------ + +Add the namespace to :code:`config/packages/doctrine_migrations_chill.yaml` + +.. code-block:: diff + + doctrine_migrations: + migrations_paths: + + 'Chill\Some\Ticket': '@ChillSomeBundle/migrations' + +Dump autoloading +---------------- + +.. code-block:: bash + + symfony composer dump-autoload -.. [#f1] Be aware that we use the Affero GPL Licence, which ensure that all users must have access to derivative works done with this software. diff --git a/package.json b/package.json index fc50ba29c..ccabc5c25 100644 --- a/package.json +++ b/package.json @@ -79,12 +79,12 @@ "dev": "encore dev", "watch": "encore dev --watch", "build": "encore production --progress", - "specs-build": "yaml-merge src/Bundle/ChillMainBundle/chill.api.specs.yaml src/Bundle/ChillPersonBundle/chill.api.specs.yaml src/Bundle/ChillCalendarBundle/chill.api.specs.yaml src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml src/Bundle/ChillDocStoreBundle/chill.api.specs.yaml> templates/api/specs.yaml", + "specs-build": "yaml-merge src/Bundle/ChillMainBundle/chill.api.specs.yaml src/Bundle/ChillPersonBundle/chill.api.specs.yaml src/Bundle/ChillCalendarBundle/chill.api.specs.yaml src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml src/Bundle/ChillDocStoreBundle/chill.api.specs.yaml src/Bundle/ChillTicketBundle/chill.api.specs.yaml> templates/api/specs.yaml", "specs-validate": "swagger-cli validate templates/api/specs.yaml", "specs-create-dir": "mkdir -p templates/api", "specs": "yarn run specs-create-dir && yarn run specs-build && yarn run specs-validate", "version": "node --version", - "eslint": "npx eslint-baseline --fix \"src/**/*.{js,ts,vue}\"" + "eslint": "eslint-baseline --fix \"src/**/*.{js,ts,vue}\"" }, "private": true } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index cdc7468ec..d122aeb4c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -58,6 +58,10 @@ src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php + + + src/Bundle/ChillTicketBundle/tests/ + - + + diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue index 86d4a6c5a..5f434052e 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue @@ -1,28 +1,28 @@ diff --git a/src/Bundle/ChillDocGeneratorBundle/Resources/public/vuejs/_components/PickTemplate.vue b/src/Bundle/ChillDocGeneratorBundle/Resources/public/vuejs/_components/PickTemplate.vue index 1bcc95fd0..3a2f4fd59 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Resources/public/vuejs/_components/PickTemplate.vue +++ b/src/Bundle/ChillDocGeneratorBundle/Resources/public/vuejs/_components/PickTemplate.vue @@ -1,59 +1,54 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/js/async-upload/uploader.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/js/async-upload/uploader.ts index a09c4a5f6..367ab0829 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/js/async-upload/uploader.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/js/async-upload/uploader.ts @@ -6,20 +6,20 @@ const algo = "AES-CBC"; const URL_POST = "/asyncupload/temp_url/generate/post"; const keyDefinition = { - name: algo, - length: 256, + name: algo, + length: 256, }; const createFilename = (): string => { - let text = ""; - const possible = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + let text = ""; + const possible = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - for (let i = 0; i < 7; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } + for (let i = 0; i < 7; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } - return text; + return text; }; /** @@ -30,59 +30,59 @@ const createFilename = (): string => { * @returns {Promise} A Promise that resolves to the newly created StoredObject. */ export const fetchNewStoredObject = async (): Promise => { - return makeFetch("POST", "/api/1.0/doc-store/stored-object/create", null); + return makeFetch("POST", "/api/1.0/doc-store/stored-object/create", null); }; export const uploadVersion = async ( - uploadFile: ArrayBuffer, - storedObject: StoredObject, + uploadFile: ArrayBuffer, + storedObject: StoredObject, ): Promise => { - const params = new URLSearchParams(); - params.append("expires_delay", "180"); - params.append("submit_delay", "180"); - const asyncData: PostStoreObjectSignature = await makeFetch( - "GET", - `/api/1.0/doc-store/async-upload/temp_url/${storedObject.uuid}/generate/post` + - "?" + - params.toString(), - ); - const suffix = createFilename(); - const filename = asyncData.prefix + suffix; - const formData = new FormData(); - formData.append("redirect", asyncData.redirect); - formData.append("max_file_size", asyncData.max_file_size.toString()); - formData.append("max_file_count", asyncData.max_file_count.toString()); - formData.append("expires", asyncData.expires.toString()); - formData.append("signature", asyncData.signature); - formData.append(filename, new Blob([uploadFile]), suffix); + const params = new URLSearchParams(); + params.append("expires_delay", "180"); + params.append("submit_delay", "180"); + const asyncData: PostStoreObjectSignature = await makeFetch( + "GET", + `/api/1.0/doc-store/async-upload/temp_url/${storedObject.uuid}/generate/post` + + "?" + + params.toString(), + ); + const suffix = createFilename(); + const filename = asyncData.prefix + suffix; + const formData = new FormData(); + formData.append("redirect", asyncData.redirect); + formData.append("max_file_size", asyncData.max_file_size.toString()); + formData.append("max_file_count", asyncData.max_file_count.toString()); + formData.append("expires", asyncData.expires.toString()); + formData.append("signature", asyncData.signature); + formData.append(filename, new Blob([uploadFile]), suffix); - const response = await window.fetch(asyncData.url, { - method: "POST", - body: formData, - }); + const response = await window.fetch(asyncData.url, { + method: "POST", + body: formData, + }); - if (!response.ok) { - console.error("Error while sending file to store", response); - throw new Error(response.statusText); - } + if (!response.ok) { + console.error("Error while sending file to store", response); + throw new Error(response.statusText); + } - return Promise.resolve(filename); + return Promise.resolve(filename); }; export const encryptFile = async ( - originalFile: ArrayBuffer, + originalFile: ArrayBuffer, ): Promise<[ArrayBuffer, Uint8Array, JsonWebKey]> => { - const iv = crypto.getRandomValues(new Uint8Array(16)); - const key = await window.crypto.subtle.generateKey(keyDefinition, true, [ - "encrypt", - "decrypt", - ]); - const exportedKey = await window.crypto.subtle.exportKey("jwk", key); - const encrypted = await window.crypto.subtle.encrypt( - { name: algo, iv: iv }, - key, - originalFile, - ); + const iv = crypto.getRandomValues(new Uint8Array(16)); + const key = await window.crypto.subtle.generateKey(keyDefinition, true, [ + "encrypt", + "decrypt", + ]); + const exportedKey = await window.crypto.subtle.exportKey("jwk", key); + const encrypted = await window.crypto.subtle.encrypt( + { name: algo, iv: iv }, + key, + originalFile, + ); - return Promise.resolve([encrypted, iv, exportedKey]); + return Promise.resolve([encrypted, iv, exportedKey]); }; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/js/generic-doc-api.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/js/generic-doc-api.ts index c15eff711..aaff2a331 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/js/generic-doc-api.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/js/generic-doc-api.ts @@ -2,9 +2,9 @@ import { fetchResults } from "ChillMainAssets/lib/api/apiMethods"; import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc"; export function fetch_generic_docs_by_accompanying_period( - periodId: number, + periodId: number, ): Promise { - return fetchResults( - `/api/1.0/doc-store/generic-doc/by-period/${periodId}/index`, - ); + return fetchResults( + `/api/1.0/doc-store/generic-doc/by-period/${periodId}/index`, + ); } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/index.ts index 30fe2b26a..97e0d3aa3 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/index.ts @@ -6,117 +6,116 @@ import { _createI18n } from "../../../../../ChillMainBundle/Resources/public/vue const i18n = _createI18n({}); const startApp = ( - divElement: HTMLDivElement, - collectionEntry: null | HTMLLIElement, + divElement: HTMLDivElement, + collectionEntry: null | HTMLLIElement, ): void => { - console.log("app started", divElement); + console.log("app started", divElement); - const inputTitle = collectionEntry?.querySelector("input[type='text']"); + const inputTitle = collectionEntry?.querySelector("input[type='text']"); - const input_stored_object: HTMLInputElement | null = - divElement.querySelector("input[data-stored-object]"); - if (null === input_stored_object) { - throw new Error("input to stored object not found"); - } + const input_stored_object: HTMLInputElement | null = divElement.querySelector( + "input[data-stored-object]", + ); + if (null === input_stored_object) { + throw new Error("input to stored object not found"); + } - let existingDoc: StoredObject | null = null; - if (input_stored_object.value !== "") { - existingDoc = JSON.parse(input_stored_object.value); - } - const app_container = document.createElement("div"); - divElement.appendChild(app_container); + let existingDoc: StoredObject | null = null; + if (input_stored_object.value !== "") { + existingDoc = JSON.parse(input_stored_object.value); + } + const app_container = document.createElement("div"); + divElement.appendChild(app_container); - const app = createApp({ - template: - '', - data() { - return { - existingDoc: existingDoc, - inputTitle: inputTitle, - }; - }, - components: { - DropFileWidget, - }, - methods: { - addDocument: function ({ - stored_object, - stored_object_version, - file_name, - }: { - stored_object: StoredObject; - stored_object_version: StoredObjectVersion; - file_name: string; - }): void { - stored_object.title = file_name; - console.log("object added", stored_object); - console.log("version added", stored_object_version); - this.$data.existingDoc = stored_object; - this.$data.existingDoc.currentVersion = stored_object_version; - input_stored_object.value = JSON.stringify( - this.$data.existingDoc, - ); - if (this.$data.inputTitle) { - if (!this.$data.inputTitle?.value) { - this.$data.inputTitle.value = file_name; - } - } - }, - removeDocument: function (object: StoredObject): void { - console.log("catch remove document", object); - input_stored_object.value = ""; - this.$data.existingDoc = undefined; - console.log("collectionEntry", collectionEntry); + const app = createApp({ + template: + '', + data() { + return { + existingDoc: existingDoc, + inputTitle: inputTitle, + }; + }, + components: { + DropFileWidget, + }, + methods: { + addDocument: function ({ + stored_object, + stored_object_version, + file_name, + }: { + stored_object: StoredObject; + stored_object_version: StoredObjectVersion; + file_name: string; + }): void { + stored_object.title = file_name; + console.log("object added", stored_object); + console.log("version added", stored_object_version); + this.$data.existingDoc = stored_object; + this.$data.existingDoc.currentVersion = stored_object_version; + input_stored_object.value = JSON.stringify(this.$data.existingDoc); + if (this.$data.inputTitle) { + if (!this.$data.inputTitle?.value) { + this.$data.inputTitle.value = file_name; + } + } + }, + removeDocument: function (object: StoredObject): void { + console.log("catch remove document", object); + input_stored_object.value = ""; + this.$data.existingDoc = undefined; + console.log("collectionEntry", collectionEntry); - if (null !== collectionEntry) { - console.log("will remove collection"); - collectionEntry.remove(); - } - }, - }, - }); + if (null !== collectionEntry) { + console.log("will remove collection"); + collectionEntry.remove(); + } + }, + }, + }); - app.use(i18n).mount(app_container); + app.use(i18n).mount(app_container); }; window.addEventListener("collection-add-entry", (( - e: CustomEvent, + e: CustomEvent, ) => { - const detail = e.detail; - const divElement: null | HTMLDivElement = detail.entry.querySelector( - "div[data-stored-object]", - ); + const detail = e.detail; + const divElement: null | HTMLDivElement = detail.entry.querySelector( + "div[data-stored-object]", + ); - if (null === divElement) { - throw new Error("div[data-stored-object] not found"); - } + if (null === divElement) { + throw new Error("div[data-stored-object] not found"); + } - startApp(divElement, detail.entry); + startApp(divElement, detail.entry); }) as EventListener); window.addEventListener("DOMContentLoaded", () => { - const upload_inputs: NodeListOf = document.querySelectorAll( - "div[data-stored-object]", - ); + const upload_inputs: NodeListOf = document.querySelectorAll( + "div[data-stored-object]", + ); - upload_inputs.forEach((input: HTMLDivElement): void => { - // test for a parent to check if this is a collection entry - let collectionEntry: null | HTMLLIElement = null; - const parent = input.parentElement; - console.log("parent", parent); - if (null !== parent) { - const grandParent = parent.parentElement; - console.log("grandParent", grandParent); - if (null !== grandParent) { - if ( - grandParent.tagName.toLowerCase() === "li" && - grandParent.classList.contains("entry") - ) { - collectionEntry = grandParent as HTMLLIElement; - } - } + upload_inputs.forEach((input: HTMLDivElement): void => { + // test for a parent to check if this is a collection entry + let collectionEntry: null | HTMLLIElement = null; + const parent = input.parentElement; + console.log("parent", parent); + if (null !== parent) { + const grandParent = parent.parentElement; + console.log("grandParent", grandParent); + if (null !== grandParent) { + if ( + grandParent.tagName.toLowerCase() === "li" && + grandParent.classList.contains("entry") + ) { + collectionEntry = grandParent as HTMLLIElement; } - startApp(input, collectionEntry); - }); + } + } + startApp(input, collectionEntry); + }); }); export {}; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/button_download/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/module/button_download/index.ts index 30b9e29d1..4ab819ddf 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/button_download/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/button_download/index.ts @@ -9,26 +9,26 @@ import ToastPlugin from "vue-toast-notification"; const i18n = _createI18n({}); window.addEventListener("DOMContentLoaded", function (e) { - document - .querySelectorAll("div[data-download-button-single]") - .forEach((el) => { - const storedObject = JSON.parse( - el.dataset.storedObject as string, - ) as StoredObject; - const title = el.dataset.title as string; - const app = createApp({ - components: { DownloadButton }, - data() { - return { - storedObject, - title, - classes: { btn: true, "btn-outline-primary": true }, - }; - }, - template: - '', - }); + document + .querySelectorAll("div[data-download-button-single]") + .forEach((el) => { + const storedObject = JSON.parse( + el.dataset.storedObject as string, + ) as StoredObject; + const title = el.dataset.title as string; + const app = createApp({ + components: { DownloadButton }, + data() { + return { + storedObject, + title, + classes: { btn: true, "btn-outline-primary": true }, + }; + }, + template: + '', + }); - app.use(i18n).use(ToastPlugin).mount(el); - }); + app.use(i18n).use(ToastPlugin).mount(el); + }); }); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts index 5874e88fe..080f63c66 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts @@ -8,66 +8,66 @@ import ToastPlugin from "vue-toast-notification"; const i18n = _createI18n({}); window.addEventListener("DOMContentLoaded", function (e) { - document - .querySelectorAll("div[data-download-buttons]") - .forEach((el) => { - const app = createApp({ - components: { DocumentActionButtonsGroup }, - data() { - const datasets = el.dataset as { - filename: string; - canEdit: string; - storedObject: string; - buttonSmall: string; - davLink: string; - davLinkExpiration: string; - }; + document + .querySelectorAll("div[data-download-buttons]") + .forEach((el) => { + const app = createApp({ + components: { DocumentActionButtonsGroup }, + data() { + const datasets = el.dataset as { + filename: string; + canEdit: string; + storedObject: string; + buttonSmall: string; + davLink: string; + davLinkExpiration: string; + }; - const storedObject = JSON.parse( - datasets.storedObject, - ) as StoredObject, - filename = datasets.filename, - canEdit = datasets.canEdit === "1", - small = datasets.buttonSmall === "1", - davLink = - "davLink" in datasets && datasets.davLink !== "" - ? datasets.davLink - : null, - davLinkExpiration = - "davLinkExpiration" in datasets - ? Number.parseInt(datasets.davLinkExpiration) - : null; - return { - storedObject, - filename, - canEdit, - small, - davLink, - davLinkExpiration, - }; - }, - template: - '', - methods: { - onStoredObjectStatusChange: function ( - newStatus: StoredObjectStatusChange, - ): void { - this.$data.storedObject.status = newStatus.status; - this.$data.storedObject.filename = newStatus.filename; - this.$data.storedObject.type = newStatus.type; + const storedObject = JSON.parse( + datasets.storedObject, + ) as StoredObject, + filename = datasets.filename, + canEdit = datasets.canEdit === "1", + small = datasets.buttonSmall === "1", + davLink = + "davLink" in datasets && datasets.davLink !== "" + ? datasets.davLink + : null, + davLinkExpiration = + "davLinkExpiration" in datasets + ? Number.parseInt(datasets.davLinkExpiration) + : null; + return { + storedObject, + filename, + canEdit, + small, + davLink, + davLinkExpiration, + }; + }, + template: + '', + methods: { + onStoredObjectStatusChange: function ( + newStatus: StoredObjectStatusChange, + ): void { + this.$data.storedObject.status = newStatus.status; + this.$data.storedObject.filename = newStatus.filename; + this.$data.storedObject.type = newStatus.type; - // remove eventual div which inform pending status - document - .querySelectorAll( - `[data-docgen-is-pending="${this.$data.storedObject.id}"]`, - ) - .forEach(function (el) { - el.remove(); - }); - }, - }, - }); + // remove eventual div which inform pending status + document + .querySelectorAll( + `[data-docgen-is-pending="${this.$data.storedObject.id}"]`, + ) + .forEach(function (el) { + el.remove(); + }); + }, + }, + }); - app.use(i18n).use(ToastPlugin).mount(el); - }); + app.use(i18n).use(ToastPlugin).mount(el); + }); }); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts index facc55e58..9cda25cad 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts @@ -2,7 +2,7 @@ import { DateTime } from "ChillMainAssets/types"; import { StoredObject } from "ChillDocStoreAssets/types/index"; export interface GenericDocMetadata { - isPresent: boolean; + isPresent: boolean; } /** @@ -15,57 +15,57 @@ export interface EmptyMetadata extends GenericDocMetadata {} * Minimal Metadata for a GenericDoc with a normalizer */ export interface BaseMetadata extends GenericDocMetadata { - title: string; + title: string; } /** * A generic doc is a document attached to a Person or an AccompanyingPeriod. */ export interface GenericDoc { - type: "doc_store_generic_doc"; - uniqueKey: string; - key: string; - identifiers: object; - context: "person" | "accompanying-period"; - doc_date: DateTime; - metadata: GenericDocMetadata; - storedObject: StoredObject | null; + type: "doc_store_generic_doc"; + uniqueKey: string; + key: string; + identifiers: object; + context: "person" | "accompanying-period"; + doc_date: DateTime; + metadata: GenericDocMetadata; + storedObject: StoredObject | null; } export interface GenericDocForAccompanyingPeriod extends GenericDoc { - context: "accompanying-period"; + context: "accompanying-period"; } interface BaseMetadataWithHtml extends BaseMetadata { - html: string; + html: string; } export interface GenericDocForAccompanyingCourseDocument - extends GenericDocForAccompanyingPeriod { - key: "accompanying_course_document"; - metadata: BaseMetadataWithHtml; + extends GenericDocForAccompanyingPeriod { + key: "accompanying_course_document"; + metadata: BaseMetadataWithHtml; } export interface GenericDocForAccompanyingCourseActivityDocument - extends GenericDocForAccompanyingPeriod { - key: "accompanying_course_activity_document"; - metadata: BaseMetadataWithHtml; + extends GenericDocForAccompanyingPeriod { + key: "accompanying_course_activity_document"; + metadata: BaseMetadataWithHtml; } export interface GenericDocForAccompanyingCourseCalendarDocument - extends GenericDocForAccompanyingPeriod { - key: "accompanying_course_calendar_document"; - metadata: BaseMetadataWithHtml; + extends GenericDocForAccompanyingPeriod { + key: "accompanying_course_calendar_document"; + metadata: BaseMetadataWithHtml; } export interface GenericDocForAccompanyingCoursePersonDocument - extends GenericDocForAccompanyingPeriod { - key: "person_document"; - metadata: BaseMetadataWithHtml; + extends GenericDocForAccompanyingPeriod { + key: "person_document"; + metadata: BaseMetadataWithHtml; } export interface GenericDocForAccompanyingCourseWorkEvaluationDocument - extends GenericDocForAccompanyingPeriod { - key: "accompanying_period_work_evaluation_document"; - metadata: BaseMetadataWithHtml; + extends GenericDocForAccompanyingPeriod { + key: "accompanying_period_work_evaluation_document"; + metadata: BaseMetadataWithHtml; } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts index 5b34b8f73..f71ed0350 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts @@ -4,73 +4,73 @@ import { SignedUrlGet } from "ChillDocStoreAssets/vuejs/StoredObjectButton/helpe export type StoredObjectStatus = "empty" | "ready" | "failure" | "pending"; export interface StoredObject { - id: number; - title: string | null; - uuid: string; - prefix: string; - status: StoredObjectStatus; - currentVersion: - | null - | StoredObjectVersionCreated - | StoredObjectVersionPersisted; - totalVersions: number; - datas: object; - /** @deprecated */ - creationDate: DateTime; - createdAt: DateTime | null; - createdBy: User | null; - _permissions: { - canEdit: boolean; - canSee: boolean; - }; - _links?: { - dav_link?: { - href: string; - expiration: number; - }; - downloadLink?: SignedUrlGet; + id: number; + title: string | null; + uuid: string; + prefix: string; + status: StoredObjectStatus; + currentVersion: + | null + | StoredObjectVersionCreated + | StoredObjectVersionPersisted; + totalVersions: number; + datas: object; + /** @deprecated */ + creationDate: DateTime; + createdAt: DateTime | null; + createdBy: User | null; + _permissions: { + canEdit: boolean; + canSee: boolean; + }; + _links?: { + dav_link?: { + href: string; + expiration: number; }; + downloadLink?: SignedUrlGet; + }; } export interface StoredObjectVersion { - /** - * filename of the object in the object storage - */ - filename: string; - iv: number[]; - keyInfos: JsonWebKey; - type: string; + /** + * filename of the object in the object storage + */ + filename: string; + iv: number[]; + keyInfos: JsonWebKey; + type: string; } export interface StoredObjectVersionCreated extends StoredObjectVersion { - persisted: false; + persisted: false; } export interface StoredObjectVersionPersisted - extends StoredObjectVersionCreated { - version: number; - id: number; - createdAt: DateTime | null; - createdBy: User | null; + extends StoredObjectVersionCreated { + version: number; + id: number; + createdAt: DateTime | null; + createdBy: User | null; } export interface StoredObjectStatusChange { - id: number; - filename: string; - status: StoredObjectStatus; - type: string; + id: number; + filename: string; + status: StoredObjectStatus; + type: string; } export interface StoredObjectVersionWithPointInTime - extends StoredObjectVersionPersisted { - "point-in-times": StoredObjectPointInTime[]; - "from-restored": StoredObjectVersionPersisted | null; + extends StoredObjectVersionPersisted { + "point-in-times": StoredObjectPointInTime[]; + "from-restored": StoredObjectVersionPersisted | null; } export interface StoredObjectPointInTime { - id: number; - byUser: User | null; - reason: "keep-before-conversion" | "keep-by-user"; + id: number; + byUser: User | null; + reason: "keep-before-conversion" | "keep-by-user"; } /** @@ -82,63 +82,63 @@ export type WopiEditButtonExecutableBeforeLeaveFunction = () => Promise; * Object containing information for performering a POST request to a swift object store */ export interface PostStoreObjectSignature { - method: "POST"; - max_file_size: number; - max_file_count: 1; - expires: number; - submit_delay: 180; - redirect: string; - prefix: string; - url: string; - signature: string; + method: "POST"; + max_file_size: number; + max_file_count: 1; + expires: number; + submit_delay: 180; + redirect: string; + prefix: string; + url: string; + signature: string; } export interface PDFPage { - index: number; - width: number; - height: number; + index: number; + width: number; + height: number; } export interface SignatureZone { - index: number | null; - x: number; - y: number; - width: number; - height: number; - PDFPage: PDFPage; + index: number | null; + x: number; + y: number; + width: number; + height: number; + PDFPage: PDFPage; } export interface Signature { - id: number; - storedObject: StoredObject; - zones: SignatureZone[]; + id: number; + storedObject: StoredObject; + zones: SignatureZone[]; } export type SignedState = - | "pending" - | "signed" - | "rejected" - | "canceled" - | "error"; + | "pending" + | "signed" + | "rejected" + | "canceled" + | "error"; export interface CheckSignature { - state: SignedState; - storedObject: StoredObject; + state: SignedState; + storedObject: StoredObject; } export type CanvasEvent = "select" | "add"; export interface ZoomLevel { - id: number; - zoom: number; - label: { - fr?: string; - nl?: string; - }; + id: number; + zoom: number; + label: { + fr?: string; + nl?: string; + }; } export interface GenericDoc { - type: "doc_store_generic_doc"; - key: string; - context: "person" | "accompanying-period"; - doc_date: DateTime; + type: "doc_store_generic_doc"; + key: string; + context: "person" | "accompanying-period"; + doc_date: DateTime; } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue index 85548f6d3..8fd348807 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue @@ -1,67 +1,65 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue index ea195da4b..3021de36e 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue @@ -1,355 +1,338 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts index a46257b5e..e3ace5b40 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/index.ts @@ -4,36 +4,36 @@ import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n"; import App from "./App.vue"; const appMessages = { - fr: { - yes: "Oui", - are_you_sure: "Êtes-vous sûr·e?", - you_are_going_to_sign: "Vous allez signer le document", - signature_confirmation: "Confirmation de la signature", - sign: "Signer", - choose_another_signature: "Choisir une autre zone", - cancel: "Annuler", - last_sign_zone: "Zone de signature précédente", - next_sign_zone: "Zone de signature suivante", - add_sign_zone: "Ajouter une zone de signature", - click_on_document: "Cliquer sur le document", - last_zone: "Zone précédente", - next_zone: "Zone suivante", - add_zone: "Ajouter une zone", - another_zone: "Autre zone", - electronic_signature_in_progress: "Signature électronique en cours...", - loading: "Chargement...", - remove_sign_zone: "Enlever la zone", - return: "Retour", - see_all_pages: "Voir toutes les pages", - all_pages: "Toutes les pages", - }, + fr: { + yes: "Oui", + are_you_sure: "Êtes-vous sûr·e?", + you_are_going_to_sign: "Vous allez signer le document", + signature_confirmation: "Confirmation de la signature", + sign: "Signer", + choose_another_signature: "Choisir une autre zone", + cancel: "Annuler", + last_sign_zone: "Zone de signature précédente", + next_sign_zone: "Zone de signature suivante", + add_sign_zone: "Ajouter une zone de signature", + click_on_document: "Cliquer sur le document", + last_zone: "Zone précédente", + next_zone: "Zone suivante", + add_zone: "Ajouter une zone", + another_zone: "Autre zone", + electronic_signature_in_progress: "Signature électronique en cours...", + loading: "Chargement...", + remove_sign_zone: "Enlever la zone", + return: "Retour", + see_all_pages: "Voir toutes les pages", + all_pages: "Toutes les pages", + }, }; const i18n = _createI18n(appMessages); const app = createApp({ - template: ``, + template: ``, }) - .use(i18n) - .component("app", App) - .mount("#document-signature"); + .use(i18n) + .component("app", App) + .mount("#document-signature"); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue index 017629ee4..c731ef19f 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue @@ -1,208 +1,206 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue index 956b3e859..bde094487 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue @@ -6,24 +6,24 @@ import { computed, reactive } from "vue"; import { useToast } from "vue-toast-notification"; interface DropFileConfig { - allowRemove: boolean; - existingDoc?: StoredObject; + allowRemove: boolean; + existingDoc?: StoredObject; } const props = withDefaults(defineProps(), { - allowRemove: false, + allowRemove: false, }); const emit = defineEmits<{ - ( - e: "addDocument", - { - stored_object: StoredObject, - stored_object_version: StoredObjectVersion, - file_name: string, - }, - ): void; - (e: "removeDocument"): void; + ( + e: "addDocument", + { + stored_object: StoredObject, + stored_object_version: StoredObjectVersion, + file_name: string, + }, + ): void; + (e: "removeDocument"): void; }>(); const $toast = useToast(); @@ -33,67 +33,67 @@ const state = reactive({ showModal: false }); const modalClasses = { "modal-dialog-centered": true, "modal-md": true }; const buttonState = computed<"add" | "replace">(() => { - if (props.existingDoc === undefined || props.existingDoc === null) { - return "add"; - } + if (props.existingDoc === undefined || props.existingDoc === null) { + return "add"; + } - return "replace"; + return "replace"; }); function onAddDocument({ - stored_object, - stored_object_version, - file_name, + stored_object, + stored_object_version, + file_name, }: { - stored_object: StoredObject; - stored_object_version: StoredObjectVersion; - file_name: string; + stored_object: StoredObject; + stored_object_version: StoredObjectVersion; + file_name: string; }): void { - const message = - buttonState.value === "add" ? "Document ajouté" : "Document remplacé"; - $toast.success(message); - emit("addDocument", { stored_object_version, stored_object, file_name }); - state.showModal = false; + const message = + buttonState.value === "add" ? "Document ajouté" : "Document remplacé"; + $toast.success(message); + emit("addDocument", { stored_object_version, stored_object, file_name }); + state.showModal = false; } function onRemoveDocument(): void { - emit("removeDocument"); + emit("removeDocument"); } function openModal(): void { - state.showModal = true; + state.showModal = true; } function closeModal(): void { - state.showModal = false; + state.showModal = false; } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue index 54f8ddf0c..8ead08b45 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue @@ -5,97 +5,97 @@ import DropFile from "ChillDocStoreAssets/vuejs/DropFileWidget/DropFile.vue"; import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue"; interface DropFileConfig { - allowRemove: boolean; - existingDoc?: StoredObject; + allowRemove: boolean; + existingDoc?: StoredObject; } const props = withDefaults(defineProps(), { - allowRemove: false, + allowRemove: false, }); const emit = defineEmits<{ - ( - e: "addDocument", - { - stored_object: StoredObject, - stored_object_version: StoredObjectVersion, - file_name: string, - }, - ): void; - (e: "removeDocument"): void; + ( + e: "addDocument", + { + stored_object: StoredObject, + stored_object_version: StoredObjectVersion, + file_name: string, + }, + ): void; + (e: "removeDocument"): void; }>(); const has_existing_doc = computed(() => { - return props.existingDoc !== undefined && props.existingDoc !== null; + return props.existingDoc !== undefined && props.existingDoc !== null; }); const dav_link_expiration = computed(() => { - if (props.existingDoc === undefined || props.existingDoc === null) { - return undefined; - } - if (props.existingDoc.status !== "ready") { - return undefined; - } + if (props.existingDoc === undefined || props.existingDoc === null) { + return undefined; + } + if (props.existingDoc.status !== "ready") { + return undefined; + } - return props.existingDoc._links?.dav_link?.expiration; + return props.existingDoc._links?.dav_link?.expiration; }); const dav_link_href = computed(() => { - if (props.existingDoc === undefined || props.existingDoc === null) { - return undefined; - } - if (props.existingDoc.status !== "ready") { - return undefined; - } + if (props.existingDoc === undefined || props.existingDoc === null) { + return undefined; + } + if (props.existingDoc.status !== "ready") { + return undefined; + } - return props.existingDoc._links?.dav_link?.href; + return props.existingDoc._links?.dav_link?.href; }); const onAddDocument = ({ - stored_object, - stored_object_version, - file_name, + stored_object, + stored_object_version, + file_name, }: { - stored_object: StoredObject; - stored_object_version: StoredObjectVersion; - file_name: string; + stored_object: StoredObject; + stored_object_version: StoredObjectVersion; + file_name: string; }): void => { - emit("addDocument", { stored_object, stored_object_version, file_name }); + emit("addDocument", { stored_object, stored_object_version, file_name }); }; const onRemoveDocument = (e: Event): void => { - e.stopPropagation(); - e.preventDefault(); - emit("removeDocument"); + e.stopPropagation(); + e.preventDefault(); + emit("removeDocument"); }; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue index 5260095fa..ba2c44f6a 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue @@ -1,46 +1,46 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue index b6c6a496f..8cb60bc12 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue @@ -1,28 +1,28 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DesktopEditButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DesktopEditButton.vue index 2b74f76bd..f00889a8e 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DesktopEditButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DesktopEditButton.vue @@ -3,13 +3,13 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal.vue"; import { computed, reactive } from "vue"; export interface DesktopEditButtonConfig { - editLink: null; - classes: Record; - expirationLink: number | Date; + editLink: null; + classes: Record; + expirationLink: number | Date; } interface DesktopEditButtonState { - modalOpened: boolean; + modalOpened: boolean; } const state: DesktopEditButtonState = reactive({ modalOpened: false }); @@ -17,80 +17,76 @@ const state: DesktopEditButtonState = reactive({ modalOpened: false }); const props = defineProps(); const buildCommand = computed( - () => "vnd.libreoffice.command:ofe|u|" + props.editLink, + () => "vnd.libreoffice.command:ofe|u|" + props.editLink, ); const editionUntilFormatted = computed(() => { - let d; + let d; - if (props.expirationLink instanceof Date) { - d = props.expirationLink; - } else { - d = new Date(props.expirationLink * 1000); - } - console.log(props.expirationLink); + if (props.expirationLink instanceof Date) { + d = props.expirationLink; + } else { + d = new Date(props.expirationLink * 1000); + } + console.log(props.expirationLink); - return new Intl.DateTimeFormat(undefined, { - dateStyle: "long", - timeStyle: "medium", - }).format(d); + return new Intl.DateTimeFormat(undefined, { + dateStyle: "long", + timeStyle: "medium", + }).format(d); }); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue index d28b49cdf..8316229ce 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue @@ -1,26 +1,26 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton.vue index 71a8d42ea..f8c1c4ead 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton.vue @@ -1,20 +1,20 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue index ac4bf4591..cf70e3db3 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue @@ -1,26 +1,26 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue index bf5e3fffb..2a563d853 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue @@ -1,8 +1,8 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonModal.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonModal.vue index b9535ca2e..0d9a951e5 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonModal.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonModal.vue @@ -3,54 +3,54 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal.vue"; import { reactive } from "vue"; import HistoryButtonList from "ChillDocStoreAssets/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue"; import { - StoredObject, - StoredObjectVersionWithPointInTime, + StoredObject, + StoredObjectVersionWithPointInTime, } from "./../../../types"; interface HistoryButtonListConfig { - versions: StoredObjectVersionWithPointInTime[]; - storedObject: StoredObject; - canEdit: boolean; + versions: StoredObjectVersionWithPointInTime[]; + storedObject: StoredObject; + canEdit: boolean; } const emit = defineEmits<{ - restoreVersion: [newVersion: StoredObjectVersionWithPointInTime]; + restoreVersion: [newVersion: StoredObjectVersionWithPointInTime]; }>(); interface HistoryButtonModalState { - opened: boolean; + opened: boolean; } const props = defineProps(); const state = reactive({ opened: false }); const open = () => { - state.opened = true; + state.opened = true; }; const onRestoreVersion = (payload: { - newVersion: StoredObjectVersionWithPointInTime; + newVersion: StoredObjectVersionWithPointInTime; }) => emit("restoreVersion", payload); defineExpose({ open }); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue index 41ae8e978..595d3781a 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue @@ -1,17 +1,17 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/api.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/api.ts index cb7581eab..b003e26b7 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/api.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/api.ts @@ -1,33 +1,33 @@ import { - StoredObject, - StoredObjectVersionPersisted, - StoredObjectVersionWithPointInTime, + StoredObject, + StoredObjectVersionPersisted, + StoredObjectVersionWithPointInTime, } from "../../../types"; import { - fetchResults, - makeFetch, + fetchResults, + makeFetch, } from "../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods"; export const get_versions = async ( - storedObject: StoredObject, + storedObject: StoredObject, ): Promise => { - const versions = await fetchResults( - `/api/1.0/doc-store/stored-object/${storedObject.uuid}/versions`, - ); + const versions = await fetchResults( + `/api/1.0/doc-store/stored-object/${storedObject.uuid}/versions`, + ); - return versions.sort( - ( - a: StoredObjectVersionWithPointInTime, - b: StoredObjectVersionWithPointInTime, - ) => b.version - a.version, - ); + return versions.sort( + ( + a: StoredObjectVersionWithPointInTime, + b: StoredObjectVersionWithPointInTime, + ) => b.version - a.version, + ); }; export const restore_version = async ( - version: StoredObjectVersionPersisted, + version: StoredObjectVersionPersisted, ): Promise => { - return await makeFetch( - "POST", - `/api/1.0/doc-store/stored-object/restore-from-version/${version.id}`, - ); + return await makeFetch( + "POST", + `/api/1.0/doc-store/stored-object/restore-from-version/${version.id}`, + ); }; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue index b57c1f188..97073e4e1 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue @@ -1,29 +1,27 @@ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers.ts index ff1e6219d..aceaa038b 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers.ts @@ -1,235 +1,230 @@ import { - StoredObject, - StoredObjectStatus, - StoredObjectStatusChange, - StoredObjectVersion, + StoredObject, + StoredObjectStatus, + StoredObjectStatusChange, + StoredObjectVersion, } from "../../types"; import { makeFetch } from "../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods"; const MIMES_EDIT = new Set([ - "application/vnd.ms-powerpoint", - "application/vnd.ms-excel", - "application/vnd.oasis.opendocument.text", - "application/vnd.oasis.opendocument.text-flat-xml", - "application/vnd.oasis.opendocument.spreadsheet", - "application/vnd.oasis.opendocument.spreadsheet-flat-xml", - "application/vnd.oasis.opendocument.presentation", - "application/vnd.oasis.opendocument.presentation-flat-xml", - "application/vnd.oasis.opendocument.graphics", - "application/vnd.oasis.opendocument.graphics-flat-xml", - "application/vnd.oasis.opendocument.chart", - "application/msword", - "application/vnd.ms-excel", - "application/vnd.ms-powerpoint", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - "application/vnd.ms-word.document.macroEnabled.12", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "application/vnd.ms-excel.sheet.binary.macroEnabled.12", - "application/vnd.ms-excel.sheet.macroEnabled.12", - "application/vnd.openxmlformats-officedocument.presentationml.presentation", - "application/vnd.ms-powerpoint.presentation.macroEnabled.12", - "application/x-dif-document", - "text/spreadsheet", - "text/csv", - "application/x-dbase", - "text/rtf", - "text/plain", - "application/vnd.openxmlformats-officedocument.presentationml.slideshow", + "application/vnd.ms-powerpoint", + "application/vnd.ms-excel", + "application/vnd.oasis.opendocument.text", + "application/vnd.oasis.opendocument.text-flat-xml", + "application/vnd.oasis.opendocument.spreadsheet", + "application/vnd.oasis.opendocument.spreadsheet-flat-xml", + "application/vnd.oasis.opendocument.presentation", + "application/vnd.oasis.opendocument.presentation-flat-xml", + "application/vnd.oasis.opendocument.graphics", + "application/vnd.oasis.opendocument.graphics-flat-xml", + "application/vnd.oasis.opendocument.chart", + "application/msword", + "application/vnd.ms-excel", + "application/vnd.ms-powerpoint", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/vnd.ms-word.document.macroEnabled.12", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "application/vnd.ms-excel.sheet.binary.macroEnabled.12", + "application/vnd.ms-excel.sheet.macroEnabled.12", + "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "application/vnd.ms-powerpoint.presentation.macroEnabled.12", + "application/x-dif-document", + "text/spreadsheet", + "text/csv", + "application/x-dbase", + "text/rtf", + "text/plain", + "application/vnd.openxmlformats-officedocument.presentationml.slideshow", ]); const MIMES_VIEW = new Set([ - ...MIMES_EDIT, - [ - "image/svg+xml", - "application/vnd.sun.xml.writer", - "application/vnd.sun.xml.calc", - "application/vnd.sun.xml.impress", - "application/vnd.sun.xml.draw", - "application/vnd.sun.xml.writer.global", - "application/vnd.sun.xml.writer.template", - "application/vnd.sun.xml.calc.template", - "application/vnd.sun.xml.impress.template", - "application/vnd.sun.xml.draw.template", - "application/vnd.oasis.opendocument.text-master", - "application/vnd.oasis.opendocument.text-template", - "application/vnd.oasis.opendocument.text-master-template", - "application/vnd.oasis.opendocument.spreadsheet-template", - "application/vnd.oasis.opendocument.presentation-template", - "application/vnd.oasis.opendocument.graphics-template", - "application/vnd.ms-word.template.macroEnabled.12", - "application/vnd.openxmlformats-officedocument.spreadsheetml.template", - "application/vnd.ms-excel.template.macroEnabled.12", - "application/vnd.openxmlformats-officedocument.presentationml.template", - "application/vnd.ms-powerpoint.template.macroEnabled.12", - "application/vnd.wordperfect", - "application/x-aportisdoc", - "application/x-hwp", - "application/vnd.ms-works", - "application/x-mswrite", - "application/vnd.lotus-1-2-3", - "image/cgm", - "image/vnd.dxf", - "image/x-emf", - "image/x-wmf", - "application/coreldraw", - "application/vnd.visio2013", - "application/vnd.visio", - "application/vnd.ms-visio.drawing", - "application/x-mspublisher", - "application/x-sony-bbeb", - "application/x-gnumeric", - "application/macwriteii", - "application/x-iwork-numbers-sffnumbers", - "application/vnd.oasis.opendocument.text-web", - "application/x-pagemaker", - "application/x-fictionbook+xml", - "application/clarisworks", - "image/x-wpg", - "application/x-iwork-pages-sffpages", - "application/x-iwork-keynote-sffkey", - "application/x-abiword", - "image/x-freehand", - "application/vnd.sun.xml.chart", - "application/x-t602", - "image/bmp", - "image/png", - "image/gif", - "image/tiff", - "image/jpg", - "image/jpeg", - "application/pdf", - ], + ...MIMES_EDIT, + [ + "image/svg+xml", + "application/vnd.sun.xml.writer", + "application/vnd.sun.xml.calc", + "application/vnd.sun.xml.impress", + "application/vnd.sun.xml.draw", + "application/vnd.sun.xml.writer.global", + "application/vnd.sun.xml.writer.template", + "application/vnd.sun.xml.calc.template", + "application/vnd.sun.xml.impress.template", + "application/vnd.sun.xml.draw.template", + "application/vnd.oasis.opendocument.text-master", + "application/vnd.oasis.opendocument.text-template", + "application/vnd.oasis.opendocument.text-master-template", + "application/vnd.oasis.opendocument.spreadsheet-template", + "application/vnd.oasis.opendocument.presentation-template", + "application/vnd.oasis.opendocument.graphics-template", + "application/vnd.ms-word.template.macroEnabled.12", + "application/vnd.openxmlformats-officedocument.spreadsheetml.template", + "application/vnd.ms-excel.template.macroEnabled.12", + "application/vnd.openxmlformats-officedocument.presentationml.template", + "application/vnd.ms-powerpoint.template.macroEnabled.12", + "application/vnd.wordperfect", + "application/x-aportisdoc", + "application/x-hwp", + "application/vnd.ms-works", + "application/x-mswrite", + "application/vnd.lotus-1-2-3", + "image/cgm", + "image/vnd.dxf", + "image/x-emf", + "image/x-wmf", + "application/coreldraw", + "application/vnd.visio2013", + "application/vnd.visio", + "application/vnd.ms-visio.drawing", + "application/x-mspublisher", + "application/x-sony-bbeb", + "application/x-gnumeric", + "application/macwriteii", + "application/x-iwork-numbers-sffnumbers", + "application/vnd.oasis.opendocument.text-web", + "application/x-pagemaker", + "application/x-fictionbook+xml", + "application/clarisworks", + "image/x-wpg", + "application/x-iwork-pages-sffpages", + "application/x-iwork-keynote-sffkey", + "application/x-abiword", + "image/x-freehand", + "application/vnd.sun.xml.chart", + "application/x-t602", + "image/bmp", + "image/png", + "image/gif", + "image/tiff", + "image/jpg", + "image/jpeg", + "application/pdf", + ], ]); export interface SignedUrlGet { - method: "GET" | "HEAD"; - url: string; - expires: number; - object_name: string; + method: "GET" | "HEAD"; + url: string; + expires: number; + object_name: string; } function is_extension_editable(mimeType: string): boolean { - return MIMES_EDIT.has(mimeType); + return MIMES_EDIT.has(mimeType); } function is_extension_viewable(mimeType: string): boolean { - return MIMES_VIEW.has(mimeType); + return MIMES_VIEW.has(mimeType); } function build_convert_link(uuid: string) { - return `/chill/wopi/convert/${uuid}`; + return `/chill/wopi/convert/${uuid}`; } function build_download_info_link( - storedObject: StoredObject, - atVersion: null | StoredObjectVersion, + storedObject: StoredObject, + atVersion: null | StoredObjectVersion, ): string { - const url = `/api/1.0/doc-store/async-upload/temp_url/${storedObject.uuid}/generate/get`; + const url = `/api/1.0/doc-store/async-upload/temp_url/${storedObject.uuid}/generate/get`; - if (null !== atVersion) { - const params = new URLSearchParams({ version: atVersion.filename }); + if (null !== atVersion) { + const params = new URLSearchParams({ version: atVersion.filename }); - return url + "?" + params.toString(); - } + return url + "?" + params.toString(); + } - return url; + return url; } async function download_info_link( - storedObject: StoredObject, - atVersion: null | StoredObjectVersion, + storedObject: StoredObject, + atVersion: null | StoredObjectVersion, ): Promise { - return makeFetch("GET", build_download_info_link(storedObject, atVersion)); + return makeFetch("GET", build_download_info_link(storedObject, atVersion)); } function build_wopi_editor_link(uuid: string, returnPath?: string) { - if (returnPath === undefined) { - returnPath = - window.location.pathname + - window.location.search + - window.location.hash; - } + if (returnPath === undefined) { + returnPath = + window.location.pathname + window.location.search + window.location.hash; + } - return ( - `/chill/wopi/edit/${uuid}?returnPath=` + encodeURIComponent(returnPath) - ); + return ( + `/chill/wopi/edit/${uuid}?returnPath=` + encodeURIComponent(returnPath) + ); } function download_doc(url: string): Promise { - return window.fetch(url).then((r) => { - if (r.ok) { - return r.blob(); - } + return window.fetch(url).then((r) => { + if (r.ok) { + return r.blob(); + } - throw new Error("Could not download document"); - }); + throw new Error("Could not download document"); + }); } async function download_and_decrypt_doc( - storedObject: StoredObject, - atVersion: null | StoredObjectVersion, + storedObject: StoredObject, + atVersion: null | StoredObjectVersion, ): Promise { - const algo = "AES-CBC"; + const algo = "AES-CBC"; - const atVersionToDownload = atVersion ?? storedObject.currentVersion; + const atVersionToDownload = atVersion ?? storedObject.currentVersion; - if (null === atVersionToDownload) { - throw new Error("no version associated to stored object"); - } + if (null === atVersionToDownload) { + throw new Error("no version associated to stored object"); + } - // sometimes, the downloadInfo may be embedded into the storedObject - console.log("storedObject", storedObject); - let downloadInfo; - if ( - typeof storedObject._links !== "undefined" && - typeof storedObject._links.downloadLink !== "undefined" - ) { - downloadInfo = storedObject._links.downloadLink; - } else { - downloadInfo = await download_info_link( - storedObject, - atVersionToDownload, - ); - } + // sometimes, the downloadInfo may be embedded into the storedObject + console.log("storedObject", storedObject); + let downloadInfo; + if ( + typeof storedObject._links !== "undefined" && + typeof storedObject._links.downloadLink !== "undefined" + ) { + downloadInfo = storedObject._links.downloadLink; + } else { + downloadInfo = await download_info_link(storedObject, atVersionToDownload); + } - const rawResponse = await window.fetch(downloadInfo.url); + const rawResponse = await window.fetch(downloadInfo.url); - if (!rawResponse.ok) { - throw new Error( - "error while downloading raw file " + - rawResponse.status + - " " + - rawResponse.statusText, - ); - } + if (!rawResponse.ok) { + throw new Error( + "error while downloading raw file " + + rawResponse.status + + " " + + rawResponse.statusText, + ); + } - if (atVersionToDownload.iv.length === 0) { - return rawResponse.blob(); - } + if (atVersionToDownload.iv.length === 0) { + return rawResponse.blob(); + } - const rawBuffer = await rawResponse.arrayBuffer(); - try { - const key = await window.crypto.subtle.importKey( - "jwk", - atVersionToDownload.keyInfos, - { name: algo }, - false, - ["decrypt"], - ); - const iv = Uint8Array.from(atVersionToDownload.iv); - const decrypted = await window.crypto.subtle.decrypt( - { name: algo, iv: iv }, - key, - rawBuffer, - ); + const rawBuffer = await rawResponse.arrayBuffer(); + try { + const key = await window.crypto.subtle.importKey( + "jwk", + atVersionToDownload.keyInfos, + { name: algo }, + false, + ["decrypt"], + ); + const iv = Uint8Array.from(atVersionToDownload.iv); + const decrypted = await window.crypto.subtle.decrypt( + { name: algo, iv: iv }, + key, + rawBuffer, + ); - return Promise.resolve(new Blob([decrypted])); - } catch (e) { - console.error("encounter error while keys and decrypt operations"); - console.error(e); + return Promise.resolve(new Blob([decrypted])); + } catch (e) { + console.error("encounter error while keys and decrypt operations"); + console.error(e); - throw e; - } + throw e; + } } /** @@ -239,48 +234,45 @@ async function download_and_decrypt_doc( * storage. */ async function download_doc_as_pdf(storedObject: StoredObject): Promise { - if (null === storedObject.currentVersion) { - throw new Error("the stored object does not count any version"); - } + if (null === storedObject.currentVersion) { + throw new Error("the stored object does not count any version"); + } - if (storedObject.currentVersion?.type === "application/pdf") { - return download_and_decrypt_doc( - storedObject, - storedObject.currentVersion, - ); - } + if (storedObject.currentVersion?.type === "application/pdf") { + return download_and_decrypt_doc(storedObject, storedObject.currentVersion); + } - const convertLink = build_convert_link(storedObject.uuid); - const response = await fetch(convertLink); + const convertLink = build_convert_link(storedObject.uuid); + const response = await fetch(convertLink); - if (!response.ok) { - throw new Error("Could not convert the document: " + response.status); - } + if (!response.ok) { + throw new Error("Could not convert the document: " + response.status); + } - return response.blob(); + return response.blob(); } async function is_object_ready( - storedObject: StoredObject, + storedObject: StoredObject, ): Promise { - const new_status_response = await window.fetch( - `/api/1.0/doc-store/stored-object/${storedObject.uuid}/is-ready`, - ); + const new_status_response = await window.fetch( + `/api/1.0/doc-store/stored-object/${storedObject.uuid}/is-ready`, + ); - if (!new_status_response.ok) { - throw new Error("could not fetch the new status"); - } + if (!new_status_response.ok) { + throw new Error("could not fetch the new status"); + } - return await new_status_response.json(); + return await new_status_response.json(); } export { - build_convert_link, - build_wopi_editor_link, - download_and_decrypt_doc, - download_doc, - download_doc_as_pdf, - is_extension_editable, - is_extension_viewable, - is_object_ready, + build_convert_link, + build_wopi_editor_link, + download_and_decrypt_doc, + download_doc, + download_doc_as_pdf, + is_extension_editable, + is_extension_viewable, + is_object_ready, }; diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 8a31779f9..3325a9c83 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -613,4 +613,14 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter return $this; } + + /** + * Check if the current object is an instance of User. + * + * @return bool returns true if the current object is an instance of User, false otherwise + */ + public function isUser(): bool + { + return true; + } } diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php index 27ee7f44c..b8105fe5f 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php @@ -27,6 +27,8 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Contracts\Translation\TranslatableInterface; use Symfony\Contracts\Translation\TranslatorInterface; +// command to get the report with curl : curl --user "center a_social:password" "http://localhost:8000/fr/exports/generate/count_person?export[filters][person_gender_filter][enabled]=&export[filters][person_nationality_filter][enabled]=&export[filters][person_nationality_filter][form][nationalities]=&export[aggregators][person_nationality_aggregator][order]=1&export[aggregators][person_nationality_aggregator][form][group_by_level]=country&export[submit]=&export[_token]=RHpjHl389GrK-bd6iY5NsEqrD5UKOTHH40QKE9J1edU" --globoff + /** * Create a CSV List for the export. */ diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php index a73c3c71c..8a7574ac0 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -76,6 +76,24 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface ->formatOutOfCountryCallingNumber($phoneNumber, $this->config['default_carrier_code']); } + /** + * @throws NumberParseException + */ + public function parse(string $phoneNumber): PhoneNumber + { + $sanitizedPhoneNumber = $phoneNumber; + + if (str_starts_with($sanitizedPhoneNumber, '00')) { + $sanitizedPhoneNumber = '+'.substr($sanitizedPhoneNumber, 2, null); + } + + if (!str_starts_with($sanitizedPhoneNumber, '+') && !str_starts_with($sanitizedPhoneNumber, '0')) { + $sanitizedPhoneNumber = '+'.$sanitizedPhoneNumber; + } + + return $this->phoneNumberUtil->parse($sanitizedPhoneNumber, $this->config['default_carrier_code']); + } + /** * Get type (mobile, landline, ...) for phone number. */ diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts b/src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts index 8a0d7cce0..233d802a0 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/js/date.ts @@ -13,15 +13,15 @@ * */ export const dateToISO = (date: Date | null): string | null => { - if (null === date) { - return null; - } + if (null === date) { + return null; + } - return [ - date.getFullYear(), - (date.getMonth() + 1).toString().padStart(2, "0"), - date.getDate().toString().padStart(2, "0"), - ].join("-"); + return [ + date.getFullYear(), + (date.getMonth() + 1).toString().padStart(2, "0"), + date.getDate().toString().padStart(2, "0"), + ].join("-"); }; /** @@ -30,16 +30,16 @@ export const dateToISO = (date: Date | null): string | null => { * **Experimental** */ export const ISOToDate = (str: string | null): Date | null => { - if (null === str) { - return null; - } - if ("" === str.trim()) { - return null; - } + if (null === str) { + return null; + } + if ("" === str.trim()) { + return null; + } - const [year, month, day] = str.split("-").map((p) => parseInt(p)); + const [year, month, day] = str.split("-").map((p) => parseInt(p)); - return new Date(year, month - 1, day, 0, 0, 0, 0); + return new Date(year, month - 1, day, 0, 0, 0, 0); }; /** @@ -47,21 +47,19 @@ export const ISOToDate = (str: string | null): Date | null => { * */ export const ISOToDatetime = (str: string | null): Date | null => { - if (null === str) { - return null; - } + if (null === str) { + return null; + } - const [cal, times] = str.split("T"), - [year, month, date] = cal.split("-").map((s) => parseInt(s)), - [time, timezone] = times.split(times.charAt(8)), - [hours, minutes, seconds] = time.split(":").map((s) => parseInt(s)); - if ("0000" === timezone) { - return new Date( - Date.UTC(year, month - 1, date, hours, minutes, seconds), - ); - } + const [cal, times] = str.split("T"), + [year, month, date] = cal.split("-").map((s) => parseInt(s)), + [time, timezone] = times.split(times.charAt(8)), + [hours, minutes, seconds] = time.split(":").map((s) => parseInt(s)); + if ("0000" === timezone) { + return new Date(Date.UTC(year, month - 1, date, hours, minutes, seconds)); + } - return new Date(year, month - 1, date, hours, minutes, seconds); + return new Date(year, month - 1, date, hours, minutes, seconds); }; /** @@ -69,96 +67,94 @@ export const ISOToDatetime = (str: string | null): Date | null => { * */ export const datetimeToISO = (date: Date): string => { - let cal, time, offset; - cal = [ - date.getFullYear(), - (date.getMonth() + 1).toString().padStart(2, "0"), - date.getDate().toString().padStart(2, "0"), - ].join("-"); + let cal, time, offset; + cal = [ + date.getFullYear(), + (date.getMonth() + 1).toString().padStart(2, "0"), + date.getDate().toString().padStart(2, "0"), + ].join("-"); - time = [ - date.getHours().toString().padStart(2, "0"), - date.getMinutes().toString().padStart(2, "0"), - date.getSeconds().toString().padStart(2, "0"), - ].join(":"); + time = [ + date.getHours().toString().padStart(2, "0"), + date.getMinutes().toString().padStart(2, "0"), + date.getSeconds().toString().padStart(2, "0"), + ].join(":"); - offset = [ - date.getTimezoneOffset() <= 0 ? "+" : "-", - Math.abs(Math.floor(date.getTimezoneOffset() / 60)) - .toString() - .padStart(2, "0"), - ":", - Math.abs(date.getTimezoneOffset() % 60) - .toString() - .padStart(2, "0"), - ].join(""); + offset = [ + date.getTimezoneOffset() <= 0 ? "+" : "-", + Math.abs(Math.floor(date.getTimezoneOffset() / 60)) + .toString() + .padStart(2, "0"), + ":", + Math.abs(date.getTimezoneOffset() % 60) + .toString() + .padStart(2, "0"), + ].join(""); - const x = cal + "T" + time + offset; + const x = cal + "T" + time + offset; - return x; + return x; }; export const intervalDaysToISO = (days: number | string | null): string => { - if (null === days) { - return "P0D"; - } + if (null === days) { + return "P0D"; + } - return `P${days}D`; + return `P${days}D`; }; export const intervalISOToDays = (str: string | null): number | null => { - if (null === str) { - return null; - } + if (null === str) { + return null; + } - if ("" === str.trim()) { - return null; - } + if ("" === str.trim()) { + return null; + } - let days = 0; - let isDate = true; - let vstring = ""; - for (let i = 0; i < str.length; i = i + 1) { - if (!isDate) { - continue; - } - switch (str.charAt(i)) { - case "P": - isDate = true; - break; - case "T": - isDate = false; - break; - case "0": - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": - case "8": - case "9": - vstring = vstring + str.charAt(i); - break; - case "Y": - days = days + Number.parseInt(vstring) * 365; - vstring = ""; - break; - case "M": - days = days + Number.parseInt(vstring) * 30; - vstring = ""; - break; - case "D": - days = days + Number.parseInt(vstring); - vstring = ""; - break; - default: - throw Error( - "this character should not appears: " + str.charAt(i), - ); - } + let days = 0; + let isDate = true; + let vstring = ""; + for (let i = 0; i < str.length; i = i + 1) { + if (!isDate) { + continue; } + switch (str.charAt(i)) { + case "P": + isDate = true; + break; + case "T": + isDate = false; + break; + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + vstring = vstring + str.charAt(i); + break; + case "Y": + days = days + Number.parseInt(vstring) * 365; + vstring = ""; + break; + case "M": + days = days + Number.parseInt(vstring) * 30; + vstring = ""; + break; + case "D": + days = days + Number.parseInt(vstring); + vstring = ""; + break; + default: + throw Error("this character should not appears: " + str.charAt(i)); + } + } - return days; + return days; }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/address.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/address.ts index 896cbd323..864f6cd52 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/address.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/address.ts @@ -1,61 +1,61 @@ import { - Address, - GeographicalUnitLayer, - SimpleGeographicalUnit, + Address, + GeographicalUnitLayer, + SimpleGeographicalUnit, } from "../../types"; import { fetchResults, makeFetch } from "./apiMethods"; export const getAddressById = async (address_id: number): Promise
=> { - const url = `/api/1.0/main/address/${address_id}.json`; + const url = `/api/1.0/main/address/${address_id}.json`; - const response = await fetch(url); + const response = await fetch(url); - if (response.ok) { - return response.json(); - } + if (response.ok) { + return response.json(); + } - throw Error("Error with request resource response"); + throw Error("Error with request resource response"); }; export const getGeographicalUnitsByAddress = async ( - address: Address, + address: Address, ): Promise => { - return fetchResults( - `/api/1.0/main/geographical-unit/by-address/${address.address_id}.json`, - ); + return fetchResults( + `/api/1.0/main/geographical-unit/by-address/${address.address_id}.json`, + ); }; export const getAllGeographicalUnitLayers = async (): Promise< - GeographicalUnitLayer[] + GeographicalUnitLayer[] > => { - return fetchResults( - `/api/1.0/main/geographical-unit-layer.json`, - ); + return fetchResults( + `/api/1.0/main/geographical-unit-layer.json`, + ); }; export const syncAddressWithReference = async ( - address: Address, + address: Address, ): Promise
=> { - return makeFetch( - "POST", - `/api/1.0/main/address/reference-match/${address.address_id}/sync-with-reference`, - ); + return makeFetch( + "POST", + `/api/1.0/main/address/reference-match/${address.address_id}/sync-with-reference`, + ); }; export const markAddressReviewed = async ( - address: Address, + address: Address, ): Promise
=> { - return makeFetch( - "POST", - `/api/1.0/main/address/reference-match/${address.address_id}/set/reviewed`, - ); + return makeFetch( + "POST", + `/api/1.0/main/address/reference-match/${address.address_id}/set/reviewed`, + ); }; export const markAddressToReview = async ( - address: Address, + address: Address, ): Promise
=> { - return makeFetch( - "POST", - `/api/1.0/main/address/reference-match/${address.address_id}/set/to_review`, - ); + return makeFetch( + "POST", + `/api/1.0/main/address/reference-match/${address.address_id}/set/to_review`, + ); }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts index e8256b348..9bfb952b5 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts @@ -6,57 +6,57 @@ export type fetchOption = Record; export type Params = Record; export interface PaginationResponse { - pagination: { - more: boolean; - items_per_page: number; - }; - results: T[]; - count: number; + pagination: { + more: boolean; + items_per_page: number; + }; + results: T[]; + count: number; } export type FetchParams = Record; export interface TransportExceptionInterface { - name: string; + name: string; } export interface ValidationExceptionInterface - extends TransportExceptionInterface { - name: "ValidationException"; - error: object; - violations: string[]; - titles: string[]; - propertyPaths: string[]; + extends TransportExceptionInterface { + name: "ValidationException"; + error: object; + violations: string[]; + titles: string[]; + propertyPaths: string[]; } export interface ValidationErrorResponse extends TransportExceptionInterface { - violations: { - title: string; - propertyPath: string; - }[]; + violations: { + title: string; + propertyPath: string; + }[]; } export interface AccessExceptionInterface extends TransportExceptionInterface { - name: "AccessException"; - violations: string[]; + name: "AccessException"; + violations: string[]; } export interface NotFoundExceptionInterface - extends TransportExceptionInterface { - name: "NotFoundException"; + extends TransportExceptionInterface { + name: "NotFoundException"; } export interface ServerExceptionInterface extends TransportExceptionInterface { - name: "ServerException"; - message: string; - code: number; - body: string; + name: "ServerException"; + message: string; + code: number; + body: string; } export interface ConflictHttpExceptionInterface - extends TransportExceptionInterface { - name: "ConflictHttpException"; - violations: string[]; + extends TransportExceptionInterface { + name: "ConflictHttpException"; + violations: string[]; } /** @@ -66,223 +66,223 @@ export interface ConflictHttpExceptionInterface * and use of the @link{fetchResults} method. */ export const makeFetch = ( - method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE", - url: string, - body?: body | Input | null, - options?: FetchParams, + method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE", + url: string, + body?: body | Input | null, + options?: FetchParams, ): Promise => { - let opts = { - method: method, - headers: { - "Content-Type": "application/json;charset=utf-8", - }, + let opts = { + method: method, + headers: { + "Content-Type": "application/json;charset=utf-8", + }, + }; + + if (body !== null && typeof body !== "undefined") { + Object.assign(opts, { body: JSON.stringify(body) }); + } + + if (typeof options !== "undefined") { + opts = Object.assign(opts, options); + } + return fetch(url, opts).then((response) => { + if (response.status === 204) { + return Promise.resolve(); + } + + if (response.ok) { + return response.json(); + } + + if (response.status === 422) { + return response.json().then((response) => { + throw ValidationException(response); + }); + } + + if (response.status === 403) { + throw AccessException(response); + } + + if (response.status === 409) { + throw ConflictHttpException(response); + } + + throw { + name: "Exception", + sta: response.status, + txt: response.statusText, + err: new Error(), + violations: response.body, }; - - if (body !== null && typeof body !== "undefined") { - Object.assign(opts, { body: JSON.stringify(body) }); - } - - if (typeof options !== "undefined") { - opts = Object.assign(opts, options); - } - return fetch(url, opts).then((response) => { - if (response.status === 204) { - return Promise.resolve(); - } - - if (response.ok) { - return response.json(); - } - - if (response.status === 422) { - return response.json().then((response) => { - throw ValidationException(response); - }); - } - - if (response.status === 403) { - throw AccessException(response); - } - - if (response.status === 409) { - throw ConflictHttpException(response); - } - - throw { - name: "Exception", - sta: response.status, - txt: response.statusText, - err: new Error(), - violations: response.body, - }; - }); + }); }; /** * Fetch results with certain parameters */ function _fetchAction( - page: number, - uri: string, - params?: FetchParams, + page: number, + uri: string, + params?: FetchParams, ): Promise> { - const item_per_page = 50; + const item_per_page = 50; - const searchParams = new URLSearchParams(); - searchParams.append("item_per_page", item_per_page.toString()); - searchParams.append("page", page.toString()); + const searchParams = new URLSearchParams(); + searchParams.append("item_per_page", item_per_page.toString()); + searchParams.append("page", page.toString()); - if (params !== undefined) { - Object.keys(params).forEach((key) => { - const v = params[key]; - if (typeof v === "string") { - searchParams.append(key, v); - } else if (typeof v === "number") { - searchParams.append(key, v.toString()); - } else if (v === null) { - searchParams.append(key, ""); - } + if (params !== undefined) { + Object.keys(params).forEach((key) => { + const v = params[key]; + if (typeof v === "string") { + searchParams.append(key, v); + } else if (typeof v === "number") { + searchParams.append(key, v.toString()); + } else if (v === null) { + searchParams.append(key, ""); + } + }); + } + + const url = uri + "?" + searchParams.toString(); + + return fetch(url, { + method: "GET", + headers: { + "Content-Type": "application/json;charset=utf-8", + }, + }) + .then((response) => { + if (response.ok) { + return response.json(); + } + + if (response.status === 404) { + throw NotFoundException(response); + } + + if (response.status === 422) { + return response.json().then((response) => { + throw ValidationException(response); }); - } + } - const url = uri + "?" + searchParams.toString(); + if (response.status === 403) { + throw AccessException(response); + } - return fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json;charset=utf-8", - }, + if (response.status >= 500) { + return response.text().then((body) => { + throw ServerException(response.status, body); + }); + } + + throw new Error("other network error"); }) - .then((response) => { - if (response.ok) { - return response.json(); - } - - if (response.status === 404) { - throw NotFoundException(response); - } - - if (response.status === 422) { - return response.json().then((response) => { - throw ValidationException(response); - }); - } - - if (response.status === 403) { - throw AccessException(response); - } - - if (response.status >= 500) { - return response.text().then((body) => { - throw ServerException(response.status, body); - }); - } - - throw new Error("other network error"); - }) - .catch( - ( - reason: - | NotFoundExceptionInterface - | ServerExceptionInterface - | ValidationExceptionInterface - | TransportExceptionInterface, - ) => { - console.error(reason); - throw reason; - }, - ); + .catch( + ( + reason: + | NotFoundExceptionInterface + | ServerExceptionInterface + | ValidationExceptionInterface + | TransportExceptionInterface, + ) => { + console.error(reason); + throw reason; + }, + ); } export const fetchResults = async ( - uri: string, - params?: FetchParams, + uri: string, + params?: FetchParams, ): Promise => { - const promises: Promise[] = []; - let page = 1; - const firstData: PaginationResponse = (await _fetchAction( - page, - uri, - params, - )) as PaginationResponse; + const promises: Promise[] = []; + let page = 1; + const firstData: PaginationResponse = (await _fetchAction( + page, + uri, + params, + )) as PaginationResponse; - promises.push(Promise.resolve(firstData.results)); + promises.push(Promise.resolve(firstData.results)); - if (firstData.pagination.more) { - do { - page = ++page; - promises.push( - _fetchAction(page, uri, params).then((r) => - Promise.resolve(r.results), - ), - ); - } while (page * firstData.pagination.items_per_page < firstData.count); - } + if (firstData.pagination.more) { + do { + page = ++page; + promises.push( + _fetchAction(page, uri, params).then((r) => + Promise.resolve(r.results), + ), + ); + } while (page * firstData.pagination.items_per_page < firstData.count); + } - return Promise.all(promises).then((values) => values.flat()); + return Promise.all(promises).then((values) => values.flat()); }; export const fetchScopes = (): Promise => { - return fetchResults("/api/1.0/main/scope.json"); + return fetchResults("/api/1.0/main/scope.json"); }; /** * Error objects to be thrown */ const ValidationException = ( - response: ValidationErrorResponse, + response: ValidationErrorResponse, ): ValidationExceptionInterface => { - const error = {} as ValidationExceptionInterface; - error.name = "ValidationException"; - error.violations = response.violations.map( - (violation) => `${violation.title}: ${violation.propertyPath}`, - ); - error.titles = response.violations.map((violation) => violation.title); - error.propertyPaths = response.violations.map( - (violation) => violation.propertyPath, - ); - return error; + const error = {} as ValidationExceptionInterface; + error.name = "ValidationException"; + error.violations = response.violations.map( + (violation) => `${violation.title}: ${violation.propertyPath}`, + ); + error.titles = response.violations.map((violation) => violation.title); + error.propertyPaths = response.violations.map( + (violation) => violation.propertyPath, + ); + return error; }; // eslint-disable-next-line @typescript-eslint/no-unused-vars const AccessException = (response: Response): AccessExceptionInterface => { - const error = {} as AccessExceptionInterface; - error.name = "AccessException"; - error.violations = ["You are not allowed to perform this action"]; + const error = {} as AccessExceptionInterface; + error.name = "AccessException"; + error.violations = ["You are not allowed to perform this action"]; - return error; + return error; }; // eslint-disable-next-line @typescript-eslint/no-unused-vars const NotFoundException = (response: Response): NotFoundExceptionInterface => { - const error = {} as NotFoundExceptionInterface; - error.name = "NotFoundException"; + const error = {} as NotFoundExceptionInterface; + error.name = "NotFoundException"; - return error; + return error; }; const ServerException = ( - code: number, - body: string, + code: number, + body: string, ): ServerExceptionInterface => { - const error = {} as ServerExceptionInterface; - error.name = "ServerException"; - error.code = code; - error.body = body; + const error = {} as ServerExceptionInterface; + error.name = "ServerException"; + error.code = code; + error.body = body; - return error; + return error; }; const ConflictHttpException = ( - // eslint-disable-next-line @typescript-eslint/no-unused-vars - response: Response, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + response: Response, ): ConflictHttpExceptionInterface => { - const error = {} as ConflictHttpExceptionInterface; + const error = {} as ConflictHttpExceptionInterface; - error.name = "ConflictHttpException"; - error.violations = [ - "Sorry, but someone else has already changed this entity. Please refresh the page and apply the changes again", - ]; + error.name = "ConflictHttpException"; + error.violations = [ + "Sorry, but someone else has already changed this entity. Please refresh the page and apply the changes again", + ]; - return error; + return error; }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/export.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/export.ts index 7e350b102..6e66122e7 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/export.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/export.ts @@ -2,17 +2,17 @@ import { makeFetch } from "ChillMainAssets/lib/api/apiMethods"; import { ExportGeneration } from "ChillMainAssets/types"; export const fetchExportGenerationStatus = async ( - exportGenerationId: string, + exportGenerationId: string, ): Promise => - makeFetch( - "GET", - `/api/1.0/main/export-generation/${exportGenerationId}/object`, - ); + makeFetch( + "GET", + `/api/1.0/main/export-generation/${exportGenerationId}/object`, + ); export const generateFromSavedExport = async ( - savedExportUuid: string, + savedExportUuid: string, ): Promise => - makeFetch( - "POST", - `/api/1.0/main/export/export-generation/create-from-saved-export/${savedExportUuid}`, - ); + makeFetch( + "POST", + `/api/1.0/main/export/export-generation/create-from-saved-export/${savedExportUuid}`, + ); diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/locations.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/locations.ts index 3c326ba78..375881924 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/locations.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/locations.ts @@ -2,7 +2,7 @@ import { fetchResults } from "./apiMethods"; import { Location, LocationType } from "../../types"; export const getLocations = (): Promise => - fetchResults("/api/1.0/main/location.json"); + fetchResults("/api/1.0/main/location.json"); export const getLocationTypes = (): Promise => - fetchResults("/api/1.0/main/location-type.json"); + fetchResults("/api/1.0/main/location-type.json"); diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/return_path.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/return_path.ts index e444aa2e5..54a12c030 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/return_path.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/return_path.ts @@ -1,3 +1,3 @@ export function buildReturnPath(location: Location): string { - return location.pathname + location.search; + return location.pathname + location.search; } diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/user.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/user.ts index 62703b740..e51d09abb 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/user.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/user.ts @@ -2,23 +2,23 @@ import { User } from "../../types"; import { makeFetch } from "./apiMethods"; export const whoami = (): Promise => { - const url = `/api/1.0/main/whoami.json`; - return fetch(url).then((response) => { - if (response.ok) { - return response.json(); - } - throw { - msg: "Error while getting whoami.", - sta: response.status, - txt: response.statusText, - err: new Error(), - body: response.body, - }; - }); + const url = `/api/1.0/main/whoami.json`; + return fetch(url).then((response) => { + if (response.ok) { + return response.json(); + } + throw { + msg: "Error while getting whoami.", + sta: response.status, + txt: response.statusText, + err: new Error(), + body: response.body, + }; + }); }; export const whereami = (): Promise => { - const url = `/api/1.0/main/user-current-location.json`; + const url = `/api/1.0/main/user-current-location.json`; - return makeFetch("GET", url); + return makeFetch("GET", url); }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/entity-notification/api.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/entity-notification/api.ts index 47cf9b1e9..97ba98d75 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/entity-notification/api.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/entity-notification/api.ts @@ -1,22 +1,22 @@ const buildLinkCreate = function ( - relatedEntityClass: string, - relatedEntityId: number, - to: number | null, - returnPath: string | null, + relatedEntityClass: string, + relatedEntityId: number, + to: number | null, + returnPath: string | null, ): string { - const params = new URLSearchParams(); - params.append("entityClass", relatedEntityClass); - params.append("entityId", relatedEntityId.toString()); + const params = new URLSearchParams(); + params.append("entityClass", relatedEntityClass); + params.append("entityId", relatedEntityId.toString()); - if (null !== to) { - params.append("tos[0]", to.toString()); - } + if (null !== to) { + params.append("tos[0]", to.toString()); + } - if (null !== returnPath) { - params.append("returnPath", returnPath); - } + if (null !== returnPath) { + params.append("returnPath", returnPath); + } - return `/fr/notification/create?${params.toString()}`; + return `/fr/notification/create?${params.toString()}`; }; export { buildLinkCreate }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/entity-workflow/api.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/entity-workflow/api.ts index a9955f31b..4f9dea715 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/entity-workflow/api.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/entity-workflow/api.ts @@ -10,17 +10,17 @@ * @throws {Error} If the related entity ID is undefined. */ export const buildLinkCreate = ( - workflowName: string, - relatedEntityClass: string, - relatedEntityId: number | undefined, + workflowName: string, + relatedEntityClass: string, + relatedEntityId: number | undefined, ): string => { - if (typeof relatedEntityId === "undefined") { - throw new Error("the related entity id is not set"); - } - const params = new URLSearchParams(); - params.set("entityClass", relatedEntityClass); - params.set("entityId", relatedEntityId.toString(10)); - params.set("workflow", workflowName); + if (typeof relatedEntityId === "undefined") { + throw new Error("the related entity id is not set"); + } + const params = new URLSearchParams(); + params.set("entityClass", relatedEntityClass); + params.set("entityId", relatedEntityId.toString(10)); + params.set("workflow", workflowName); - return `/fr/main/workflow/create?` + params.toString(); + return `/fr/main/workflow/create?` + params.toString(); }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/localizationHelper/localizationHelper.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/localizationHelper/localizationHelper.ts index 9cd1dcb51..b2fa260d2 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/localizationHelper/localizationHelper.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/localizationHelper/localizationHelper.ts @@ -9,33 +9,33 @@ import { TranslatableString } from "ChillMainAssets/types"; * @returns The localized string or null if no translation is available */ export function localizeString( - translatableString: TranslatableString | null | undefined, - locale?: string, + translatableString: TranslatableString | null | undefined, + locale?: string, ): string { - if (!translatableString || Object.keys(translatableString).length === 0) { - return ""; - } - - const currentLocale = locale || navigator.language.split("-")[0] || "fr"; - - if (translatableString[currentLocale]) { - return translatableString[currentLocale]; - } - - // Define fallback locales - const fallbackLocales: string[] = ["fr", "en"]; - - for (const fallbackLocale of fallbackLocales) { - if (translatableString[fallbackLocale]) { - return translatableString[fallbackLocale]; - } - } - - // No fallback translation found, use the first available - const availableLocales = Object.keys(translatableString); - if (availableLocales.length > 0) { - return translatableString[availableLocales[0]]; - } - + if (!translatableString || Object.keys(translatableString).length === 0) { return ""; + } + + const currentLocale = locale || navigator.language.split("-")[0] || "fr"; + + if (translatableString[currentLocale]) { + return translatableString[currentLocale]; + } + + // Define fallback locales + const fallbackLocales: string[] = ["fr", "en"]; + + for (const fallbackLocale of fallbackLocales) { + if (translatableString[fallbackLocale]) { + return translatableString[fallbackLocale]; + } + } + + // No fallback translation found, use the first available + const availableLocales = Object.keys(translatableString); + if (availableLocales.length > 0) { + return translatableString[availableLocales[0]]; + } + + return ""; } diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/workflow/attachments.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/workflow/attachments.ts index 7e2f23f57..05c745099 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/workflow/attachments.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/workflow/attachments.ts @@ -3,20 +3,20 @@ import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/gener import { makeFetch } from "ChillMainAssets/lib/api/apiMethods"; export const find_attachments_by_workflow = async ( - workflowId: number, + workflowId: number, ): Promise => - makeFetch("GET", `/api/1.0/main/workflow/${workflowId}/attachment`); + makeFetch("GET", `/api/1.0/main/workflow/${workflowId}/attachment`); export const create_attachment = async ( - workflowId: number, - genericDoc: GenericDocForAccompanyingPeriod, + workflowId: number, + genericDoc: GenericDocForAccompanyingPeriod, ): Promise => - makeFetch("POST", `/api/1.0/main/workflow/${workflowId}/attachment`, { - relatedGenericDocKey: genericDoc.key, - relatedGenericDocIdentifiers: genericDoc.identifiers, - }); + makeFetch("POST", `/api/1.0/main/workflow/${workflowId}/attachment`, { + relatedGenericDocKey: genericDoc.key, + relatedGenericDocIdentifiers: genericDoc.identifiers, + }); export const delete_attachment = async ( - attachment: WorkflowAttachment, + attachment: WorkflowAttachment, ): Promise => - makeFetch("DELETE", `/api/1.0/main/workflow/attachment/${attachment.id}`); + makeFetch("DELETE", `/api/1.0/main/workflow/attachment/${attachment.id}`); diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/address-details/index.ts b/src/Bundle/ChillMainBundle/Resources/public/module/address-details/index.ts index abe516934..d41a70499 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/address-details/index.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/module/address-details/index.ts @@ -7,43 +7,43 @@ import { Address } from "../../types"; const i18n = _createI18n({}); document - .querySelectorAll("span[data-address-details]") - .forEach((el) => { - const dataset = el.dataset as { - addressId: string; - addressRefStatus: string; + .querySelectorAll("span[data-address-details]") + .forEach((el) => { + const dataset = el.dataset as { + addressId: string; + addressRefStatus: string; + }; + + const app = createApp({ + components: { AddressDetailsButton }, + data() { + return { + addressId: Number.parseInt(dataset.addressId), + addressRefStatus: dataset.addressRefStatus, }; - - const app = createApp({ - components: { AddressDetailsButton }, - data() { - return { - addressId: Number.parseInt(dataset.addressId), - addressRefStatus: dataset.addressRefStatus, - }; - }, - template: - '', - methods: { - onUpdateAddress: (address: Address): void => { - if ( - address.refStatus === "to_review" || - address.refStatus === "reviewed" - ) { - // in this two case, the address content do not change - return; - } - if ( - window.confirm( - "L'adresse a été modifiée. Vous pouvez continuer votre travail. Cependant, pour afficher les données immédiatement, veuillez recharger la page. \n\n Voulez-vous recharger la page immédiatement ?", - ) - ) { - window.location.reload(); - } - }, - }, - }); - - app.use(i18n); - app.mount(el); + }, + template: + '', + methods: { + onUpdateAddress: (address: Address): void => { + if ( + address.refStatus === "to_review" || + address.refStatus === "reviewed" + ) { + // in this two case, the address content do not change + return; + } + if ( + window.confirm( + "L'adresse a été modifiée. Vous pouvez continuer votre travail. Cependant, pour afficher les données immédiatement, veuillez recharger la page. \n\n Voulez-vous recharger la page immédiatement ?", + ) + ) { + window.location.reload(); + } + }, + }, }); + + app.use(i18n); + app.mount(el); + }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/editor_config.ts b/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/editor_config.ts index a396da295..fbbbb5881 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/editor_config.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/editor_config.ts @@ -1,16 +1,16 @@ import { - Essentials, - Bold, - Italic, - Paragraph, - Markdown, - BlockQuote, - Heading, - Link, - List, - Emoji, - Mention, - Fullscreen, + Essentials, + Bold, + Italic, + Paragraph, + Markdown, + BlockQuote, + Heading, + Link, + List, + Emoji, + Mention, + Fullscreen, } from "ckeditor5"; import coreTranslations from "ckeditor5/translations/fr.js"; @@ -19,41 +19,41 @@ import "ckeditor5/ckeditor5.css"; import "./index.scss"; export default { - plugins: [ - Essentials, - Markdown, - Bold, - Italic, - BlockQuote, - Heading, - Link, - List, - Paragraph, - // both Emoji and Mention are required for Emoji feature - Emoji, - Mention, - // to enable fullscreen - Fullscreen, + plugins: [ + Essentials, + Markdown, + Bold, + Italic, + BlockQuote, + Heading, + Link, + List, + Paragraph, + // both Emoji and Mention are required for Emoji feature + Emoji, + Mention, + // to enable fullscreen + Fullscreen, + ], + toolbar: { + items: [ + "heading", + "|", + "bold", + "italic", + "link", + "bulletedList", + "numberedList", + "blockQuote", + "|", + "emoji", + "|", + "undo", + "redo", + "|", + "fullscreen", ], - toolbar: { - items: [ - "heading", - "|", - "bold", - "italic", - "link", - "bulletedList", - "numberedList", - "blockQuote", - "|", - "emoji", - "|", - "undo", - "redo", - "|", - "fullscreen", - ], - }, - translations: [coreTranslations], - licenseKey: "GPL", + }, + translations: [coreTranslations], + licenseKey: "GPL", }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/index.ts b/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/index.ts index 783c0acfa..f8e0cb48b 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/index.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/index.ts @@ -2,31 +2,31 @@ import { createApp } from "vue"; import CommentEditor from "ChillMainAssets/vuejs/_components/CommentEditor/CommentEditor.vue"; const ckeditorFields: NodeListOf = - document.querySelectorAll("textarea[ckeditor]"); + document.querySelectorAll("textarea[ckeditor]"); ckeditorFields.forEach((field: HTMLTextAreaElement): void => { - const content = field.value; - const div = document.createElement("div"); + const content = field.value; + const div = document.createElement("div"); - if (field.parentNode !== null) { - field.parentNode.insertBefore(div, field); - } else { - throw "parent is null"; - } + if (field.parentNode !== null) { + field.parentNode.insertBefore(div, field); + } else { + throw "parent is null"; + } - createApp({ - components: { CommentEditor }, - template: ``, - data() { - return { - content, - }; - }, - methods: { - handleInput() { - field.value = this.content; - }, - }, - }).mount(div); + createApp({ + components: { CommentEditor }, + template: ``, + data() { + return { + content, + }; + }, + methods: { + handleInput() { + field.value = this.content; + }, + }, + }).mount(div); - field.style.display = "none"; + field.style.display = "none"; }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts b/src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts index 77ff044ec..1c45f468d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/module/collection/index.ts @@ -31,157 +31,157 @@ import "./collection.scss"; declare global { - interface GlobalEventHandlersEventMap { - "show-hide-show": CustomEvent<{ - id: number; - froms: HTMLElement[]; - container: HTMLElement; - }>; - } + interface GlobalEventHandlersEventMap { + "show-hide-show": CustomEvent<{ + id: number; + froms: HTMLElement[]; + container: HTMLElement; + }>; + } } export class CollectionEventPayload { - collection: HTMLUListElement; - entry: HTMLLIElement; + collection: HTMLUListElement; + entry: HTMLLIElement; - constructor(collection: HTMLUListElement, entry: HTMLLIElement) { - this.collection = collection; - this.entry = entry; - } + constructor(collection: HTMLUListElement, entry: HTMLLIElement) { + this.collection = collection; + this.entry = entry; + } } export const handleAdd = (button: any): void => { - const form_name = button.dataset.collectionAddTarget, - prototype = button.dataset.formPrototype, - collection: HTMLUListElement | null = document.querySelector( - 'ul[data-collection-name="' + form_name + '"]', - ); + const form_name = button.dataset.collectionAddTarget, + prototype = button.dataset.formPrototype, + collection: HTMLUListElement | null = document.querySelector( + 'ul[data-collection-name="' + form_name + '"]', + ); - if (collection === null) { - return; + if (collection === null) { + return; + } + + const empty_explain: HTMLLIElement | null = collection.querySelector( + "li[data-collection-empty-explain]", + ), + entry = document.createElement("li"), + counter = collection.querySelectorAll("li.entry").length, // Updated counter logic + content = prototype.replace(/__name__/g, counter.toString()), + event = new CustomEvent("collection-add-entry", { + detail: new CollectionEventPayload(collection, entry), + }); + + console.log(counter); + console.log(content); + + entry.innerHTML = content; + entry.classList.add("entry"); + + if ("collectionRegular" in collection.dataset) { + initializeRemove(collection, entry); + if (empty_explain !== null) { + empty_explain.remove(); } + } - const empty_explain: HTMLLIElement | null = collection.querySelector( - "li[data-collection-empty-explain]", - ), - entry = document.createElement("li"), - counter = collection.querySelectorAll("li.entry").length, // Updated counter logic - content = prototype.replace(/__name__/g, counter.toString()), - event = new CustomEvent("collection-add-entry", { - detail: new CollectionEventPayload(collection, entry), - }); - - console.log(counter); - console.log(content); - - entry.innerHTML = content; - entry.classList.add("entry"); - - if ("collectionRegular" in collection.dataset) { - initializeRemove(collection, entry); - if (empty_explain !== null) { - empty_explain.remove(); - } - } - - collection.appendChild(entry); - collection.dispatchEvent(event); - window.dispatchEvent(event); + collection.appendChild(entry); + collection.dispatchEvent(event); + window.dispatchEvent(event); }; const initializeRemove = ( - collection: HTMLUListElement, - entry: HTMLLIElement, + collection: HTMLUListElement, + entry: HTMLLIElement, ): void => { - const button = buildRemoveButton(collection, entry); - if (null === button) { - return; - } - entry.appendChild(button); + const button = buildRemoveButton(collection, entry); + if (null === button) { + return; + } + entry.appendChild(button); }; export const buildRemoveButton = ( - collection: HTMLUListElement, - entry: HTMLLIElement, + collection: HTMLUListElement, + entry: HTMLLIElement, ): HTMLButtonElement | null => { - const button = document.createElement("button"), - isPersisted = entry.dataset.collectionIsPersisted || "", - content = collection.dataset.collectionButtonRemoveLabel || "", - allowDelete = collection.dataset.collectionAllowDelete || "", - event = new CustomEvent("collection-remove-entry", { - detail: new CollectionEventPayload(collection, entry), - }); - - if (allowDelete === "0" && isPersisted === "1") { - return null; - } - button.classList.add("btn", "btn-delete", "remove-entry"); - button.textContent = content; - button.addEventListener("click", (e: Event) => { - e.preventDefault(); - entry.remove(); - collection.dispatchEvent(event); - window.dispatchEvent(event); + const button = document.createElement("button"), + isPersisted = entry.dataset.collectionIsPersisted || "", + content = collection.dataset.collectionButtonRemoveLabel || "", + allowDelete = collection.dataset.collectionAllowDelete || "", + event = new CustomEvent("collection-remove-entry", { + detail: new CollectionEventPayload(collection, entry), }); - return button; + if (allowDelete === "0" && isPersisted === "1") { + return null; + } + button.classList.add("btn", "btn-delete", "remove-entry"); + button.textContent = content; + button.addEventListener("click", (e: Event) => { + e.preventDefault(); + entry.remove(); + collection.dispatchEvent(event); + window.dispatchEvent(event); + }); + + return button; }; const collectionsInit = new Set(); const buttonsInit = new Set(); const initialize = function (target: Document | Element): void { - const addButtons: NodeListOf = document.querySelectorAll( - "button[data-collection-add-target]", - ), - collections: NodeListOf = document.querySelectorAll( - "ul[data-collection-regular]", - ); + const addButtons: NodeListOf = document.querySelectorAll( + "button[data-collection-add-target]", + ), + collections: NodeListOf = document.querySelectorAll( + "ul[data-collection-regular]", + ); - for (let i = 0; i < addButtons.length; i++) { - const addButton = addButtons[i]; - const uniqid = addButton.dataset.uniqid as string; - if (buttonsInit.has(uniqid)) { - continue; - } - buttonsInit.add(uniqid); - addButton.addEventListener("click", (e: Event) => { - e.preventDefault(); - handleAdd(e.target); - }); + for (let i = 0; i < addButtons.length; i++) { + const addButton = addButtons[i]; + const uniqid = addButton.dataset.uniqid as string; + if (buttonsInit.has(uniqid)) { + continue; } - for (let i = 0; i < collections.length; i++) { - const collection = collections[i]; - const uniqid = collection.dataset.uniqid as string; - if (collectionsInit.has(uniqid)) { - continue; - } - collectionsInit.add(uniqid); - const entries: NodeListOf = - collection.querySelectorAll(":scope > li"); - for (let j = 0; j < entries.length; j++) { - if (entries[j].dataset.collectionEmptyExplain === "1") { - continue; - } - initializeRemove(collections[i], entries[j]); - } + buttonsInit.add(uniqid); + addButton.addEventListener("click", (e: Event) => { + e.preventDefault(); + handleAdd(e.target); + }); + } + for (let i = 0; i < collections.length; i++) { + const collection = collections[i]; + const uniqid = collection.dataset.uniqid as string; + if (collectionsInit.has(uniqid)) { + continue; } + collectionsInit.add(uniqid); + const entries: NodeListOf = + collection.querySelectorAll(":scope > li"); + for (let j = 0; j < entries.length; j++) { + if (entries[j].dataset.collectionEmptyExplain === "1") { + continue; + } + initializeRemove(collections[i], entries[j]); + } + } }; window.addEventListener("DOMContentLoaded", () => { - initialize(document); + initialize(document); }); window.addEventListener( - "show-hide-show", - ( - event: CustomEvent<{ - id: number; - container: HTMLElement; - froms: HTMLElement[]; - }>, - ) => { - const container = event.detail.container as HTMLElement; - initialize(container); - }, + "show-hide-show", + ( + event: CustomEvent<{ + id: number; + container: HTMLElement; + froms: HTMLElement[]; + }>, + ) => { + const container = event.detail.container as HTMLElement; + initialize(container); + }, ); diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read_all.ts b/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read_all.ts index 97697fca5..d07a7e815 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read_all.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read_all.ts @@ -5,39 +5,39 @@ import NotificationReadAllToggle from "../../vuejs/_components/Notification/Noti const i18n = _createI18n({}); document.addEventListener("DOMContentLoaded", function () { - const elements = document.querySelectorAll(".notification_all_read"); + const elements = document.querySelectorAll(".notification_all_read"); - elements.forEach((element) => { - console.log("launch"); - createApp({ - template: ``, - components: { - NotificationReadAllToggle, - }, - methods: { - markAsRead(id: number) { - const el = document.querySelector( - `div.notification-status[data-notification-id="${id}"]`, - ); - if (el === null) { - return; - } - el.classList.add("read"); - el.classList.remove("unread"); - }, - markAsUnread(id: number) { - const el = document.querySelector( - `div.notification-status[data-notification-id="${id}"]`, - ); - if (el === null) { - return; - } - el.classList.remove("read"); - el.classList.add("unread"); - }, - }, - }) - .use(i18n) - .mount(element); - }); + elements.forEach((element) => { + console.log("launch"); + createApp({ + template: ``, + components: { + NotificationReadAllToggle, + }, + methods: { + markAsRead(id: number) { + const el = document.querySelector( + `div.notification-status[data-notification-id="${id}"]`, + ); + if (el === null) { + return; + } + el.classList.add("read"); + el.classList.remove("unread"); + }, + markAsUnread(id: number) { + const el = document.querySelector( + `div.notification-status[data-notification-id="${id}"]`, + ); + if (el === null) { + return; + } + el.classList.remove("read"); + el.classList.add("unread"); + }, + }, + }) + .use(i18n) + .mount(element); + }); }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js index 9f6bb753e..8d9484bb1 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js @@ -124,9 +124,10 @@ function loadDynamicPicker(element) { removeEntity({ entity }) { if ( -1 === - this.suggested.findIndex( - (e) => e.type === entity.type && e.id === entity.id, - ) + this.suggested.findIndex( + (e) => e.type === entity.type && e.id === entity.id, + ) && + "me" !== entity ) { this.suggested.push(entity); } diff --git a/src/Bundle/ChillMainBundle/Resources/public/types.ts b/src/Bundle/ChillMainBundle/Resources/public/types.ts index 2cd83bc64..fecb9a578 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/types.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/types.ts @@ -2,216 +2,279 @@ import { GenericDoc } from "ChillDocStoreAssets/types/generic_doc"; import { StoredObject, StoredObjectStatus } from "ChillDocStoreAssets/types"; export interface DateTime { - datetime: string; - datetime8601: string; + datetime: string; + datetime8601: string; } export interface Civility { - id: number; - // TODO + id: number; + // TODO +} + +export interface Household { + type: "household"; + id: number; } export interface Job { - id: number; - type: "user_job"; - label: { - fr: string; // could have other key. How to do that in ts ? - }; + id: number; + type: "user_job"; + label: { + fr: string; // could have other key. How to do that in ts ? + }; } export interface Center { - id: number; - type: "center"; - name: string; + id: number; + type: "center"; + name: string; } export interface Scope { - id: number; - type: "scope"; - name: { - fr: string; - }; + id: number; + type: "scope"; + name: { + fr: string; + }; } export interface ResultItem { - result: T; - relevance: number; + result: T; + relevance: number; } export interface User { - type: "user"; - id: number; - username: string; - text: string; - text_without_absence: string; - email: string; - user_job: Job; - label: string; - // todo: mainCenter; mainJob; etc.. + type: "user"; + id: number; + username: string; + text: string; + text_without_absence: string; + email: string; + user_job: Job; + label: string; + // todo: mainCenter; mainJob; etc.. } export interface UserGroup { - type: "user_group"; - id: number; - label: TranslatableString; - backgroundColor: string; - foregroundColor: string; - excludeKey: string; - text: string; + type: "user_group"; + id: number; + label: TranslatableString; + backgroundColor: string; + foregroundColor: string; + excludeKey: string; + text: string; } export type UserGroupOrUser = User | UserGroup; export interface UserAssociatedInterface { - type: "user"; - id: number; + type: "user"; + id: number; } export type TranslatableString = Record; export interface Postcode { - id: number; - name: string; - code: string; - center: Point; + id: number; + name: string; + code: string; + center: Point; } export interface Point { - type: "Point"; - coordinates: [lat: number, lon: number]; + type: "Point"; + coordinates: [lat: number, lon: number]; } export interface Country { - id: number; - name: TranslatableString; - code: string; + id: number; + name: TranslatableString; + code: string; } export type AddressRefStatus = "match" | "to_review" | "reviewed"; export interface Address { - type: "address"; - address_id: number; - text: string; - street: string; - streetNumber: string; - postcode: Postcode; - country: Country; - floor: string | null; - corridor: string | null; - steps: string | null; - flat: string | null; - buildingName: string | null; - distribution: string | null; - extra: string | null; - confidential: boolean; - lines: string[]; - addressReference: AddressReference | null; - validFrom: DateTime; - validTo: DateTime | null; - point: Point | null; - refStatus: AddressRefStatus; - isNoAddress: boolean; + type: "address"; + address_id: number; + text: string; + street: string; + streetNumber: string; + postcode: Postcode; + country: Country; + floor: string | null; + corridor: string | null; + steps: string | null; + flat: string | null; + buildingName: string | null; + distribution: string | null; + extra: string | null; + confidential: boolean; + lines: string[]; + addressReference: AddressReference | null; + validFrom: DateTime; + validTo: DateTime | null; + point: Point | null; + refStatus: AddressRefStatus; + isNoAddress: boolean; } export interface AddressWithPoint extends Address { - point: Point; + point: Point; } export interface AddressReference { - id: number; - createdAt: DateTime | null; - deletedAt: DateTime | null; - municipalityCode: string; - point: Point; - postcode: Postcode; - refId: string; - source: string; - street: string; - streetNumber: string; - updatedAt: DateTime | null; + id: number; + createdAt: DateTime | null; + deletedAt: DateTime | null; + municipalityCode: string; + point: Point; + postcode: Postcode; + refId: string; + source: string; + street: string; + streetNumber: string; + updatedAt: DateTime | null; } export interface SimpleGeographicalUnit { - id: number; - layerId: number; - unitName: string; - unitRefId: string; + id: number; + layerId: number; + unitName: string; + unitRefId: string; } export interface GeographicalUnitLayer { - id: number; - name: TranslatableString; - refId: string; + id: number; + name: TranslatableString; + refId: string; } export interface Location { - type: "location"; - id: number; - active: boolean; - address: Address | null; - availableForUsers: boolean; - createdAt: DateTime | null; - createdBy: User | null; - updatedAt: DateTime | null; - updatedBy: User | null; - email: string | null; - name: string; - phonenumber1: string | null; - phonenumber2: string | null; - locationType: LocationType; + type: "location"; + id: number; + active: boolean; + address: Address | null; + availableForUsers: boolean; + createdAt: DateTime | null; + createdBy: User | null; + updatedAt: DateTime | null; + updatedBy: User | null; + email: string | null; + name: string; + phonenumber1: string | null; + phonenumber2: string | null; + locationType: LocationType; } export interface LocationAssociated { - type: "location"; - id: number; + type: "location"; + id: number; } export interface LocationType { - type: "location-type"; - id: number; - active: boolean; - addressRequired: "optional" | "required"; - availableForUsers: boolean; - editableByUsers: boolean; - contactData: "optional" | "required"; - title: TranslatableString; + type: "location-type"; + id: number; + active: boolean; + addressRequired: "optional" | "required"; + availableForUsers: boolean; + editableByUsers: boolean; + contactData: "optional" | "required"; + title: TranslatableString; } export interface NewsItemType { - id: number; - title: string; - content: string; - startDate: DateTime; - endDate: DateTime | null; + id: number; + title: string; + content: string; + startDate: DateTime; + endDate: DateTime | null; } export interface WorkflowAvailable { - name: string; - text: string; + name: string; + text: string; } export interface WorkflowAttachment { - id: number; - relatedGenericDocKey: string; - relatedGenericDocIdentifiers: object; - createdAt: DateTime | null; - createdBy: User | null; - updatedAt: DateTime | null; - updatedBy: User | null; - genericDoc: null | GenericDoc; + id: number; + relatedGenericDocKey: string; + relatedGenericDocIdentifiers: object; + createdAt: DateTime | null; + createdBy: User | null; + updatedAt: DateTime | null; + updatedBy: User | null; + genericDoc: null | GenericDoc; } export interface ExportGeneration { - id: string; - type: "export_generation"; - exportAlias: string; - createdBy: User | null; - createdAt: DateTime | null; - status: StoredObjectStatus; - storedObject: StoredObject; + id: string; + type: "export_generation"; + exportAlias: string; + createdBy: User | null; + createdAt: DateTime | null; + status: StoredObjectStatus; + storedObject: StoredObject; } export interface PrivateCommentEmbeddable { - comments: Record; + comments: Record; +} + +// API Exception types +export interface TransportExceptionInterface { + name: string; +} + +export interface ValidationExceptionInterface + extends TransportExceptionInterface { + name: "ValidationException"; + error: object; + violations: string[]; + titles: string[]; + propertyPaths: string[]; +} + +export interface AccessExceptionInterface extends TransportExceptionInterface { + name: "AccessException"; + violations: string[]; +} + +export interface NotFoundExceptionInterface + extends TransportExceptionInterface { + name: "NotFoundException"; +} + +export interface ServerExceptionInterface extends TransportExceptionInterface { + name: "ServerException"; + message: string; + code: number; + body: string; +} + +export interface ConflictHttpExceptionInterface + extends TransportExceptionInterface { + name: "ConflictHttpException"; + violations: string[]; +} + +export type ApiException = + | ValidationExceptionInterface + | AccessExceptionInterface + | NotFoundExceptionInterface + | ServerExceptionInterface + | ConflictHttpExceptionInterface; + +export interface Modal { + showModal: boolean; + modalDialogClass: string; +} + +export interface Selected { + result: UserGroupOrUser; +} + +export interface addNewEntities { + selected: Selected[]; + modal: Modal; } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index 075bf6d65..d259d0cae 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -1,130 +1,130 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue index 5d90bf818..fda84c817 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue @@ -1,32 +1,32 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue index 103849e3a..ede1b3778 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -1,251 +1,248 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMap.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMap.vue index 167b3b981..4aa44f4a6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMap.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMap.vue @@ -1,5 +1,5 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue index 4b59efbc6..3e9da5da4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue @@ -1,149 +1,149 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue index fd1740a40..6ad8965b4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue @@ -1,227 +1,223 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue index 0d85c69f9..74520310e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue @@ -1,60 +1,60 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue index 37decf15e..47feab563 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue @@ -1,23 +1,23 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue index 96e67f952..3e8e1f4bb 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue @@ -1,69 +1,66 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue index df5ea56dc..cf808ed2a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue @@ -1,104 +1,101 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index a17ce719d..d0796bc0d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -1,109 +1,98 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/SuggestPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/SuggestPane.vue index ddaed6219..2e62b5963 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/SuggestPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/SuggestPane.vue @@ -1,67 +1,64 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue index 033eb6cac..d1389a748 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue @@ -1,10 +1,10 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts index e970e51b9..ae77fbb08 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts @@ -4,8 +4,8 @@ import App from "./App.vue"; const el = document.getElementById("app"); if (null === el) { - console.error("div element app was not found"); - throw new Error("div element app was not found"); + console.error("div element app was not found"); + throw new Error("div element app was not found"); } const exportGenerationId = el?.dataset.exportGenerationId as string; diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/App.vue index 8686b59a7..c550d1c0d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/App.vue @@ -1,36 +1,36 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue index 5633d3133..4f664d6a5 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue @@ -1,13 +1,13 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue index 997eae58b..5cbd33712 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue @@ -1,40 +1,38 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyAccompanyingCourses.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyAccompanyingCourses.vue index 9f7edf8e7..bd3b5cdf8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyAccompanyingCourses.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyAccompanyingCourses.vue @@ -1,76 +1,65 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyCustoms.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyCustoms.vue index 1f76a5a0a..5b10dc89c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyCustoms.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyCustoms.vue @@ -1,105 +1,103 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue index 1c5d2b6da..b74b64054 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue @@ -1,66 +1,63 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/CommentEditor/CommentEditor.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/CommentEditor/CommentEditor.vue index d6019fabe..97242ffa2 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/CommentEditor/CommentEditor.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/CommentEditor/CommentEditor.vue @@ -4,9 +4,9 @@ import { Ckeditor } from "@ckeditor/ckeditor5-vue"; import { ClassicEditor } from "ckeditor5"; import classicEditorConfig from "ChillMainAssets/module/ckeditor5/editor_config"; import { - trans, - EDITOR_SWITCH_TO_SIMPLE, - EDITOR_SWITCH_TO_COMPLEX, + trans, + EDITOR_SWITCH_TO_SIMPLE, + EDITOR_SWITCH_TO_COMPLEX, } from "translator"; const EDITOR_MODE_KEY = "editorMode"; @@ -16,107 +16,101 @@ const value = defineModel({ required: true }); const isSimple = computed(() => kind.value === "simple"); const toggleButtonClass = computed(() => { - return { - ["toggle-button"]: true, - onEditor: !isSimple.value, - onSimple: isSimple.value, - }; + return { + ["toggle-button"]: true, + onEditor: !isSimple.value, + onSimple: isSimple.value, + }; }); const toggleEditor = () => { - let newValue; + let newValue; - newValue = kind.value === "simple" ? "rich" : "simple"; - kind.value = "rich"; - window.localStorage.setItem(EDITOR_MODE_KEY, newValue); + newValue = kind.value === "simple" ? "rich" : "simple"; + kind.value = "rich"; + window.localStorage.setItem(EDITOR_MODE_KEY, newValue); - window.dispatchEvent(new Event("toggleEditorKind")); + window.dispatchEvent(new Event("toggleEditorKind")); }; const onKindChange = function (/* event: StorageEvent | Event */) { - const newValue = window.localStorage.getItem(EDITOR_MODE_KEY); + const newValue = window.localStorage.getItem(EDITOR_MODE_KEY); - if (null === newValue || !(newValue === "rich" || newValue === "simple")) { - throw "invalid new value: " + newValue; - } + if (null === newValue || !(newValue === "rich" || newValue === "simple")) { + throw "invalid new value: " + newValue; + } - if (kind.value !== newValue) { - kind.value = newValue; - } + if (kind.value !== newValue) { + kind.value = newValue; + } }; onMounted(function () { - const storage = window.localStorage; - const savedKind = storage.getItem(EDITOR_MODE_KEY); + const storage = window.localStorage; + const savedKind = storage.getItem(EDITOR_MODE_KEY); - if ( - null !== kind.value && - (savedKind === "simple" || savedKind === "rich") - ) { - kind.value = savedKind; - } + if (null !== kind.value && (savedKind === "simple" || savedKind === "rich")) { + kind.value = savedKind; + } - window.addEventListener("storage", onKindChange); - window.addEventListener("toggleEditorKind", onKindChange); + window.addEventListener("storage", onKindChange); + window.addEventListener("toggleEditorKind", onKindChange); }); onUnmounted(function () { - window.removeEventListener("storage", onKindChange); - window.removeEventListener("toggleEditorKind", onKindChange); + window.removeEventListener("storage", onKindChange); + window.removeEventListener("toggleEditorKind", onKindChange); }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue index 13459b390..9c010e8d1 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue @@ -1,40 +1,40 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue index 86f4155b6..7085b3b18 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue @@ -1,83 +1,77 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue index d47b9b777..794771014 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue @@ -1,9 +1,28 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue index 7c37e98a9..81f836c62 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue @@ -4,23 +4,23 @@ import { computed } from "vue"; import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper"; interface UserGroupRenderBoxProps { - userGroup: UserGroup; + userGroup: UserGroup; } const props = defineProps(); const styles = computed<{ color: string; "background-color": string }>(() => { - return { - color: props.userGroup.foregroundColor, - "background-color": props.userGroup.backgroundColor, - }; + return { + color: props.userGroup.foregroundColor, + "background-color": props.userGroup.backgroundColor, + }; }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue index 63c43c37f..4bae3b541 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue @@ -1,31 +1,31 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue index 332849ef5..4d817a2f9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue @@ -1,83 +1,83 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue index 59dcd80f4..658c0f9e9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue @@ -1,49 +1,45 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue index 06e1bfa1a..4808e2bda 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue @@ -1,42 +1,39 @@ @@ -73,17 +79,17 @@ const emits = defineEmits<{ * This is a mask behind the modal. */ .modal-mask { - position: fixed; - z-index: 9998; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.75); - transition: opacity 0.3s ease; + position: fixed; + z-index: 9998; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.75); + transition: opacity 0.3s ease; } .modal-header .close { - border-top-right-radius: 0.3rem; + border-top-right-radius: 0.3rem; } /* * The following styles are auto-applied to elements with @@ -94,23 +100,23 @@ const emits = defineEmits<{ * these styles. */ .modal-enter { - opacity: 0; + opacity: 0; } .modal-leave-active { - opacity: 0; + opacity: 0; } .modal-enter .modal-container, .modal-leave-active .modal-container { - -webkit-transform: scale(1.1); - transform: scale(1.1); + -webkit-transform: scale(1.1); + transform: scale(1.1); } h3.modal-title { - font-size: 1.5rem; - font-weight: bold; + font-size: 1.5rem; + font-weight: bold; } div.modal-footer { - button:first-child { - margin-right: auto; - } + button:first-child { + margin-right: auto; + } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue index 57f7fd7f8..bb7a43c92 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue @@ -1,17 +1,17 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue index cc64d4835..fb94af80f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue @@ -1,96 +1,96 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts index db9a37104..cbee6bf25 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts @@ -2,87 +2,86 @@ import { createI18n } from "vue-i18n"; import datetimeFormats from "../i18n/datetimeFormats"; const messages = { - fr: { - action: { - actions: "Actions", - show: "Voir", - edit: "Modifier", - create: "Créer", - remove: "Enlever", - delete: "Supprimer", - save: "Enregistrer", - valid: "Valider", - valid_and_see: "Valider et voir", - add: "Ajouter", - show_modal: "Ouvrir une modale", - ok: "OK", - cancel: "Annuler", - close: "Fermer", - back: "Retour", - check_all: "cocher tout", - reset: "réinitialiser", - redirect: { - person: "Quitter la page et ouvrir la fiche de l'usager", - thirdparty: "Quitter la page et voir le tiers", - }, - refresh: "Rafraîchir", - addContact: "Ajouter un contact", - }, - nav: { - next: "Suivant", - previous: "Précédent", - top: "Haut", - bottom: "Bas", - }, - renderbox: { - person: "Usager", - birthday: { - man: "Né le", - woman: "Née le", - neutral: "Né·e le", - unknown: "Né·e le", - }, - deathdate: "Date de décès", - household_without_address: "Le ménage de l'usager est sans adresse", - no_data: "Aucune information renseignée", - type: { - thirdparty: "Tiers", - person: "Usager", - }, - holder: "Titulaire", - years_old: "1 an | {n} an | {n} ans", - residential_address: "Adresse de résidence", - located_at: "réside chez", - }, + fr: { + action: { + actions: "Actions", + show: "Voir", + edit: "Modifier", + create: "Créer", + remove: "Enlever", + delete: "Supprimer", + save: "Enregistrer", + valid: "Valider", + valid_and_see: "Valider et voir", + add: "Ajouter", + show_modal: "Ouvrir une modale", + ok: "OK", + cancel: "Annuler", + close: "Fermer", + back: "Retour", + check_all: "cocher tout", + reset: "réinitialiser", + redirect: { + person: "Quitter la page et ouvrir la fiche de l'usager", + thirdparty: "Quitter la page et voir le tiers", + }, + refresh: "Rafraîchir", + addContact: "Ajouter un contact", }, + nav: { + next: "Suivant", + previous: "Précédent", + top: "Haut", + bottom: "Bas", + }, + renderbox: { + person: "Usager", + birthday: { + man: "Né le", + woman: "Née le", + neutral: "Né·e le", + unknown: "Né·e le", + }, + deathdate: "Date de décès", + household_without_address: "Le ménage de l'usager est sans adresse", + no_data: "Aucune information renseignée", + type: { + thirdparty: "Tiers", + person: "Usager", + }, + holder: "Titulaire", + years_old: "1 an | {n} an | {n} ans", + residential_address: "Adresse de résidence", + located_at: "réside chez", + }, + }, }; const _createI18n = (appMessages: any, legacy?: boolean) => { - Object.assign(messages.fr, appMessages.fr); - return createI18n({ - legacy: typeof legacy === undefined ? true : legacy, - locale: "fr", - fallbackLocale: "fr", - // @ts-ignore - datetimeFormats, - messages, - }); + Object.assign(messages.fr, appMessages.fr); + return createI18n({ + legacy: typeof legacy === undefined ? true : legacy, + locale: "fr", + fallbackLocale: "fr", + // @ts-ignore + datetimeFormats, + messages, + }); }; export { _createI18n }; export const multiSelectMessages = { - fr: { - multiselect: { - placeholder: "Choisir", - tag_placeholder: "Créer un nouvel élément", - select_label: '"Entrée" ou cliquez pour sélectionner', - deselect_label: '"Entrée" ou cliquez pour désélectionner', - select_group_label: - 'Appuyer sur "Entrée" pour sélectionner ce groupe', - deselect_group_label: - 'Appuyer sur "Entrée" pour désélectionner ce groupe', - selected_label: "Sélectionné", - }, + fr: { + multiselect: { + placeholder: "Choisir", + tag_placeholder: "Créer un nouvel élément", + select_label: '"Entrée" ou cliquez pour sélectionner', + deselect_label: '"Entrée" ou cliquez pour désélectionner', + select_group_label: 'Appuyer sur "Entrée" pour sélectionner ce groupe', + deselect_group_label: + 'Appuyer sur "Entrée" pour désélectionner ce groupe', + selected_label: "Sélectionné", }, + }, }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts index fe20cb217..aca1328ac 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts @@ -1,27 +1,27 @@ export default { - fr: { - short: { - year: "numeric", - month: "numeric", - day: "numeric", - }, - text: { - year: "numeric", - month: "long", - day: "numeric", - }, - long: { - year: "numeric", - month: "numeric", - day: "numeric", - hour: "numeric", - minute: "numeric", - hour12: false, - }, - hoursOnly: { - hour: "numeric", - minute: "numeric", - hour12: false, - }, + fr: { + short: { + year: "numeric", + month: "numeric", + day: "numeric", }, + text: { + year: "numeric", + month: "long", + day: "numeric", + }, + long: { + year: "numeric", + month: "numeric", + day: "numeric", + hour: "numeric", + minute: "numeric", + hour12: false, + }, + hoursOnly: { + hour: "numeric", + minute: "numeric", + hour12: false, + }, + }, }; diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index 30f84c855..d92f2e260 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -69,35 +69,37 @@ {% endif %} - {% block content %} - - {# DISABLED {{ chill_widget('homepage', {} ) }} #} + {# DISABLED {{ chill_widget('homepage', {} ) }} #} - {% include '@ChillMain/Homepage/index.html.twig' %} + {% include '@ChillMain/Homepage/index.html.twig' %} + {% endblock %} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php index 182980dd0..cae0cdd48 100644 --- a/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Tests\Phonenumber; use Chill\MainBundle\Phonenumber\PhonenumberHelper; +use libphonenumber\PhoneNumber; use libphonenumber\PhoneNumberUtil; use Psr\Log\NullLogger; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; @@ -31,6 +32,7 @@ final class PhonenumberHelperTest extends KernelTestCase public function testFormatPhonenumbers(string $defaultCarrierCode, string $phoneNumber, string $expected) { $util = PhoneNumberUtil::getInstance(); + $subject = new PhonenumberHelper( new ArrayAdapter(), new ParameterBag([ @@ -70,4 +72,47 @@ final class PhonenumberHelperTest extends KernelTestCase '00 33 6 23 12 45 54', ]; } + + /** + * @dataProvider providePhoneNumbersToParse + */ + public function testParsePhonenumbers(string $defaultCarrierCode, string $phoneNumber, PhoneNumber $expected): void + { + $subject = new PhonenumberHelper( + new ArrayAdapter(), + new ParameterBag([ + 'chill_main.phone_helper' => [ + 'default_carrier_code' => $defaultCarrierCode, + ], + ]), + new NullLogger() + ); + + $actual = $subject->parse($phoneNumber); + + self::assertTrue($expected->equals($actual)); + } + + public static function providePhoneNumbersToParse(): iterable + { + $util = PhoneNumberUtil::getInstance(); + + yield [ + 'FR', + '+32486544999', + $util->parse('+32486544999', 'FR'), + ]; + + yield [ + 'FR', + '32486544999', + $util->parse('+32486544999', 'FR'), + ]; + + yield [ + 'FR', + '0228858040', + $util->parse('+33228858040', 'FR'), + ]; + } } diff --git a/src/Bundle/ChillMainBundle/Tests/Validation/Validator/UserGroupDoNotExcludeTest.php b/src/Bundle/ChillMainBundle/Tests/Validation/Validator/UserGroupDoNotExcludeTest.php new file mode 100644 index 000000000..d6d1c9887 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Tests/Validation/Validator/UserGroupDoNotExcludeTest.php @@ -0,0 +1,91 @@ +validator->validate([], new \Chill\MainBundle\Validation\Constraint\UserGroupDoNotExclude()); + + $this->assertNoViolation(); + } + + public function testMixedUserGroupAndUsersIsValid(): void + { + $this->validator->validate( + [new User(), new UserGroup()], + new \Chill\MainBundle\Validation\Constraint\UserGroupDoNotExclude() + ); + + $this->assertNoViolation(); + } + + public function testDifferentExcludeKeysIsValid(): void + { + $this->validator->validate( + [(new UserGroup())->setExcludeKey('A'), (new UserGroup())->setExcludeKey('B')], + new \Chill\MainBundle\Validation\Constraint\UserGroupDoNotExclude() + ); + + $this->assertNoViolation(); + } + + public function testMultipleGroupsWithEmptyExcludeKeyIsValid(): void + { + $this->validator->validate( + [(new UserGroup())->setExcludeKey(''), (new UserGroup())->setExcludeKey('')], + new \Chill\MainBundle\Validation\Constraint\UserGroupDoNotExclude() + ); + + $this->assertNoViolation(); + } + + public function testSameExclusionKeyWillRaiseError(): void + { + $this->validator->validate( + [ + (new UserGroup())->setExcludeKey('A')->setLabel(['fr' => 'Group 1']), + (new UserGroup())->setExcludeKey('A')->setLabel(['fr' => 'Group 2']), + ], + new \Chill\MainBundle\Validation\Constraint\UserGroupDoNotExclude() + ); + + $this->buildViolation('The groups {{ excluded_groups }} do exclude themselves. Please choose one between them') + ->setParameter('excluded_groups', 'Group 1, Group 2') + ->setCode('e16c8226-0090-11ef-8560-f7239594db09') + ->assertRaised(); + } +} diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index d87a0eb71..047f69675 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -10,6 +10,31 @@ servers: components: schemas: + Collection: + type: object + properties: + count: + type: number + format: u64 + pagination: + type: object + properties: + first: + type: number + format: u64 + items_per_page: + type: number + format: u64 + next: + type: string + format: uri + nullable: true + previous: + type: string + format: uri + nullable: true + more: + type: boolean EntityWorkflowAttachment: type: object properties: diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml index 2982d94db..0d1b30ef8 100644 --- a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml @@ -130,3 +130,58 @@ filter_order: Search: Chercher dans la liste By date: Filtrer par date search_box: Filtrer par contenu +renderbox: + person: "Usager" + birthday: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + unknown: "Né·e le" + deathdate: "Date de décès" + household_without_address: "Le ménage de l'usager est sans adresse" + no_data: "Aucune information renseignée" + type: + thirdparty: "Tiers" + person: "Usager" + holder: "Titulaire" + years_old: >- + {n, plural, + =0 {0 an} + one {1 an} + other {# ans} + } + residential_address: "Adresse de résidence" + located_at: "réside chez" + household_number: "Ménage n°{number}" + current_members: "Membres actuels" + no_current_address: "Sans adresse actuellement" + new_household: "Nouveau ménage" + no_members_yet: "Aucun membre actuellement" + +pick_entity: + add: "Ajouter" + modal_title: >- + {count, plural, + one {Indiquer un} + other {Ajouter des} + } + user: >- + {count, plural, + one {Utilisateur} + other {Utilisateurs} + } + user_group: >- + {count, plural, + one {Groupe d'utilisateur} + other {Groupes d'utilisateurs} + } + person: >- + {count, plural, + one {Usager} + other {Usagers} + } + thirdparty: >- + {count, plural, + one {Tiers} + other {Tiers} + } diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index d3498cba9..5e591fba8 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -941,3 +941,34 @@ multiselect: editor: switch_to_simple: Éditeur simple switch_to_complex: Éditeur riche +action: + actions: Actions + show: Voir + edit: Modifier + create: Créer + remove: Enlever + delete: Supprimer + save: Enregistrer + valid: Valider + valid_and_see: Valider et voir + add: Ajouter + show_modal: Ouvrir une modale + ok: OK + cancel: Annuler + close: Fermer + back: Retour + check_all: cocher tout + reset: réinitialiser + redirect: + person: Quitter la page et ouvrir la fiche de l'usager + thirdparty: Quitter la page et voir le tiers + refresh: Rafraîchir + addContact: Ajouter un contact + +nav: + next: "Suivant" + previous: "Précédent" + top: "Haut" + bottom: "Bas" + + diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index 686022ca3..0d972914d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -21,6 +21,8 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\Query; +use libphonenumber\PhoneNumber; +use libphonenumber\PhoneNumberFormat; use Symfony\Component\Security\Core\Security; final readonly class PersonACLAwareRepository implements PersonACLAwareRepositoryInterface @@ -298,4 +300,27 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor \array_map(static fn (Center $c) => $c->getId(), $authorizedCenters) ); } + + public function findByPhone(PhoneNumber $phoneNumber, int $start = 0, int $limit = 20): array + { + $authorizedCenters = $this->authorizationHelper + ->getReachableCenters($this->security->getUser(), PersonVoter::SEE); + + if ([] === $authorizedCenters) { + return []; + } + + $util = \libphonenumber\PhoneNumberUtil::getInstance(); + + return $this->em->createQuery( + 'SELECT p FROM '.Person::class.' p LEFT JOIN p.otherPhoneNumbers opn JOIN p.centerCurrent pcc '. + 'WHERE (p.phonenumber LIKE :phone OR p.mobilenumber LIKE :phone OR opn.phonenumber LIKE :phone) '. + 'AND pcc.center IN (:centers)' + ) + ->setMaxResults($limit) + ->setFirstResult($start) + ->setParameter('phone', $util->format($phoneNumber, PhoneNumberFormat::E164)) + ->setParameter('centers', $authorizedCenters) + ->getResult(); + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php index 50fdcd4b3..aeaefecd4 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Repository; use Chill\MainBundle\Search\SearchApiQuery; use Chill\PersonBundle\Entity\Person; +use libphonenumber\PhoneNumber; interface PersonACLAwareRepositoryInterface { @@ -60,4 +61,13 @@ interface PersonACLAwareRepositoryInterface ?string $phonenumber = null, ?string $city = null, ): array; + + /** + * @return list + */ + public function findByPhone( + PhoneNumber $phoneNumber, + int $start = 0, + int $limit = 20, + ): array; } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index 6d6373999..8d5e244ea 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -12,10 +12,12 @@ declare(strict_types=1); namespace Chill\PersonBundle\Repository; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Entity\PersonPhone; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ObjectRepository; +use libphonenumber\PhoneNumber; class PersonRepository implements ObjectRepository { @@ -29,6 +31,8 @@ class PersonRepository implements ObjectRepository /** * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException + * + * @deprecated */ public function countByPhone( string $phonenumber, @@ -71,6 +75,8 @@ class PersonRepository implements ObjectRepository /** * @throws \Exception + * + * @deprecated Use @see{self::findByPhoneNumber} or use a dedicated method in PersonACLAwareRepository */ public function findByPhone( string $phonenumber, @@ -91,6 +97,25 @@ class PersonRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + /** + * Find a person which is associated to the given phonenumber, without restrictions + * on any. + * + * @return list + */ + public function findByPhoneNumber(PhoneNumber $phoneNumber, int $firstResult = 0, int $maxResults = 50): array + { + $qb = $this->repository->createQueryBuilder('p'); + $qb->select('p'); + + $this->searchByPhoneNumbers($qb, $phoneNumber); + + $qb->setFirstResult($firstResult) + ->setMaxResults($maxResults); + + return $qb->getQuery()->getResult(); + } + public function findOneBy(array $criteria) { return $this->repository->findOneBy($criteria); @@ -109,6 +134,20 @@ class PersonRepository implements ObjectRepository } } + private function searchByPhoneNumbers(QueryBuilder $qb, PhoneNumber $phoneNumber): void + { + $qb->setParameter('number', $phoneNumber, 'phone_number'); + + $orX = $qb->expr()->orX(); + $orX->add($qb->expr()->eq('p.mobilenumber', ':number')); + $orX->add($qb->expr()->eq('p.phonenumber', ':number')); + $orX->add( + $qb->expr()->exists('SELECT 1 FROM '.PersonPhone::class.' k WHERE k.phonenumber = :number AND k.person = p') + ); + + $qb->andWhere($orX); + } + /** * @throws \Exception */ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts index 8f117d6ef..6ceb64b98 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts +++ b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts @@ -3,49 +3,47 @@ import AccompanyingPeriodWorkSelectorModal from "../../vuejs/_components/Accompa import { AccompanyingPeriodWork } from "../../types"; document.addEventListener("DOMContentLoaded", () => { - const elements = document.querySelectorAll( - 'div[data-pick-entities-type="acpw"]', + const elements = document.querySelectorAll( + 'div[data-pick-entities-type="acpw"]', + ); + elements.forEach((el) => { + const uniqid = el.dataset.inputUniqid; + + if (undefined === uniqid) { + throw "Uniqid not found on this element"; + } + + const input = document.querySelector( + `input[data-input-uniqid="${uniqid}"]`, ); - elements.forEach((el) => { - const uniqid = el.dataset.inputUniqid; - if (undefined === uniqid) { - throw "Uniqid not found on this element"; - } + if (null === input) { + throw "Element with uniqid not found: " + uniqid; + } - const input = document.querySelector( - `input[data-input-uniqid="${uniqid}"]`, - ); + const accompanyingPeriodIdAsString = input.dataset.accompanyingPeriodId; - if (null === input) { - throw "Element with uniqid not found: " + uniqid; - } + if (undefined === accompanyingPeriodIdAsString) { + throw "accompanying period id not found"; + } - const accompanyingPeriodIdAsString = input.dataset.accompanyingPeriodId; + const accompanyingPeriodId = Number.parseInt(accompanyingPeriodIdAsString); - if (undefined === accompanyingPeriodIdAsString) { - throw "accompanying period id not found"; - } - - const accompanyingPeriodId = Number.parseInt( - accompanyingPeriodIdAsString, - ); - - const app = createApp({ - template: - '', - components: { AccompanyingPeriodWorkSelectorModal }, - data() { - return { accompanyingPeriodId }; - }, - methods: { - pickWork: function (payload: { work: AccompanyingPeriodWork }) { - console.log("payload", payload); - input.value = payload.work.id.toString(); - }, - }, - }); - - app.mount(el); + const app = createApp({ + template: + '', + components: { AccompanyingPeriodWorkSelectorModal }, + data() { + return { accompanyingPeriodId }; + }, + methods: { + pickWork: function (payload: { work: AccompanyingPeriodWork }) { + console.log("payload", payload); + input.value = payload.work.id.toString(); + }, + }, }); + + app.mount(el); + }); }); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/types.ts b/src/Bundle/ChillPersonBundle/Resources/public/types.ts index 7d641c859..32dc24f73 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/types.ts +++ b/src/Bundle/ChillPersonBundle/Resources/public/types.ts @@ -1,253 +1,329 @@ import { - Address, - Scope, - Center, - Civility, - DateTime, - User, - WorkflowAvailable, - Job, - PrivateCommentEmbeddable, + Address, + Center, + Civility, + DateTime, + User, + UserGroup, + Household, + WorkflowAvailable, + Scope, + Job, + PrivateCommentEmbeddable, } from "ChillMainAssets/types"; import { StoredObject } from "ChillDocStoreAssets/types"; import { Thirdparty } from "../../../ChillThirdPartyBundle/Resources/public/types"; import { Calendar } from "../../../ChillCalendarBundle/Resources/public/types"; +export interface AltName { + label: string; + key: string; +} + export interface Person { - id: number; - type: "person"; - text: string; - textAge: string; - firstName: string; - lastName: string; - current_household_address: Address | null; - birthdate: DateTime | null; - deathdate: DateTime | null; - age: number; - phonenumber: string; - mobilenumber: string; - email: string; - gender: "woman" | "man" | "other"; - centers: Center[]; - civility: Civility | null; - current_household_id: number; - current_residential_addresses: Address[]; + id: number; + type: "person"; + text: string; + textAge: string; + firstName: string; + lastName: string; + altNames: AltName[]; + suffixText: string; + current_household_address: Address | null; + birthdate: DateTime | null; + deathdate: DateTime | null; + age: number; + phonenumber: string; + mobilenumber: string; + email: string; + gender: "woman" | "man" | "other"; + centers: Center[]; + civility: Civility | null; + current_household_id: number; + current_residential_addresses: Address[]; } export interface AccompanyingPeriod { - id: number; - addressLocation?: Address | null; - administrativeLocation?: Location | null; - calendars: Calendar[]; - closingDate?: Date | null; - closingMotive?: ClosingMotive | null; - comments: Comment[]; - confidential: boolean; - createdAt?: Date | null; - createdBy?: User | null; - emergency: boolean; - intensity?: "occasional" | "regular"; - job?: Job | null; - locationHistories: AccompanyingPeriodLocationHistory[]; - openingDate?: Date | null; - origin?: Origin | null; - participations: AccompanyingPeriodParticipation[]; - personLocation?: Person | null; - pinnedComment?: Comment | null; - preventUserIsChangedNotification: boolean; - remark: string; - requestorAnonymous: boolean; - requestorPerson?: Person | null; - requestorThirdParty?: Thirdparty | null; - resources: AccompanyingPeriodResource[]; - scopes: Scope[]; - socialIssues: SocialIssue[]; - step?: - | "CLOSED" - | "CONFIRMED" - | "CONFIRMED_INACTIVE_SHORT" - | "CONFIRMED_INACTIVE_LONG" - | "DRAFT"; -} - -export interface AccompanyingPeriodWorkEvaluationDocument { - id: number; - type: "accompanying_period_work_evaluation_document"; - storedObject: StoredObject; - title: string; - createdAt: DateTime | null; - createdBy: User | null; - updatedAt: DateTime | null; - updatedBy: User | null; - workflows_availables: WorkflowAvailable[]; - workflows: object[]; + id: number; + addressLocation?: Address | null; + administrativeLocation?: Location | null; + calendars: Calendar[]; + closingDate?: Date | null; + closingMotive?: ClosingMotive | null; + comments: Comment[]; + confidential: boolean; + createdAt?: Date | null; + createdBy?: User | null; + emergency: boolean; + intensity?: "occasional" | "regular"; + job?: Job | null; + locationHistories: AccompanyingPeriodLocationHistory[]; + openingDate?: Date | null; + origin?: Origin | null; + participations: AccompanyingPeriodParticipation[]; + personLocation?: Person | null; + pinnedComment?: Comment | null; + preventUserIsChangedNotification: boolean; + remark: string; + requestorAnonymous: boolean; + requestorPerson?: Person | null; + requestorThirdParty?: Thirdparty | null; + resources: AccompanyingPeriodResource[]; + scopes: Scope[]; + socialIssues: SocialIssue[]; + step?: + | "CLOSED" + | "CONFIRMED" + | "CONFIRMED_INACTIVE_SHORT" + | "CONFIRMED_INACTIVE_LONG" + | "DRAFT"; } export interface AccompanyingPeriodWork { - id: number; - accompanyingPeriod?: AccompanyingPeriod; - accompanyingPeriodWorkEvaluations: AccompanyingPeriodWorkEvaluation[]; - createdAt?: string; - createdAutomatically: boolean; - createdAutomaticallyReason: string; - createdBy: User; - endDate?: string; - goals: AccompanyingPeriodWorkGoal[]; - handlingThierParty?: Thirdparty; - note: string; - persons: Person[]; - privateComment: PrivateCommentEmbeddable; - referrersHistory: AccompanyingPeriodWorkReferrerHistory[]; - results: Result[]; - socialAction?: SocialAction; - startDate?: string; - thirdParties: Thirdparty[]; - updatedAt?: string; - updatedBy: User; - version: number; + id: number; + accompanyingPeriod?: AccompanyingPeriod; + accompanyingPeriodWorkEvaluations: AccompanyingPeriodWorkEvaluation[]; + createdAt?: string; + createdAutomatically: boolean; + createdAutomaticallyReason: string; + createdBy: User; + endDate?: string; + goals: AccompanyingPeriodWorkGoal[]; + handlingThierParty?: Thirdparty; + note: string; + persons: Person[]; + privateComment: PrivateCommentEmbeddable; + referrersHistory: AccompanyingPeriodWorkReferrerHistory[]; + results: Result[]; + socialAction?: SocialAction; + startDate?: string; + thirdParties: Thirdparty[]; + updatedAt?: string; + updatedBy: User; + version: number; } -interface SocialAction { - id: number; - parent?: SocialAction | null; - children: SocialAction[]; - issue?: SocialIssue | null; - ordering: number; - title: { - fr: string; - }; - defaultNotificationDelay?: string | null; - desactivationDate?: string | null; - evaluations: Evaluation[]; - goals: Goal[]; - results: Result[]; +export interface SocialAction { + id: number; + parent?: SocialAction | null; + children: SocialAction[]; + issue?: SocialIssue | null; + ordering: number; + title: { + fr: string; + }; + defaultNotificationDelay?: string | null; + desactivationDate?: string | null; + evaluations: Evaluation[]; + goals: Goal[]; + results: Result[]; } export interface AccompanyingPeriodResource { - id: number; - accompanyingPeriod: AccompanyingPeriod; - comment?: string | null; - person?: Person | null; - thirdParty?: Thirdparty | null; + id: number; + accompanyingPeriod: AccompanyingPeriod; + comment?: string | null; + person?: Person | null; + thirdParty?: Thirdparty | null; } export interface Origin { - id: number; - label: { - fr: string; - }; - noActiveAfter: DateTime; + id: number; + label: { + fr: string; + }; + noActiveAfter: DateTime; } export interface ClosingMotive { - id: number; - active: boolean; - name: { - fr: string; - }; - ordering: number; - isCanceledAccompanyingPeriod: boolean; - parent?: ClosingMotive | null; - children: ClosingMotive[]; + id: number; + active: boolean; + name: { + fr: string; + }; + ordering: number; + isCanceledAccompanyingPeriod: boolean; + parent?: ClosingMotive | null; + children: ClosingMotive[]; } export interface AccompanyingPeriodParticipation { - id: number; - startDate: DateTime; - endDate?: DateTime | null; - accompanyingPeriod: AccompanyingPeriod; - person: Person; + id: number; + startDate: DateTime; + endDate?: DateTime | null; + accompanyingPeriod: AccompanyingPeriod; + person: Person; } export interface AccompanyingPeriodLocationHistory { - id: number; - startDate: DateTime; - endDate?: DateTime | null; - addressLocation?: Address | null; - period: AccompanyingPeriod; - personLocation?: Person | null; + id: number; + startDate: DateTime; + endDate?: DateTime | null; + addressLocation?: Address | null; + period: AccompanyingPeriod; + personLocation?: Person | null; } export interface SocialIssue { - id: number; - parent?: SocialIssue | null; - children: SocialIssue[]; - socialActions?: SocialAction[] | null; - ordering: number; - title: { - fr: string; - }; - desactivationDate?: string | null; + id: number; + parent?: SocialIssue | null; + children: SocialIssue[]; + socialActions?: SocialAction[] | null; + ordering: number; + title: { + fr: string; + }; + desactivationDate?: string | null; } export interface Goal { - id: number; - results: Result[]; - socialActions?: SocialAction[] | null; - title: { - fr: string; - }; + id: number; + results: Result[]; + socialActions?: SocialAction[] | null; + title: { + fr: string; + }; } export interface Result { - id: number; - accompanyingPeriodWorks: AccompanyingPeriodWork[]; - accompanyingPeriodWorkGoals: AccompanyingPeriodWorkGoal[]; - goals: Goal[]; - socialActions: SocialAction[]; - title: { - fr: string; - }; - desactivationDate?: string | null; + id: number; + accompanyingPeriodWorks: AccompanyingPeriodWork[]; + accompanyingPeriodWorkGoals: AccompanyingPeriodWorkGoal[]; + goals: Goal[]; + socialActions: SocialAction[]; + title: { + fr: string; + }; + desactivationDate?: string | null; } export interface AccompanyingPeriodWorkGoal { - id: number; - accompanyingPeriodWork: AccompanyingPeriodWork; - goal: Goal; - note: string; - results: Result[]; + id: number; + accompanyingPeriodWork: AccompanyingPeriodWork; + goal: Goal; + note: string; + results: Result[]; } export interface AccompanyingPeriodWorkEvaluation { - accompanyingPeriodWork: AccompanyingPeriodWork | null; - comment: string; - createdAt: DateTime | null; - createdBy: User | null; - documents: AccompanyingPeriodWorkEvaluationDocument[]; - endDate: DateTime | null; - evaluation: Evaluation | null; - id: number | null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - key: any; - maxDate: DateTime | null; - startDate: DateTime | null; - updatedAt: DateTime | null; - updatedBy: User | null; - warningInterval: string | null; - timeSpent: number | null; + accompanyingPeriodWork: AccompanyingPeriodWork | null; + comment: string; + createdAt: DateTime | null; + createdBy: User | null; + documents: AccompanyingPeriodWorkEvaluationDocument[]; + endDate: DateTime | null; + evaluation: Evaluation | null; + id: number | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + key: any; + maxDate: DateTime | null; + startDate: DateTime | null; + updatedAt: DateTime | null; + updatedBy: User | null; + warningInterval: string | null; + timeSpent: number | null; } export interface Evaluation { - id: number; - url: string; - socialActions: SocialAction[]; - title: { - fr: string; - }; - active: boolean; - delay: string; - notificationDelay: string; + id: number; + url: string; + socialActions: SocialAction[]; + title: { + fr: string; + }; + active: boolean; + delay: string; + notificationDelay: string; } export interface AccompanyingPeriodWorkReferrerHistory { - id: number; - accompanyingPeriodWork: AccompanyingPeriodWork; - user: User; - startDate: DateTime; - endDate: DateTime | null; - createdAt: DateTime; - updatedAt: DateTime | null; - createdBy: User; - updatedBy: User | null; + id: number; + accompanyingPeriodWork: AccompanyingPeriodWork; + user: User; + startDate: DateTime; + endDate: DateTime | null; + createdAt: DateTime; + updatedAt: DateTime | null; + createdBy: User; + updatedBy: User | null; +} + +export interface AccompanyingPeriodWorkEvaluationDocument { + id: number; + type: "accompanying_period_work_evaluation_document"; + storedObject: StoredObject; + title: string; + createdAt: DateTime | null; + createdBy: User | null; + updatedAt: DateTime | null; + updatedBy: User | null; + workflows_availables: WorkflowAvailable[]; + workflows: object[]; +} + +export type EntityType = + | "user_group" + | "user" + | "person" + | "thirdparty" + | "household"; + +export type Entities = (UserGroup | User | Person | Thirdparty | Household) & { + address?: Address | null; + kind?: string; + text?: string; + profession?: string; +}; + +export type EntitiesOrMe = "me" | Entities; + +export type AddPersonResult = Entities & { + parent?: Entities | null; +}; + +export interface Suggestion { + key: string; + relevance: number; + result: AddPersonResult; +} + +export interface SearchPagination { + first: number; + items_per_page: number; + next: number | null; + previous: number | null; + more: boolean; +} + +export interface Search { + count: number; + pagination: SearchPagination; + results: Suggestion[]; +} + +export interface SearchOptions { + uniq: boolean; + type: string[]; + priority: number | null; + button: { + size: string; + class: string; + type: string; + display: string; + }; +} + +export class MakeFetchException extends Error { + sta: number; + txt: string; + violations: unknown | null; + + constructor(txt: string, sta: number, violations: unknown | null = null) { + super(txt); + this.name = "ValidationException"; + this.sta = sta; + this.txt = txt; + this.violations = violations; + Object.setPrototypeOf(this, MakeFetchException.prototype); + } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue index 85f031a64..e81949711 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue @@ -1,28 +1,28 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue index 408852711..3ce902daa 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue @@ -1,127 +1,120 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue index f781eca0b..af985e502 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue @@ -1,95 +1,85 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue index 641c9ef37..053eb058f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue @@ -1,33 +1,33 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue index d6979928b..b4e0e70b8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue @@ -1,121 +1,106 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue index 61a9d2571..c2dbd6e0c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue @@ -1,98 +1,97 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue index dbb21fa40..963ff65b5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue @@ -1,116 +1,113 @@ - + + + - +
+ - -
+ -
-
    -
  • - -
  • -
-
+ -
- {{ $t("job.not_valid") }} -
+ + + + +
+
    +
  • + +
  • +
+
+ +
+ {{ $t("job.not_valid") }} +
+ 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 c2b9acfc4..5858cdb00 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue @@ -1,263 +1,239 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue index 1ef9bfe45..fa600bfdd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue @@ -1,57 +1,57 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue index 8a52748d4..87daacf47 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue @@ -1,107 +1,107 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue index 26b561c5d..416c6085c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue @@ -1,34 +1,32 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue index 1d05e0bbe..fee6a89ad 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue @@ -1,25 +1,25 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue index 02d3b0c84..21c290f48 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue @@ -1,30 +1,30 @@ @@ -96,20 +91,20 @@ export default { @import "ChillPersonAssets/chill/scss/mixins"; @import "ChillMainAssets/chill/scss/chill_variables"; div#accompanying-course { - span.multiselect__tag { - @include badge_social($social-issue-color); - background: $chill-l-gray; - color: $dark; + span.multiselect__tag { + @include badge_social($social-issue-color); + background: $chill-l-gray; + color: $dark; + } + span.multiselect__option--highlight { + &::after { + background: $green; } - span.multiselect__option--highlight { - &::after { - background: $green; - } - &.multiselect__option--selected { - &::after { - background: $red; - } - } + &.multiselect__option--selected { + &::after { + background: $red; + } } + } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index 0bfd87b18..d3e9ae97a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -1,22 +1,22 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue index 890aa5153..3ff18f03a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue @@ -1,207 +1,195 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue index 8e175f72b..ecdf3026c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue @@ -1,26 +1,22 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue index 904d4ff42..929b4edd8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue @@ -1,155 +1,146 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 745317211..f8b5389f4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -1,152 +1,135 @@ @@ -288,46 +267,46 @@ export default { @import "ChillPersonAssets/chill/scss/mixins"; @import "ChillMainAssets/chill/scss/chill_variables"; span.badge { - @include badge_social($social-issue-color); - font-size: 95%; - margin-bottom: 5px; - margin-right: 1em; - margin-left: 1em; + @include badge_social($social-issue-color); + font-size: 95%; + margin-bottom: 5px; + margin-right: 1em; + margin-left: 1em; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index f3404e2de..bd87224b2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -1,482 +1,453 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue index bb90557b7..4499b40c8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue @@ -1,136 +1,124 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeHousehold.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeHousehold.vue index 86a58737a..a1e33c4de 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeHousehold.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeHousehold.vue @@ -1,26 +1,25 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypePerson.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypePerson.vue index 259029f73..98119bd8e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypePerson.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypePerson.vue @@ -1,43 +1,48 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue index 8c97d2e29..28be7c119 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue @@ -1,126 +1,137 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUser.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUser.vue index 56b3afe17..74f80c321 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUser.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUser.vue @@ -1,40 +1,40 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue index 1daf921e1..ca3aa2cb8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue @@ -1,32 +1,24 @@ + + - - 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 ad996a375..e6f50708b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue @@ -1,168 +1,161 @@ +
+ + {{ trans(RENDERBOX_HOUSEHOLD_NUMBER, { number: household.id }) }} +
+ +
+
    + +
  • + + + + + +
  • +
  • +

    + {{ trans(RENDERBOX_NO_MEMBERS_YET) }} +

    +
  • - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue index cdc143f76..0d9e3ec5f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -1,493 +1,418 @@ - - - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue index f157fac6a..10302ee30 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue @@ -1,75 +1,51 @@ - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index ff4b312f1..3a93a305d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -1,530 +1,466 @@ - - - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.ts b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.ts index ba7637544..088ff11ea 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.ts +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.ts @@ -1,64 +1,63 @@ const personMessages = { - fr: { - add_persons: { - title: "Ajouter des usagers", - suggested_counter: - "Pas de résultats | 1 résultat | {count} résultats", - selected_counter: " 1 sélectionné | {count} sélectionnés", - search_some_persons: "Rechercher des personnes..", - }, - item: { - type_person: "Usager", - type_user: "TMS", - type_thirdparty: "Tiers professionnel", - type_household: "Ménage", - }, - person: { - firstname: "Prénom", - lastname: "Nom", - born: (ctx: { gender: "man" | "woman" | "neutral" }) => { - if (ctx.gender === "man") { - return "Né le"; - } else if (ctx.gender === "woman") { - return "Née le"; - } else { - return "Né·e le"; - } - }, - center_id: "Identifiant du centre", - center_type: "Type de centre", - center_name: "Territoire", // vendée - phonenumber: "Téléphone", - mobilenumber: "Mobile", - altnames: "Autres noms", - email: "Courriel", - gender: { - title: "Genre", - placeholder: "Choisissez le genre de l'usager", - woman: "Féminin", - man: "Masculin", - neutral: "Neutre, non binaire", - unknown: "Non renseigné", - undefined: "Non renseigné", - }, - civility: { - title: "Civilité", - placeholder: "Choisissez la civilité", - }, - address: { - create_address: "Ajouter une adresse", - show_address_form: - "Ajouter une adresse pour un usager non suivi et seul dans un ménage", - warning: - "Un nouveau ménage va être créé. L'usager sera membre de ce ménage.", - }, - center: { - placeholder: "Choisissez un centre", - title: "Centre", - }, - }, - error_only_one_person: "Une seule personne peut être sélectionnée !", + fr: { + add_persons: { + title: "Ajouter des usagers", + suggested_counter: "Pas de résultats | 1 résultat | {count} résultats", + selected_counter: " 1 sélectionné | {count} sélectionnés", + search_some_persons: "Rechercher des personnes..", }, + item: { + type_person: "Usager", + type_user: "TMS", + type_thirdparty: "Tiers professionnel", + type_household: "Ménage", + }, + person: { + firstname: "Prénom", + lastname: "Nom", + born: (ctx: { gender: "man" | "woman" | "neutral" }) => { + if (ctx.gender === "man") { + return "Né le"; + } else if (ctx.gender === "woman") { + return "Née le"; + } else { + return "Né·e le"; + } + }, + center_id: "Identifiant du centre", + center_type: "Type de centre", + center_name: "Territoire", // vendée + phonenumber: "Téléphone", + mobilenumber: "Mobile", + altnames: "Autres noms", + email: "Courriel", + gender: { + title: "Genre", + placeholder: "Choisissez le genre de l'usager", + woman: "Féminin", + man: "Masculin", + neutral: "Neutre, non binaire", + unknown: "Non renseigné", + undefined: "Non renseigné", + }, + civility: { + title: "Civilité", + placeholder: "Choisissez la civilité", + }, + address: { + create_address: "Ajouter une adresse", + show_address_form: + "Ajouter une adresse pour un usager non suivi et seul dans un ménage", + warning: + "Un nouveau ménage va être créé. L'usager sera membre de ce ménage.", + }, + center: { + placeholder: "Choisissez un centre", + title: "Centre", + }, + }, + error_only_one_person: "Une seule personne peut être sélectionnée !", + }, }; export { personMessages }; diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php index 94df35d88..667242111 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php @@ -11,14 +11,17 @@ declare(strict_types=1); namespace Chill\PersonBundle\Tests\Repository; +use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Repository\CenterRepositoryInterface; use Chill\MainBundle\Repository\CountryRepository; use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Entity\PersonPhone; use Chill\PersonBundle\Repository\PersonACLAwareRepository; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Doctrine\ORM\EntityManagerInterface; +use PHPUnit\Framework\Attributes\DataProvider; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; @@ -98,4 +101,67 @@ final class PersonACLAwareRepositoryTest extends KernelTestCase $this->assertStringContainsString('diallo', strtolower($person->getFirstName().' '.$person->getLastName())); } } + + /** + * @dataProvider providePersonsWithPhoneNumbers + */ + public function testFindByPhonenumber(\libphonenumber\PhoneNumber $phoneNumber, ?int $expectedId): void + { + $user = new User(); + + $authorizationHelper = $this->prophesize(AuthorizationHelperInterface::class); + $authorizationHelper->getReachableCenters(Argument::exact($user), Argument::exact(PersonVoter::SEE)) + ->willReturn($this->centerRepository->findAll()); + + $security = $this->prophesize(Security::class); + $security->getUser()->willReturn($user); + + $repository = new PersonACLAwareRepository( + $security->reveal(), + $this->entityManager, + $this->countryRepository, + $authorizationHelper->reveal() + ); + + $actual = $repository->findByPhone($phoneNumber, 0, 10); + + if (null === $expectedId) { + self::assertCount(0, $actual); + } else { + $actualIds = array_map(fn (Person $person) => $person->getId(), $actual); + + self::assertContains($expectedId, $actualIds); + } + } + + public static function providePersonsWithPhoneNumbers(): iterable + { + self::bootKernel(); + $em = self::getContainer()->get(EntityManagerInterface::class); + $center = $em->createQuery('SELECT c FROM '.Center::class.' c ')->setMaxResults(1) + ->getSingleResult(); + $util = \libphonenumber\PhoneNumberUtil::getInstance(); + + $mobile = $util->parse('+32486123456'); + $fixed = $util->parse('+3281136917'); + $anotherMobile = $util->parse('+32486123478'); + $person = (new Person())->setFirstName('diallo')->setLastName('diallo')->setCenter($center); + $person->setMobilenumber($mobile)->setPhonenumber($fixed); + $otherPhone = new PersonPhone(); + $otherPhone->setPerson($person); + $otherPhone->setPhonenumber($anotherMobile); + $otherPhone->setType('mobile'); + + $em->persist($person); + $em->persist($otherPhone); + + $em->flush(); + + self::ensureKernelShutdown(); + + yield [$mobile, $person->getId()]; + yield [$anotherMobile, $person->getId()]; + yield [$fixed, $person->getId()]; + yield [$util->parse('+331234567890'), null]; + } } diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 6e42a362b..ae7ac6284 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -206,3 +206,59 @@ accompanying_course_evaluation_document: accompanying_period_work: title: Action d'accompagnement (n°{id}) - {action_title} + +add_persons: + title: "Ajouter des usagers" + suggested_counter: >- + {count, plural, + =0 {Pas de résultats} + =1 {1 résultat} + other {# résultats} + } + selected_counter: >- + {count, plural, + =1 {1 sélectionné} + other {# sélectionnés} + } + search_some_persons: "Rechercher des personnes.." + + item: + type_person: "Usager" + type_user: "TMS" + type_thirdparty: "Tiers professionnel" + type_household: "Ménage" + + person: + firstname: "Prénom" + lastname: "Nom" + born: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + center_id: "Identifiant du centre" + center_type: "Type de centre" + center_name: "Territoire" + phonenumber: "Téléphone" + mobilenumber: "Mobile" + altnames: "Autres noms" + email: "Courriel" + gender: + title: "Genre" + placeholder: "Choisissez le genre de l'usager" + woman: "Féminin" + man: "Masculin" + neutral: "Neutre, non binaire" + unknown: "Non renseigné" + undefined: "Non renseigné" + civility: + title: "Civilité" + placeholder: "Choisissez la civilité" + address: + create_address: "Ajouter une adresse" + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage" + warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." + center: + placeholder: "Choisissez un centre" + title: "Centre" + + error_only_one_person: "Une seule personne peut être sélectionnée !" diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index c9f1af282..6c271fd80 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -1522,3 +1522,48 @@ my_parcours_filters: parcours_intervening: Intervenant is_open: Parcours ouverts is_closed: Parcours clôturés + +person_messages: + add_persons: + title: "Ajouter des usagers" + suggested_counter: "Pas de résultats | 1 résultat | {count} résultats" + selected_counter: " 1 sélectionné | {count} sélectionnés" + search_some_persons: "Rechercher des personnes.." + item: + type_person: "Usager" + type_user: "TMS" + type_thirdparty: "Tiers professionnel" + type_household: "Ménage" + person: + firstname: "Prénom" + lastname: "Nom" + born: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + center_id: "Identifiant du centre" + center_type: "Type de centre" + center_name: "Territoire" + phonenumber: "Téléphone" + mobilenumber: "Mobile" + altnames: "Autres noms" + email: "Courriel" + gender: + title: "Genre" + placeholder: "Choisissez le genre de l'usager" + woman: "Féminin" + man: "Masculin" + neutral: "Neutre, non binaire" + unknown: "Non renseigné" + undefined: "Non renseigné" + civility: + title: "Civilité" + placeholder: "Choisissez la civilité" + address: + create_address: "Ajouter une adresse" + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage" + warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." + center: + placeholder: "Choisissez un centre" + title: "Centre" + error_only_one_person: "Une seule personne peut être sélectionnée !" diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php index 111be4089..3153713bb 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php @@ -18,12 +18,15 @@ use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query; use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ObjectRepository; +use libphonenumber\PhoneNumber; +use libphonenumber\PhoneNumberFormat; +use libphonenumber\PhoneNumberUtil; class ThirdPartyRepository implements ObjectRepository { private readonly EntityRepository $repository; - public function __construct(EntityManagerInterface $em, private readonly Connection $connection) + public function __construct(EntityManagerInterface $em, private readonly Connection $connection, private readonly PhoneNumberUtil $phonenumberUtil) { $this->repository = $em->getRepository(ThirdParty::class); } @@ -122,6 +125,43 @@ class ThirdPartyRepository implements ObjectRepository return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + /** + * Finds third-party records by phone number. + * + * The search is performed agains every phonenumber field (there are two phonenumber on a thirdParty). + * + * @param string|PhoneNumber $phonenumber The phone number to search for. Can be a string or a PhoneNumber object. + * @param int $firstResult the index of the first result to retrieve (pagination start) + * @param int $maxResults the maximum number of results to retrieve (pagination limit) + * + * @return list the result set containing matching third-party records + */ + public function findByPhonenumber(string|PhoneNumber $phonenumber, int $firstResult = 0, int $maxResults = 20): array + { + if ('' === $phonenumber) { + return []; + } + + $qb = $this->createQueryBuilder('tp'); + $qb->select('tp'); + + $qb->where( + $qb->expr()->orX( + $qb->expr()->eq('tp.telephone', ':phonenumber'), + $qb->expr()->eq('tp.telephone2', ':phonenumber') + ) + ); + + $qb->setParameter( + 'phonenumber', + is_string($phonenumber) ? $phonenumber : $this->phonenumberUtil->format($phonenumber, PhoneNumberFormat::E164) + ); + + $qb->setFirstResult($firstResult)->setMaxResults($maxResults); + + return $qb->getQuery()->getResult(); + } + /** * Search amongst parties associated to $centers, with $terms parameters. * diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/types.ts b/src/Bundle/ChillThirdPartyBundle/Resources/public/types.ts index 20ae3309b..2d2acc42b 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/types.ts +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/types.ts @@ -1,47 +1,49 @@ import { - Address, - Center, - Civility, - DateTime, - User, + Address, + Center, + Civility, + DateTime, + User, } from "ChillMainAssets/types"; export interface Thirdparty { - acronym: string | null; - active: boolean; - address: Address | null; - canonicalized: string | null; - categories: ThirdpartyCategory[]; - centers: Center[]; - children: Thirdparty[]; - civility: Civility | null; - comment: string | null; - contactDataAnonymous: boolean; - createdAt: DateTime; - createdBy: User | null; - email: string | null; - firstname: string | null; - id: number | null; - kind: string; - name: string; - nameCompany: string | null; - parent: Thirdparty | null; - profession: string; - telephone: string | null; - thirdPartyTypes: ThirdpartyType[] | null; - updatedAt: DateTime | null; - updatedBy: User | null; + type: "thirdparty"; + text: string; + acronym: string | null; + active: boolean; + address: Address | null; + canonicalized: string | null; + categories: ThirdpartyCategory[]; + centers: Center[]; + children: Thirdparty[]; + civility: Civility | null; + comment: string | null; + contactDataAnonymous: boolean; + createdAt: DateTime; + createdBy: User | null; + email: string | null; + firstname: string | null; + id: number | null; + kind: string; + name: string; + nameCompany: string | null; + parent: Thirdparty | null; + profession: string; + telephone: string | null; + thirdPartyTypes: ThirdpartyType[] | null; + updatedAt: DateTime | null; + updatedBy: User | null; } interface ThirdpartyType { - key: string; - value: string; + key: string; + value: string; } export interface ThirdpartyCategory { - id: number; - active: boolean; - name: { - fr: string; - }; + id: number; + active: boolean; + name: { + fr: string; + }; } diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue index 0fee3dcdb..3413861ae 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue @@ -1,158 +1,131 @@ diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue index 2214605e2..dfd46efd9 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue @@ -1,28 +1,28 @@ diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 623926807..e3b2338bd 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -1,449 +1,450 @@