Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start multiple sprint in a single project #128

Open
surajheadsup opened this issue Jan 23, 2025 · 0 comments
Open

Unable to start multiple sprint in a single project #128

surajheadsup opened this issue Jan 23, 2025 · 0 comments
Assignees

Comments

@surajheadsup
Copy link

Image

As you can see in the image I am not able to start more than 1 sprint in a single project.

Requirement :
if multiple developers are working at a same time on multiple modules like

2 developer on users and 2 on dashbaord, then if I start 1 sprint and then try to start another sprint then older one gets closed.

I also tried to remove the start_sprint function but bot working.
old code

Tables\Actions\Action::make('start')
                    ->label(__('Start sprint'))
                    ->visible(fn($record) => !$record->started_at && !$record->ended_at)
                    ->requiresConfirmation()
                    ->color('success')
                    ->button()
                    ->icon('heroicon-o-play')
                    ->action(function ($record) {
                        $now = now();
                        Sprint::where('project_id', $record->project_id)
                            ->where('id', '<>', $record->id)
                            ->whereNotNull('started_at')
                            ->whereNull('ended_at')
                            ->update(['ended_at' => $now]);
                        $record->started_at = $now;
                        $record->save();
                        
                    }),

Tables\Actions\Action::make('start')
                    ->label(__('Start sprint'))
                    ->visible(fn($record) => !$record->started_at && !$record->ended_at)
                    ->requiresConfirmation()
                    ->color('success')
                    ->button()
                    ->icon('heroicon-o-play')
                    ->action(function ($record) {
  //either this or
                        $now = now();
                      
                        $record->started_at = $now;
                        $record->save();

//or this

                        $now = now();
$record->update(['started_at' => $now]);
                    }),

Both codes tried but not worked

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

No branches or pull requests

1 participant