Skip to content

Commit

Permalink
变更产品模块相关资源的标签和字段名称
Browse files Browse the repository at this point in the history
- 修改了BrandResource、ProductCategoryResource、ProductPropertyGroupResource、ProductPropertyResource、ProductPropertyValueResource和ProductSellerCategoryResource的标签和字段名称
- 更新了各资源的form和table定义,以反映新的标签和字段名称
- 调整了部分资源的导航组名称
  • Loading branch information
liushoukun committed Oct 9, 2024
1 parent 6a74fd8 commit 8c3842d
Show file tree
Hide file tree
Showing 12 changed files with 288 additions and 288 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Clusters/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class Product extends Cluster
public static function getNavigationLabel() : string
{

return __('filament-product::product.label');
return __('red-jasmine-filament-product::product.label');
}


public static function getClusterBreadcrumb() : ?string
{
return __('filament-product::product.label');
return __('red-jasmine-filament-product::product.label');
}

}
30 changes: 15 additions & 15 deletions src/Clusters/Product/Resources/BrandResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BrandResource extends Resource

public static function getModelLabel() : string
{
return __('red-jasmine.product::brand.labels.brand');
return __('red-jasmine-product::brand.labels.brand');
}

public static function form(Form $form) : Form
Expand All @@ -64,25 +64,25 @@ public static function form(Form $form) : Form
->parentNullValue(0)
,
Forms\Components\TextInput::make('name')
->label(__('red-jasmine.product::brand.fields.name'))
->label(__('red-jasmine-product::brand.fields.name'))
->required(),
Forms\Components\TextInput::make('description')
->label(__('red-jasmine.product::brand.fields.description'))
->label(__('red-jasmine-product::brand.fields.description'))

->maxLength(255),
Forms\Components\TextInput::make('english_name')
->label(__('red-jasmine.product::brand.fields.english_name'))
->label(__('red-jasmine-product::brand.fields.english_name'))
->required(),
Forms\Components\TextInput::make('initial')
->maxLength(1)
->label(__('red-jasmine.product::brand.fields.initial'))->required(),
->label(__('red-jasmine-product::brand.fields.initial'))->required(),
Forms\Components\TextInput::make('sort')
->label(__('red-jasmine.product::brand.fields.sort'))
->label(__('red-jasmine-product::brand.fields.sort'))
->default(0)->required()->numeric()->minValue(0),
Forms\Components\Radio::make('is_show')
->label(__('red-jasmine.product::brand.fields.is_show'))
->label(__('red-jasmine-product::brand.fields.is_show'))
->boolean()->inline()->default(true),
Forms\Components\Radio::make('status')->label(__('red-jasmine.product::brand.fields.status'))
Forms\Components\Radio::make('status')->label(__('red-jasmine-product::brand.fields.status'))
->options(BrandStatusEnum::options())
->inline()->default(BrandStatusEnum::ENABLE->value),
])->columns(1);
Expand All @@ -96,17 +96,17 @@ public static function table(Table $table) : Table
Tables\Columns\TextColumn::make('id'),
Tables\Columns\TextColumn::make('parent.name'),
Tables\Columns\TextColumn::make('name')
->label(__('red-jasmine.product::brand.fields.name'))
->label(__('red-jasmine-product::brand.fields.name'))
->searchable(),

Tables\Columns\TextColumn::make('initial')
->label(__('red-jasmine.product::brand.fields.initial')),
->label(__('red-jasmine-product::brand.fields.initial')),
Tables\Columns\TextColumn::make('english_name')
->label(__('red-jasmine.product::brand.fields.english_name')),
Tables\Columns\ImageColumn::make('logo')->label(__('red-jasmine.product::brand.fields.logo')),
Tables\Columns\IconColumn::make('is_show')->label(__('red-jasmine.product::brand.fields.is_show'))->boolean(),
Tables\Columns\TextColumn::make('sort')->label(__('red-jasmine.product::brand.fields.sort'))->sortable(),
Tables\Columns\TextColumn::make('status')->label(__('red-jasmine.product::brand.fields.status'))
->label(__('red-jasmine-product::brand.fields.english_name')),
Tables\Columns\ImageColumn::make('logo')->label(__('red-jasmine-product::brand.fields.logo')),
Tables\Columns\IconColumn::make('is_show')->label(__('red-jasmine-product::brand.fields.is_show'))->boolean(),
Tables\Columns\TextColumn::make('sort')->label(__('red-jasmine-product::brand.fields.sort'))->sortable(),
Tables\Columns\TextColumn::make('status')->label(__('red-jasmine-product::brand.fields.status'))
->badge()->formatStateUsing(fn($state) => $state->label())->color(fn($state) => $state->color()),


