Skip to content

when only one role available, autoselect it and continue to dashboard rightaway.#327

Open
paaton wants to merge 3 commits intostagingfrom
role-autoselect
Open

when only one role available, autoselect it and continue to dashboard rightaway.#327
paaton wants to merge 3 commits intostagingfrom
role-autoselect

Conversation

@paaton
Copy link
Collaborator

@paaton paaton commented Jul 29, 2025

No description provided.

Comment on lines +32 to +42
private ParticipantRepository $participantRepository,
private TroopParticipantRepository $troopParticipantRepository,
private PaymentService $paymentService,
private UserService $userService,
private FlashMessagesBySession $flashMessages,
private TranslatorInterface $translator,
private Mailer $mailer,
private SaveFileHandler $saveFileHandler,
private UploadFileHandler $uploadFileHandler,
) {
private PaymentService $paymentService,
private UserService $userService,
private FlashMessagesBySession $flashMessages,
private TranslatorInterface $translator,
private Mailer $mailer,
private SaveFileHandler $saveFileHandler,
private UploadFileHandler $uploadFileHandler,
)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zbytečně přidaný whitespace, není potřeba


if ($event->eventType->enforceActiveSkautisMembership()
&& $participant->getUserButNotNull()->loginType === UserLoginType::Skautis
&& !(bool)$participant->getUserButNotNull()->skautisHasMembership) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

komplikované přetypování, stačilo by porovnat s true třeba

Suggested change
&& !(bool)$participant->getUserButNotNull()->skautisHasMembership) {
&& $participant->getUserButNotNull()->skautisHasMembership !== true) {

Comment on lines +443 to +444
): AbstractContentArbiter
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zbytečně přidaný whitespace, není potřeba

Comment on lines +118 to +120
if (
$user->loginType === UserLoginType::Skautis &&
!$this->skautisService->isUserLoggedIn()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je tu bummer s tím, že se to nemusí použít jen na Korbo a je potřeba, aby to fungovalo i s eventy, kde je na přihlášení použitý email místo skautisu. Ale vlastně by to mělo jít celé smazat a mělo by to fungovat i s tím myslím

Comment on lines +141 to +145
$user->loginType === UserLoginType::Skautis &&
!$this->skautisService->isUserLoggedIn()
) {
$this->flashMessages->error('flash.error.skautisUserNotLoggedIn');
return $this->redirect($request, $response, 'landing');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potřeba zachovat přepoužitelnost i pro eventy, kde se přihlašuješ mailem. Smazal bych a bude fungovat OK myslím

Comment on lines +132 to +135

if ($user->loginType === UserLoginType::Skautis) {
$this->skautisService->prefillDataFromSkautis($participant);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto mega dává smysl. Nejradši bych sem přesunul logiku i z UserController, aby to mohlo být jen jednou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pokud je k dispozici pouze jedna role, rovnou ji vybrat a pokračovat na participant dashboard

2 participants