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

1843 commits

Author SHA1 Message Date
Peter Zimon
7f2d2f74f2 🐛 Fixed dark mode link input bug
no refs.
- fixed style bug for link input in Koenig having no blue border in dark mode
2020-01-21 12:27:30 +01:00
Peter Zimon
479ed5a25b 🐛 Fixed button style for staff creation
no refs.
- Fixed Create button being visually detached and incorrect size on the Create (staff) account screen
2020-01-21 12:14:35 +01: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
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
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
Kevin Ansfield
8046820190 Unsilenced deprecations that are no longer triggered
no issue

- cleaned up the `deprecation-workflow.js` file by removing deprecations that are no longer being triggered by our test suite or general app usage (if they are still triggered in untested areas it will be useful to see the logs)
- updated usages of `{{gh-text-field}}` to use it's `shouldFocus` attribute rather than directly overriding it's `autofocus` computed property
2020-01-09 17:20:13 +00:00
Kevin Ansfield
8f1375677d Fixed typo in email confirmation modal 2020-01-08 16:44:43 +00:00
Kevin Ansfield
cc0aa73355 Fixed invite resend
refs af4bd52b55

- `record.belongsTo().id` is an older Ember Data concept so it was returning `undefined`
- the `role` relationship is set up as `async: false` and is always output as an embedded record by our API so we're safe to use `this.role.id` without dealing with any async lookup
2020-01-07 13:45:06 +00:00
Kevin Ansfield
af4bd52b55 Fixed Ember Data record.toJSON() deprecation
no issue

- https://deprecations.emberjs.com/ember-data/v3.x/#toc_record-toJSON
2020-01-07 13:23:15 +00:00
renovate[bot]
4efee29df5 Update dependency ember-simple-auth to v2 (#1449)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-07 09:27:13 +00:00
renovate[bot]
9c7d69ebda Update ember core (#1441)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-06 10:51:48 +00:00
Kevin Ansfield
684ce495b4 Fixed incorrect "explicit this" for did-insert and will-destroy element modifiers
no issue

- the "explicit this" codemod incorrectly added `this.` in front of the `{{did-insert}}` and `{{will-destroy}}` element modifiers
2019-12-19 21:19:20 +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
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
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
Peter Zimon
85518b3b6a 🐛 Fixed darkmode color regressions
refs. https://github.com/TryGhost/Ghost/issues/11445

- fixed input field background colors in Post Settings menu in darkmode
- applied color variables to day picker calendar component
- fixed colors of day picker calendar in darkmode
2019-12-16 15:04:32 +01: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
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
aaf9f88ebc Ran "no implicit this in templates" codemod
no issue

We were in a part-way state where some touched files had been (sometimes partially) migrated to explicit `this`. The codemod that was available has now fixed the formatting issues it had so it was a good time to run it.

https://github.com/ember-codemods/ember-no-implicit-this-codemod

- part of the migration path for https://github.com/emberjs/rfcs/pull/308
- starts to make template resolution rules more explicit
  - `<MyComponent />` - always a component
  - `{{my-component}}` - component or helper (components _must_ have a `-`. This style of component will go away once fully migrated to angle bracket components)
  - `{{value}}` - a helper or local template variable
  - `{{this.value}}` - reference to a property on the backing context (either a controller or a component JS file)
2019-12-13 14:20:29 +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
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
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
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
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
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
Peter Zimon
00ab972d2e 🎨 Refined new member avatar style
no issue.
- removed outline from manually created member avatar on member detail screen
2019-12-04 11:42:58 +01: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
Peter Zimon
251bd03b79 Added white border to member gravatar on member list 2019-12-03 15:40:46 +01:00
Peter Zimon
f5d1b3df75 Refined member gravatar design
no issue.
- removed halo from member gravatars
2019-12-03 15:32:01 +01:00
Peter Zimon
4aea38d31b 🎨 Scaled email mobile preview
no issue.

- scaled email mobile preview to resemble mobile proportions better
2019-12-03 15:04:32 +01:00
Naz Gargol
ab2ef2d8d4
🎨 Added gravatars for member avatars (#1417)
no issue

- When an email has a valid gravatar handle it displays an image instead of initials for the member
- Introduces new {{gravatar}} helper which accepts an email as parameter and size/d as named parameters. The output is a URL to gravatar image
- Refactored usage of "splattribute" to explicit property. There was a need to duplicate class property usage in the component and doing that through splatttibute feature is unsafe as pointed ou here - https://github.com/TryGhost/Ghost-Admin/pull/1417#discussion_r351837584
2019-12-03 18:10:47 +07:00
Peter Zimon
8aeda9352d 🐛 Fixed email preview header position
no issue.
- fixed email preview header being off in Firefox and Safari
2019-12-03 11:23:51 +01:00
Peter Zimon
600fe7637a Refined mobile email preview
no refs.
Issue was that the ratio of email mobile preview UI was completely off on higher screen resolutions.

- set the email mobile preview UI to fixed size
2019-12-03 11:18:02 +01: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
Peter Zimon
a30e218c4c Updated post paragraph spacing 2019-11-27 13:36:12 +00:00
Peter Zimon
6bee0d7718 Refined editor post title styles
no issue.
- fixed editor post title placeholder font-weight
- fixed spacing between editor post title and first paragraph/card
2019-11-27 13:36:12 +00:00