Skip to content

Siri Sudheeksha Vavila fix: CreateNewTeam actually submits form, assigns members, and redire…#5196

Open
sirisudheeksha wants to merge 2 commits intodevelopmentfrom
fix-create-team-redirect
Open

Siri Sudheeksha Vavila fix: CreateNewTeam actually submits form, assigns members, and redire…#5196
sirisudheeksha wants to merge 2 commits intodevelopmentfrom
fix-create-team-redirect

Conversation

@sirisudheeksha
Copy link
Copy Markdown
Contributor

@sirisudheeksha sirisudheeksha commented Apr 25, 2026

#Description

image

Fixes the Priority High bug where the Create Team flow redirects the user away instead of completing team creation and returning them to the team experience.

Before this change, submitting the Create Team form did not actually create a team. The frontend only logged the form payload and reset local state, so the user never got a valid success flow. This made the experience look like it was bouncing back to the dashboard or otherwise abandoning the create flow.

This PR updates the Create Team flow so that submitting the form now:

Creates the team through the existing team API.
Assigns the selected members to the newly created team.
Redirects the user to the teams page on success.
Shows a toast error if the API returns an error instead of silently failing.
Fixes #(Priority High bug: Create Team redirect creates dashboard instead of team)

#Related PRs (if any)
This frontend PR is not paired with a backend PR.
It uses the existing backend team creation and team-member assignment endpoints.

#Main changes explained
Update src/components/BMDashboard/Team/CreateNewTeam/CreateNewTeam.jsx to replace the placeholder submit behavior with the real create flow.

#Update summary:

Submit now dispatches the existing postNewTeam action instead of only logging form data.
After successful team creation, the selected users are assigned to the new team using the existing addTeamMember action.
On success, the user is redirected to /teams instead of being left in a broken flow.
On failure, the UI now shows a toast error with the API/server message when available.
Member options now refresh correctly after async profile data loads.
Assigned member badges now display human-readable member names instead of raw IDs.
The task badge remove action was corrected to remove tasks properly.

##How to test

  1. Check out the current branch:

  2. Install dependencies:

  3. Run the app locally:

  4. Clear site data/cache for the local app.

  5. Log in as an Owner or admin user.

  6. Go to:
    Team Management -> Team Locations -> Create Team

  7. Fill in the required fields

  8. Click Submit.

  9. Verify:

  • The team creation request succeeds.
  • The selected members are assigned to the newly created team.
  • The UI redirects to /teams not the dashboard.
  • If the team already exists or the API fails, an error toast is shown.
  • No console errors appear during submission.Description
  • Fixes the Priority High bug where the Create Team flow redirects the user away instead of completing team creation and returning them to the team experience.

Before:
image

image

After:

image image image

…cts to /teams

- Call postNewTeam action on submit instead of only logging
- Assign each selected member via addTeamMember after team creation
- Redirect to /teams on success; show toast error on failure
- Fix useEffect deps for members list (empty [] -> [userProfilesBasicInfo])
- Show member names in assigned-member badges instead of raw IDs
- Fix task badge remove handler (was calling handleRemoveMember(member) with undefined variable; now correctly calls handleRemoveTask(task))

Fixes: Create Team redirects to Dashboard instead of creating team (PR#3064)
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 25, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 93a719f
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69ec40fe72ad2b0008ed205e
😎 Deploy Preview https://deploy-preview-5196--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant