feat(editorial): separate cluster analysis approval and publication in QA
This commit is contained in:
@@ -31,8 +31,17 @@ class InvestmentStructureController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
return Inertia::render('structures/index', ['structure' => $structure, 'filters' => $filters,
|
||||
'records' => $query->orderBy('name')->orderBy('id')->paginate(20)->withQueryString()]);
|
||||
$records = $query->orderBy('name')->orderBy('id')->paginate(20)->withQueryString();
|
||||
if ($structure === 'clusters' && app(ClusterCompetitiveness::class)->editorialEnabled()) {
|
||||
$records->through(function ($record) {
|
||||
$analysis = app(ClusterCompetitiveness::class)->current($record->id);
|
||||
$record->setAttribute('editorial_state', $analysis['workflow']['state'] ?? ($analysis['approved'] ? 'legacy_published' : 'not_started'));
|
||||
|
||||
return $record;
|
||||
});
|
||||
}
|
||||
|
||||
return Inertia::render('structures/index', ['structure' => $structure, 'filters' => $filters, 'records' => $records]);
|
||||
}
|
||||
|
||||
public function edit(Request $request, string $structure, ?string $id = null): Response
|
||||
|
||||
Reference in New Issue
Block a user