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

Add site-level announcements to OJS #9253

Closed
NateWr opened this issue Aug 23, 2023 · 26 comments
Closed

Add site-level announcements to OJS #9253

NateWr opened this issue Aug 23, 2023 · 26 comments
Assignees
Labels
Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days.
Milestone

Comments

@NateWr
Copy link
Contributor

NateWr commented Aug 23, 2023

Describe the problem you would like to solve
Multi-journal instances of OJS want to be able to add announcements at the site-level.

Describe the solution you'd like
Add announcements to the admin settings area, so that administrators can add, edit and delete announcements that appear on the site-wide homepage.

The ability to view the latest announcements will be added to the homepage in the default theme. Each site-level announcement will have its own page.

Who is asking for this feature?
This is part of sponsored development work for a PKP|PS client, UNIANDES, who will use this feature in their custom theme.

Implementation

This feature is hidden behind a config flag for 3.4.x and requires a migration to be run manually. Follow these steps to test:

  1. Check out the PRs.
  2. Add the following to the bottom of your config.inc.php file.
[features]
site_announcements = On
  1. Run the following command to run the migration.
php lib/pkp/tools/migration.php \\PKP\\migration\\upgrade\\v3_5_0\\I9253_SiteAnnouncements up
  1. Login as an admin.
  2. Go to Administration > Hosted Journals and make sure there are two or more journals.
  3. Go to Administration > Site Settings > Announcements.
  4. Click the checkbox to enable announcements and enter a positive number in the Display on Homepage field.
  5. Click the Save button.

Notes:

  • When an announcement is sent at the journal level, an email is sent to all users who have subscribed to the journal's announcements. No emails are sent for announcements at the site level because users can not subscribe or unsubscribe to these announcements.
  • This PR changes how announcements are ordered in the backend and frontend. Now they are shown with the latest first, by date_posted in descending order.
  • This PR fixes a small visual bug in the list of announcements, due to a CSS override, that caused extra padding on the page that lists announcements.
  • This only adjusts the default theme. Other themes would need to be modified separately to support this feature.
  • This PR also adds support for a featured image with each announcement.

PRs:

stable-3_4_0:
#9255
pkp/ui-library#283
pkp/ojs#4023

main:
#9260
pkp/ui-library#284
pkp/ojs#4028

@NateWr NateWr added the Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. label Aug 23, 2023
@NateWr NateWr self-assigned this Aug 23, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 24, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 24, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 24, 2023
@NateWr NateWr changed the title Add site-wide announcements to OJS Add site-level announcements to OJS Aug 24, 2023
NateWr added a commit to NateWr/ojs that referenced this issue Aug 24, 2023
@NateWr
Copy link
Contributor Author

NateWr commented Aug 24, 2023

The following PRs add support for announcements at the site level to the stable-3_4_0 branch. Once approved, I will port to the other apps and to the main branch. @asmecher can someone review this?

#9255
pkp/ojs#4023
pkp/ui-library#283

This feature is hidden behind a config flag for 3.4.x and requires a migration to be run manually. Follow these steps to test:

  1. Check out the PRs.
  2. Add the following to the bottom of your config.inc.php file.
[features]
site_announcements = On
  1. Run the following command to run the migration.
php lib/pkp/tools/migration.php \\PKP\\migration\\upgrade\\v3_5_0\\I9253_SiteAnnouncements up
  1. Login as an admin.
  2. Go to Administration > Hosted Journals and make sure there are two or more journals.
  3. Go to Administration > Site Settings > Announcements.
  4. Click the checkbox to enable announcements and enter a positive number in the Display on Homepage field.
  5. Click the Save button.

Notes:

  • When an announcement is sent at the journal level, an email is sent to all users who have subscribed to the journal's announcements. No emails are sent for announcements at the site level because users can not subscribe or unsubscribe to these announcements.
  • This PR changes how announcements are ordered in the backend and frontend. Now they are shown with the latest first, by date_posted in descending order.
  • This PR fixes a small visual bug in the list of announcements, due to a CSS override, that caused extra padding on the page that lists announcements.
  • This only adjusts the default theme. Other themes would need to be modified separately to support this feature.

NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 24, 2023
@asmecher
Copy link
Member

Reviews added -- thanks, @NateWr!

