Skip to content

Commit

Permalink
Merge pull request bagisto#10210 from bagisto/2.2
Browse files Browse the repository at this point in the history
feat: 2.2 updates
  • Loading branch information
devansh-webkul authored Oct 22, 2024
2 parents 3ae62e9 + d25462d commit cfe6e68
Show file tree
Hide file tree
Showing 18 changed files with 455 additions and 429 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class="flex gap-2.5 px-5 py-2 text-base cursor-pointer hover:bg-gray-100 dark:ho
:class="[errors['{{ $currentLocale->code }}[name]'] ? 'border border-red-600 hover:border-red-600' : '']"
class="flex min-h-[39px] w-full rounded-md border px-3 py-2 text-sm text-gray-600 transition-all hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300 dark:hover:border-gray-400 dark:focus:border-gray-400"
placeholder="{{ trans('admin::app.catalog.categories.edit.name') }}"
v-slugify-target:{{$currentLocale->code . '[slug]'}}="setValues"
v-slugify-target:{{$currentLocale->code.'[slug]'}}="setValues"
/>
</v-field>

Expand Down Expand Up @@ -273,7 +273,7 @@ class="description"
class="flex min-h-[39px] w-full rounded-md border px-3 py-2 text-sm text-gray-600 transition-all hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300 dark:hover:border-gray-400 dark:focus:border-gray-400"
v-bind="field"
placeholder="{{ trans('admin::app.catalog.categories.edit.slug') }}"
v-slugify-target:slug
v-slugify-target:{{$currentLocale->code.'[slug]'}}
/>
</v-field>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,19 @@ class="primary-button"
computed: {
unassignedAttributes() {
this.columnGroups[1] = this.columnGroups[1] || [];
this.columnGroups[2] = this.columnGroups[2] || [];
return this.customAttributes.filter(attribute => {
return ! this.columnGroups[1].find(group => group.custom_attributes.find(customAttribute => customAttribute.id == attribute.id))
&& ! this.columnGroups[2].find(group => group.custom_attributes.find(customAttribute => customAttribute.id == attribute.id));
const isInGroup1 = this.columnGroups[1].some(group =>
group.custom_attributes.some(customAttribute => customAttribute.id === attribute.id)
);
const isInGroup2 = this.columnGroups[2].some(group =>
group.custom_attributes.some(customAttribute => customAttribute.id === attribute.id)
);
return !isInGroup1 && !isInGroup2;
});
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,16 @@ class="text-gray-600 dark:text-gray-300"
},
mounted() {
let self = this;
this.metaTitle = document.getElementById('meta_title').value;
self.metaTitle = document.getElementById('meta_title').value;
this.metaDescription = document.getElementById('meta_description').value;
self.metaDescription = document.getElementById('meta_description').value;
document.getElementById('meta_title').addEventListener('input', function(e) {
self.metaTitle = e.target.value;
document.getElementById('meta_title').addEventListener('input', (e) => {
this.metaTitle = e.target.value;
});
document.getElementById('meta_description').addEventListener('input', function(e) {
self.metaDescription = e.target.value;
document.getElementById('meta_description').addEventListener('input', (e) => {
this.metaDescription = e.target.value;
});
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,10 @@ class="icon-delete max-h-9 max-w-9 cursor-pointer rounded-md p-1.5 text-2xl tran
) {
this.condition.operator = '{}';
if (! this.condition.value) {
if (
! this.condition.value
|| ! Array.isArray(this.condition.value)
) {
this.condition.value = [];
}
}
Expand Down Expand Up @@ -1239,21 +1242,15 @@ class="ltr:pr-10 rtl:pl-10"
:label="trans('admin::app.marketing.promotions.cart-rules.edit.code-format')"
:placeholder="trans('admin::app.marketing.promotions.cart-rules.edit.code-format')"
>
<option
value="alphanumeric"
>
<option value="alphanumeric">
@lang('admin::app.marketing.promotions.cart-rules.edit.alphanumeric')
</option>
<option
value="alphabetical"
>
<option value="alphabetical">
@lang('admin::app.marketing.promotions.cart-rules.edit.alphabetical')
</option>
<option
value="numeric"
>
<option value="numeric">
@lang('admin::app.marketing.promotions.cart-rules.edit.numeric')
</option>
</x-admin::form.control-group.control>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,37 +153,37 @@ class="inline-flex w-full max-w-max cursor-pointer appearance-none items-center
orderType: {
all : {
icon: 'icon',
message: "@lang('admin::app.notifications.order-status-messages.all'),
message: '@lang('admin::app.notifications.order-status-messages.all')',
status: 'all'
},
pending : {
icon: 'icon-information bg-amber-100 text-amber-600 dark:!text-amber-600',
message: "@lang('admin::app.notifications.order-status-messages.pending')",
message: '@lang('admin::app.notifications.order-status-messages.pending')',
status: 'pending'
},
processing : {
icon: 'icon-sort-right bg-green-100 text-green-600 dark:!text-green-600',
message: "@lang('admin::app.notifications.order-status-messages.processing')",
message: '@lang('admin::app.notifications.order-status-messages.processing')',
status: 'processing'
},
canceled : {
icon: 'icon-cancel-1 bg-red-100 text-red-600 dark:!text-red-600',
message: "@lang('admin::app.notifications.order-status-messages.canceled')",
message: '@lang('admin::app.notifications.order-status-messages.canceled')',
status: 'canceled'
},
completed : {
icon: 'icon-done bg-blue-100 text-blue-600 dark:!text-blue-600',
message: "@lang('admin::app.notifications.order-status-messages.completed')",
message: '@lang('admin::app.notifications.order-status-messages.completed')',
status: 'completed'
},
closed : {
icon: 'icon-repeat bg-red-100 text-red-600 dark:!text-red-600',
message: "@lang('admin::app.notifications.order-status-messages.closed')",
message: '@lang('admin::app.notifications.order-status-messages.closed')',
status: 'closed'
},
},
Expand Down
4 changes: 4 additions & 0 deletions packages/Webkul/Checkout/src/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,10 @@ public function getOrderAmount(): int

if (core()->getConfigData('sales.order_settings.minimum_order.include_discount_amount')) {
$minimumOrderAmount -= $this->cart->tax_total;

if ($this->cart->discount_amount) {
$minimumOrderAmount -= $this->cart->discount_amount;
}
}

return $minimumOrderAmount;
Expand Down
9 changes: 7 additions & 2 deletions packages/Webkul/Installer/src/Console/Commands/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,12 @@ protected function createAdminCredentials()
$adminPassword = text(
label : 'Configure the password for the admin user',
default : 'admin123',
required : true
required : true,
validate : function (string $value) {
if (strlen($value) < 6) {
return 'The password must be at least 6 characters.';
}
}
);

$sampleProduct = select(
Expand Down Expand Up @@ -424,7 +429,7 @@ protected function createAdminCredentials()
$this->info('-----------------------------');
$this->info('Congratulations!');
$this->info('The installation has been finished and you can now use Bagisto.');
$this->info('Go to ' . env('APP_URL') . '/' . env('APP_ADMIN_URL', 'admin') . ' and authenticate with:');
$this->info('Go to '.env('APP_URL').'/'.env('APP_ADMIN_URL', 'admin').' and authenticate with:');
$this->info('Email: '.$adminEmail);
$this->info('Password: '.$adminPassword);
$this->info('Cheers!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ class="w-full max-w-[568px] rounded-lg border border-gray-300 bg-white shadow-[0
<x-installer::form.control-group.control
type="password"
name="password"
rules="required"
rules="required|min:6"
:value="old('password')"
:label="trans('installer::app.installer.index.create-administrator.password')"
/>
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Shop/src/Http/Controllers/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function view($urlKey)
if ($urlRewrite) {
return redirect()->to($urlRewrite->target_path, $urlRewrite->redirect_type);
}

abort_if(! $page && ! $urlRewrite, 404);
}

return view('shop::cms.page')->with('page', $page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
public function index()
{
$this->validate(request(), [
'query' => ['required', 'string', 'regex:/^[^\\\\]+$/u'],
'query' => ['sometimes', 'required', 'string', 'regex:/^[^\\\\]+$/u'],
]);

$searchTerm = $this->searchTermRepository->findOneWhere([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,23 @@ class="grid gap-2"
<div class="md:hidden">
<p class="text-lg font-semibold max-md:text-sm">
@{{ item.formatted_total }}
<template v-if="displayTax.prices == 'including_tax'">
@{{ item.formatted_total_incl_tax }}
</template>
<template v-else-if="displayTax.prices == 'both'">
@{{ item.formatted_total_incl_tax }}
<span class="text-xs font-normal">
@lang('shopTheme::app.checkout.cart.index.excl-tax')
<span class="font-medium">@{{ item.formatted_total }}</span>
</span>
</template>
<template v-else>
@{{ item.formatted_total }}
</template>
</p>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ class="mx-1 h-3 w-3 cursor-pointer rounded-full max-md:h-2 max-md:w-2 max-sm:h-1
},
setSliderPosition() {
this.slider.style.transform = `translateX(${this.currentTranslate}px)`
if (this.slider) {
this.slider.style.transform = `translateX(${this.currentTranslate}px)`;
}
},
visitLink(image) {
Expand Down
Loading

0 comments on commit cfe6e68

Please sign in to comment.