Commit Graph

17 Commits

Author SHA1 Message Date
Simon Backx 492702304e Added basic newsletter creation test
refs https://github.com/TryGhost/Team/issues/1477

- Very basic test only
- Includes some extra test attributes in the components
- Commented out a test that was not yet fininished
2022-04-28 10:50:27 +02:00
Rishabh be4d3e82fe Added post and subscriber count to newsletters
- updates newsletter management to show count of posts and members for a newsletter
2022-04-26 13:10:16 +01:00
Rishabh 9706a82dd2 Updated newsletter management heading
- without the multiple newsletter UI flag, a site can have only one newsletter
- updates the heading for newsletter management UI to singular in that case
2022-04-26 13:10:16 +01:00
Rishabh ec3347f69b Added newsletter creation UI behind separate flag
Enables splitting of multiple newsletters backend and ability to add newsletters behind different flags. This allows release and testing of all the new backend behavior for multiple newsletters to work with the default newsletter, and later allow sites to create multiple newsletters.
2022-04-22 12:44:42 +05:30
Kevin Ansfield eb8f0cf5eb Added confirmation dialog when unarchiving a newsletter
closes https://github.com/TryGhost/Team/issues/1540
refs 3e51df1ca3

- follows same pattern as archiving
2022-04-20 13:15:45 +01:00
Kevin Ansfield 3e51df1ca3 Added confirmation dialog when archiving newsletter
closes https://github.com/TryGhost/Team/issues/1530

- added confirmation modal that uses passed in archive task when confirming to provide feedback on progress
- switched archive link from immediately triggering the archive task to an action that launches the confirm modal
2022-04-20 11:08:57 +01:00
Sanne de Vries 6bea7c8e8b Fixed horizontal position of dropdown menus in newsletter settings
Refs https://github.com/TryGhost/Team/issues/1525
2022-04-20 11:06:05 +01:00
Kevin Ansfield 905f37b0c5 Fixed interfering actions menus in newsletter management
no issue

When multiple newsletters existed, the actions dropdown menus were all rendered on top of each other but hidden with CSS. This resulted in clicks that you expected to open an actions menu immediately triggering actions on a newsletter higher up in the list.

- switched from `<GhDropdown>` to `<GhBasicDropdown>` which adds/removes the dropdown content elements rather than rendering everything and hiding with CSS
- updated styling to match previous implementation
- added `.anim-fade-in-scale` classes for use with `{{css-transition}}` so we can keep the open/close animation
  - `ember-basic-dropdown` does have support for transitioning in/out CSS classes but they are only triggered on the first open/close for each menu which resulted in oddly inconsistent behaviour with multiple menus in a list
  - close animation doesn't actually work because the outer elements are removed by `ember-basic-dropdown` preventing `css-transitions` from performing it's animation
2022-04-20 10:50:11 +01:00
Sanne de Vries 41b893abb5 Updated newsletter settings copy
Refs https://github.com/TryGhost/Team/issues/1525
2022-04-20 09:14:17 +01:00
Sanne de Vries 5b680a16e7 Updated newsletter modal
Refs https://github.com/TryGhost/Team/issues/1525
2022-04-19 12:31:16 +01:00
Sanne de Vries a66ff27847 Fixed archived description in Email newsletter settings
Refs https://github.com/TryGhost/Team/issues/1525
2022-04-18 11:11:51 +01:00
Sanne de Vries add0cfdc41 Added active and archived newsletter descriptions
Refs https://github.com/TryGhost/Team/issues/1525
2022-04-18 10:57:23 +01:00
Kevin Ansfield 43e7ef7fb4 Fixed moving border when hovering default newsletter
no issue

- when displaying only the default newsletter there's no option to drag/re-order but the border was still moving on hover as it does when displaying the drag handle
- updated the class name to take `displayingDefault` into account when adding the draggable class
2022-04-07 17:04:08 +01:00
Kevin Ansfield 72f8792b75 Added drag-and-drop sorting of newsletters
closes https://github.com/TryGhost/Team/issues/1483

- updated newsletters list to use `<SortableObjects>` and `<DraggableObject>`
- swapped the `filteredNewsletters` reactive getter for a tracked property because `<SortableObjects>` replaces the value with a new array when re-ordering which isn't compatible with a getter
  - required explicit update of the list any time the list should change through filter swap, archive, unarchive
  - required explicit update of the list via router event when leaving the "new newsletter" route so any newly added newsletter can be displayed
- added action for handling update of `sort_order` properties when a re-order occurs
  - updates every newsletter setting `sort_order` of the active newsletters first based on the new order, followed by all archived newsletters following their existing order
- disabled sorting of newsletters in the archived newsletters list
  - hides the grab handle and disables the resize on hover
  - allowing re-order of archived newsletters would complicate the re-order+save algorithm and re-ordering archived newsletters doesn't have a use-case
2022-04-07 16:42:50 +01:00
Kevin Ansfield b517f7a51b Wired up active/archived newsletter filter
closes https://github.com/TryGhost/Team/issues/1476

- added dropdown for switching between active and archived newsletters
- modified the "default" newsletter display so it's only activated when a single active newsletter is shown
- added ability to un-archive a newsletter with a switch between "archive" and "un-archive" actions based on newsletter status
  - if all archived newsletters are un-archived, automatically switches to "active" filter so you're not left with an empty list
2022-04-06 13:18:07 +01:00
Kevin Ansfield 1b7769b5d0 Wired up newsletter management with real newsletter model and API
refs https://github.com/TryGhost/Team/issues/1441

- switched "leave settings" confirmation modal on members email settings screen over to modern modal pattern
- removed unused `showEmailDesignSettings` property and `closeEmailDesignSettings()` action on `<Settings::MembersEmailLabs>` component
  - the used property and action live on the controller, looks like it was a copy/paste hangover when functionality was moved to a component
- added newsletter model
  - includes design-related attributes which are not yet supported by the API but are due to be added
  - includes `default` attribute but there is no setting for it, due to be removed from the API but it's needed for save not to error for now
  - set up basic mirage model and endpoints
  - added validation for main settings to match API validation
- added `EditNewsletter` modal
  - separate tabs for general newsletter settings and design-related settings
  - used for both creating and editing newsletters
- added `/settings/members-email/newsletters/new` and `/settings/members-email/newsletters/:id` routes
  - both display the `EditNewsletter` modal on top of the members-email settings screen with the appropriate newsletter model
- updated `<Settings::MembersEmailLabs::NewsletterManagement>` component to work with real newsletter model instances and the new add/edit routes
- removed now-unused `newsletter` service that was providing mocked data for earlier design iteration
2022-04-04 19:30:52 +01:00
Kevin Ansfield 73101da176 Extracted newsletter management section into separate component
refs https://github.com/TryGhost/Team/issues/1441

- pulls newsletter-related functionality into one place to keep higher-level components from knowing about too many concepts and becoming bloated
- updated temporary newsletters service to have fully tracked objects so the `active/archivedNewsletters` properties can be closer to how they will work with full models
2022-04-03 22:14:07 +01:00