feat(tags): match add-tag modal to tauri design (preset swatches + active toggle)
- TagsSettingsPage modal: replace native color input with 4 preset swatches, add 'وضعیت برچسب' active toggle, update labels and submit button to mirror tauri AddPurchaseSubTabModal - TenantTagController::create now honors an optional 'active' flag (defaults true, non-breaking for existing callers) - tests: backend active-flag case, frontend preset-color + inactive case - docs/api/tag.md: document the new create 'active' field Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,24 @@ class TenantTagTest extends ApiTestCase
|
||||
self::assertCount(0, $after['data']);
|
||||
}
|
||||
|
||||
public function testCreateHonorsActiveFlag(): void
|
||||
{
|
||||
[$user] = $this->doctorUser();
|
||||
|
||||
// explicit active:false is persisted, not forced to the default true
|
||||
$created = $this->authJson('POST', '/api/v1/tenant-tag', $user, [
|
||||
'name' => 'بایگانی', 'color' => '#123456', 'active' => false,
|
||||
]);
|
||||
self::assertSame(201, $this->responseCode());
|
||||
self::assertFalse($created['data']['active']);
|
||||
|
||||
// omitting active still defaults to true
|
||||
$default = $this->authJson('POST', '/api/v1/tenant-tag', $user, [
|
||||
'name' => 'پیشفرض', 'color' => '#654321',
|
||||
]);
|
||||
self::assertTrue($default['data']['active']);
|
||||
}
|
||||
|
||||
public function testRejectsInvalidNameAndColor(): void
|
||||
{
|
||||
[$user] = $this->doctorUser();
|
||||
|
||||
Reference in New Issue
Block a user