Commit Graph

1525 Commits

Author SHA1 Message Date
Kevin Ansfield
1dad18a06c Added language selection to code cards (#1180)
no issue

- Added a language indicator when in rendered mode and a language input when in edit mode
- Allow code card language to be set with <code>```lang</code>+<kbd>Space/Enter</kbd> expansion 
    - previously <code>\`\`\`</code> would immediately create a code card, the <kbd>Space/Enter</kbd> is now necessary for the insertion to occur
    - lang is optional <code>\`\`\`</code>+<kbd>Space/Enter</kbd> will insert a code card with no language selected
    - requires <kbd>Enter</kbd> to be pressed to finalise the expansion and insert the card
    - added hook for text expansions to skip newline creation for when they are triggered with <kbd>Enter</kbd>
- Set the code card editor's language mode based on selected language
    - set the CodeMirror mode based on the code card payload language
        - add a basic map of language short codes to their respective CodeMirror modes
    - observe `mode` property in `{{gh-cm-editor}}` so that the mode is properly set when it's changed after initial render
2019-04-30 16:46:29 +02:00
Emilio Cobos Álvarez
28b5f7de52 🐛 Fixed night shift toggle in Firefox Nightly. (#1174)
Over in:

 * https://github.com/whatwg/html/issues/3840
 * https://bugzilla.mozilla.org/show_bug.cgi?id=1281135

I'm trying to come up with a model for `<link rel="stylesheet" disabled>` in
which Blink / WebKit and Firefox can agree on.

See that HTML spec issue for all the inconsistencies of WebKit / Blink, and the
following post for more context:

 * https://groups.google.com/d/msg/mozilla.dev.platform/BdgNaChHnpY/mhXzCBwSCgAJ

---

Unfortunately, my change to Firefox breaks the Ghost Admin panel night-mode
switch (you can see it in Firefox Nightly).

This is because with my change, removing the `disabled` attribute from an
stylesheet behaves the same regardless of whether the `disabled` attribute is
added dynamically or not.

That means that adding the `disabled` attribute dynamically "unloads" the
stylesheet completely (just like when the attribute is there before inserting
the link in the document, or from the parser). Thus removing the attribute will
load the stylesheet again and fire a load event.

This is problematic for the code as-is, because it means that each time that the
load event fires when the disabled attribute is removed on an alternate, then
it's added again. :)

Prevent that from happening by removing the load event listener ASAP. What this
code wants is to only resolve the promise once after all.

Given this is so far the only regression from my change that has been reported
(over at https://bugzilla.mozilla.org/show_bug.cgi?id=1546707), I think fixing
the Ghost-Admin panel is worth it.

If this pattern is somehow common, then we'll probably revert that patch and go
back to the sad current state of affairs regarding interop :(
2019-04-25 09:40:26 +02:00
Nazar Gargol
7486b6b2f3 Allowed editors to see notifications
refs https://github.com/TryGhost/Ghost/issues/9546

- Change introduced due to users with 'editor' role are now allowed to access notifications
2019-04-18 13:03:19 +02:00
Zimo
9ea62c8e13 Updated member labs settings API key URL 2019-04-17 16:37:13 +02:00
Peter Zimon
7f8dd9e4bb Members refinements (#1163)
* Updated loading state for member detail plan data

* Code refinement for loading member plan data
2019-04-17 16:18:21 +02:00
Rish
3bc06608b9 Updated member detail screen to handle free memberships 2019-04-16 22:59:52 +05:30
Rish
015bf9da0c Updated member detail placeholder
no issue
2019-04-16 22:07:27 +05:30
Zimo
2c75403202 Changed wording for free Member detail data 2019-04-16 18:07:02 +02:00
Peter Zimon
46d9d82e19 Members refinements (#1161)
* Added hover to member cells in member list

* Fixed members labs settings for nightshift
2019-04-16 17:02:52 +02:00
Rishabh Garg
c72e7b6040 Updated member management data (#1150)
no issue

- Updated hard-coded data in member management to use real values from API
2019-04-16 20:32:43 +05:30
Zimo
a029e92266 Fixed members labs settings for nightshift 2019-04-16 14:27:55 +02:00
Zimo
d3b50275e0 Added hover to member cells in member list 2019-04-16 14:27:55 +02:00
Kevin Ansfield
151b7a2844 🐛 Fixed missing errors and confusing button text in theme upload modal
no issue
- fixed "Active with errors" button successful theme upload with no warnings/errors
- fixed fatal errors not showing due to change in API error response
- fixed "Retry" button not showing when there were fatal errors
- fixed "Upload successful!" message after clicking "Retry" on a failed upload
2019-04-15 22:43:29 +01:00
Kevin Ansfield
42eb736b15 🐛 Fixed posts list scrolling and missing momentum scroll on all screens in iOS
closes https://github.com/TryGhost/Ghost/issues/9494, refs https://github.com/TryGhost/Ghost/issues/10365
- removed `overflow-y: auto` on posts list to fix the vertical scrolling
- added `overflow-wrap: break-word` so that post previews are forced to wrap for long words such as URLs
- added `-webkit-overflow-scrolling: touch` to the main scrollable pane so that iOS Safari uses momentum scrolling
2019-04-15 17:23:09 +01:00
John O'Nolan
defbf0f40c Updated to new Twitter username placeholder 2019-04-11 14:33:15 +02:00
Kevin Ansfield
67afe653cd 🐛 Fixed missing error details when activating a theme with fatal errors
no issue
- the API response for theme activation when a fatal validation error occurred has changed but the client wasn't updated resulting in a modal containing an "Activation failed" header but no details
- updates the error details extraction path and adjusts the tests to match the real API response
2019-04-11 11:00:40 +01:00
Rish
89e3303dad Fixed members list update on switch
no issue

- Members list updates on screen switch
2019-04-09 20:46:47 +05:30
Vikas Potluri
c19332f093 Fixed post/page labels in feature image and save components (#1143)
closes https://github.com/TryGhost/Ghost/issues/10658

- update publish menu states to use `{{post.displayName}}` instead of hard coded `post`
- update settings menu image uploader to generate CTA using `post.displayName`
2019-04-06 09:01:49 +01:00
Peter Zimon
bd90585956 Improved theme upload/activate flow and error styles (#1142)
no issue 

* Update error and warning styles
* Refined upload dialog
* Theme upload and activation style refinements
2019-04-05 17:27:14 +01:00
Zimo
f75d07ab87 Zapier settings screen UI refinements
no refs.
- refined Zapier template header for integrations screen
2019-04-04 14:07:20 +02:00
Kevin Ansfield
b51bc4751d Added integration details to Zapier integration screen behind dev flag
no issue
- the new version of our Zapier App uses API Key auth so we need to expose the details on the Zapier integration screen
- extracted `copyTextToClipboard` into a util function
- added `integrationModelHook` method to `settings.integrations` controller to remove duplication in the `settings.integration` and `settings.integration.zapier` routes
- fixed missing "Zapier" title token
2019-04-04 12:25:16 +01:00
Vikas Potluri
747bf6ea9f 🐛 Fixed confusing messaging around .yml extension being allowed for routes.yaml uploads (#1140)
no issue

The server never supported uploading .yml files

* updated uploader `invalid extension` error message to be more abstract
* fixed routes uploader validation allowing .yml files
2019-04-03 19:54:05 +01:00
Zimo
5b9e68401a Added placeholder illustration for posts and pages
no refs.
2019-03-25 16:43:38 +01:00
Zimo
428984bca2 Fixed integration icon background for Night shift
refs. 35d8e43c88

The blending mode used on light theme didn't work for Night shift (made all the icons blend into the dark background).
2019-03-25 14:38:16 +01:00
Kevin Ansfield
dbbc4f5fa4 🐛 Fixed error after logging in from a nested admin URL
closes https://github.com/TryGhost/Ghost/issues/10629
- the error was occurring due to `session.user` CP being populated with a rejected promise when attempting to access the first route. The CP has no dependent key so any further attempts to access `session.user` would be rejected
- marking the CP as "changed" immediately after logging in means that the next request will create a new promise and successfully fetch the user
2019-03-25 13:01:58 +00:00
Kevin Ansfield
d7b464a7ff Fixed notificaitons.displayDelayed() throwing an error
no issue
- `notifications.displayDelayed()` resets the `delayedNotifications` array but it wasn't using `.set()` which was throwing an Ember error because it wouldn't be tracked
2019-03-25 12:28:14 +00:00
Kevin Ansfield
162cbae3f0 Improved theme activation warnings modal content
closes https://github.com/TryGhost/Ghost/issues/10627
- removed confusing/unnecessary message when activation was successful with warnings
- do not display "Warnings" sub-heading if there are no other errors to reduce duplication with the modal title
- changed "Close" button text to "Ok" so it feels more like a confirmation
- refactored modal template to have explicit `this` rather than implicit property lookup ([RFC](e724c7087e/text/0308-deprecate-property-lookup-fallback.md))
2019-03-25 12:20:14 +00:00
Kevin Ansfield
d0a834b477 🐛 Fixed missing error notification when attempting to activate an invalid theme
no issue
- updates error handling to work with new v2 error response formats
  - `.errorType` -> `.error`
  - `.errorDetails` -> `.details`
2019-03-25 11:32:29 +00:00
Zimo
2eabb1b75a Fix tumbleweed Y position on 404
no refs.
The tumbleweed position on the 404 animation was too high and it looked like it was bouncing behind the cactus.
2019-03-25 09:59:28 +01:00
Zimo
35d8e43c88 Removed white background of integration icons
no refs.
Set blending mode to multiply on the integration icons (on Integrations screen) to remove the white background that was visible on hover and didn't fit with the background color of the table rows.
2019-03-25 09:48:22 +01:00
Zimo
cdd3f40422 Fixed button and title cases for Tags screen
no refs.
Set "New tag" button and "Tag settings" to sentence case to be consistent with the rest of the UI. (Previously they were title case.)
2019-03-25 09:37:44 +01:00
Zimo
4a3344e70a Fixed Unsplash image preview width
no refs.
The image in Unsplash preview in Koenig didn't fill the entire width of the viewport which caused the overlay lean off on the sides of the preview image.
2019-03-25 09:30:48 +01:00
Kevin Ansfield
895cc7b647 🐛 Fixed unsaved editor changes being lost when changing PSM data on a published post
This reverts commit c19f5b9c51.

The "fix" is not correct, we want to ensure that unsaved changes in the editor are always kept.
2019-03-22 11:06:22 +00:00
Kevin Ansfield
700d3587c3 Fixed "view site" link not getting active class immediately after login 2019-03-21 18:08:57 +00:00
Kevin Ansfield
e7b740ba5f Added reset-to-homepage behaviour when clicking "view site" link
no issue
- return a basic "guid" from the site's `model` hook so that we have some data which changes on each refresh
- add an action to the wrapper element of the "view site" link which will cause the route to refresh when clicked if we're already on the route
- move the site iframe into a component so that it can watch an @uuid property and force a reset of the iframe's `src` when it detects a change
2019-03-21 17:55:58 +00:00
Kevin Ansfield
6acf2691d7 Fixed highlight of email field for "unknown user" in forgot password flow 2019-03-21 16:07:57 +00:00
Kevin Ansfield
0f46321565 Fixed undefined showing up in setup/two errors 2019-03-21 11:01:29 +00:00
Kevin Ansfield
f3cfafe6ac Improved error handling in setup/two screen
no issue
- display the `context` property of any API errors so that the messages are useful
- use the same email/password that was used for the setup request in the session request to avoid issues with keys being hit after Enter
2019-03-21 10:53:50 +00:00
Zimo
ea3c986f63 Fixed design/marketplace icon stroke
no refs.
- the marketplace icon is a filled icon and a stroke CSS property was applied to it, resulting in messy output
2019-03-21 11:47:44 +01:00
John O'Nolan
181de6f5ea View site inside Ghost Admin
no refs.
- added "View site" as the first and default menu item in navigation bar to be able to browse the site without leaving the Admin
- rearranged left sidebar items according to new structure (moved Labs down to bottom)
- removed "View site" from publication main menu because it's become redundant
- added Night shift toggle in line with Labs menu to be able quickly access it
2019-03-21 10:33:14 +01:00
Kevin Ansfield
e4ee09cfba 🐛 Fixed sometimes invalid (due to trailing slash) API URL shown on integration screen 2019-03-19 11:47:36 +00:00
Julien Ma
140a294b16 Fixed typo in page updated webhook event name (#1125) 2019-03-19 09:39:00 +00:00
Kevin Ansfield
68c09fce2d Fixed random failures in uploader component tests
refs https://github.com/TryGhost/Ghost/issues/10308
- removed reliance on `run.later` (`setTimeout`) in tests, instead favouring explicit ember-test-helper methods which wait for DOM changes
2019-03-18 19:14:24 +00:00
Kevin Ansfield
63b8127cfa Fixed "Send invitation" button needing to be clicked twice
refs https://github.com/TryGhost/Ghost/issues/7131
- adds `disableMouseDown` flag to `{{gh-task-button}}`
- uses flag for the send invite button so that the focus-out validation on the e-mail input is not triggered before the click event is triggered
2019-03-18 17:56:32 +00:00
Kevin Ansfield
98ab4d1d20 Fixed missing margin on subscribers action buttons 2019-03-15 16:27:52 +00:00
Kevin Ansfield
c19f5b9c51 🐛 Fixed unnecessary "Are you sure you want to leave?" modals
no issue
- if a post was saved before the body content was edited you would get stuck with an "Are you sure you want to leave?" modal even though you had already saved
- the editor saw the post as being in a dirty state because the `mobiledoc` and `scratch` value were null but after saving the `mobiledoc` value was set to an blank mobiledoc object as returned by the API
- updated the `post` model save method to reset the `scratch` value if the returned `mobiledoc` no longer matches
2019-03-15 16:18:53 +00:00
Kevin Ansfield
855fd7ae80 🐛 Fixed difficult to cancel webhook modal
closes https://github.com/TryGhost/Ghost/issues/10135
- `focusOut` events are fired before the `click` event is fired when clicking buttons whilst an input has focus, this has the effect of triggering our on-blur validations that can cause UI to jump which then results in the `mouseUp` being outside of the button which means no `click` event is fired
- stops `mouseDown` event from bubbling from modal cancel/close buttons so that `focusOut` validations aren't triggered
2019-03-15 14:38:54 +00:00
Kevin Ansfield
9104b73aff Fixed ember resolver warning for ambiguous authorNames access
no issue
- we've added an `{{author-names}}` helper, this generated a warning from `{{gh-posts-list-item}}` which contained `{{authorNames}}` referencing a CP on the component context
- changing the CP access to be explicit using `{{this.authorNames}}` resolves the warning
- updated other references in the template to be explicit in order to differentiate between local context and helpers (this will be enforced in later Ember versions)
2019-03-13 16:16:08 +00:00
Kevin Ansfield
75245f0d3d Improved duplication checking in notifications service
closes https://github.com/TryGhost/Ghost/issues/10514
- deduplicates alerts based on message content as well as key
2019-03-12 17:50:45 +00:00
Kevin Ansfield
fc6574f0ed Updated editor error handler to work better with new API error messages
no issue
- pass a received API error directly through to the notifications service rather than adding an unnecessary prefix to the error message
2019-03-12 17:49:15 +00:00