1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Commit graph

831 commits

Author SHA1 Message Date
Fabien 'egg' O'Carroll 3e21c21d12
Updated labs to use new mailgun_* settings (#1628)
refs https://github.com/TryGhost/Ghost/issues/10318

This removes references to the old bulk_email_settings
2020-07-03 11:48:54 +02:00
Fabien 'egg' O'Carroll 7517373176
Added basic handling for invalid plan amount (#1625)
refs https://github.com/TryGhost/Ghost/issues/11765

Adds handling to disallow plans of less than 1

Co-authored-by: Matt Hanley <3798302+matthanley@users.noreply.github.com>
2020-07-03 10:36:59 +02:00
Nazar Gargol ba34621564 Added field mapping column to members importer gird
no issue

- Adds UI to map imported csv fields to ones accepted by Ghost API
- Includes automatic mapping detection for emails and stripe_customer_ids
2020-07-03 16:54:21 +12:00
Matt Hanley 4e9c741b74
🐛 Fixed missing currency for yearly plan in Labs subscription price settings (#1626)
no-issue
2020-07-02 12:36:32 +02:00
Kevin Ansfield a0370eeea5 Improved scheduled status text in posts list
closes https://github.com/TryGhost/Ghost/issues/11965

- fixes scheduled posts always showing "and sent"
- updates status text to match that shown in the editor for scheduled posts
2020-07-01 20:37:46 +01:00
Kevin Ansfield e9fe7eec40 Converted <GhPostsListItem> to glimmer component
no issue

- moved tag name and classes into template
- updated backing class to native class syntax
2020-07-01 20:37:46 +01:00
Kevin Ansfield 2f0676e2cc Refactored <GhPostsListItem>
no issue

- moved `primaryTag` CP into the post model as per `primaryAuthor`
- removed all unnecessary or unused CPs in the component's backing class
- switched to using `@post` for direct argument access rather than `this.post`
2020-07-01 20:37:46 +01:00
Kevin Ansfield 1b09a946f4 Improved scheduled status text shown in editor
refs https://github.com/TryGhost/Ghost/issues/11965

- always show scheduled time when a post is scheduled
- show when a post will be emailed and to which group of members
2020-07-01 14:07:52 +01:00
Peter Zimon b0bfc7b459 Refined styles and copy for member import dialog
no refs.
- refined copy for Stripe warnings for members import pre-validation
- updated styles for data preview for dark mode
2020-07-01 07:24:10 +02:00
Fabien O'Carroll d9e8a21727 Fixed stripe disconnect not working with new settings
refs #10318
2020-06-30 18:27:13 +02:00
Fabien O'Carroll 8ffcb9ee23 Updated to remove stripe_connect_integration references
refs #10318
2020-06-30 11:50:43 +02:00
Rish 1c886d56a1 Fixed incorrect from address check for button
refs https://github.com/TryGhost/Ghost/issues/10318

- The check for disabled update button for from address was reversed in this commit - eea43963a1
- This updates the check to correctly validate for from address update for disabling the button
2020-06-30 12:16:48 +05:30
Rish 41ce723a43 Refined email newsletter error messages
refs https://github.com/TryGhost/Ghost/issues/11971

- Updates error messages incorrectly pointing to invalid mailgun config to show more generic error
- Needs to be updated to point to correct error message in future
2020-06-30 11:57:18 +05:30
Fabien 'egg' O'Carroll eea43963a1
Refactored to use updated members and stripe settings (#1621)
refs #10318

* Updated settings model with new settings

* Removed parseSubscriptionSettings from settings service

* Updated members-utils to use new settings

* Updated labs controller to use new settings

* Fixed dependency for member-settings-form

* Updated members-lab-setting component to use new settings

* Updated disconnect modal to use new settings

* Updated members portal modal to use new settings

* Removed Direct from settings

* Renamed members_allow_signup -> members_allow_free_signup

* Allowed for null fromAddress
2020-06-29 19:37:11 +02:00
Rishabh Garg 8f609bd4b2
Added live preview to members settings modal (#1622)
no issue

- Adds live preview of members.js modal UI to the new settings modal behind dev flag
- Uses `gh-site-iframe` to render site in preview mode with custom portal url
2020-06-26 02:15:47 +05:30
Kevin Ansfield 3da8815759 Renamed activeTimezone setting to timezone
refs https://github.com/TryGhost/Ghost/issues/10318

- API has been updated to still work with `active_timezone` for backwards compatibility but it makes sense for the client to match the underlying settings keys
2020-06-24 15:34:59 +01:00
Fabien 'egg' O'Carroll 93720eae97
Disconnect Stripe Connect integration (#1613)
no-issue

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>

This adds the ability to disconnect the Stripe Connect integration from the Members settings.
2020-06-23 13:29:12 +02:00
Rish 685cf37490 🐛 Fixed staff profile editing incorrectly showing saved state
closes https://github.com/TryGhost/Ghost/issues/11866

- Adds extra check to task button states if the last task ran was same as the current associated task
- In case of task groups, triggering one task in group also triggered states for other tasks in group
- Editing slug called `updateSlug` task which is part of the same task group as `save` task, which triggered the state for save button
2020-06-22 17:09:37 +05:30
John O'Nolan 4865093284 Updated email newsletter config instructions
Added link to explain why Mailgun is required, and the different types of emails within Ghost
2020-06-22 13:47:45 +07:00
Peter Zimon 86856f57af Added scrolling to members import preview table
no issues.
- adds scrolling to import table
- adds shadow to top and bottom if the table is taller than the viewport
2020-06-19 19:43:12 +02:00
Kevin Ansfield 312b9fb4e1 Added first pass bulk members delete confirmation and results display
no issue

- display a confirmation modal when bulk deleting members
- hit the `DELETE /members/?all=true` endpoint when confirming
- show counts of members deleted/skipped
- fix selection reset when leaving edit mode
2020-06-19 18:14:41 +01:00
Rishabh Garg 1902389757
Added new modal settings behind dev flag (#1615)
no issue

depends on 77e1ada6c6

- reverts commit c46fcec with modifications for naming
- Adds new portal settings UI in Labs -> Members setting
- Allows customization of new portal-* settings upstream
- Updates settings service to include portal group
- Updates settings modal to include new portal-* settings
2020-06-19 21:36:49 +05:30
Kevin Ansfield 29bed994ff Moved members bulk delete confirmation into a modal 2020-06-19 14:14:39 +01:00
Kevin Ansfield 4b23a2f204 Switched members links to use default cursor when in edit mode 2020-06-19 13:08:02 +01:00
Rish 0e6d5fbbdc 🐛 Added tags sidebar navigation for editors
closes https://github.com/TryGhost/Ghost/issues/11882

- Editors have all the same permissions and access to tags as Owner/Admin roles, but had the sidebar navigation for tags missing
- Adds "Tags" to sidebar for Editor roles same as Owner/Admin
2020-06-19 11:39:05 +05:30
Rish c46fcec5b2 Revert "Added new members modal settings behind dev flag (#1611)"
This reverts commit c86a01b675.
2020-06-18 19:05:06 +05:30
Peter Zimon 0b59628f85 Refined member import result screen
no issues.
- puts back file icon preview when not in dev. experiment
- refines generic style of member import result screen
2020-06-18 15:24:08 +02:00
Rish 0e55590360 🐛 Fixed incorrect save warning on design settings
closes https://github.com/TryGhost/Ghost/issues/11590

- Dirty attribute flag was set incorrectly on focus out from label/url fields as no check with existing was used
- Checks against existing nav item value before setting dirty attribute on focus out
2020-06-18 17:46:18 +05:30
Rishabh Garg c86a01b675
Added new members modal settings behind dev flag (#1611)
no issue

- Adds new modal settings option in members settings
- Allows customization of modal settings for membersjs
- Uses new `memebrsjs_*` settings from core
2020-06-18 17:15:19 +05:30
Kevin Ansfield 10f047e6ed Disabled members list links whilst editing
no issue

- these will eventually toggle selection of individual members when clicked whilst in editing mode
2020-06-18 11:42:06 +01:00
Kevin Ansfield 0f587a90d0 Added rough "edit mode" for members table behind dev flag
no issue

- initial UI for bulk-selection, focusing for now on first stage which is limited to select-all and delete actions
- adds "Edit" button to the members table that shows the "selection" toolbar in place of the table header and shows a checkbox next to each member
2020-06-18 11:08:53 +01:00
Peter Zimon c9ae3fcd08 Refined members import data table design
no issues.
- refined style for members import preview table
2020-06-18 11:33:34 +02:00
Peter Zimon 823437c1a6 Refined pre-validation of members import
no issues.
- removes email and Stripe duplicate customer ID check to focus validation that might affect the whole dataset
- applies visual style and refines copy
2020-06-18 10:30:15 +02:00
Nazar Gargol b28a25a64e Added imported members csv data preview
no issue

- Adds a table representation of data present in a CSV file that is about to be imported. Allows to navigate through data to see how exactly the file would be parsed on server
2020-06-18 17:47:04 +12:00
Kevin Ansfield a6fe448512 Fixed multiple no-shadow linting errors 2020-06-17 09:35:46 +01:00
Peter Zimon ba00aa6e05 Updated members import validation warning design
no issues.
- changed warning style when import can still happen
- combines all warnings to a single section
- hides details for warnings behind an expandable list so that
- updated copy
2020-06-16 19:08:37 +02:00
Nazar Gargol c666cbbed8 Renamed members import/export endpoints to match API changes
refs 5f00619d1a
2020-06-16 18:13:06 +12:00
Kevin Ansfield e8336b847d Fixed stripe connect persistent button and "unsaved changes" warnings
no issue

- hook template up directly to the `settings.stripeConnectIntegrationToken` value
- reset `settings.stripeConnectIntegrationToken` when leaving the labs route
  - without the reset, after a failed save other settings screens will show the "unsaved changes" warning
2020-06-15 17:43:02 +01:00
Peter Zimon 99788c25d1 Made save Stripe settings button dynamic
no issues.
- shows/hides the "Save Stripe settings" button depending on the token value. This allows better focus and less distraction UX
2020-06-15 17:57:46 +02:00
Kevin Ansfield 388053dfd4 Updated image card to store original width/height in payload
no issue

- extract width/height from selected local image when uploading and store in the payload with `src` once upload finishes
- capture width/height from Unsplash and store in the payload after selecting an image
2020-06-15 13:16:37 +01:00
Nazar Gargol d13a38c1e3 Hidden member import validation messages bahind the experiments flag
refs e9cae26ed4

- The feature still needs polishing UI side and will move out of `enableDeveloperExperiments` flag once that's ready
2020-06-15 22:42:56 +12:00
Hannah Wolfe a4a892a93e Adding INR currency support
- We have many customers asking for INR as there are special rules in Stripe for this currency
- As well as a desire for local-selling
- Meaning it's not valid to use e.g. USD instead
2020-06-12 15:17:22 +01:00
Nazar Gargol ef59dbf74d Added imported member count to the "Import" button
no issue

- When importing members from CSV file this change shows total amount of members that will attempt to be imported
2020-06-13 00:51:19 +12:00
Kevin Ansfield d94f4a436a 🐛 Fixed file inputs not allowing same file to be re-uploaded in Firefox
closes https://github.com/TryGhost/Ghost/issues/11707

- Firefox is different to every other browser and doesn't allow file input values to be reset by doing `input.value = null`
- outcome of reset not working is that Firefox won't trigger the change event when the same file is re-selected
- fixed by cloning the input element and replacing it
2020-06-12 13:45:28 +01:00
Kevin Ansfield 67d195179f
Added all/free/paid filter to members admin screen (#1600)
requires https://github.com/TryGhost/Ghost/pull/11892

- adds `?paid` query parameter to members route that is tied to the `?paid` query param in the API request
- added all/free/paid members dropdown to members filter component
2020-06-12 12:12:27 +01:00
Nazar Gargol e443368d0d Updated import results response handling with new error format
refs 7904c303a7

- Adds failed import records details to post members import screen
2020-06-12 20:01:46 +12:00
Nazar Gargol e9cae26ed4 Added improved validations for 2nd step of members import
no issue

- Adds validations for imported CSV data
- These checks include obvious validation checks for data - like if email addresses are valid, checking if Stripe configured when entries with stripe_customer_id are present and additional server-side validation for entries with stripe_customer_id to check if they appear in connected Stripe account
- The validation set is calculated by naive choosing of first 5, middle 5 and 5 tail records from imported set. This logic comes from observations that errors usually apear withing "test" records in the beggining or the end of the file. These selection rules might change in the future if we find a need for it.
- Adds papaparse CSV parser, which was chosen for it's maturity and relatively small minified size. In the future this library should be lazy-loaded to make the first page load UX nicer
2020-06-12 17:22:36 +12:00
Peter Zimon ac27a4f2eb Added success state for Stripe Connect
no issue
- adds success message when Stripe Connect is successfully set up
- automatically closes the setting section on success
2020-06-11 17:14:20 +02:00
Peter Zimon 042fb1e501 Added "Test mode" label UI to Stripe Connect
no issues.
- added label to indicate if the connected Stripe account is in test mode
2020-06-11 15:36:22 +02:00
Peter Zimon 41bf50e777
Stripe connect design (#1603)
no issues

Updated and refined Stripe Connect design in Labs/Members settings:
- refined visuals and UI logic
- updated copy
- added switch for test mode
- added error handling
2020-06-11 15:15:44 +02:00
Nazar Gargol d57154aaab Fixed linting error for using this.get() in octane syntax
no issue

- Switched to getter as this.get() is not available in native classes
2020-06-12 00:46:04 +12:00
Nazar Gargol 4c138268ff Refactored stripe configuration checks into separate service
no issue

- This logic is planned to be reused in more places, e.g. members import data validation. This change is meant to be a prep work for that.
- With stripe connect functionality coming it is important to have a central place checking for configured Stripe
2020-06-11 21:05:40 +12:00
Kevin Ansfield 4a758c7a5f Renamed <GhMembersContentFilter> to <GhMembersFilter> (fixed)
refs c5d718dee9

- adds the template rename that was missed in previous commit
2020-06-09 22:58:12 +01:00
Kevin Ansfield c5d718dee9 Renamed <GhMembersContentFilter> to <GhMembersFilter>
no issue

- "Content" referred to content as in posts/pages so the naming didn't make sense in the members filter component
2020-06-09 22:54:07 +01:00
Kevin Ansfield 24bf414cc3 Added access level filter to posts and pages lists in admin
no issue

- adds `visibility` query param to posts and pages controllers/routes that is tied to the `filter` query param used in API requests
- adds dropdown for selecting post/page visibility to `<GhContentFilter>`
2020-06-09 12:19:40 +01:00
Nazar Gargol c1866ed3ec Fixes labels duplicating themselves across lalbe inputs when unsaved
no issue

- Unsaved labels were still persisted in the store. This was causing unsaved labels reappearing on different instances and caused broken states
2020-06-09 20:31:09 +12:00
Rish 2ae388504b Fixed incorrect "from" address save
refs https://github.com/TryGhost/Ghost/issues/11414

- From address input value was refactored but update was still using the old value
2020-06-09 11:52:09 +05:30
Rish c16381bb42 Added site domain for default from address
refs https://github.com/TryGhost/Ghost/issues/11414

- Appends blog domain as default for from address members setting
- Disabled update button when current from address is same as in field
2020-06-09 11:14:53 +05:30
Rishabh Garg 1e7c80a1da
Allowed domain change for members "from" address (#1597)
refs TryGhost/Ghost#11414

- Restructures member settings in labs, from address gets its own section
- Removes explicit site domain for fromAddress as we allow updating the full address
- Adds new CTA to trigger magic link for updating members from address
- Adds new confirmation modal for email sent to new from address
- Adds notification banner for from address update redirect link
2020-06-09 01:52:58 +05:30
Peter Zimon 563c740a42 Refined copy for member import dialog
no issues.
- refined copy for member import start and end step screens
2020-06-05 15:03:43 +02:00
Nazar Gargol bc72f6eb3c Updated members' import file validation logic
no issue

- The invalid file type error should be shown on the very first step of import and should not allow proceeding without selecting a correct file.
2020-06-06 00:48:09 +12:00
Peter Zimon b64f2679c5 Refined members import dialog
no issue
- updated screen logic for member import
- added icons and refined styles for file upload dialog
2020-06-05 14:20:23 +02:00
Nazar Gargol 035d79d56f Added separate stage to members import popup with support of labels
refs 633ba27f0e

- Import modal is now devided into separate stages with ability to specify labels which will be assigned to every member present in the dataset.
- Also adds explicit "Import" button without automatic import when the CSV file is selected
2020-06-05 22:57:07 +12:00
Kevin Ansfield b75f5965d3 🐛 Fixed members list not refreshing after adding yourself
no issue

- passed in the `refreshData` action to the `<GhMembersNoMembers>` component and called it after creating the member
- converted `<GhMembersNoMembers>` to a glimmer component
2020-06-05 08:50:20 +01:00
Kevin Ansfield 4a53587f3b Switched per-user custom views to shared custom views
requires fdeb7daf40

- swapped to using settings model for storing custom views instead of user accessibility field
- added conditional that checks current user is an admin/owner when displaying the manage custom views button in the content filter (only admins/owners can edit settings model)
  - passed `session.user` into the `<GhContentFilter>` component as an argument so that the conditional getter doesn't need to handle async user access
- fixed no-shadow linting error in settings service
2020-06-04 21:30:06 +01:00
Rish 4ed4f71c71 Removed redundant reset value for task buttons
no issue

- Since task buttons by default have reset on now, we don't need to explicitly add it to individual buttons
2020-06-04 19:23:59 +05:30
Rish 36fa9dc32c Enabled auto reset state for action buttons
no issue

- By default, action buttons had auto-reset off and reset had to be explicitly set
- Auto reset for action buttons is on by default now, and any button that should not reset should explicitly switch it off
2020-06-04 18:44:38 +05:30
Fabien O'Carroll 1db5968131 Corrected url for Stripe Connect auth
no-issue

This was missed in the PR changes requests in Ghost.
2020-06-03 15:10:29 +02:00
Fabien 'egg' O'Carroll c17612e3d1
Added Stripe Connect UI (#1586)
no-issue

- Rendering is conditional on `stripeDirect` config being false.
- CSS downloaded from https://stripe.com/newsroom/brand-assets
- `stripe_connect_integration_token` is the setting to _set_ the
  stripe_connect_integration setting
2020-06-02 13:58:43 +02:00
Peter Zimon 342d8dd686 Fixed members list cell wrapping
no issues.
- sets members cells wrapping to avoid table cells overlapping
2020-06-02 12:30:11 +02:00
Kevin Ansfield ef491730d8 Fixed members list/chart not updating after members import
no issue

- move members loading code into `members` controller so that it's more accessible to other areas of the app
- add `refreshData()` to the `members` controller which forces members list and stats to be re-fetched
- call `members.refreshData()` after successful upload of members import file
- store range/days in `membersStats` service so that it's remembered across refreshes and component renders
2020-06-01 15:48:46 +01:00
Peter Zimon 8867c364ff Added placeholder to impersonate URL
no issues.
- adds a placeholder value for impersonate URL field to avoid empty field while loading
- disables "Copy link" button until the actual URL is not loaded
2020-06-01 10:04:12 +02:00
Marco Zehe 263724dc83
🐛 Fixed various Close buttons throughout the UI. (#1585)
refs TryGhost/Ghost#11863

Some `a`tags with `href` attributes that are empty are used as buttons, but since the href is not linkifying anything, they appear as text nodes to assistive technologies. Give them a `"button"` role so it is guaranteed that assistive technologies will pick them up as actionable controls.
2020-05-28 17:11:21 +01:00
Marco Zehe 52b53d068b
Various A11y post screen fixes (#1584)
refs #11863

* 🐛 Gave various buttons accessible labels

Hidden span elements are not rendered to assistive technologies, so duplicate the text in an aria-label on the button element.

* 🐛 Fixed various accessibility issues in the editor

* Made menus menus and menu item menuitems.
* Added labels to buttons where there were only hidden spans, or no text at all.
* Made separators show up for screen readers.
2020-05-28 16:01:09 +01:00
Marco Zehe ef56dbfad9
🐛 Fixed various small accessibility problems in the admin screen (#1583)
refs #11863

* 🐛 Fixed accessible button label for showing and hiding custom post types.
* 🐛 Made the menu separators accessible.
* 🐛 Fixed the More item to be a button for assistive technologies.
2020-05-28 15:51:14 +01:00
Kevin Ansfield 3da16a8c32 Improved performance of members admin screens
no issue

- removes the "old" members screens
- swaps route names and links to point at the new members screens that were behind the experiments flag

Why are the new screens faster?

- only loads 50 members at once rather than every member in the database
- loads pages of members in as-needed whilst scrolling
- fetches member stats from the API rather than calculating locally
- caches members list and stats data for 60 seconds to avoid re-fetching when navigating to/from the members list
- moves search and filtering duties to the API rather than calculating locally
2020-05-28 13:35:53 +01:00
Kevin Ansfield 093e06ed48 Fixed borders on <GhMemberListItem> loading state
no issue

- `display: table` doesn't provide an equivalent of `colspan` so the loading state needs to include the same number of `display: table-cell` elements as the live state
2020-05-28 12:55:11 +01:00
Kevin Ansfield 7ee1218f20 Removed unnecessary <GhMembersListItem> backing class
no issue

- `ember-moment` provides the `{{moment-from-now}}` helper that does the same thing the `.memberSince` computed property was doing
2020-05-28 12:33:49 +01:00
Kevin Ansfield 1422687527 Deleted component templates that are no longer used
no issue

- we had a few template files left over where their backing JS files had been deleted
2020-05-28 12:33:48 +01:00
Rish 9428ef0660 🐛 Fixed email preview not visible to Editors
refs https://github.com/TryGhost/Ghost/issues/11841

- Allows editors to see email customization option for sending test newsletters
- Editors had the necessary permission fixtures but the UI was previously only available to owners or administrators
2020-05-28 15:57:59 +05:30
Aileen Nowak c5a6206189 Updated billing icon in nav bar
no issue

- Replaced placeholder icon with new billing icon
2020-05-28 21:53:38 +12:00
Kevin Ansfield cbc085fb14 Fixed members chart
no issue

- "stale data" logic was incorrect so we were always returning `undefined` from `membersStats.fetch()`
- improved behaviour of the chart when stats are not available or are loading
2020-05-27 16:12:13 +01:00
Kevin Ansfield 80346e4868 Memoized member stats with expiration
no issue

- added a `member-stats` service to keep member stats state outside of the chart component's lifecycle
- returns memoized member stats when fetching if the query hasn't changed and the data is less than a minute old
- reduces potentially heavy network requests when quickly navigating between members list and other screens
2020-05-26 17:17:52 +01:00
Kevin Ansfield 4610068e2c Improved number formatting in members screen
no issue

- added `format-number` helper that uses browser's built-in `toLocaleString()` method to format numbers such as adding commas or periods to improve number readability (`123,000` instead of `123000`)
- updated members chart totals to use the helper
- replaced direct `.toLocaleString()` usage with the new helper so we can change global number formatting if needed
2020-05-26 14:40:03 +01:00
Kevin Ansfield 2e3c72891e Updated members screen to work with final stats API naming
refs 071ab9774b

- stats API uses snake_case rather than camelCase to be consistent with the rest of Ghost's APIs
2020-05-26 12:26:04 +01:00
Kevin Ansfield 5de9483df8 Removed "members" from mocked stats API payload property names
no issue

- removes duplication from property names as the "members" part is implicit from the resource name
2020-05-25 10:35:39 +01:00
Kevin Ansfield 332cb72e25 Updated <GhMembersChart> to fetch stats from the API
no issue

- added mocked API for `/admin/members/stats/` that generates random data for the chart
- re-architected `<GhMembersChart>` to fetch data from the API rather than calculating stats from all members loaded in memory
- enabled mirage in development so that the chart can be tested before the live API is ready
2020-05-22 17:58:45 +01:00
Kevin Ansfield ad7c8ed423 Linked label dropdown in members screen to paginated list loading
no issue

- moved model loading back into the route
- updated model loading to refresh correctly when `label` query param changes
- fixed infinite loading/"no members" display in members list by using the `members.loading` property that `ella-sparse` gives us (previously we'd never leave the loading display because `this.members.length` would be 0)
- changed the members nav link to reset query params only if it's clicked whilst on the members screen - matches posts/pages behaviour and lets you navigate without having to re-enter your filter/search
2020-05-22 17:58:45 +01:00
Kevin Ansfield 4f2e6cd55f Fixed dropdown styling for content filter and members chart timeframe
refs cc80214916

- `<PowerSelect>` no longer has it's own wrapper element so `@classNames=` has no effect and needs to be added to an explicit wrapper element
2020-05-22 11:38:50 +01:00
Kevin Ansfield aba7f0b7c8 Added loading state for member list rows
no issue

- with the sparsely loaded list you can scroll to an area which is being loaded in the background
- if a list row is being loaded, display a "loading" version of the row so it doesn't look like you're stuck on a blank screen
2020-05-22 09:31:17 +01:00
Nazar Gargol 1cf3573d12 Fixed browser URL syncronization with embeded iframe state
no issue

- Opted in to use explicit `hisotry.replaceState` and setting iframe's `src` using assignment instead of tracking it through computed property. This allows for tighter control over when iframe's history is updated which was causing problems when `src` was bound to computed property
- Added billing page metadata. This way browser history records appear with nicer signature
- Removed "update button" iframe and rewrote "global iframe" to not use modals. This allows to have single iframe on a page, which simplifies `postMessage` communication and preserve history inside iframe to be able to navigate it after closure
- Added route change handler responding to BMA app route changes. Allows to sync browser URL visible to the user with active route in BMA iframe. The sync is based on `hisory.replaceState` method that makes sure singular history records are kept in the browser history
- Added nested wildcard billing route. This is meant to catch all the nested routes inside of BMA iframe
2020-05-22 14:44:37 +12:00
Kevin Ansfield 33bb521c11 Updated members list to use paginated loading
no issue

- disabled members search/filter/chart as they won't work without all members loaded into memory (they will be added back later)
- added `ember-ella-sparse` to handle a sparse array of members
- updated `fetchMembersTask` to return a sparse array instance
- updated components that work on a `member` instance to use `.get` because all items in a sparse array are proxy objects
- changed list loading behaviour to not refresh the list from the API unless the client-side list is more than a minute old - allows for much snappier nav between list and details screens
2020-05-20 16:39:32 +01:00
Kevin Ansfield 650b785d3d Refactored members routes
no issue

- moved labels fetching into the controller to unify members+labels loading approaches
- removed unnecessary `deactivate` hook on members route because the label form component already rolls back the model attributes when it's destroyed
- unified non owner/admin redirect approach across members and member routes
2020-05-20 16:39:31 +01:00
Kevin Ansfield e80fa137db Updated members routes/controllers with Octane idioms
no issue

- ran [`ember-native-class-codemod`](https://github.com/ember-codemods/ember-native-class-codemod) on members-related files
- updated files to remove need for `@classic` decorator where possible
    - switched to tracked properties
    - removed usage of `this.get/set/toggleProperty` etc
- swapped usage of `{{action 'foo'}}` for `{{this.foo}}`
2020-05-20 16:39:31 +01:00
Kevin Ansfield 9250d7939b Swapped duplicated members files from -dev to -old
no issue

- allows continued development on the "original/non duplicated" files to better preserve git history once the `-old.*` files are deleted
2020-05-20 16:39:31 +01:00
Fabien O'Carroll c7b75e35dd Hid Stripe apikey form if stripeDirect: false
no-issue

We are going to keep the UI as a fallback in future. Eventually this
`if` will include an `else` block rendering a Stripe Connect button.
2020-05-20 16:49:00 +02:00
Kevin Ansfield dc5549a265 Duplicated members screens for development experiments
no issue

- members screens will be undergoing heavy development to change how underlying data loading works
- duplicated all related screens and components so that development can occur behind the `enableDeveloperExperiments` flag without breaking the existing screens
- added "Members (dev)" link to the duplicate screens in nav bar when `enableDeveloperExperiments` is on
2020-05-19 16:18:30 +01:00
Kevin Ansfield f4524e0206 Fixed delete button in token select inputs
refs cc80214916

- ember-power-select switch to Glimmer components meant that our mousedown handler that was going through Ember's event bus was firing after the EPS events which trigger dropdown open/close and therefore not triggering the delete action
2020-05-18 13:33:21 +01:00
Kevin Ansfield d6058dbf27 Co-located component template files
no issue

Keeps component JS backing files and template files in the same directory which avoids hunting across directories when working with components. Also lets you see all components when looking at one directory, whereas previously template-only or js-only components may not have been obvious without looking at both directories.

- ran [codemod](https://github.com/ember-codemods/ember-component-template-colocation-migrator/) for app-level components
- manually moved in-repo-addon component templates in `lib/koenig-editor`
- removed all explicit `layout` imports as JS/template associations are now made at build-time removing the need for them
- updated `.embercli` to default to new flat component structure
2020-05-18 13:14:08 +01:00
renovate[bot] cc80214916
Update dependency ember-power-select to v4 (#1528)
* Update dependency ember-power-select to v4
* Fixed trigger component override collision when building

- move the "override" into our own namespace
- update all `<PowerSelect>` usage to explicitly reference our customised trigger component

* Bumped ember-power-datepicker

- bumps `ember-basic-dropdown` sub-dependency
- resolves "Error: Could not find module `ember-compatibility-helpers` imported from `@glimmer/component/index`"
- https://github.com/cibernox/ember-basic-dropdown/issues/551

* Updated trigger to use class syntax

- it's not possible to use `.extend()` on an imported class

* Updated <GhBasicDropdown>

- match updated ember-basic-dropdown code

* Added `autofocus` modifier

- added `ember-modifier` dependency so that we can create our own render modifiers

* Updated <GhSearchInputTrigger> to a glimmer component

* Updated gh-token-input components

* Fixed tests

- wrap `<PowerSelect>` with `<div>` to maintain test selectors
- fixed `<GhBasicDropdown>` not rendering anything due to not having a local template

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2020-05-17 22:35:53 +01:00
renovate[bot] 7e195b24dc
Update dependency ember-infinity to v2.1.1 (#1484)
no issue

- fixed template reference
- updated template to match upstream's use of render-modifiers
- removed silencing of `isVisible` deprecation

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-12 09:05:17 +01:00
Kevin Ansfield 69e5cdb5e9 Reduced unnecessary waiting in tests
no issue

- fixed `<GhTaskButton>` not resetting after an externally triggered task run such as when pressing Cmd+S
- cleaned up manual timeouts/resets where button reset is now fully handled by `<GhTaskButton>` (these were causing 2.5s waits each time a save occurred in acceptance tests)
- where manual timeouts were required, reduce testing time from >2.5s to 50ms
2020-05-11 11:37:35 +01:00
Kevin Ansfield 479eecba4c Update dependency eslint-plugin-ghost to v1.4.0
no issue

- applies fixes for new/updated rules
- disables `ember/no-mixins` rule as we're not able to migrate away yet
2020-05-06 18:07:01 +01:00
Rish bc0106ce0c Added regenerate copy tweak for internal Zapier integration
no issue

- Updates dialog copy for confirmation of regenerating internal Zapier integration admin key
2020-05-06 12:36:43 +05:30
Rishabh Garg 87ab94d9d5
Added regenerate button to integration api keys (#1562)
no issue

- Adds new regenerate button for refreshing custom integration's admin and content api keys
- Adds new regenerate button for refreshing internal Zapier integration's admin key
- Regenerates content or admin API key after confirmation and shows user new key
2020-05-05 23:44:45 +05:30
Nazar Gargol 15522e5826 Added response parameter to postMessage data
no issue

- The 'response' property is needed to make the receiving client generic in regards of what data format has to be returned as a result of the call. For example with this change the 'response: subscription' meant there should be an incoming 'message' event as a response to this call with 'subscription' key into it's data
2020-05-01 17:34:55 +12:00
Peter Zimon 503bd972bc 💄 Improved members chart Y range
no issue.

- improved the Y axis of members list chart to only take the visible range into consideration. This way the change in a period is more understandable
- added labels to Y axis so that the range is clearer
2020-04-28 13:59:45 +02:00
Kevin Ansfield e6496947c1 Sped up tests by reducing reset button timeout whilst testing
no issue

- tests will wait for everything to settle before continuing or ending so the 2.5sec timeout on task button resets was adding a lot of extra time
- use Ember's environment to see if we're testing and reduce the reset timeout from 2500ms to 50ms
2020-04-23 20:20:19 +01:00
Kevin Ansfield 718524d7c0 🐛 Fixed ability to schedule emailed post when date is incorrect
refs https://github.com/TryGhost/Ghost/issues/11757

- moved schedule date validation to occur before we short-circuit for display of the email confirmation modal
2020-04-23 19:43:10 +01:00
Naz 54a91891eb
Added handling for /billing route with query param passing to BMA (#1551)
no issue

- This change allows to open BMA popup using external link and pass in information using query parameters. Main use case being redirects from external sites
2020-04-22 15:35:56 +12:00
Nazar Gargol f70e1b1e29 Added billing "update" CTA button
no issue

- Added billing update button to navigation menu. Ghost-Admin communicates with billing iframe and displays this button based on the plan data that iframe returns
- Ghost-Admin communicates with an iframe using same mechanism as with token exchange - throu `window.postMessage` API
2020-04-21 18:54:29 +12:00
Nazar Gargol 734d8f02e3 Moved billing page to a popup
no issue

- To simplify styling and give a better separation feeling from UI perspective
2020-04-09 17:26:11 +12:00
Rishabh Garg 825161422f
💄Updated save buttons to reset state (#1522)
* Updated save buttons to reset state

no issue

Currently the save buttons across Admin don't auto-reset to idle state after success/failure on run which can give false impression once user changes any value. This PR auto-resets the button to idle state after a fixed timeout if no subsequent action is performed as a short term UX improvement.

* Fixed success check for auto reset

* Updated timeout value

* Added explicit save button reset for pages

* Updated save buttons to reset via shortcut

Auto-reset for save buttons wasn't working if not done through manual click on task button previously, this handles by splitting the original save task in controller to handle shortcut saves.

* Updated reset check for only successful tasks

* Added save reset to code-injection and design settings

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2020-04-06 16:17:28 +05:30
Nazar Gargol e7cff63982 Cleaned up use of members isPaid flag
refs https://github.com/TryGhost/Ghost/pull/11651

- The flag is being removed from the backend, so can be safely removed on client as well
2020-03-16 13:44:14 +08:00
Nazar Gargol 536c41bb93 🐛 Fixed complimentary plan currency change when yearly currency was changed
refs https://github.com/TryGhost/Ghost/issues/11649

- The bug was changing all complimentary plan prices to the value of yearly.
- This is another point to putting in place validation of plan setting object on the server side so we don't accidentally allow values like this to slip through
2020-03-13 11:59:18 +08:00
Fabien O'Carroll 74ff94e9fd Updated URL and response handling for identity token
no-issue

This just keeps the admin in line with the changes made in
https://github.com/TryGhost/Ghost/pull/11559/files
2020-03-12 13:35:57 +01:00
Nazar Gargol 9e7a6b801a 🐛 Fixed complimentary plan creation when there was none in plans collection
closes https://github.com/TryGhost/Ghost/issues/11649
closes https://github.com/TryGhost/Ghost/issues/11648

- When complimentary plan with new currency is created for the first time it doesn't have a reference to a previously default "Complimentary USD" plan which caused problems when switching currencies for the first time.
- Value for complimentary plan taken from  https://github.com/TryGhost/Ghost/blob/3.10.0/core/server/services/members/config.js#L8-L13
2020-03-10 13:39:38 +08:00
Nazar Gargol 1a61b500d9 Added support for setting custom currency on member's plans
refs c0512e30bb6e5e3f2d3d86a3ca04b0273d405447

- Adds a dropdown allowing to select and set custom currency.
- At the moment we don't have a specific way to interface with the members configuration API so all values are set directly on existing "config JSON". Ideally we should add more validations and be more precise what values can be set for the `stripeProcessor.config.*` values.
- Saves selected currency in `stripeProcessor.config.currency` variable.
2020-03-04 13:31:39 +08:00
Fabien O'Carroll 3cc039323f
Added billing route and iframe behind config
no-issue

* Updated the iframe src

* Moved billing behind config

* Transition to home route for missing billing config

* Replaced jquery element selection with native
2020-03-02 10:36:54 +05:30
Kevin Ansfield 73ab00be1b Refactored <GhMemberAvatar> to glimmer component
no issue

- cleaned up property access in template to differentiate between passed-in args and component-defined properties
- tidied up logic in `backgroundStyle` and `initials` getters
2020-02-27 12:33:33 +00:00
Kevin Ansfield 612b71a77f Refactored <GhMembersListItem>
no issue

- switched to using a glimmer component
  - cleaned up property access in the template
  - used helpers for basic display logic in the template
- removed unused computed properties, aliases, and injected services
2020-02-27 12:17:48 +00:00
Peter Zimon 81945b22ef
Updated notifications design (#1498)
no issue

- updating toaster design for better discoverability
2020-02-27 09:19:29 +00:00
Naz b192917e88
Added member impersonation (#1497)
refs b0ff1e7cac

- Adds "impersonate" button which would be triggering a popup window with "login url" that allows to log in as a member
2020-02-27 11:50:15 +08:00
Nazar Gargol f3d6a75a3c Hidden subscriptions section on member profile when no connected Stripe
no issue

- There is no way to turn on "Complimentary" subscription when Stripe is not connected
- There is no constructiove information that can be shown about subscriptions
2020-02-24 17:08:47 +08:00
Rishabh Garg fb5663f3f0
Updated send email messaging for Editors (#1505)
no issue

Fixes incorrect member count for Editors when trying to publish/schedule post with send email.

Note: This is a short-term fix till we fix fetching member data for Editors for proper count.
2020-02-24 13:22:39 +05:30
Rishabh Garg 87086edc70
Allowed editors to send email on publish (#1504)
no issue

So far, only owners or Admins were allowed to control the send email setting while publishing/scheduling a post. This change allows Editors to see the setting as well and toggle as needed.

No changes on the API side were needed.
2020-02-24 12:20:29 +08:00
Nazar Gargol 0cb787d11a Enabled editing email field on member profile page
refs b9db9fa15e

- Now that Admin API allows to edit email, there is no reason to keep this field disabled
2020-02-21 16:12:35 +08:00
Rishabh Garg 4812eed5ca
Added labels for Members (#1477)
no issue

refs TryGhost/Ghost#11538

* Added members label handling v1

* Added members label dropdown in list screen

* Updated selected labels and member list UI refactor

* Added v1 label add/delete modal

* Added add label modal v1

* Fixed disabled check for new label save

* First stab at member filters layout

* Updated member detail screen design

* Member detail refinements

* Added basic editing for member labels

* Fixed label deletion from members list

* Updated filtered list header

* Refinements for dropdown and empty filter state

* Refined label modal

* Updated member labels fetch logic

* Added custom dropdown component for labels

* Refined style for dropdown

* Refined dropdown button

* Restructure and refine members dropdown styles

* Added selected indication to dropdown

* Fixed dropdown footer style

* Removed member label placeholder

* Removed add label from member list actions

* New label refinements

* Added confirmation modal for label delete

* Added duplicate validation check for labels

* Updated validation check with slug

* Updated copy

* Updated actions dropdown copy

* Fixed visual glitch of dropdown on FF

* Hide scrollbar for labels dropdown

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2020-02-14 15:04:01 +05:30
Kevin Ansfield 5f3d48f626 Fixed query params not resetting when deleting a custom view
no issue

- added a `transitionTo` after deleting a custom view that transitions to the `posts` route with default query params
- refactored `reset-posts-query` helper to a more generic `reset-query-params` helper
  - moved default query params definitions to this helper and expose them so we have a single source of truth
  - exposed `resetQueryParams()` function from the helper for use outside of templates
  - adjust the function and helper behaviour to accept the route name as the first param so that `router.currentRouteName` can be used as a generic reset
2020-02-03 16:38:14 +00:00
Kevin Ansfield 855757ffe5
Added default and custom post views (filters) to the admin sidebar (#1474)
no issue

- list custom post views in collapsable sidebar navigation
  - default views: Draft, Scheduled, Published (except for contributors)
  - record expanded/collapsed state of the navigation menus in user settings via new `navigation` service
- adds `customViews` service that manages custom views
  - provides list of default views
  - gives access to "active" custom view based on current route and query params
  - manages loading/saving of custom views to user settings
- show "Add view" button in the content filter when the posts list has been filtered
- show "Edit view" button in the content filter when the posts list filter matches a saved view

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2020-01-30 15:35:36 +00:00
Kevin Ansfield 2bc00a375b Removed <GhDownloadCount>
no issue

- the count.ghost.org service is being shut down
- replaced the fetch+poll component with a hardcoded figure
2020-01-27 09:51:45 +00:00
Kevin Ansfield f0025da3f2 Fixed toaster notification not clearing
no issue

- we switched to using native event listeners rather than jQuery but were still looking for the jQuery-specific `event.originalEvent`
2020-01-20 15:30:24 +00:00
Kevin Ansfield 92107312a8 Upgraded eslint-plugin-ghost and fixed new linter errors
no issue

- update imports for `@ember-data` package (https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md)
- use `computed.reads` where applicable (https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/require-computed-macros.md)
- fix usage of `scheduleOnce` so that functions are only scheduled once (https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-incorrect-calls-with-inline-anonymous-functions.md)
2020-01-16 17:01:12 +00:00
Kevin Ansfield f529296129
Migrated to <AngleBracketSyntax /> (#1460)
no issue

Ember is migrating to `<AngleBracketSyntax />` for component invocation, see https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md

We were in a half-way situation where some templates used angle bracket syntax in some places, this PR updates templates to use the syntax everywhere.

This simplifies the rules for what template code is referring to...

`<Component>` = a component
`{{helper}}` = a helper (or locally assigned handlebars variable)
`{{this.foo}}` = data on the template backing context (a component/controller)
`{{@foo}}` = a named argument passed into the component that the component backing class has not modified (note: this commit does not introduce any named arguments)

- ran codemod https://github.com/ember-codemods/ember-angle-brackets-codemod on the following directories:
  - `app/templates`
  - `lib/koenig-editor/addon/templates`
- removed positional params from components as angle bracket syntax does not support them
  - `gh-feature-flag`
  - `gh-tour-item`
  - `gh-cm-editor`
  - `gh-fullscreen-modal`
  - `gh-task-button`
- updates some code that was missed in aaf9f88ebc to use explicit this
2020-01-16 15:14:03 +00:00
Kevin Ansfield 25add1d4ac Extracted duplicated posts/pages filter into a component
no issue

- posts and pages (and their corresponding `-loading` counterparts) templates were all duplicating a lengthy section of handlebars
- extracted the duplicated handlebars into a template for easier design changes or upgrading of `ember-power-select`
- moved generation of the "selected" CSS classes into the template to clean up code in the controller
2020-01-15 15:15:20 +00:00
Kevin Ansfield 92931f7190
Upgraded ember-power-* addons (#1459)
no issue

- bump deps
- adjust usage for breaking changes... 
  - https://github.com/cibernox/ember-power-select/blob/master/CHANGELOG.md#300-beta1
  - https://github.com/cibernox/ember-basic-dropdown/blob/master/CHANGELOG.md#200-beta3
  - https://github.com/cibernox/ember-power-datepicker/blob/master/CHANGELOG.md#070
- update overridden component and template files to match latest addon code
  - switch to class syntax w/decorators
  - adjust for angle bracket syntax
2020-01-15 13:53:51 +00:00
Kevin Ansfield f25f82879b Removed deprecated usage of this.$() in components
no issue

- converted remaining uses of `this.$()` that I could find over to native DOM
- deprecation is still silenced for now because both `liquid-fire` and `liquid-wormhole` trigger it
2020-01-10 15:12:39 +00:00
Kevin Ansfield 26e975e791 Cleaned up more unused code in <GhTagSettingsForm>
refs b61f3f1ecc

- `reset()` method was previously removed as it's no longer needed
- supporting code for calling that method was missed in the previous cleanup
2020-01-10 14:56:43 +00:00
Kevin Ansfield ad4cbc3321
Enabled manual typing of post publish dates (#1431)
*  Enabled manual typing of post publish dates

closes https://github.com/TryGhost/Ghost/issues/9256

- stores the typed date internally to the component until
  - Enter is pressed whilst focused
  - Ctrl/Cmd+S is pressed whilst focused
  - the input loses focus
- shows an error message if the typed date is not in the correct format or is invalid
- stops Ctrl/Cmd+S propagating if the typed date is not in the correct format or is invalid
- as long as the date is valid it calls the `setDate` action when the input loses focus, Ctrl/Cmd+S or Enter is pressed
- prevents publish being triggered in the publish menu if an invalid date is entered
- resets any invalid state in the PSM when it's closed
- manages focus when using <kbd>Tab</kbd>
2020-01-10 14:25:59 +00:00
Kevin Ansfield b61f3f1ecc Cleaned up unused code in <GhTagSettingsForm>
no issue

- the tag screen is now separate from the index so the code needed for handling switches between main/meta panes and scroll resets is not used and no longer needed
- tidies up indentation in the template
2020-01-10 14:14:55 +00:00
Rishabh Garg f95c68662b
Added upgrade modal for host member limits (#1428)
no issue

Uses 160ef2976a to add new upgrade popup for host limit errors while publishing/scheduling post with emails.
2019-12-17 19:27:42 +05:30
Rishabh Garg 8afa2bf645
Added members growth chart (#1424)
no issue

Adds new members growth chart in members list screen to highlight growth of members over different date ranges
2019-12-17 15:59:26 +05:30
Kevin Ansfield ffa200d00f Added console log with reason unsaved changes modal is shown in editor
no issue

- output the reason we're showing the unsaved changes modal along with some context to the console
- to share it, right click on the object that is logged to the web inspector console next to the text "showing leave editor modal" and choose "Store as global variable" in the popup menu, then execute `copy(temp1)` (if `temp1` was the variable that was created for you) which will copy a string representation of the object to your clipboard ready for sharing
2019-12-17 09:57:37 +00:00
Kevin Ansfield 403bac5876 Converted <GhErrorMessage> to glimmer component
no issue

- fixes `isVisible` deprecation warning that was showing up for every component invocation since the Ember 3.14 upgrade
2019-12-13 16:12:04 +00:00
Kevin Ansfield aa9a2d393a Fixed member count after deleting a member
no issue

- the member count is automatically calculated via the length of the live members array so there's no need to manually decrement it - if we do manually decrement then the count is off by one because the auto calculation runs to get the new value before the manual decrement
2019-12-13 11:38:37 +00:00
Kevin Ansfield 35b53e7712 🐛 Fixed unsaved changes modal when using Cmd+S on tag/member screens
no issue

- keep a scratch model on the tag/member controllers rather than inside of the form components
  - allows the controller's `save` task to transfer scratch values to real values before saving
  - means that pressing Cmd+S whilst a field is still focused will save the expected value rather than the old value avoiding unsaved changes modals when trying to leave the screen when you think you've already saved
- fixed route and url not changing after saving a new member
- fixed error when clicking delete tag button
- cleaned up unused `showDeleteTagModal` actions
2019-12-13 11:37:01 +00:00
Kevin Ansfield 72e4722f66 Tidied up <GhMemberSettingsForm>
no issue

- removed unused `isViewingSubview` property
- replaced `hasMultipleSubscriptions` CP with the `gt` CP macro
- fixed indentation in the template
2019-12-12 18:22:31 +00:00
Naz Gargol cf3bbeffe5
Added members cancel subscription fields on members page (#1423)
refs https://github.com/TryGhost/Members/pull/107

- Added 'cancel at period end' logic to members subscription details
- Added stripe subscription link in subscriptions details
2019-12-12 20:00:57 +07:00
Kevin Ansfield 421f4ea0e5 Fixed linting 2019-12-09 17:45:51 +00:00
Kevin Ansfield c2605a32ae Cleaned up and re-organised tag and new tag routes/controllers
no issue

- removed unused `<GhTagsManagementContainer>` component and related `isMobile` CPs
- un-nested `tag` and `tag.new` routes
  - nested routes in Ember are used for nested UI but these are both separate screens
  - removes usage of `selectedTag` property in favour of using Ember's built-in model handling
  - removed unnecessary `tags/new` controller
  - sets up `tag.new` route which extends the `tag` route to avoid duplicate code
2019-12-09 17:44:16 +00:00