Skip to content
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

Refactor attribute creation and editing views and attribute shimmer #9745

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{!! view_render_event('bagisto.admin.catalog.attributes.create.create_form_controls.before') !!}

<!-- actions buttons -->
<div class="flex items-center justify-between">
<div class="flex items-center justify-between gap-4 max-sm:flex-wrap">
<p class="text-xl font-bold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.create.title')
</p>
Expand Down Expand Up @@ -60,12 +60,12 @@ class="primary-button"
id="v-create-attributes-template"
>
<!-- body content -->
<div class="mt-3.5 flex gap-2.5">
<div class="mt-3.5 flex gap-2.5 max-xl:flex-wrap">

{!! view_render_event('bagisto.admin.catalog.attributes.create.card.label.before') !!}

<!-- Left sub Component -->
<div class="flex flex-1 flex-col gap-2 overflow-auto">
<div class="flex flex-1 flex-col gap-2 overflow-auto max-xl:flex-auto">
<!-- Label -->
<div class="box-shadow rounded bg-white p-4 dark:bg-gray-900">
<p class="mb-4 text-base font-semibold text-gray-800 dark:text-white">
Expand Down Expand Up @@ -357,14 +357,14 @@ class="h-[120px] w-[120px] dark:mix-blend-exclusion dark:invert"
<!-- Right sub-component -->
<div class="flex w-[360px] max-w-full flex-col gap-2">
<!-- General -->
<div class="box-shadow rounded bg-white dark:bg-gray-900">
<div class="flex items-center justify-between p-1.5">
<x-admin::accordion>
<x-slot:header>
<p class="p-2.5 text-base font-semibold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.create.general')
</p>
</div>
</x-slot>

<div class="px-4 pb-4">
<x-slot:content>
<!-- Attribute Code -->
<x-admin::form.control-group>
<x-admin::form.control-group.label class="required">
Expand Down Expand Up @@ -449,9 +449,9 @@ class="cursor-pointer"
:label="trans('admin::app.catalog.attributes.create.default-value')"
/>
</x-admin::form.control-group>
</div>
</div>

</x-slot>
</x-admin::accordion>
<!-- Validations -->
<x-admin::accordion>
<x-slot:header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
enctype="multipart/form-data"
method="PUT"
>
<div class="flex items-center justify-between">
<div class="flex items-center justify-between gap-4 max-sm:flex-wrap">
<p class="text-xl font-bold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.edit.title')
</p>
Expand Down Expand Up @@ -54,9 +54,9 @@ class="primary-button"
id="v-edit-attributes-template"
>
<!-- body content -->
<div class="mt-3.5 flex gap-2.5">
<div class="mt-3.5 flex gap-2.5 max-xl:flex-wrap">
<!-- Left sub Component -->
<div class="flex flex-1 flex-col gap-2 overflow-auto">
<div class="flex flex-1 flex-col gap-2 overflow-auto max-xl:flex-auto">

{!! view_render_event('bagisto.admin.catalog.attributes.edit.card.label.before', ['attribute' => $attribute]) !!}

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

<!-- Options -->
<div
class="p-4 bg-white dark:bg-gray-900 box-shadow rounded {{ in_array($attribute->type, ['select', 'multiselect', 'checkbox', 'price']) ?: 'hidden' }}"
class="box-shadow rounded bg-white p-4 dark:bg-gray-900 {{ in_array($attribute->type, ['select', 'multiselect', 'checkbox', 'price']) ?: 'hidden' }}"
v-if="showSwatch"
>
<div class="mb-3 flex items-center justify-between">
Expand Down Expand Up @@ -374,14 +374,14 @@ class="secondary-button text-sm"
{!! view_render_event('bagisto.admin.catalog.attributes.edit.card.accordian.general.before', ['attribute' => $attribute]) !!}

<!-- General -->
<div class="box-shadow rounded bg-white dark:bg-gray-900">
<div class="flex items-center justify-between p-1.5">
<x-admin::accordion>
<x-slot:header>
<p class="p-2.5 text-base font-semibold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.edit.general')
</p>
</div>
</x-slot>

<div class="px-4 pb-4">
<x-slot:content>
<!-- Attribute Code -->
<x-admin::form.control-group>
<x-admin::form.control-group.label class="required">
Expand Down Expand Up @@ -493,9 +493,9 @@ class="cursor-not-allowed"

