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

500 commits

Author SHA1 Message Date
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
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
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
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
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
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
Liam Williams
a540265c43
🐛 Fixed unselectable routes files in macOS Safari (#1472)
closes TryGhost/Ghost#11472

- adds an explicit `.yaml` to the `accepts` attribute of the routes file uploader to work around Safari only allowing `.yml` to be selected when given the yaml mime type
2020-05-08 12:05:55 +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
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
9b560a1e12 Refactored check with regexp to error type checking
- Changed as per review here: https://github.com/TryGhost/Ghost-Admin/pull/1560#discussion_r420040384
2020-05-06 00:05:19 +12:00
Peter Zimon
d7597e426e
Added special view for "locked" users when they fail signin (#1561)
refs https://github.com/TryGhost/Ghost/pull/11790

- After user fails to signin due to "locked" being locked a new view with automatic email message and more instructions will be shown to make the password reset process easier.
- Refined instructions screen
- Added icon + animation
- Refined copy

Co-authored-by: Nazar Gargol <nazargargol@gmail.com>
2020-05-05 23:27:19 +12:00
Nazar Gargol
40e48cd5be Added billing controller for explicitness
refs 54a9189

- Additionally removed redundant super call
2020-04-22 16:44:34 +12: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
Rish
3f14c04abe Fixed members loading spinner alignment
refs https://github.com/TryGhost/Ghost/issues/11755

Loading spinner on members screen was not vertically centered, this updates the spinner position.
2020-04-21 13:42:34 +05:30
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
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
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
Rish
059ce28cb6 Fixed lint
no issue
2020-02-24 13:39:59 +05:30
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
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
196ba168fd updated to use new model._meta
- use model._meta to access the meta object in the delete response
- removed unused `_deleteUser` method
- move the success/failure method bodies into the main `deleteUser` task to improve readability
- added a timeout after calling `_exportDb()` so that the iframe is not removed from the DOM immediately after it's `src` value is set due to a transition away from the member screen
2020-02-10 12:41:35 +00:00
Nazar Gargol
e357adffa5 Rewrote delete into generator function
- Wasn't necessary, but thought this might fix the problem when there's no 'meta' in the reponse object
2020-02-10 12:41:35 +00:00
Nazar Gargol
49ccc6b66d Basic flow for triggering db export on user deletion 2020-02-10 12:41:35 +00:00
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
8526d98156 Changed content filters to show "unknown" if a deleted tag/author is selected
refs https://github.com/TryGhost/Ghost-Admin/pull/1474

- show some indicitive text rather than a blank dropdown button when type/author/tag/order query param is present but doesn't match something in our data sets (eg, if a tag/author has been deleted or a query param has been incorrectly typed)
2020-01-20 15:40:32 +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
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
708509d754 Fixed Ember Data error when navigating to Staff screen
no issue

- if only some roles have been loaded, such as from embedded user records in posts, navigating to the Staff screen when invites exist for roles that have not yet been loaded would result in an Ember Data error
- the error occurs because we use `invite.role.*` in the template but we've specified `{async: false}` in the `belongsTo` relationship for `invite.role` which prevents Ember Data automatically querying the API
- by always fetching the roles list before fetching the invites list we prevent the error but we do introduce an extra API request in some circumstances
2020-01-10 13:53:58 +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
9298e30562
Added new brand color publication setting (#1409)
no issue

Reads new brand primary color setting and adds UI to modify/update it behind the dev flag
2019-12-17 16:37:34 +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
39ecd67d13 Fixed unsaved changes modal showing after focus/blur of tag and member fields
no issue

- the inputs in tag/member settings are now two-way bound which means that a `null` or `undefined` value can become `""` when a field is focused/blurred due to inputs only working on strings
- if a `null` or `undefined` property value becomes `""` Ember Data will treat that as a dirty property and that will in turn trigger the unsaved changes modal when leaving the tag/member details screens
- this change strengthens our `_saveXProperty` private controller methods to skip any changes between "falsy" property values unless the new value is explicitly `false`
2019-12-16 17:02:19 +00:00
Kevin Ansfield
693d6b48b2 🐛 Fixed unexpected "unsaved changes" modals when accessing screens
no issue

We weren't correctly clearing state for the "display modal" booleans when leaving screens. This meant that it was possible to end up in a state where where every time you access a screen you get the unsaved changes modal
2019-12-13 17:09:06 +00:00
Kevin Ansfield
077347a8a1 Fixed linter errors 2019-12-13 13:55:59 +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
3497d86338 Unified tag and member screen code
no issue

The tag and member screens share the same underlying UI/UX patterns but were using different code patterns. This brings both in line so that we have consistent code patterns that can be re-used for other screens.

- fixed cleanup of new tags by adding the `deactivate` hook to the `tag` route
- updated `member` and `member.new` route/controller setup to match tag route/controller setup
  - added `save` action to member controller so that Ctrl/Cmd+S works on member screen
  - updated tag route/controller to utilise the same instant display w/background refresh when accessing the tag details screen
- completed transition of non-component tag/members templates over to angle bracket component syntax
2019-12-12 13:59:46 +00:00
Kevin Ansfield
47abee280b Fixed tag deletion
no issue

- don't show "Delete tag" button when we're displaying a new/unsaved tag
- refactor the `_deleteTag()` method to be more explicit and remove handling that is no longer required since the tag screen is not nested in the tags screen
- revised the condition in `showUnsavedChangesModal()` method so that it's body doesn't fire twice when leaving the `tag` or `tag.new` route
- revised the `showUnsavedChangesModal()` method body to look at the number of changed properties on the tag rather than relying on `tag.hasChangedAttributes` which is always `true` for new models
2019-12-10 12:18:20 +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
Hannah Wolfe
377055a7de Added Secondary Navigation (#1410)
refs: https://github.com/TryGhost/Ghost/pull/11409

- Added a new UI for a second set of navigation links
- This should support most concepts of nav, e.g. left and right, or header and footer
- This PR mostly updates the design and nav components to cope with a second set of nav
2019-12-04 11:14:45 +07:00
Naz Gargol
83fced0e73
Improved adding first members on no-members screen (#1416)
no issue

- There was a need to make the experience of adding a first member(s) as frictionless as possible, which lead to adding some actionable controls to the "no-members" screen.
- Adds the ability to make yourself a member
- Adds the ability to import CSV member
- Link to add a member manually
2019-12-03 12:04:04 +07:00
Naz Gargol
3ec3671aee
Added member "add" screen (#1411)
no issue

- We have a need to create a member manually, this changeset solves this problem.
- Added new member button to the member's screen
- Needed to be able to perform add member action
- Fixed inconsistent `createAt` naming. All models use consistent `createdAtUTC`, fixed it up so that members model follows the same pattern. If we want to change this pattern should probably happen for all models at once
- Fixed member avatar when creating a new member. If the values are completely empty the screen ends up being filled with empty space. Added some dummy initials which are recalculated once the member enters the name or an email
- Refactored DS naming for consistency. Nowhere else in the codebase 'DS' name is ever used, made this consistent
- Added missing validations in members form
- Simplified if conditions in the member list template. When using the if/esle statements unnecessary new-line symbols were inserted which made it hard to test. Also by using computed property view is much cleaner
- Updated member's model default value for `subscribed` to "true". It is turned on by default in the model layer  on the backend (ref: https://github.com/TryGhost/Ghost/blob/3.1.0/core/server/data/schema/schema.js#L330), this behavior is intended and should be the same on the frontend
2019-11-28 18:30:21 +07:00
Kevin Ansfield
4bcd016e88 Fixed members count in confirm email modal
no issue

- the members count used to disable the email toggle and shown in the confirm modal was incorrect as it didn't take into account subscribed vs non-subscribed members
- adjusts the filter in the count query to only fetch subscribed members
2019-11-26 15:08:33 +00:00