Commit Graph

4 Commits

Author SHA1 Message Date
Kevin Ansfield
4c0c5dcac6 Allowed Editor and Author roles to see email options when publishing
no issue

- there are no restrictions on Editor/Author emailing on the API side
- removed `user.canEmail` computed property as it's only contributors that don't have publish/email permissions and they aren't shown the publishing flow anyway
2022-05-12 12:47:45 +01:00
Kevin Ansfield
e1c7360075 Fixed errors in publish flow for users who don't have email permission
no issue

- roles that don't have email permissions also don't have permissions to read newsletters so we shouldn't attempt to fetch any during PublishOptions setup
2022-05-11 21:05:31 +01:00
Kevin Ansfield
6c079daafa Improved handling of missing member counts in publish flow
no issue

Only Admins/Owners can browse members to get member counts but Editors/Authors are allowed to send email. This means we need to account for the count figures being missing.

- added guard to the total member count fetch in `PublishOptions`
  - guard needed because the failed API request would abort setup
  - when the current user isn't an admin, set the total member count to 1 to avoid email options being disabled
- added guard in the `{{members-count-fetcher}}` resource so we're not triggering API errors and the count is kept as `null` so it's handled automatically if passed to `{{gh-pluralize}}`
- updated `<GhMembersRecipientSelect>` to not show counts (or the surrounding `()`) when the count is `null`
2022-05-11 18:56:29 +01:00
Kevin Ansfield
e852c29699 Extracted PublishOptions class into separate file
no issue

- `PublishOptions` was exported from the `<EditorLabs::PublishManagement>` component as a convenience when development started but both have now grown in size and are easier to read as separate files
2022-05-11 17:51:53 +01:00