<x-admin::form.control-group.error control-name="default_value" />
</x-admin::form.control-group>
</div>
</div>

</x-slot>
</x-admin::accordion>
{!! view_render_event('bagisto.admin.catalog.attributes.edit.card.accordian.general.after', ['attribute' => $attribute]) !!}

{!! view_render_event('bagisto.admin.catalog.attributes.edit.card.accordian.validations.before', ['attribute' => $attribute]) !!}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{!! view_render_event('bagisto.admin.catalog.families.create.create_form_controls.before') !!}

<!-- Page Header -->
<div class="flex items-center justify-between">
<div class="flex items-center justify-between gap-4 max-sm:flex-wrap">
<p class="text-xl font-bold text-gray-800 dark:text-white">
@lang('admin::app.catalog.families.create.title')
</p>
Expand All @@ -32,11 +32,11 @@ class="primary-button"
</div>

<!-- Container -->
<div class="mt-3.5 flex gap-2.5">
<div class="mt-3.5 flex gap-2.5 max-xl:flex-wrap">
<!-- Left Container -->
<div class="box-shadow flex flex-1 flex-col gap-2 rounded bg-white dark:bg-gray-900">
<div class="box-shadow flex flex-1 flex-col gap-2 rounded bg-white dark:bg-gray-900 max-xl:flex-auto">
<v-family-attributes>
<x-admin::shimmer.families.attributes-panel />
<x-admin::shimmer.catalog.families.attributes-panel />
</v-family-attributes>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{!! view_render_event('bagisto.admin.catalog.families.edit.edit_form_control.before', ['attributeFamily' => $attributeFamily]) !!}

<!-- Page Header -->
<div class="flex items-center justify-between">
<div class="flex items-center justify-between gap-4 max-sm:flex-wrap">
<p class="text-xl font-bold text-gray-800 dark:text-white">
@lang('admin::app.catalog.families.edit.title')
</p>
Expand All @@ -35,14 +35,14 @@ class="primary-button"
</div>

<!-- Container -->
<div class="mt-3.5 flex gap-2.5">
<div class="mt-3.5 flex gap-2.5 max-xl:flex-wrap">
<!-- Left Container -->

{!! view_render_event('bagisto.admin.catalog.families.edit.card.attributes-panel.before', ['attributeFamily' => $attributeFamily]) !!}

<div class="box-shadow flex flex-1 flex-col gap-2 rounded bg-white dark:bg-gray-900">
<div class="box-shadow flex flex-1 flex-col gap-2 rounded bg-white dark:bg-gray-900 max-xl:flex-auto">
<v-family-attributes>
<x-admin::shimmer.families.attributes-panel />
<x-admin::shimmer.catalog.families.attributes-panel />
</v-family-attributes>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span class="absolute my-1.5 block w-full border border-gray-200 ltr:left-0 rtl:right-0"></span>

<v-product-customer-group-price>
<x-admin::shimmer.products.edit.group-price />
<x-admin::shimmer.catalog.products.edit.group-price />
</v-product-customer-group-price>

@inject('customerGroupRepository', 'Webkul\Customer\Repositories\CustomerGroupRepository')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,111 +1,65 @@
<!-- Pannel Content -->
<div class="mt-3.5 flex gap-2.5">
<div class="mt-3.5 flex gap-2.5 max-xl:flex-wrap">
<!-- Left Component -->
<div class="flex flex-1 flex-col gap-2 overflow-auto">
<div class="box-shadow rounded p-4">
<div class="shimmer mb-4 h-4 w-11"></div>
<div class="flex flex-1 flex-col gap-2 overflow-auto max-xl:flex-auto">
<div class="box-shadow rounded bg-white p-4 dark:bg-gray-900">
<div class="shimmer mb-4 h-4 w-16"></div>

<div>
@for ($i = 1; $i < 10; $i++)
<div class="mb-6 h-14 w-full">
<div class="shimmer mb-2 h-4 w-24"></div>

<div class="flex min-h-10 w-full rounded-md border px-3 py-2 dark:border-gray-800"></div>
<div class="shimmer flex h-10 w-full rounded-md py-px"></div>
</div>

<div class="mb-6 h-14 w-full">
<div class="shimmer mb-2 h-4 w-24"></div>

