Skip to content

Commit

Permalink
Fixed Issue #1784
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-webkul committed Dec 27, 2024
1 parent 1f90616 commit 1597371
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@if (isset($attribute))
<v-address-component
:attribute='@json($attribute)'
:validations="'{{ $validations }}'"
:data='@json(old($attribute->code) ?: $value)'
>
<!-- Addresses Shimmer -->
Expand All @@ -23,7 +24,7 @@
rows="10"
::value="data ? data['address'] : ''"
:label="trans('admin::app.common.custom-attributes.address')"
::rules="attribute.is_required ? 'required' : ''"
::rules="attribute.is_required ? 'required' : validations"
/>
<x-admin::form.control-group.error ::name="attribute['code'] + '[address]'" />
Expand All @@ -38,7 +39,7 @@
<x-admin::form.control-group.control
type="select"
::name="attribute['code'] + '[country]'"
::rules="attribute.is_required ? 'required' : ''"
::rules="attribute.is_required ? 'required|' + validations : validations"
:label="trans('admin::app.common.custom-attributes.country')"
v-model="country"
>
Expand All @@ -62,7 +63,7 @@
::name="attribute['code'] + '[state]'"
v-model="state"
:label="trans('admin::app.common.custom-attributes.state')"
::rules="attribute.is_required ? 'required' : ''"
::rules="attribute.is_required ? 'required|' + validations : validations"
>
<option value="">@lang('admin::app.common.custom-attributes.select-state')</option>
Expand All @@ -87,7 +88,7 @@
::name="attribute['code'] + '[state]'"
:placeholder="trans('admin::app.common.custom-attributes.state')"
:label="trans('admin::app.common.custom-attributes.state')"
::rules="attribute.is_required ? 'required' : ''"
::rules="attribute.is_required ? 'required|' + validations : validations"
v-model="state"
>
</x-admin::form.control-group.control>
Expand All @@ -106,7 +107,7 @@
::value="data && data['city'] ? data['city'] : ''"
:placeholder="trans('admin::app.common.custom-attributes.city')"
:label="trans('admin::app.common.custom-attributes.city')"
::rules="attribute.is_required ? 'required' : ''"
::rules="attribute.is_required ? 'required|' + validations : validations"
/>
<x-admin::form.control-group.error ::name="attribute['code'] + '[city]'"/>
Expand All @@ -122,7 +123,7 @@
::value="data && data['postcode'] ? data['postcode'] : ''"
:placeholder="trans('admin::app.common.custom-attributes.postcode')"
:label="trans('admin::app.common.custom-attributes.postcode')"
::rules="attribute.is_required ? 'required' : ''"
::rules="attribute.is_required ? 'required|min:5|max:10' : 'min:5|max:10'"
/>
<x-admin::form.control-group.error ::name="attribute['code'] + '[postcode]'" />
Expand All @@ -137,7 +138,7 @@
app.component('v-address-component', {
template: '#v-address-component-template',
props: ['attribute', 'data'],
props: ['attribute', 'data', 'validations'],
data() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ class="primary-button"
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'organizations',
])"
:custom-validations="[
'name' => [
'max:100',
],
'address' => [
'max:100',
],
'postcode' => [
'max:20',
],
]"
/>

{!! view_render_event('admin.contacts.organizations.edit.form_controls.after') !!}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="[&>div:last-child]:border-b-0 sticky top-[73px] flex min-w-[394px] max-w-[394px] flex-col self-start rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900">
<!-- Person Information -->
<div class="flex w-full flex-col gap-2 border-b border-gray-200 p-4 dark:border-gray-800">
<!-- Breadcrums -->
<!-- Breadcrumbs -->
<div class="flex items-center justify-between">
<x-admin::breadcrumbs
name="contacts.persons.view"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div class="flex flex-col gap-2">
<div class="flex cursor-pointer items-center">
<!-- Bredcrumbs -->
<!-- Breadcrumb's -->
<x-admin::breadcrumbs name="leads" />
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{!! view_render_event('admin.leads.index.kanban.before') !!}

<!-- Kanabn Vue Component -->
<!-- Kanban Vue Component -->
<v-leads-kanban>
<div class="flex flex-col gap-4">
<!-- Shimmer -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="[&>div:last-child]:border-b-0 sticky top-[73px] flex min-w-[394px] max-w-[394px] flex-col self-start rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900">
<!-- Lead Information -->
<div class="flex w-full flex-col gap-2 border-b border-gray-200 p-4 dark:border-gray-800">
<!-- Breadcrums -->
<!-- Breadcrumb's -->
<div class="flex items-center justify-between">
<x-admin::breadcrumbs
name="leads.view"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="[&>div:last-child]:border-b-0 sticky top-[73px] flex min-w-[394px] max-w-[394px] flex-col self-start rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900">
<!-- Product Information -->
<div class="flex w-full flex-col gap-2 border-b border-gray-200 p-4 dark:border-gray-800">
<!-- Breadcrums -->
<!-- Breadcrumbs -->
<div class="flex items-center justify-between">
<x-admin::breadcrumbs name="products.view" :entity="$product" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="[&>div:last-child]:border-b-0 sticky top-[73px] flex min-w-[394px] max-w-[394px] flex-col self-start rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900">
<!-- Product Information -->
<div class="flex w-full flex-col gap-2 border-b border-gray-200 p-4 dark:border-gray-800">
<!-- Breadcrums -->
<!-- Breadcrumbs -->
<div class="flex items-center justify-between">
<x-admin::breadcrumbs
name="settings.warehouses.view"
Expand Down

0 comments on commit 1597371

Please sign in to comment.