I have access to fixtures, components and storybook stories for a form and table for Announcements
So that I can build future features for the Announcements table
Acceptance Criteria:
[ ] There is a form component for announcements suitable for crud operations (similar to team03 form components, but with a nice large text area for the announcement text.) Note that the commonsId is not part of the form; it will be set implicitly.
[ ] There is a table component for announcements (similar to team03 table components) Note that the commonsId is not part of the table component; it will be the same for all entries in the table, so we will put it at the top of the page separately.
[ ] There are fixtures that match the format of the GET operations for the API endpoints being worked on in the second issue. Note that the fixtures should be organized so that each set of announcements is for a single commons, since we only ever work with the announcements for one commons at at time, even though in the database they are all stored in the same database able.
[ ] There are storybook entries for the form and table components. Note that the storybook entries for the table should focus on one commons at a time (see discussion above under fixtures).
I can create, read, update and destroy announcements for a user commons
So that I can communicate important information to the users (farmers)
Acceptance Criteria:
[ ] On the Admin Commons List page, there is a button next to the current buttons for Edit | Delete | Leaderboard | Stats CSV called Announcements that takes you to an index page with the url /admin/announcements/{commonsId} that shows a table containing the announcements for just that one commons.
[ ] The page at /admin/announcements/{commonsId} should have a header that indicates which something like "Announcements for
[ ] On the This page should include the name of the commons in the header so that the user knows which commons announcements are being created for.
[ ] The Announcements Index page has a Create Announcement button that takes you to a page /admin/announcements/{commonsId}/create where you can create a new announcement for the commons identified by {commonsId}.
[ ] On the Create Announcement page at /admin/announcements/{commonsId}/create, the commonsId field is not entered by the user, but is implicitly set; it will come from the {commonsId} in the url via the useParams hook.
[ ] The page header at /admin/announcements/{commonsId}/create, should show the name of the commons. For example, if the name of the commons is Summer Meadows 123 the page should say something like Create Announcement for Commons Summer Meadows 123, with appropriate line breaks.
[ ] The Delete button on the index page should work, or else it should be removed and factored out into a separate issue.
[ ] The Edit button on the index page should work, or else it should be removed and factored out into a separate issue.
[ ] Making the announcements actually appear on the Commons Page page is not part of this issue; that's separate.
Note: Additional issues if not done as part of Issue F2 (defining the user stories and acceptance criteria is left as an exercise to the student):
Issue F2a: Edit button added to Index page (if not done as part of Issue F2).
Issue F2b: Delete button added to index page (if not done as part of Issue F2)
Issue F3: Frontend Make Announcements appear on Play Page
User stories:
As an admin
I can post messages that the users will see
So that I can communicate important information to game players
As a user (game player, farmer)
I can see important announcements about game play
So that I can see what's happening in the game
Note that you may want to implement a different component for announcements for the play page, perhaps based on the react component. See the way the commons cards are implemented on the HomePage as an example.
It's important that the announcements are clear, but also don't clutter up the play page too much.
If needed, you could make a component that shows, by default, only the first line of the text, and then has a place to click to see the full announcement, and then click to restore the compacted view. React offers a variety of ways to accomplish this; you may use your creativity. Don't get too fancy though; remember that this is intended to be a "minimum viable product" for announcements. Future functionality might include keeping track, for each individual user, which announcements they have seen or not seen, and differentiating new announcements from ones that have already been seen, using modals to alert the user about new announcements, but that's all for the future. Keep it simple in your first implementation, and then if there's time, you can propose additional issues to get fancier.
Acceptance Criteria:
[ ] Announcements that have both a start and end specified appear at the top of the commons play page as long as the current date/time falls on or after the start date/time for the announcement, and is before the end date/time (if one is specified).
[ ] Announcements that have no end specified appear at the top of the commons play page as long as the current date/time falls on or after the start date/time.
[ ] The format of the announcements is clear and doesn't clutter up the play page too much.
Implementation Todos
Frontend:
[ ] Buttons have been added in the correct places
[ ] Headers have been modified as intended
[ ] Modify frontend code to display announcements
Testing:
[ ] Front end tests pass and there is adequate coverage
Discussion
Issue F1: fixtures/components for announcements
Developer Story:
Acceptance Criteria:
Issue F2: Frontend Create. Read operations for announcements (and optionally Edit, Delete)
User story:
Acceptance Criteria:
/admin/announcements/{commonsId}
that shows a table containing the announcements for just that one commons./admin/announcements/{commonsId}
should have a header that indicates which something like "Announcements for/admin/announcements/{commonsId}/create
where you can create a new announcement for the commons identified by {commonsId}./admin/announcements/{commonsId}/create
, the commonsId field is not entered by the user, but is implicitly set; it will come from the {commonsId} in the url via the useParams hook./admin/announcements/{commonsId}/create
, should show the name of the commons. For example, if the name of the commons is Summer Meadows 123 the page should say something like Create Announcement for Commons Summer Meadows 123, with appropriate line breaks.Note: Additional issues if not done as part of Issue F2 (defining the user stories and acceptance criteria is left as an exercise to the student):
Issue F2a: Edit button added to Index page (if not done as part of Issue F2).
Issue F2b: Delete button added to index page (if not done as part of Issue F2)
Issue F3: Frontend Make Announcements appear on Play Page
User stories: As an admin
As a user (game player, farmer)
Note that you may want to implement a different component for announcements for the play page, perhaps based on the react component. See the way the commons cards are implemented on the HomePage as an example.
It's important that the announcements are clear, but also don't clutter up the play page too much.
If needed, you could make a component that shows, by default, only the first line of the text, and then has a place to click to see the full announcement, and then click to restore the compacted view. React offers a variety of ways to accomplish this; you may use your creativity. Don't get too fancy though; remember that this is intended to be a "minimum viable product" for announcements. Future functionality might include keeping track, for each individual user, which announcements they have seen or not seen, and differentiating new announcements from ones that have already been seen, using modals to alert the user about new announcements, but that's all for the future. Keep it simple in your first implementation, and then if there's time, you can propose additional issues to get fancier.
Acceptance Criteria:
Implementation Todos
Frontend:
Testing: