From e53b7acbf84216cc3fae2f19831bd920a694a521 Mon Sep 17 00:00:00 2001 From: Mazarin Date: Sun, 11 Dec 2022 21:42:27 -0500 Subject: [PATCH] fix: fix contact information without a protocol (monicahq/chandler#347) --- .../ViewHelpers/ModuleContactInformationViewHelper.php | 4 +++- resources/js/Shared/Modules/ContactInformation.vue | 9 ++++++--- .../ModuleContactInformationViewHelperTest.php | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Domains/Contact/ManageContactInformation/Web/ViewHelpers/ModuleContactInformationViewHelper.php b/app/Domains/Contact/ManageContactInformation/Web/ViewHelpers/ModuleContactInformationViewHelper.php index 4dcda758135..975bedfed78 100644 --- a/app/Domains/Contact/ManageContactInformation/Web/ViewHelpers/ModuleContactInformationViewHelper.php +++ b/app/Domains/Contact/ManageContactInformation/Web/ViewHelpers/ModuleContactInformationViewHelper.php @@ -41,7 +41,9 @@ public static function dto(Contact $contact, ContactInformation $info): array return [ 'id' => $info->id, 'label' => $info->name, - 'data' => $info->contactInformationType->protocol ? $info->contactInformationType->protocol.$info->data : $info->data, + 'protocol' => $info->contactInformationType->protocol, + 'data' => $info->data, + 'data_with_protocol' => $info->contactInformationType->protocol ? $info->contactInformationType->protocol.$info->data : $info->data, 'contact_information_type' => [ 'id' => $info->contactInformationType->id, 'name' => $info->contactInformationType->name, diff --git a/resources/js/Shared/Modules/ContactInformation.vue b/resources/js/Shared/Modules/ContactInformation.vue index 117137129fb..9c178aceb8e 100644 --- a/resources/js/Shared/Modules/ContactInformation.vue +++ b/resources/js/Shared/Modules/ContactInformation.vue @@ -48,7 +48,7 @@ :type="'text'" :autofocus="true" :input-class="'block w-full'" - :required="false" + :required="true" :autocomplete="false" :maxlength="255" @esc-key-pressed="addContactInformationModalShown = false" /> @@ -81,7 +81,10 @@ class="item-list border-b border-gray-200 hover:bg-slate-50 dark:border-gray-700 dark:bg-slate-900 hover:dark:bg-slate-800">
- {{ info.label }} +
+ {{ info.data }} + ({{ info.label }}) +