From e210f50af4e863dd03f198fbeb665a6c665520b4 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 26 Jun 2024 08:57:04 +0200 Subject: [PATCH 1/3] Add carrier shipping options with zone association --- packages/admin/config/components/setting.php | 2 + packages/admin/public/shopper.css | 44 ++++++ .../lang/en/pages/settings/zones.php | 11 ++ packages/admin/resources/lang/en/words.php | 3 +- .../lang/fr/pages/settings/zones.php | 12 ++ packages/admin/resources/lang/fr/words.php | 3 +- .../settings/zones/detail.blade.php | 12 +- .../settings/zones/shipping-options.blade.php | 68 ++++++++++ .../livewire/pages/settings/zones.blade.php | 2 +- .../Components/Settings/Zones/Detail.php | 7 +- .../Settings/Zones/ZoneShippingOptions.php | 64 +++++++++ .../src/Livewire/Pages/Settings/Zones.php | 8 +- .../SlideOvers/ShippingOptionForm.php | 128 ++++++++++++++++++ .../src/Livewire/SlideOvers/ZoneForm.php | 6 +- .../factories/CarrierOptionFactory.php | 18 +++ ...10_071333_create_carrier_options_table.php | 37 +++++ packages/core/src/Helpers/Price.php | 6 +- packages/core/src/Models/Carrier.php | 8 ++ packages/core/src/Models/CarrierOption.php | 75 ++++++++++ packages/core/src/Models/Zone.php | 9 ++ 20 files changed, 504 insertions(+), 19 deletions(-) create mode 100644 packages/admin/resources/views/livewire/components/settings/zones/shipping-options.blade.php create mode 100644 packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php create mode 100644 packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php create mode 100644 packages/core/database/factories/CarrierOptionFactory.php create mode 100644 packages/core/database/migrations/2024_06_10_071333_create_carrier_options_table.php create mode 100644 packages/core/src/Models/CarrierOption.php diff --git a/packages/admin/config/components/setting.php b/packages/admin/config/components/setting.php index 1afb00b3d..3082fde67 100644 --- a/packages/admin/config/components/setting.php +++ b/packages/admin/config/components/setting.php @@ -50,8 +50,10 @@ 'settings.team.permissions' => Components\Settings\Team\Permissions::class, 'settings.team.users' => Components\Settings\Team\UsersRole::class, 'settings.zones.detail' => Components\Settings\Zones\Detail::class, + 'settings.zones.shipping-options' => Components\Settings\Zones\ZoneShippingOptions::class, 'slide-overs.create-team-member' => Livewire\SlideOvers\CreateTeamMember::class, + 'slide-overs.shipping-option-form' => Livewire\SlideOvers\ShippingOptionForm::class, 'slide-overs.zone-form' => Livewire\SlideOvers\ZoneForm::class, ], diff --git a/packages/admin/public/shopper.css b/packages/admin/public/shopper.css index d10148dd9..82c5130a5 100755 --- a/packages/admin/public/shopper.css +++ b/packages/admin/public/shopper.css @@ -3543,6 +3543,10 @@ html { inset: -0.625rem; } +.-inset-px { + inset: -1px; +} + .inset-0 { inset: 0px; } @@ -5348,6 +5352,11 @@ html { border-color: rgb(74 222 128 / var(--tw-border-opacity)); } +.border-indigo-600 { + --tw-border-opacity: 1; + border-color: rgb(79 70 229 / var(--tw-border-opacity)); +} + .border-primary-300 { --tw-border-opacity: 1; border-color: rgb(147 197 253 / var(--tw-border-opacity)); @@ -9341,6 +9350,11 @@ html.dark .shiki span { background-color: rgb(255 255 255 / 0.75); } +.hover\:bg-danger-50:hover { + --tw-bg-opacity: 1; + background-color: rgb(254 242 242 / var(--tw-bg-opacity)); +} + .hover\:text-custom-600:hover { --tw-text-opacity: 1; color: rgba(var(--c-600), var(--tw-text-opacity)); @@ -9409,6 +9423,11 @@ html.dark .shiki span { color: rgb(202 138 4 / var(--tw-text-opacity)); } +.hover\:text-danger-500:hover { + --tw-text-opacity: 1; + color: rgb(239 68 68 / var(--tw-text-opacity)); +} + .hover\:opacity-100:hover { opacity: 1; } @@ -10145,6 +10164,10 @@ html.dark .shiki span { background-color: rgb(255 255 255 / 0.05); } +:is(.dark .dark\:hover\:bg-danger-800\/50:hover) { + background-color: rgb(153 27 27 / 0.5); +} + :is(.dark .dark\:hover\:text-custom-300:hover) { --tw-text-opacity: 1; color: rgba(var(--c-300), var(--tw-text-opacity)); @@ -10380,11 +10403,20 @@ html.dark .shiki span { margin-right: 0px; } + .sm\:mx-1 { + margin-left: 0.25rem; + margin-right: 0.25rem; + } + .sm\:my-8 { margin-top: 2rem; margin-bottom: 2rem; } + .sm\:ml-0 { + margin-left: 0px; + } + .sm\:ml-3 { margin-left: 0.75rem; } @@ -10409,6 +10441,10 @@ html.dark .shiki span { display: inline-block; } + .sm\:inline { + display: inline; + } + .sm\:flex { display: flex; } @@ -10555,6 +10591,10 @@ html.dark .shiki span { flex-direction: row-reverse; } + .sm\:flex-col { + flex-direction: column; + } + .sm\:flex-nowrap { flex-wrap: nowrap; } @@ -10738,6 +10778,10 @@ html.dark .shiki span { text-align: left; } + .sm\:text-right { + text-align: right; + } + .sm\:align-middle { vertical-align: middle; } diff --git a/packages/admin/resources/lang/en/pages/settings/zones.php b/packages/admin/resources/lang/en/pages/settings/zones.php index dff1c8e31..755c21911 100644 --- a/packages/admin/resources/lang/en/pages/settings/zones.php +++ b/packages/admin/resources/lang/en/pages/settings/zones.php @@ -5,6 +5,7 @@ return [ 'title' => 'Zones', + 'single' => 'zone', 'description' => 'Zones represent the markets in which you will be operating.', 'add_action' => 'Add zone', 'empty_heading' => 'No zones', @@ -14,4 +15,14 @@ 'empty_detail_heading' => 'No zone selected', 'empty_detail_description' => "Once you've selected a zone, all its information will be available here", + 'shipping_options' => [ + 'title' => 'Shipping Options', + 'description' => 'Enter specifics about available zone shipment methods.', + 'option_visibility' => 'Enable or disable the shipping option visibility in store.', + 'add' => 'Add Option', + 'add_heading' => 'Shipping Option for the :name zone', + 'update' => 'Update option (:name)', + 'empty_heading' => 'No shipping option available', + ], + ]; diff --git a/packages/admin/resources/lang/en/words.php b/packages/admin/resources/lang/en/words.php index e4397531a..6c94bef86 100755 --- a/packages/admin/resources/lang/en/words.php +++ b/packages/admin/resources/lang/en/words.php @@ -139,7 +139,7 @@ 'slug' => 'SEO', 'description' => 'Improve your ranking and how your :name page will appear in search engines results.', 'sub_description' => 'Here is a preview of what an search engine can display, play with it!', - 'characters' => '160 characters', + 'characters' => '160 characters', // to replace in blade file ], 'other' => ' other(s)', @@ -148,5 +148,6 @@ 'amount' => 'Amount', 'soon' => 'Soon', 'learn_more' => 'Learn more about', + 'characters' => ':number characters', ]; diff --git a/packages/admin/resources/lang/fr/pages/settings/zones.php b/packages/admin/resources/lang/fr/pages/settings/zones.php index 971f29fc0..bb3f37f0a 100644 --- a/packages/admin/resources/lang/fr/pages/settings/zones.php +++ b/packages/admin/resources/lang/fr/pages/settings/zones.php @@ -5,6 +5,7 @@ return [ 'title' => 'Zones', + 'single' => 'zone', 'description' => 'Les zones représentent les marchés sur lesquels vous allez opérer.', 'add_action' => 'Ajouter une zone', 'empty_heading' => 'Aucunes zones', @@ -14,4 +15,15 @@ 'empty_detail_heading' => 'Aucune zone sélectionner', 'empty_detail_description' => 'Une fois que vous avez sélectionné une zone, toutes ses informations seront disponible ici', + 'shipping_options' => [ + 'title' => 'Options de livraison', + 'single' => 'Option de livraison', + 'description' => 'Saisir des informations sur les méthodes d\'expédition par zone disponibles.', + 'option_visibility' => 'Active ou désactive la visibilité des options de livraison sur votre boutique.', + 'add' => 'Ajouter une option', + 'add_heading' => 'Option de livraison pour la zone :name', + 'update' => 'Modifier cette option (:name)', + 'empty_heading' => 'Aucune option de livraison disponible', + ], + ]; diff --git a/packages/admin/resources/lang/fr/words.php b/packages/admin/resources/lang/fr/words.php index fa1d549c8..32092fd35 100755 --- a/packages/admin/resources/lang/fr/words.php +++ b/packages/admin/resources/lang/fr/words.php @@ -139,7 +139,7 @@ 'slug' => 'SEO', 'description' => 'Améliorez votre classement et la façon dont votre page :name apparaîtra dans les résultats des moteurs de recherche.', 'sub_description' => 'Voici un aperçu du résultat que peut donner un moteur de recherche, jouez avec !', - 'characters' => '160 caractères', + 'characters' => '160 caractères', // à remplacer dans les fichiers blade ], 'other' => ' autre(s)', @@ -148,5 +148,6 @@ 'amount' => 'Montant', 'soon' => 'Bientôt', 'learn_more' => 'En savoir plus', + 'characters' => ':number caractères', ]; diff --git a/packages/admin/resources/views/livewire/components/settings/zones/detail.blade.php b/packages/admin/resources/views/livewire/components/settings/zones/detail.blade.php index 5120f0024..b8b6138b8 100644 --- a/packages/admin/resources/views/livewire/components/settings/zones/detail.blade.php +++ b/packages/admin/resources/views/livewire/components/settings/zones/detail.blade.php @@ -1,4 +1,4 @@ -
+
@if ($zone)
@@ -13,7 +13,7 @@
{{ ($this->editAction)(['id' => $zone->id]) }} - {{ $this->deleteAction }} + {{ ($this->deleteAction)(['id' => $zone->id]) }}
@@ -38,7 +38,7 @@ :heading="__('shopper::pages/settings/carriers.title')" :content="$zone->carriers_name" /> -
+
+ + @else @endif diff --git a/packages/admin/resources/views/livewire/components/settings/zones/shipping-options.blade.php b/packages/admin/resources/views/livewire/components/settings/zones/shipping-options.blade.php new file mode 100644 index 000000000..a8037dfa3 --- /dev/null +++ b/packages/admin/resources/views/livewire/components/settings/zones/shipping-options.blade.php @@ -0,0 +1,68 @@ +
+ +
+
+
+
+ + {{ __('shopper::pages/settings/zones.shipping_options.add') }} + +
+
+
+ @forelse($zone->shippingOptions as $shippingOption) +
+
+

+ + {{ $shippingOption->name }} + + + {{ $shippingOption->isEnabled() ? __('shopper::words.is_enabled') : __('shopper::words.is_disabled') }} + +

+ @if($shippingOption->description) +

+ {{ $shippingOption->description }} +

+ @endif + + {{ __('shopper::forms.label.price') }}: + + {{ shopper_money_format($shippingOption->price, $zone->currency->code) }} + + +
+
+ {{ ($this->editAction)(['zone_id' => $zone->id, 'option_id' => $shippingOption->id]) }} + {{ ($this->deleteAction)(['id' => $shippingOption->id]) }} +
+
+ @empty +

+ {{ __('shopper::pages/settings/zones.shipping_options.empty_heading') }} +

+ @endforelse +
+
+ + +
diff --git a/packages/admin/resources/views/livewire/pages/settings/zones.blade.php b/packages/admin/resources/views/livewire/pages/settings/zones.blade.php index ce2024c67..ff25af5d9 100644 --- a/packages/admin/resources/views/livewire/pages/settings/zones.blade.php +++ b/packages/admin/resources/views/livewire/pages/settings/zones.blade.php @@ -41,7 +41,7 @@ class="relative text-gray-400 hover:text-gray-500 focus:outline-none dark:text-g zone = Zone::with([ @@ -32,6 +32,7 @@ public function mount(?int $currentZoneId = null): void 'currency', 'carriers', 'paymentMethods', + 'shippingOptions', ])->find($currentZoneId); } @@ -41,11 +42,11 @@ public function deleteAction(): Action ->record($this->zone) ->icon('untitledui-trash-03') ->iconButton() - ->successNotificationTitle(__('shopper::notifications.actions.remove', ['item' => 'zone'])) + ->successNotificationTitle(__('shopper::notifications.delete', ['item' => __('shopper::pages/settings/zones.single')])) ->after(function (): void { $this->reset('zone'); - $this->dispatch('refreshZones'); + $this->dispatch('refresh-zones'); }); } diff --git a/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php b/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php new file mode 100644 index 000000000..44939220e --- /dev/null +++ b/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php @@ -0,0 +1,64 @@ +requiresConfirmation() + ->icon('untitledui-trash-03') + ->color('danger') + ->iconButton() + ->action(function (array $arguments): void { + CarrierOption::query()->find($arguments['id'])->delete(); + + Notification::make() + ->title(__('shopper::notifications.delete', ['item' => __('shopper::pages/settings/zones.shipping_options.single')])) + ->success() + ->send(); + + $this->dispatch('$refresh'); + }); + } + + public function editAction(): Action + { + return Action::make('edit') + ->iconButton() + ->icon('untitledui-edit-03') + ->action(fn (array $arguments) => $this->dispatch( + 'openPanel', + component: 'shopper-slide-overs.shipping-option-form', + arguments: ['zoneId' => $arguments['zone_id'], 'optionId' => $arguments['option_id']] + )); + } + + public function render(): View + { + return view('shopper::livewire.components.settings.zones.shipping-options'); + } +} diff --git a/packages/admin/src/Livewire/Pages/Settings/Zones.php b/packages/admin/src/Livewire/Pages/Settings/Zones.php index 62d934c5c..58b7c0a29 100644 --- a/packages/admin/src/Livewire/Pages/Settings/Zones.php +++ b/packages/admin/src/Livewire/Pages/Settings/Zones.php @@ -7,20 +7,24 @@ use Illuminate\Contracts\View\View; use Livewire\Attributes\Layout; use Livewire\Attributes\On; +use Livewire\Attributes\Url; use Livewire\Component; use Shopper\Core\Models\Zone; #[Layout('shopper::components.layouts.setting')] class Zones extends Component { + #[Url(as: 'zone-id', except: '')] public ?int $currentZoneId = null; public function updatedCurrentZoneId(int $value): void { - $this->dispatch('zoneRefresh', currentZoneId: $value); + $this->currentZoneId = $value; + + $this->dispatch('refresh-zone', currentZoneId: $value); } - #[On('refreshZones')] + #[On('refresh-zones')] public function render(): View { return view('shopper::livewire.pages.settings.zones', [ diff --git a/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php b/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php new file mode 100644 index 000000000..02eb739d0 --- /dev/null +++ b/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php @@ -0,0 +1,128 @@ +option = CarrierOption::query() + ->where('zone_id', $this->zoneId) + ->find($optionId); + + $this->title = $optionId + ? __('shopper::pages/settings/zones.shipping_options.update', ['name' => $this->option->name]) + : __('shopper::pages/settings/zones.shipping_options.add_heading', ['name' => $this->zone->name]); + + $this->form->fill($this->option?->toArray()); + } + + #[Computed] + public function zone(): Zone + { + return Zone::with(['currency', 'carriers'])->find($this->zoneId); + } + + public function form(Form $form): Form + { + return $form + ->schema([ + Forms\Components\Group::make() + ->schema([ + Forms\Components\TextInput::make('name') + ->label(__('shopper::forms.label.name')) + ->placeholder('Standard option...') + ->required(), + + Forms\Components\TextInput::make('price') + ->label(__('shopper::forms.label.price')) + ->numeric() + ->required() + ->rules(['regex:/^\d{1,6}(\.\d{0,2})?$/']) + ->suffix($this->zone->currency->code) + ->currencyMask(thousandSeparator: ',', decimalSeparator: '.', precision: 2), + + Forms\Components\Select::make('carrier_id') + ->label(__('shopper::pages/settings/carriers.title')) + ->options($this->zone->carriers->pluck('name', 'id')) + ->required() + ->native(false) + ->columnSpan('full'), + + Forms\Components\Textarea::make('description') + ->label(__('shopper::forms.label.description')) + ->hint(__('shopper::words.characters', ['number' => 200])) + ->rows(3) + ->maxLength(200) + ->columnSpan('full'), + ]) + ->columns(), + + Forms\Components\Toggle::make('is_enabled') + ->label(__('shopper::forms.label.visibility')) + ->helperText(__('shopper::pages/settings/zones.shipping_options.option_visibility')), + + Separator::make(), + + Forms\Components\KeyValue::make('metadata') + ->label('Metadata') + ->reorderable(), + ]) + ->statePath('data') + ->model($this->option); + } + + public function store(): void + { + $data = array_merge($this->form->getState(), ['zone_id' => $this->zoneId]); + + if ($this->option) { + $this->option->update($data); + } else { + $this->option = CarrierOption::query()->create($data); + } + + Notification::make() + ->title(__('shopper::notifications.save', ['item' => $this->option->name])) + ->success() + ->send(); + + $this->dispatch('refresh-zone', currentZoneId: $this->zoneId); + + $this->closePanel(); + } +} diff --git a/packages/admin/src/Livewire/SlideOvers/ZoneForm.php b/packages/admin/src/Livewire/SlideOvers/ZoneForm.php index da04c0dee..86a2d499a 100644 --- a/packages/admin/src/Livewire/SlideOvers/ZoneForm.php +++ b/packages/admin/src/Livewire/SlideOvers/ZoneForm.php @@ -75,7 +75,7 @@ public function form(Form $form): Form ->schema([ Forms\Components\TextInput::make('name') ->label(__('shopper::forms.label.name')) - ->placeholder('Afrique') + ->placeholder('Africa') ->required() ->live(onBlur: true) ->afterStateUpdated(function ($state, Forms\Set $set): void { @@ -177,11 +177,11 @@ public function store(): void $this->zone->paymentMethods()->sync($data['payments']); Notification::make() - ->title(__('shopper::notifications.actions.save', ['item' => $this->zone->name])) + ->title(__('shopper::notifications.save', ['item' => $this->zone->name])) ->success() ->send(); - $this->dispatch('refreshZones'); + $this->dispatch('refresh-zones'); $this->closePanel(); } diff --git a/packages/core/database/factories/CarrierOptionFactory.php b/packages/core/database/factories/CarrierOptionFactory.php new file mode 100644 index 000000000..713bc805a --- /dev/null +++ b/packages/core/database/factories/CarrierOptionFactory.php @@ -0,0 +1,18 @@ +getTableName('carrier_options'), function (Blueprint $table): void { + $this->addCommonFields($table); + + $table->string('name')->unique(); + $table->string('description', 255)->nullable(); + $table->boolean('is_enabled')->default(false); + $table->integer('price'); + $table->foreignIdFor(Models\Carrier::class); + $table->foreignIdFor(Models\Zone::class); + $table->json('metadata')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists($this->getTableName('carrier_options')); + } +}; diff --git a/packages/core/src/Helpers/Price.php b/packages/core/src/Helpers/Price.php index 10693462d..38939a854 100755 --- a/packages/core/src/Helpers/Price.php +++ b/packages/core/src/Helpers/Price.php @@ -12,11 +12,11 @@ final class Price public string $currency; - public function __construct(int | float $cent) + public function __construct(int | float $cent, ?string $currency = null) { $this->value = $cent; - $this->currency = shopper_currency(); - $this->formatted = shopper_money_format(amount: $this->value); + $this->currency = $currency ?? shopper_currency(); + $this->formatted = shopper_money_format(amount: $this->value, currency: $this->currency); } public static function from(int | float $cent): self diff --git a/packages/core/src/Models/Carrier.php b/packages/core/src/Models/Carrier.php index 782742c36..1b3d8dd0e 100755 --- a/packages/core/src/Models/Carrier.php +++ b/packages/core/src/Models/Carrier.php @@ -5,7 +5,9 @@ namespace Shopper\Core\Models; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasMany; use Shopper\Core\Traits\HasSlug; /** @@ -21,6 +23,7 @@ */ class Carrier extends Model { + use HasFactory; use HasSlug; protected $fillable = [ @@ -48,4 +51,9 @@ public function scopeEnabled(Builder $query): Builder { return $query->where('is_enabled', true); } + + public function options(): HasMany + { + return $this->hasMany(CarrierOption::class); + } } diff --git a/packages/core/src/Models/CarrierOption.php b/packages/core/src/Models/CarrierOption.php new file mode 100644 index 000000000..eda1304eb --- /dev/null +++ b/packages/core/src/Models/CarrierOption.php @@ -0,0 +1,75 @@ + 'array', + 'is_enabled' => 'boolean', + ]; + + protected function price(): Attribute + { + return Attribute::make( + get: fn ($value) => $value / 100, + set: fn ($value) => $value * 100, + ); + } + + public function getTable(): string + { + return shopper_table('carrier_options'); + } + + public function isEnabled(): bool + { + return $this->is_enabled; + } + + public function scopeEnabled(Builder $query): Builder + { + return $query->where('is_enabled', true); + } + + public function carrier(): BelongsTo + { + return $this->belongsTo(Carrier::class, 'carrier_id'); + } + + public function zone(): BelongsTo + { + return $this->belongsTo(Zone::class, 'zone_id'); + } +} diff --git a/packages/core/src/Models/Zone.php b/packages/core/src/Models/Zone.php index 122338e58..66d007aeb 100644 --- a/packages/core/src/Models/Zone.php +++ b/packages/core/src/Models/Zone.php @@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\MorphToMany; use Shopper\Core\Traits\HasSlug; @@ -23,6 +24,9 @@ * @property string $carriers_name * @property string $countries_name * @property string $payments_name + * @property \Shopper\Core\Models\Currency $currency + * @property \Illuminate\Database\Eloquent\Collection $carriers + * @property \Illuminate\Database\Eloquent\Collection $shippingOptions */ class Zone extends Model { @@ -110,4 +114,9 @@ public function carriers(): MorphToMany { return $this->morphedByMany(Carrier::class, 'zonable', shopper_table('zone_has_relations')); } + + public function shippingOptions(): HasMany + { + return $this->hasMany(CarrierOption::class); + } } From 1c355c57a7c6b99f12993498443c0705ceee2a2b Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 26 Jun 2024 09:25:34 +0200 Subject: [PATCH 2/3] Remove feature flag on dashboard product link --- packages/admin/public/shopper.css | 44 ------------------- .../views/livewire/pages/dashboard.blade.php | 22 +++++----- 2 files changed, 10 insertions(+), 56 deletions(-) diff --git a/packages/admin/public/shopper.css b/packages/admin/public/shopper.css index 82c5130a5..d10148dd9 100755 --- a/packages/admin/public/shopper.css +++ b/packages/admin/public/shopper.css @@ -3543,10 +3543,6 @@ html { inset: -0.625rem; } -.-inset-px { - inset: -1px; -} - .inset-0 { inset: 0px; } @@ -5352,11 +5348,6 @@ html { border-color: rgb(74 222 128 / var(--tw-border-opacity)); } -.border-indigo-600 { - --tw-border-opacity: 1; - border-color: rgb(79 70 229 / var(--tw-border-opacity)); -} - .border-primary-300 { --tw-border-opacity: 1; border-color: rgb(147 197 253 / var(--tw-border-opacity)); @@ -9350,11 +9341,6 @@ html.dark .shiki span { background-color: rgb(255 255 255 / 0.75); } -.hover\:bg-danger-50:hover { - --tw-bg-opacity: 1; - background-color: rgb(254 242 242 / var(--tw-bg-opacity)); -} - .hover\:text-custom-600:hover { --tw-text-opacity: 1; color: rgba(var(--c-600), var(--tw-text-opacity)); @@ -9423,11 +9409,6 @@ html.dark .shiki span { color: rgb(202 138 4 / var(--tw-text-opacity)); } -.hover\:text-danger-500:hover { - --tw-text-opacity: 1; - color: rgb(239 68 68 / var(--tw-text-opacity)); -} - .hover\:opacity-100:hover { opacity: 1; } @@ -10164,10 +10145,6 @@ html.dark .shiki span { background-color: rgb(255 255 255 / 0.05); } -:is(.dark .dark\:hover\:bg-danger-800\/50:hover) { - background-color: rgb(153 27 27 / 0.5); -} - :is(.dark .dark\:hover\:text-custom-300:hover) { --tw-text-opacity: 1; color: rgba(var(--c-300), var(--tw-text-opacity)); @@ -10403,20 +10380,11 @@ html.dark .shiki span { margin-right: 0px; } - .sm\:mx-1 { - margin-left: 0.25rem; - margin-right: 0.25rem; - } - .sm\:my-8 { margin-top: 2rem; margin-bottom: 2rem; } - .sm\:ml-0 { - margin-left: 0px; - } - .sm\:ml-3 { margin-left: 0.75rem; } @@ -10441,10 +10409,6 @@ html.dark .shiki span { display: inline-block; } - .sm\:inline { - display: inline; - } - .sm\:flex { display: flex; } @@ -10591,10 +10555,6 @@ html.dark .shiki span { flex-direction: row-reverse; } - .sm\:flex-col { - flex-direction: column; - } - .sm\:flex-nowrap { flex-wrap: nowrap; } @@ -10778,10 +10738,6 @@ html.dark .shiki span { text-align: left; } - .sm\:text-right { - text-align: right; - } - .sm\:align-middle { vertical-align: middle; } diff --git a/packages/admin/resources/views/livewire/pages/dashboard.blade.php b/packages/admin/resources/views/livewire/pages/dashboard.blade.php index 5e3e213c8..91d2e359b 100755 --- a/packages/admin/resources/views/livewire/pages/dashboard.blade.php +++ b/packages/admin/resources/views/livewire/pages/dashboard.blade.php @@ -117,20 +117,18 @@ class="flex h-10 w-10 items-center justify-center rounded-lg bg-primary-100 dark {{ __('shopper::pages/dashboard.cards.product_description') }}
- @if (\Shopper\Feature::enabled('product')) - @can('add_products') - -
- {{ __('shopper::pages/dashboard.cards.product_link') }} - + @can('add_products') + +
+ {{ __('shopper::pages/dashboard.cards.product_link') }} + -
-
- @endcan - @endif +
+
+ @endcan
From acf6e8f57e3dd61530d938e70b70e8e9eccf959b Mon Sep 17 00:00:00 2001 From: mckenziearts Date: Wed, 26 Jun 2024 13:46:40 +0000 Subject: [PATCH 3/3] fix code formatting --- .../Livewire/Components/Settings/Zones/ZoneShippingOptions.php | 2 -- packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php | 1 - 2 files changed, 3 deletions(-) diff --git a/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php b/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php index 44939220e..c331589b8 100644 --- a/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php +++ b/packages/admin/src/Livewire/Components/Settings/Zones/ZoneShippingOptions.php @@ -7,13 +7,11 @@ use Filament\Actions\Action; use Filament\Actions\Concerns\InteractsWithActions; use Filament\Actions\Contracts\HasActions; -use Filament\Actions\DeleteAction; use Filament\Forms\Concerns\InteractsWithForms; use Filament\Forms\Contracts\HasForms; use Filament\Notifications\Notification; use Illuminate\Contracts\View\View; use Livewire\Attributes\Lazy; -use Livewire\Attributes\On; use Livewire\Component; use Shopper\Core\Models\CarrierOption; use Shopper\Core\Models\Zone; diff --git a/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php b/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php index 02eb739d0..9c7325df0 100644 --- a/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php +++ b/packages/admin/src/Livewire/SlideOvers/ShippingOptionForm.php @@ -14,7 +14,6 @@ use Shopper\Contracts\SlideOverForm; use Shopper\Core\Models\CarrierOption; use Shopper\Core\Models\Zone; -use Shopper\Livewire\Components\Settings\Zones\ZoneShippingOptions; use Shopper\Livewire\Components\SlideOverComponent; use Shopper\Traits\InteractsWithSlideOverForm;