NateWr added a commit to NateWr/ui-library that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 25, 2023
NateWr added a commit to NateWr/ojs that referenced this issue Aug 25, 2023
@NateWr
Copy link
Contributor Author

NateWr commented Aug 25, 2023

Thanks @asmecher! I've made the change from CONTEXT_SITE_ID to null for site-level announcements and addressed your other comments. I also added a missing PR for ui-library -- just a small adjustment to show/hide stuff when announcements are enabled/disabled at the site level. There's just one unresolved comment regarding the interface for Site/Context classes.

Can you review this again when you have a moment?

@asmecher
Copy link
Member

asmecher commented Aug 25, 2023

Looks good, @NateWr -- would you like this merged now, or would you rather do the porting to main first?
[edit: Looks like it'll need a minor amount of porting to the other apps too.]

NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 28, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 28, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 28, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 28, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 28, 2023
NateWr added a commit to NateWr/pkp-lib that referenced this issue Aug 28, 2023
@NateWr
Copy link
Contributor Author

NateWr commented Nov 3, 2023

@asmecher thanks, Jarda resolved that quickly yesterday. I've now got main ports for all apps and everything is passing. All PRs are ready to merge here: #9253 (comment)

asmecher pushed a commit that referenced this issue Nov 8, 2023
asmecher pushed a commit to pkp/ui-library that referenced this issue Nov 8, 2023
* pkp/pkp-lib#9253 Add site-level announcements

* pkp/pkp-lib#9253 Use URL in announcement properties
asmecher pushed a commit to pkp/ojs that referenced this issue Nov 8, 2023
asmecher pushed a commit to pkp/ui-library that referenced this issue Nov 8, 2023
* pkp/pkp-lib#9253 Add site-level announcements

* pkp/pkp-lib#9253 Use URL in announcement properties

* pkp/pkp-lib#9253 Fix AnnouncementsListPanel after rebase
asmecher pushed a commit that referenced this issue Nov 8, 2023
* #9253 Add site-level announcements

* #9253 Fix type error in announcement helper function

* #9253 Use shorter syntax to filter array

* #9253 Use null to associate announcements with the site

* #9253 Move shared announcements template into pkp-lib

* #9253 Fix URL in announcement API responses

* #9253 Add featured image to site announcements

* #9253 Fix error when adding announcement

* #9253 Fix unwanted file deletion when editing announcement

* #9253 Add image to default announcement templates

* #9253 Make context nullable in announcements install migration

* #9253 Require User when handling announcement image upload

* Fix exception name

* Refactor to new Controllers

* #9253 Fix duplicate method name after rebase

* #9253 Fix announcements API handler after rebase

* #9253 Check image validity when creating announcement
asmecher pushed a commit to pkp/ojs that referenced this issue Nov 8, 2023
asmecher pushed a commit to pkp/ops that referenced this issue Nov 8, 2023
asmecher pushed a commit to pkp/omp that referenced this issue Nov 8, 2023
@asmecher
Copy link
Member

asmecher commented Nov 8, 2023

All merged or cherry-picked, @NateWr! Can this be closed?

@asmecher asmecher added this to the 3.4.0-4 milestone Nov 8, 2023
@NateWr NateWr closed this as completed Nov 9, 2023
ipula pushed a commit to ipula/pkp-lib that referenced this issue Dec 4, 2023
* pkp#9253 Add site-level announcements

* pkp#9253 Fix type error in announcement helper function

* pkp#9253 Use shorter syntax to filter array

* pkp#9253 Use null to associate announcements with the site

* pkp#9253 Move shared announcements template into pkp-lib

* pkp#9253 Fix URL in announcement API responses

* pkp#9253 Add featured image to site announcements

* pkp#9253 Fix error when adding announcement

* pkp#9253 Fix unwanted file deletion when editing announcement

* pkp#9253 Add image to default announcement templates

* pkp#9253 Make context nullable in announcements install migration

* pkp#9253 Require User when handling announcement image upload

* Fix exception name

* Refactor to new Controllers

* pkp#9253 Fix duplicate method name after rebase

* pkp#9253 Fix announcements API handler after rebase

* pkp#9253 Check image validity when creating announcement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days.
Projects
None yet
Development

No branches or pull requests

4 participants