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

1974 commits

Author SHA1 Message Date
Rish a258e8ad15 Removed redundant auto reset for amp
no issue

- Auto reset is on by default, this got missed in last commit
2020-06-04 19:25:42 +05:30
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 aaac414745 🐛 Fixed change password button state on staff screen
closes https://github.com/TryGhost/Ghost/issues/11789

- Invert css classes definitions for red/green buttons to allow the button to turn green for the success state

Credits - https://github.com/m1kl - https://github.com/TryGhost/Ghost-Admin/pull/1568
2020-06-04 18:44:38 +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 6a94e56988 Fixed columns resizing whilst scrolling members list
no issue

- the members list uses occluded rendering to keep scrolling performance high but this will cause constant reflows of the table contents whilst scrolling because contents are swapped in and out causing the browser to adjust the column widths to match longest/shortest content in the currently rendered set of rows
- applying `table-layout: fixed` to the table means that columns will always match the sizes defined by the first row of the table (in this case the header) ensuring that there is no dynamic resizing whilst scrolling
2020-05-28 12:59:34 +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
Kevin Ansfield cae4a0163a Fixed sending of empty search param in members browse requests
no issue

- when the search param was empty we were still adding a `?search=` query param to the API request
2020-05-28 11:11:43 +01:00
Kevin Ansfield 4e4d7cc85c Fixed and improved members stats "debounced" fetches
no issue

- the "days changed" logic was incorrect so we were always performing new fetches rather than using existing data
- added a minor improvement that returns an in-progress fetch promise if we have one and params haven't changed - avoids triggering unnecessary extra fetches in the rare occasions the chart is re-rendered before a previous stats fetch has finished
2020-05-28 11:11:43 +01:00
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 64d7639b57
Added server-side search to new members screen (#1582)
requires https://github.com/TryGhost/Ghost/pull/11854

- ties the search input on the members screen to a `?search` query param, debounced at 250ms to avoid unnecessary API requests and UI churn
- updated the members route's `model` hook to pass through the search param in the API request query parameters
2020-05-28 10:15:17 +01: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 c582f16dc0 🐛 Fixed members import not showing upload modal
no issue

- template was not renamed correctly in 9250d7939b
2020-05-26 15:49:48 +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 d948ba33fb Fixed redirect after saving member in "old" member screen
no issue

- changed the `replaceRoute` after saving to transition to the `member-old` route instead of `member` route
- updated tests to work with the old routes (for now)
2020-05-22 10:50:12 +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
Peter Zimon a5fa4074e2 Removed test email function from Labs
no refs.
- removes leftover test email section from Labs to resolve a lot of confusion around it
2020-05-20 11:34:56 +02:00
Peter Zimon 51fc3008b2 Fixed FF dropdown visual bug
no refs.
- fixes double border visual bug in Firefox
2020-05-20 09:49:12 +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 acb3624de3 Fixed saving of custom views expansion state
no issue

- if `user.accessibility` is `null` as it is for newly created users then toggling the expansion state of custom views menus failed to save because we were assuming there was an object available
2020-05-18 13:45:59 +01:00
Kevin Ansfield db8a53e8f5 Fixed initial animation of custom views expansion
no issue

- apply defaults during service initialisation so that `navigation.settings.expanded.posts` doesn't start out as "undefined" then transition to "true" on first render resulting in unnecessary animation in the sidebar
- speeds up acceptance tests which no longer need to wait for animation to complete before continuing
2020-05-18 13:42:01 +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] 8dd6c5c5c0
Update dependency ember-infinity to v2.1.2 (#1573)
* Update dependency ember-infinity to v2.1.2
* updated gh-infinity-loader template to match ember-infinity default template

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2020-05-18 09:06:04 +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 499ed7b764 Fixed incorrect validation when member's name is too long
no issue

- the email length validation was conditional on `member.name` rather than `member.email` so if the name was too long both name and email were marked as invalid
2020-05-11 11:40:38 +01:00