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

Adding volunteer, ready-to-startinfo to organizer edit mission screen #613

Merged
merged 18 commits into from
May 22, 2020

Conversation

laredotornado
Copy link
Contributor

Based on this GitHub issue

#561

mission.status === MissionStatus.unassigned ||
mission.status === MissionStatus.tentative ||
mission.status === MissionStatus.assigned;

Copy link
Collaborator

Choose a reason for hiding this comment

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

outside of the class
const volunteerStatus = [MissionStatus.unassigned, MissionStatus.tentative, MissionStatus.assigned]
inside of the class
const volunteerEditable = volunteerStatus.includes(mission.status)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

selectedVolunteer && values.status === MissionStatus.tentative
? selectedVolunteer.volunteerPhoneNumber
: "",
readyToStart: values.readyToStart,
Copy link
Collaborator

Choose a reason for hiding this comment

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

const getVolunteerAttribute = (selectedVolunteer, status, attr) => {
    if(selectedVolunteer && status === MissionStatus.tentative){
        return selectedVolunteer[attr]
   }
   return ""
}

{...,
tentativeVolunteerUid = getVolunteerAttribute(selectedVolunteer, values.status, "volunteerUid")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to add one more param to the "getVolunteerAttribute" function but should capture what you are pointing out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It did not look as pretty as I had hope, my bad there, lets keep it for now

@mat10tng mat10tng merged commit ab021c2 into factn:master May 22, 2020
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.

2 participants