Skip to content

issue #2170 fixed. #2266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
:validations="'{{ $validations }}'"
:value="{{ json_encode($lookUpEntityData)}}"
can-add-new="{{ $canAddNew ?? false }}"
@lookup-added="handleLookupAdded"
@lookup-removed="handleLookupRemoved"
>
<div class="relative inline-block w-full">
<!-- Input Container -->
Expand Down Expand Up @@ -152,6 +154,8 @@ class="cursor-pointer border-t border-gray-800 px-4 py-2 text-gray-500 hover:bg-

props: ['validations', 'isDisabled', 'attribute', 'value', 'canAddNew'],

emits: ['lookup-added', 'lookup-removed'],

data() {
return {
showPopup: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</x-slot>

{!! view_render_event('admin.persons.create.form.before') !!}

<!--Create Page Form -->
<x-admin::form
:action="route('admin.contacts.persons.store')"
Expand Down Expand Up @@ -43,13 +43,14 @@ class="primary-button"
</div>
</div>
</div>

<!-- Form fields -->
<div class="box-shadow rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900">
{!! view_render_event('admin.persons.create.form_controls.before') !!}

<x-admin::attributes
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
['code', 'NOTIN', ['organization_id']],
'entity_type' => 'persons',
])"
:custom-validations="[
Expand All @@ -62,11 +63,55 @@ class="primary-button"
],
]"
/>


<v-organization></v-organization>

{!! view_render_event('admin.persons.create.form_controls.after') !!}
</div>
</div>
</x-admin::form>

{!! view_render_event('admin.persons.create.form.after') !!}

@pushOnce('scripts')
<script
type="text/x-template"
id="v-organization-template"
>
<div>
<x-admin::attributes
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
['code', 'IN', ['organization_id']],
'entity_type' => 'persons',
])"
/>

<template v-if="organizationName">
<x-admin::form.control-group.control
type="hidden"
name="organization_name"
v-model="organizationName"
/>
</template>
</div>
</script>

<script type="module">
app.component('v-organization', {
template: '#v-organization-template',

data() {
return {
organizationName: null,
};
},

methods: {
handleLookupAdded(event) {
this.organizationName = event?.name || null;
},
},
});
</script>
@endPushOnce
</x-admin::layouts>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<div class="flex flex-col gap-2">
{!! view_render_event('admin.persons.edit.breadcrumbs.before') !!}

<x-admin::breadcrumbs
name="contacts.persons.edit"
<x-admin::breadcrumbs
name="contacts.persons.edit"
:entity="$person"
/>

Expand Down Expand Up @@ -51,6 +51,7 @@ class="primary-button"

<x-admin::attributes
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
['code', 'NOTIN', ['organization_id']],
'entity_type' => 'persons',
])"
:custom-validations="[
Expand All @@ -64,11 +65,56 @@ class="primary-button"
]"
:entity="$person"
/>


<v-organization></v-organization>

{!! view_render_event('admin.contacts.persons.edit.form_controls.after') !!}
</div>
</div>
</x-admin::form>

{!! view_render_event('admin.persons.edit.form.after') !!}

@pushOnce('scripts')
<script
type="text/x-template"
id="v-organization-template"
>
<div>
<x-admin::attributes
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
['code', 'IN', ['organization_id']],
'entity_type' => 'persons',
])"
:entity="$person"
/>

<template v-if="organizationName">
<x-admin::form.control-group.control
type="hidden"
name="organization_name"
v-model="organizationName"
/>
</template>
</div>
</script>

<script type="module">
app.component('v-organization', {
template: '#v-organization-template',

data() {
return {
organizationName: null,
};
},

methods: {
handleLookupAdded(event) {
this.organizationName = event?.name || null;
},
},
});
</script>
@endPushOnce
</x-admin::layouts>
Loading