Skip to content

Commit

Permalink
Merge branch '1.x' into feat/variant-editing
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson authored Jan 29, 2024
2 parents 9621c6f + 8a92100 commit 2087140
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ListChannels extends BaseListRecords
{
protected static string $resource = ChannelResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ListCollectionGroups extends ListRecords
{
protected static string $resource = CollectionGroupResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function mount(): void
abort(404);
}

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ListCurrencies extends BaseListRecords
{
protected static string $resource = CurrencyResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ListCustomerGroups extends BaseListRecords
{
protected static string $resource = CustomerGroupResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ListOrders extends BaseListRecords
{
protected static string $resource = OrderResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
// Actions\CreateAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static function createRecord(array $data, string $model): Model
]);
$variant->prices()->create([
'tier' => 1,
'currency_id' => $currency->id,
'price' => (int) bcmul($data['base_price'], $currency->factor),
]);
DB::commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ListStaff extends BaseListRecords
{
protected static string $resource = StaffResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
Actions\Action::make('access-control')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ListTaxClasses extends BaseListRecords
{
protected static string $resource = TaxClassResource::class;

protected function getHeaderActions(): array
protected function getDefaultHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/src/Support/FieldTypes/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public static function getFilamentComponent(Attribute $attribute): Component
$input = TextField::getFilamentComponent($attribute)->numeric();

if ($min) {
$input->min($min);
$input->minValue($min);
}

if ($max) {
$input->max($max);
$input->maxValue($max);
}

return $input;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Lunar\Base\Migration;

class UpdateNullableCurrencyOnPricesTable extends Migration
{
public function up()
{
Schema::table($this->prefix.'prices', function (Blueprint $table) {
$table->foreignId('currency_id')->nullable(false)->change();
});
}

public function down()
{
Schema::table($this->prefix.'prices', function (Blueprint $table) {
$table->foreignId('currency_id')->nullable(true)->change();
});
}
}

0 comments on commit 2087140

Please sign in to comment.