As a user, I should be able to list interesting news articles on my dashboard
Acceptance Criteria
CREATE:
GIVEN a user wants to record a news article on their dashboard
WHEN the user performs a gesture on a New Article affordance
THEN a form should be presented to the user in which the following information can be entered
News title
Synopsis
URL
GIVEN a user has entered in all field values for storing a new article
WHEN the user performs a gesture on the Save Article affordance
THEN the article should be saved in the database, and assigned to the user
READ:
GIVEN a user has saved news articles
WHEN the user visits their dashboard
THEN the news articles should be presented in the News components
AND the user should only see articles that belong to their uid.
UPDATE:
GIVEN a user wants to update a news article
WHEN the user performs a gesture on the edit affordance
THEN a form should be presented to the user
AND all the information for the article should pre-populate in the form
AND after the user edits the information and pushes a 'Save Article' button the data should update in firebase
DELETE:
GIVEN a user wants to remove a previously stored news article
WHEN the user performs a gesture on the delete affordance
THEN the article should be deleted
DEV NOTES
create a newsData file containing a promise to getNewsByUid via axios.get the apiKeys
Object.keys(newsResults).forEach((storyId) => to push the object id results into a newsarray,
and resolve the array
addStory = newsObject => axios.post
deleteStory = storyId => axios.delete
editStory = storyId => axios.put
create a news.js file to newsBuilder = (uid) => the data from newsData.getNewsByUid
include edit, save and delete buttons in the newsBuilder with id="storyId"
add an input form with saveButton for news stories to be added: newsTitle, imageUrl, and synopsis
add eventListeners to saveButton to call newsData.addStory
add eventListeners to deleteStory buttons to call newsData.deleteStory
add eventListeners to editStory buttons to call newsData.editStory
User Story
As a user, I should be able to list interesting news articles on my dashboard
Acceptance Criteria
CREATE:
GIVEN a user wants to record a news article on their dashboard WHEN the user performs a gesture on a
New Article
affordance THEN a form should be presented to the user in which the following information can be enteredGIVEN a user has entered in all field values for storing a new article WHEN the user performs a gesture on the
Save Article
affordance THEN the article should be saved in the database, and assigned to the userREAD:
GIVEN a user has saved news articles WHEN the user visits their dashboard THEN the news articles should be presented in the
News
components AND the user should only see articles that belong to their uid.UPDATE:
GIVEN a user wants to update a news article WHEN the user performs a gesture on the edit affordance THEN a form should be presented to the user AND all the information for the article should pre-populate in the form AND after the user edits the information and pushes a 'Save Article' button the data should update in firebase
DELETE:
GIVEN a user wants to remove a previously stored news article WHEN the user performs a gesture on the delete affordance THEN the article should be deleted
DEV NOTES
newsData
file containing a promise togetNewsByUid
viaaxios.get
theapiKeys
Object.keys(newsResults).forEach((storyId) =>
to push the object id results into anews
array, and resolve the arrayaddStory = newsObject => axios.post
deleteStory = storyId => axios.delete
editStory = storyId => axios.put
news.js
file tonewsBuilder = (uid) =>
the data fromnewsData.getNewsByUid
edit
,save
anddelete
buttons in thenewsBuilder
withid="storyId"
saveButton
for news stories to be added:newsTitle
,imageUrl
, andsynopsis
saveButton
to callnewsData.addStory
deleteStory
buttons to callnewsData.deleteStory
editStory
buttons to callnewsData.editStory