Warn newer creators that uploads go through review first.

Show a level-based notice on /upload without revealing the internal approved-artwork threshold, and mention the usual 48-hour review window.
This commit is contained in:
test
2026-09-20 14:50:39 +02:00
parent 232880e01f
commit c247b8f652
2 changed files with 83 additions and 0 deletions
@@ -0,0 +1,20 @@
import React from 'react'
export default function UploadReviewNotice({ visible = false }) {
if (!visible) {
return null
}
return (
<div
role="status"
className="rounded-2xl border border-amber-400/25 bg-amber-500/10 px-4 py-3 text-sm text-amber-50 shadow-[0_14px_44px_rgba(245,158,11,0.08)]"
>
<p className="font-semibold text-amber-100">New creator uploads are reviewed first</p>
<p className="mt-1 leading-6 text-amber-100/80">
Because your account is still at a newer creator level, this upload will be reviewed before it appears on Skinbase.
If it meets our guidelines, it is usually published within 48 hours.
</p>
</div>
)
}
@@ -0,0 +1,63 @@
<?php
declare(strict_types=1);
use App\Models\Artwork;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Inertia\Testing\AssertableInertia as Assert;
uses(RefreshDatabase::class);
it('warns newer creators on the upload page without revealing the internal threshold', function (): void {
$user = User::factory()->create([
'role' => 'user',
'level' => 1,
'created_at' => now()->subYear(),
]);
$this->actingAs($user)
->get('/upload')
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('Upload/Index')
->where('requires_upload_review', true)
->missing('approved_uploads')
->missing('reasons'))
->assertDontSee('insufficient_approved_uploads', false)
->assertDontSee('minimum_approved_uploads', false);
});
it('does not show the new-creator review warning for trusted uploaders', function (): void {
$user = User::factory()->create([
'role' => 'user',
'level' => 1,
'created_at' => now()->subYear(),
]);
Artwork::factory()->for($user)->count(5)->create([
'is_approved' => true,
'is_public' => true,
'artwork_status' => 'published',
'published_at' => now()->subDay(),
'approval_source' => null,
]);
$this->actingAs($user)
->get('/upload')
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('Upload/Index')
->where('requires_upload_review', false));
});
it('does not show the new-creator review warning for admins', function (): void {
$admin = User::factory()->create(['role' => 'admin']);
$this->actingAs($admin)
->get('/upload')
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('Upload/Index')
->where('requires_upload_review', false));
});