feat: custom labels toggle and inline editing in product list
Adds session-based show/hide toggle for custom labels in admin product list, inline editable fields for custom_label_0..4, and label suggestions with custom entry support. Includes repository/controller updates, UI fixes, tests, and PAUL docs release updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,7 @@ class ShopProductControllerTest extends TestCase
|
||||
$this->assertTrue(method_exists($this->controller, 'product_unarchive'));
|
||||
$this->assertTrue(method_exists($this->controller, 'product_delete'));
|
||||
$this->assertTrue(method_exists($this->controller, 'change_product_status'));
|
||||
$this->assertTrue(method_exists($this->controller, 'product_custom_labels_toggle'));
|
||||
$this->assertTrue(method_exists($this->controller, 'product_change_price_brutto'));
|
||||
$this->assertTrue(method_exists($this->controller, 'product_change_price_brutto_promo'));
|
||||
$this->assertTrue(method_exists($this->controller, 'product_change_custom_label'));
|
||||
@@ -128,6 +129,9 @@ class ShopProductControllerTest extends TestCase
|
||||
'renderCustomFieldsBox',
|
||||
'escapeHtml',
|
||||
'resolveSavePayload',
|
||||
'customLabelsEnabled',
|
||||
'isAllowedCustomLabelType',
|
||||
'renderCustomLabelsEditor',
|
||||
];
|
||||
|
||||
foreach ($expectedPrivate as $method) {
|
||||
@@ -147,4 +151,22 @@ class ShopProductControllerTest extends TestCase
|
||||
$reflection = new \ReflectionClass($this->controller);
|
||||
$this->assertEquals('void', (string)$reflection->getMethod('save')->getReturnType());
|
||||
}
|
||||
|
||||
public function testToggleCustomLabelsMethodReturnsVoid(): void
|
||||
{
|
||||
$reflection = new \ReflectionClass($this->controller);
|
||||
$this->assertEquals('void', (string)$reflection->getMethod('product_custom_labels_toggle')->getReturnType());
|
||||
}
|
||||
|
||||
public function testAllowedCustomLabelTypeValidation(): void
|
||||
{
|
||||
$reflection = new \ReflectionClass($this->controller);
|
||||
$method = $reflection->getMethod('isAllowedCustomLabelType');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$this->assertTrue($method->invoke($this->controller, 'custom_label_0'));
|
||||
$this->assertTrue($method->invoke($this->controller, 'custom_label_4'));
|
||||
$this->assertFalse($method->invoke($this->controller, 'custom_label_5'));
|
||||
$this->assertFalse($method->invoke($this->controller, 'invalid'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user