RC4Community icon indicating copy to clipboard operation
RC4Community copied to clipboard

[NEW] Announcement component

Open samad-yar-khan opened this issue 3 years ago • 1 comments

  • [x] I have read the Contributing Guide - https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat doc
  • [x] I have signed the CLA - https://cla-assistant.io/RocketChat/Rocket.Chat
  • [x] Lint and unit tests pass locally with my changes
  • [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
  • [x] I have added necessary documentation (if applicable)
  • [x] Any dependent changes have been merged and published in downstream modules

Issues

Mentioned in the issue #113

Proposed changes (including videos or screenshots)

  • Add New Announcement Component which can display relevant announcement on any page using a helper function - getAnnouncementData('announcement_code').
  • The component has been added to the layout and is only displayed when a relevant/published announcement is fetched using getAnnouncementData('announcement_code') code function and passed in the page props.
  • Added announcement collection type / schema to store announcements in the database.
  • Announcements have a publish_date and unpublish_date
    • Announcements are only displayed after the publish_date and before the unpublish_date
  • Added a deleteOldAnnouncemts() helper function as a cron job which will run once a day and will delete any announcements which are supposed to be unpublished depending on the date. This will ensure that unwanted announcements do not clutter the database.
  • At the time of data-initialization , the announcements in cms/config/initialData/announcemnets.json will populate the data base.

https://user-images.githubusercontent.com/70485812/160889912-0181fd56-e62d-416c-9c6d-0a92280bbc94.mp4

samad-yar-khan avatar Mar 30 '22 16:03 samad-yar-khan

@debdutdeb I have rebased the branch with the master branch and there are no more build errors. Build is not failing anymore 😅

samad-yar-khan avatar Apr 03 '22 10:04 samad-yar-khan