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

Ability to Edit Staff #9

Closed
jamalbrowning opened this issue Jul 14, 2020 · 0 comments
Closed

Ability to Edit Staff #9

jamalbrowning opened this issue Jul 14, 2020 · 0 comments
Assignees

Comments

@jamalbrowning
Copy link
Contributor

jamalbrowning commented Jul 14, 2020

User Story

As a user, I should be able to edit my spellin' mistakes on Staff.

AC

WHEN the logged-in user visits the Staff section of the site via the homepage
THEN they should see all of the current staff on display
AND there should also be a visible option to edit the staff
AND once they edit the item, it should be changed in the firebase database
AND they should see it change on the display when they hit the update button
AND if the user is not logged in, they should not see an option to edit

Dev Notes

  • use a const getStaff function and axios.get in staffData.js to obtain the staffId
  • easier option: use dataset or modal to bring up the edit form on the same page
  • challenge option: inline editing
  • create an editStaff.js file
  • use this function in the staffData.js file:
const updateStaff = (staffId, editedStaff) => axios.put(`${baseUrl}/staff/${staffId}.json`, editedStaff);
  • use bootstrap form to edit staff
<form>
  <div class="form-group">
    <label for="editStaff-name">Name</label>
    <input type="text" class="form-control" id="editStaff-name">
  </div>
  <div class="form-group">
    <label for="editStaff-jobTitle">Job Title</label>
    <input type="text" class="form-control" id="editStaff-jobTitle">
  </div>
<div class="form-group">
    <label for="editStaff-imageUrl">Image Url</label>
    <input type="text" class="form-control" id="editStaff-imageUrl">
  </div>
  <button type="submit" class="btn btn-primary" id="staff-editor">Update!</button>
</form>
  • use a click event to show the edit form that takes the staffId
  • use a click event to update the information from the edit form
@jamalbrowning jamalbrowning created this issue from a note in nutshell-elk (Requirements) Jul 14, 2020
@wcampbell91 wcampbell91 moved this from Requirements to To do in nutshell-elk Jul 14, 2020
@wcampbell91 wcampbell91 changed the title Edit functionality for staff Ability to Edit Staff Jul 14, 2020
@luketlancaster luketlancaster mentioned this issue Jul 14, 2020
4 tasks
@jamalbrowning jamalbrowning self-assigned this Jul 15, 2020
@jamalbrowning jamalbrowning moved this from To do to In progress in nutshell-elk Jul 18, 2020
@jamalbrowning jamalbrowning moved this from In progress to Review in nutshell-elk Jul 18, 2020
@jamalbrowning jamalbrowning moved this from Review to Done in nutshell-elk Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
nutshell-elk
  
Done
Development

No branches or pull requests

1 participant