diff --git a/Gemfile.lock b/Gemfile.lock index 4ea52d1e1..298d8e041 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -452,7 +452,7 @@ GEM activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -471,7 +471,7 @@ GEM mime-types-data (3.2023.0218.1) mini_magick (4.12.0) mini_mime (1.1.5) - mini_portile2 (2.8.7) + mini_portile2 (2.8.8) minitest (5.25.1) mock_redis (0.36.0) ruby2_keywords @@ -502,14 +502,14 @@ GEM newrelic_rpm (9.6.0) base64 nio4r (2.7.3) - nokogiri (1.16.7) + nokogiri (1.16.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.7-arm64-darwin) + nokogiri (1.16.8-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.7-x86_64-darwin) + nokogiri (1.16.8-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.7-x86_64-linux) + nokogiri (1.16.8-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -599,9 +599,9 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.1) loofah (~> 2.21) - nokogiri (~> 1.14) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) railties (7.0.8.5) actionpack (= 7.0.8.5) activesupport (= 7.0.8.5) diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue b/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue index 1813f1057..90329b311 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue @@ -214,6 +214,10 @@ const resetValidation = () => { v$.value.$reset(); }; +const resetForm = () => { + Object.assign(state, defaultState); +}; + watch(() => props.contactData, prepareStateBasedOnProps, { immediate: true, deep: true, @@ -224,6 +228,7 @@ defineExpose({ state, resetValidation, isFormInvalid, + resetForm, }); @@ -261,7 +266,7 @@ defineExpose({ :placeholder="item.placeholder" :message-type="getMessageType(item.key)" :custom-input-class="`h-8 !pt-1 !pb-1 ${ - !isDetailsView ? '[&:not(.error)]:!border-transparent' : '' + !isDetailsView ? '[&:not(.error,.focus)]:!border-transparent' : '' }`" class="w-full" @input=" diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue b/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue index 1a9f183e8..806fcf4ac 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsForm/CreateNewContactDialog.vue @@ -27,11 +27,16 @@ const handleDialogConfirm = async () => { emit('create', contact.value); }; +const onSuccess = () => { + contactsFormRef.value?.resetForm(); + dialogRef.value.close(); +}; + const closeDialog = () => { dialogRef.value.close(); }; -defineExpose({ dialogRef, contactsFormRef }); +defineExpose({ dialogRef, contactsFormRef, onSuccess });