Expand Down
36 changes: 18 additions & 18 deletions src/Clusters/Product/Resources/ProductCategoryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ProductCategoryResource extends Resource

public static function getModelLabel() : string
{
return __('red-jasmine.product::product-category.labels.product-category');
return __('red-jasmine-product::product-category.labels.product-category');
}

public static function form(Form $form) : Form
Expand All @@ -49,7 +49,7 @@ public static function form(Form $form) : Form
->schema([

SelectTree::make('parent_id')
->label(__('red-jasmine.product::product-category.fields.parent_id'))
->label(__('red-jasmine-product::product-category.fields.parent_id'))
->relationship(relationship: 'parent', titleAttribute: 'name', parentAttribute: 'parent_id',
modifyQueryUsing: fn($query, Forms\Get $get, ?Model $record) => $query->when($record?->getKey(), fn($query, $value) => $query->where('id', '<>', $value)),
modifyChildQueryUsing: fn($query, Forms\Get $get, ?Model $record) => $query->when($record?->getKey(), fn($query, $value) => $query->where('id', '<>', $value)),
Expand All @@ -61,31 +61,31 @@ public static function form(Form $form) : Form
->parentNullValue(0)
,
Forms\Components\TextInput::make('name')
->label(__('red-jasmine.product::product-category.fields.name'))
->label(__('red-jasmine-product::product-category.fields.name'))
->required()
->maxLength(255),
Forms\Components\TextInput::make('description')
->label(__('red-jasmine.product::product-category.fields.description'))->maxLength(255),
->label(__('red-jasmine-product::product-category.fields.description'))->maxLength(255),
Forms\Components\FileUpload::make('image')
->label(__('red-jasmine.product::product-category.fields.image'))
->label(__('red-jasmine-product::product-category.fields.image'))
->image(),
Forms\Components\TextInput::make('group_name')
->label(__('red-jasmine.product::product-category.fields.group_name'))
->label(__('red-jasmine-product::product-category.fields.group_name'))
->maxLength(255),
Forms\Components\TextInput::make('sort')
->label(__('red-jasmine.product::product-category.fields.sort'))
->label(__('red-jasmine-product::product-category.fields.sort'))
->required()
->default(0),
Forms\Components\Toggle::make('is_leaf')
->label(__('red-jasmine.product::product-category.fields.is_leaf'))
->label(__('red-jasmine-product::product-category.fields.is_leaf'))
->required()
->default(0),
Forms\Components\Toggle::make('is_show')
->label(__('red-jasmine.product::product-category.fields.is_show'))
->label(__('red-jasmine-product::product-category.fields.is_show'))
->required()
->default(1),
Forms\Components\Radio::make('status')
->label(__('red-jasmine.product::product-category.fields.status'))
->label(__('red-jasmine-product::product-category.fields.status'))
->required()
->default(CategoryStatusEnum::ENABLE)
->options(CategoryStatusEnum::options()),
Expand All @@ -100,29 +100,29 @@ public static function table(Table $table) : Table
->label('ID')
->sortable(),
Tables\Columns\TextColumn::make('parent.name')
->label(__('red-jasmine.product::product-category.fields.parent_id'))
->label(__('red-jasmine-product::product-category.fields.parent_id'))
->sortable(),
Tables\Columns\TextColumn::make('name')
->label(__('red-jasmine.product::product-category.fields.name'))
->label(__('red-jasmine-product::product-category.fields.name'))
->searchable(),
Tables\Columns\ImageColumn::make('image')
->label(__('red-jasmine.product::product-category.fields.image'))
->label(__('red-jasmine-product::product-category.fields.image'))
,
Tables\Columns\TextColumn::make('group_name')
->label(__('red-jasmine.product::product-category.fields.group_name'))
->label(__('red-jasmine-product::product-category.fields.group_name'))
->searchable(),

Tables\Columns\IconColumn::make('is_leaf')
->label(__('red-jasmine.product::product-category.fields.is_leaf'))
->label(__('red-jasmine-product::product-category.fields.is_leaf'))
->boolean(),
Tables\Columns\IconColumn::make('is_show')
->label(__('red-jasmine.product::product-category.fields.is_show'))
->label(__('red-jasmine-product::product-category.fields.is_show'))
->boolean(),
Tables\Columns\TextColumn::make('sort')
->label(__('red-jasmine.product::product-category.fields.sort'))
->label(__('red-jasmine-product::product-category.fields.sort'))
->sortable(),
Tables\Columns\TextColumn::make('status')
->label(__('red-jasmine.product::product-category.fields.status'))
->label(__('red-jasmine-product::product-category.fields.status'))
->badge()->formatStateUsing(fn($state) => $state->label())->color(fn($state) => $state->color()),

])
Expand Down
Loading

0 comments on commit 8c3842d

Please sign in to comment.