boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

Add features to more button on the student list component #214

Closed OlhaDorofiychuk closed 1 year ago

OlhaDorofiychuk commented 1 year ago

From TeacherCohortPage add possibility for the teacher to remove student from the cohort and change student cohort if needed.

When teacher clicks on more button on any student item popUp with 2 options appears:

### - Remove student from the cohort. Once clicked message 'You will remove student.first.Name + student.lastName from the cohort' and button confirm below.

OnClick on confirm we will send PATCH request with updated student details and user.cohortId set to null.

Updated details should look like below:

        "id": 12,
    "cohortId": null,
    "role": "STUDENT",
    "firstName": "Admin",
    "lastName": "Boolean",
    "email": "admin@admin.com",
    "biography": null,
    "githubUrl": null,
    "profileUrl": "https://images.takeshape.io/86ce9525-f5f2-4e97-81ba-54e8ce933da7/dev/2a6f37ce-a2f9-4f31-a854-b38c4412baac/819%20sand%20cat%20WC%20Cle%CC%81ment%20Bardot.jpeg?auto=compress%2Cformat&w=1200"
            }

When clicked on this option teacher will see field with current cohort assigned to this student (user.cohortId) and drop down(Select Cohort)

Teacher can choose another cohort from the drop down below ones another cohort selected and confirm button pressed, similar to the first option, onClick we will send PATCH request with value from the select element.

Once PATCH request sent for any of those options, we will do another clien.get() and update state. PopUp will be closed