feat: replace notifications with import status in profile dropdown

Remove the notification system entirely and show import progress
directly in the user dropdown menu. Block new imports while one
is already running.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-31 21:34:05 +02:00
parent 3edde1c7db
commit 6a844542ad
12 changed files with 233 additions and 306 deletions

View File

@@ -33,4 +33,27 @@ class ImportRepository extends ServiceEntityRepository
['id' => $import->getId()]
);
}
public function findLatestForUser(\App\Entity\User $user): ?Import
{
return $this->createQueryBuilder('i')
->andWhere('i.user = :user')
->setParameter('user', $user)
->orderBy('i.createdAt', 'DESC')
->setMaxResults(1)
->getQuery()
->getOneOrNullResult();
}
public function hasActiveImport(\App\Entity\User $user): bool
{
return (int) $this->createQueryBuilder('i')
->select('COUNT(i.id)')
->andWhere('i.user = :user')
->andWhere('i.status IN (:statuses)')
->setParameter('user', $user)
->setParameter('statuses', [Import::STATUS_PENDING, Import::STATUS_PROCESSING])
->getQuery()
->getSingleScalarResult() > 0;
}
}