minor fixes
This commit is contained in:
@@ -407,6 +407,7 @@ final class CreatorStudioContentService
|
||||
{
|
||||
$now = Carbon::now();
|
||||
$updatedAt = Carbon::parse((string) ($item['updated_at'] ?? $item['created_at'] ?? $now->toIso8601String()));
|
||||
$status = (string) ($item['status'] ?? '');
|
||||
$isDraft = ($item['status'] ?? null) === 'draft';
|
||||
$missing = [];
|
||||
$score = 0;
|
||||
@@ -441,6 +442,16 @@ final class CreatorStudioContentService
|
||||
default => 'Needs more work',
|
||||
};
|
||||
|
||||
$readiness = $status === 'published'
|
||||
? null
|
||||
: [
|
||||
'score' => $score,
|
||||
'max' => 4,
|
||||
'label' => $label,
|
||||
'can_publish' => $score >= 3,
|
||||
'missing' => $missing,
|
||||
];
|
||||
|
||||
$workflowActions = match ((string) ($item['module'] ?? '')) {
|
||||
'artworks' => [
|
||||
['label' => 'Create card', 'href' => route('studio.cards.create'), 'icon' => 'fa-solid fa-id-card'],
|
||||
@@ -466,13 +477,7 @@ final class CreatorStudioContentService
|
||||
'is_stale_draft' => $isDraft && $updatedAt->lte($now->copy()->subDays(3)),
|
||||
'last_touched_days' => max(0, $updatedAt->diffInDays($now)),
|
||||
'resume_label' => $isDraft ? 'Resume draft' : 'Open item',
|
||||
'readiness' => [
|
||||
'score' => $score,
|
||||
'max' => 4,
|
||||
'label' => $label,
|
||||
'can_publish' => $score >= 3,
|
||||
'missing' => $missing,
|
||||
],
|
||||
'readiness' => $readiness,
|
||||
'cross_module_actions' => $workflowActions,
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user