<div class="flex min-h-10 w-full rounded-md border px-3 py-2 dark:border-gray-800"></div>
</div>

<div class="mb-2 h-14 w-full">
<div class="shimmer mb-2 h-4 w-24"></div>

<div class="flex min-h-10 w-full rounded-md border px-3 py-2 dark:border-gray-800"></div>
</div>
</div>
@endfor
</div>
</div>

<!-- Right Component -->
<div class="flex w-[360px] max-w-full flex-col gap-2">
<!-- General -->
<div class="box-shadow rounded">
<div class="flex items-center justify-between p-1.5">
<p class="p-2.5 text-base font-semibold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.create.general')
</p>
<div class="box-shadow rounded bg-white dark:bg-gray-900">
<div class="flex items-center justify-between gap-x-5 p-4">
<p class="shimmer w-20 p-2.5"></p>

<p class="shimmer w-5 p-2.5"></p>
</div>

<div class="px-4 pb-4">
<div class="mb-6 h-14 w-full">
<div class="shimmer mb-2 h-4 w-24"></div>

<div class="flex min-h-10 w-full rounded-md border px-3 py-2 dark:border-gray-800"></div>
</div>

<div class="mb-6 h-14 w-full">
<div class="shimmer mb-2 h-4 w-24"></div>
@for ($i = 1; $i < 4; $i++)
<div class="mb-4 last:mb-0">
<div class="shimmer mb-1.5 h-4 w-24"></div>

<div class="flex min-h-10 w-full rounded-md border px-3 py-2 dark:border-gray-800"></div>
</div>

<div class="mb-2 h-14 w-full">
<div class="shimmer mb-2 h-4 w-24"></div>

<div class="flex min-h-10 w-full rounded-md border px-3 py-2 dark:border-gray-800"></div>
</div>
<div class="shimmer flex h-10 w-full rounded-md py-px"></div>
</div>
@endfor
</div>
</div>

<!-- Validation Section -->
<div class="box-shadow rounded">
<div class="flex items-center justify-between p-1.5">
<p class="p-2.5 text-base font-semibold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.create.validations')
</p>

<div class="shimmer mx-2.5 h-6 w-6 rounded"></div>
<div class="box-shadow rounded bg-white dark:bg-gray-900">
<div class="flex items-center justify-between gap-x-5 p-4">
<p class="shimmer w-24 p-2.5"></p>

<p class="shimmer w-5 p-2.5"></p>
</div>

<div class="px-4 pb-4">
<div class="mb-2 flex items-center gap-5">
<div class="mb-2 flex items-center gap-2.5">
<div class="shimmer h-6 w-6"></div>

<div class="shimmer h-6 w-16"></div>
<div class="shimmer h-4 w-20"></div>
</div>

<div class="flex items-center gap-5">
<div class="flex items-center gap-2.5">
<div class="shimmer h-6 w-6"></div>

<div class="shimmer h-6 w-16"></div>
<div class="shimmer h-4 w-20"></div>
</div>
</div>
</div>

<!-- Configuration Section -->
<div class="box-shadow rounded">
<div class="flex items-center justify-between p-1.5">
<p class="p-2.5 text-base font-semibold text-gray-800 dark:text-white">
@lang('admin::app.catalog.attributes.edit.configuration')
</p>

<div class="shimmer mx-2.5 h-6 w-6 rounded"></div>
</div>

<div class="px-4 pb-4">
<div class="mb-3 flex gap-5">
<div class="shimmer h-5 w-6"></div>

<div class="shimmer h-5 w-20"></div>
</div>

<div class="flex gap-5">
<div class="shimmer h-5 w-6"></div>

<div class="shimmer h-5 w-20"></div>
</div>
</div>
</div>
<x-admin::shimmer.accordion />
</div>
</div>
1 change: 0 additions & 1 deletion public/themes/admin/default/build/assets/app-1a29d6e4.css

This file was deleted.

1 change: 1 addition & 0 deletions public/themes/admin/default/build/assets/app-a475c0fa.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/themes/admin/default/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"src/Resources/assets/css/app.css": {
"file": "assets/app-1a29d6e4.css",
"file": "assets/app-a475c0fa.css",
"isEntry": true,
"src": "src/Resources/assets/css/app.css"
},
Expand Down