As a user, I should be able to see all of the messages that have been posted to the message board by myself and all other users
Acceptance Criteria
GIVEN a user comes to the site
WHEN they look at the chat component
THEN they should see all messages from all users
GIVEN a user is viewing, or entering in chat messages
WHEN a new message is entered by any user, and there are more messages than can fit in the default size of the chat history
THEN the most recent message should always be made visible at the bottom of the chat history
Development
Create an events component messagesData.js file that is in src/javascripts/helpers/data
Create a function that passes in a uid and uses a promise and axios call to get all messages data in firebase
The array of objects that is resolved is a collection of all messages in firebase for all users
That array is then passed into a domStringBuilder for the messages that prints them to the page
The domStringBuilder should add a class to each message that causes messages to appear on either the right or left side of the chat window based on whether the message uid matches the current user id or not.
The domStringBuilder should show or hide 'delete' and 'edit' buttons based on the current user's uid
Take your domStringBuilder function and add it to the end of the create new message function
User Story
As a user, I should be able to see all of the messages that have been posted to the message board by myself and all other users
Acceptance Criteria
GIVEN a user comes to the site WHEN they look at the chat component THEN they should see all messages from all users GIVEN a user is viewing, or entering in chat messages WHEN a new message is entered by any user, and there are more messages than can fit in the default size of the chat history THEN the most recent message should always be made visible at the bottom of the chat history
Development