diff --git a/app/View/Components/SelectContactCard.php b/app/View/Components/SelectContactCard.php index 516740e61..c0176fef4 100644 --- a/app/View/Components/SelectContactCard.php +++ b/app/View/Components/SelectContactCard.php @@ -35,13 +35,16 @@ class SelectContactCard extends Component /** @var string */ public $textChooseDifferentContact; + /** @var $error */ + public $error; + /** * Create a new component instance. * * @return void */ public function __construct( - $type, $contact = false, $contacts = [], $search_route = '', $create_route = '', + $type, $contact = false, $contacts = [], $search_route = '', $create_route = '', string $error = '', $textAddContact = '', $textCreateNewContact = '', $textEditContact = '', $textContactInfo = '', $textChooseDifferentContact = '' ) { @@ -50,6 +53,7 @@ class SelectContactCard extends Component $this->contacts = $contacts; $this->search_route = $search_route; $this->create_route = $create_route; + $this->error = ($error) ?: "form.errors.get('contact_id')" ; $this->textAddContact = $this->getTextAddContact($type, $textAddContact); $this->textCreateNewContact = $this->getTextCreateNewContact($type, $textCreateNewContact); diff --git a/resources/assets/js/components/AkauntingContactCard.vue b/resources/assets/js/components/AkauntingContactCard.vue index d2a53517a..535c7fe1c 100644 --- a/resources/assets/js/components/AkauntingContactCard.vue +++ b/resources/assets/js/components/AkauntingContactCard.vue @@ -5,7 +5,7 @@
-
+
+ +
+
@@ -163,6 +167,10 @@ export default { default: '', description: 'Contact create route' }, + error: { + type: String, + description: "Input error (below input)" + }, selected: { type: Object, default: function() { @@ -324,6 +332,7 @@ export default { this.show.contact_list = false; this.show.contact_selected = true; + this.error = ''; this.$emit('change', this.contact); }, @@ -618,3 +627,10 @@ export default { }, }; + + diff --git a/resources/views/components/documents/form/metadata.blade.php b/resources/views/components/documents/form/metadata.blade.php index 726f89b6f..be7e1a753 100644 --- a/resources/views/components/documents/form/metadata.blade.php +++ b/resources/views/components/documents/form/metadata.blade.php @@ -8,6 +8,7 @@ :contacts="$contacts" :search_route="$contactSearchRoute" :create_route="$contactCreateRoute" + error="form.errors.get('contact_name')" :text-add-contact="$textAddContact" :text-create-new-contact="$textCreateNewContact" :text-edit-contact="$textEditContact" diff --git a/resources/views/components/select-contact-card.blade.php b/resources/views/components/select-contact-card.blade.php index 68f86d794..65c860293 100644 --- a/resources/views/components/select-contact-card.blade.php +++ b/resources/views/components/select-contact-card.blade.php @@ -27,6 +27,7 @@ ] ] ])}}" + :error="{{ $error }}" @change="onChangeContactCard" >