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

100 commits

Author SHA1 Message Date
Kevin Ansfield 7e4d385de8 refactor gh-fullscreen-modal component to use liquid-wormhole directly (#281)
no issue

- remove `liquid-tether` dependency
- add `liquid-wormhole` dependency (previously a dependency of liquid-tether)
- refactor `gh-fullscreen-modal` to simplify and use `liquid-wormhole` directly instead of `liquid-tether` as we don't need the positioning ability that `liquid-tether` provides
- fixes broken View/Component tree in Ember Inspector 🎉
2016-10-07 14:27:39 +01:00
Kevin Ansfield 1f36c94109 deps: ember-light-table@1.4.2 (#307)
no issue

- update `ember-light-table` to 1.4.2
- remove `gh-light-table` override component as scrolling has been fixed
- disable the infinite scroll acceptance test for now because Chrome has issues detecting the position of the scroll trigger when the app is rendered into the zoomed container during testing
2016-10-07 13:58:53 +01:00
Austin Burdine 772d1faf5f remove unused gh-select-native template (#297)
no issue
- removes template that was missed in #286
2016-10-01 09:10:21 +01:00
Kevin Ansfield 0a163d7333 Ghost.org OAuth support (#278)
issue TryGhost/Ghost#7452, requires TryGhost/Ghost#7451
- use a `ghostOAuth` config flag to switch between the old-style per-install auth and centralized OAuth auth based on config provided by the server
- add OAuth flows for:
  - setup
  - sign-in
  - sign-up
  - re-authenticate
- add custom `oauth-ghost` authenticator to support our custom data structure
- add test helpers to stub successful/failed oauth authentication
- hide change password form if using OAuth (temporary - a way to change password via oauth provider will be added later)
2016-09-30 13:43:40 +02:00
Kevin Ansfield 3afc43e2d2 replace gh-select-native with one-way-select (#286)
no issue
- removes `gh-select-native` component as ember-one-way-control's `one-way-select` component offers the same one-way-binding but also allows element attributes to be set
2016-09-26 11:39:43 -05:00
Kevin Ansfield 5913827646 Separate invites and users (#277)
closes https://github.com/TryGhost/Ghost/issues/7420, requires https://github.com/TryGhost/Ghost/pull/7422
- adds a new `Invite` model with associated serializer and test setup
- updates team screen to use invites rather than existing users with the "invited" property
- updates signup process to work with new invite model
- updates setup process to create invites instead of users
- swaps usage of `gh-select-native` for `one-way-select` in the invite modal so that attributes can be set on the `select` element
- updates resend invite process to account for server returning a new model
- rewrites the invite management tests and fixes mirage mocks for invite endpoints
- sorts invites by email address to avoid jumping invites when re-sending
2016-09-26 18:03:53 +02:00
Ryan McCarvill c34e0161ff Mobile-Doc based editor (#291)
refs TryGhost/Ghost#7429, requires TryGhost/Ghost#7437

Added Ghost-Editor (based on mobiled doc).
-------------------
- Added mobiledoc editor
- Fixed problems with workflow and auto saves
- Integrated basic toolbar
- Removed all editor related tests, everything bar the most basic acceptance tests will be in the ghost-editor repository.
- Commented out tests which relied on Ember Helpers that are not compatable with mobile-doc, workarounds are inbound shortly.

This is the first integration of ghost-editor. It's styled enough to work, however it is not anywhere approaching something that looks remotely like what the finished thing will be.

Early ALPHA, development build. Tread cautiously.
2016-09-26 15:04:20 +02:00
Kenneth Ashley 54e41b2f78 Safari doesn't show dragged-over state for file uploads (#288)
closes TryGhost/Ghost#7310
- Removes double dashes from modifier classes as safari won’t allow this.
2016-09-24 11:10:08 +02:00
Kevin Ansfield 1ee787ed42 display warnings after theme upload (#262)
refs TryGhost/Ghost#7362, requires TryGhost/Ghost#7367
- display any gscan warnings we get back from a successful upload to cater for the downgrade of missing `{{asset}}` helpers from an error to a warning
2016-09-14 18:34:07 +01:00
Kevin Ansfield a9f17cbfb6 detailed theme validation errors (#226)
no issue
- display the detailed validation errors that we get back from gscan so that users know how to fix their themes
2016-08-24 20:22:20 +02:00
Kevin Ansfield eb0db3fafe indicate folder names to tell duplicate themes apart
refs https://github.com/TryGhost/Ghost-Admin/pull/210
- removes unused `activeTheme` property on `gh-theme-table`
- updates label generation in `gh-theme-table` to add folder names when there are duplicate package.json name+version combos
2016-08-23 16:55:32 +01:00
Kevin Ansfield 5581c6ba5a theme management UI
refs https://github.com/TryGhost/Ghost/issues/7204, requires https://github.com/TryGhost/Ghost/pull/7209

- replaces theme dropdown with a table
- adds theme upload modal
    - validates theme mime type
    - prevents upload of `casper.zip` (default Casper theme can't be overwritten)
    - warns if an upload will overwrite an existing theme
    - gives option of immediately activating the uploaded theme or closing after successful upload
- adds theme activation link/action
- adds theme download link/action
- adds theme deletion modal
    - warns about no undo possibility
    - offers possibility to download theme
- modifies mirage config to handle theme changes
2016-08-23 12:42:38 +01:00
Kevin Ansfield 4d59fdb8fb validate file uploads against "accept" mime-type before uploading (#214)
closes https://github.com/TryGhost/Ghost/issues/7144
- allow the `accept` attr of `gh-file-uploader` and `gh-image-uploader` to be specified
- allows a `validate` action to be passed into `gh-image-uploader` and `gh-file-uploader` components that runs after a file is selected and before the upload starts
- adds a default `validate` action to `gh-image-uploader` and `gh-file-uploader` that triggers the normal `UnsupportedFileType` error when the selected file's mime-type does not match the `accept` attribute
- adds mime type validation to labs importer (basic implementation, should be replaced with uploader components once they have been refactored)
2016-08-22 05:45:33 -06:00
Austin Burdine e772430bd6 Introducing Concurrency (#147)
* deps: ember-concurrency@0.7.8

* initial conversion of post & user actions to e-concurrency tasks

- add task button which handles auto-spinning of e-concurrency tasks
- fix tests
2016-08-11 07:58:38 +01:00
Kevin Ansfield 96f2d4088f Handle automatic timezone override
refs https://github.com/TryGhost/Ghost/pull/7142, https://github.com/TryGhost/Ghost/pull/7143
- moves timezone selection template and logic into a component
- detect if the current `activeTimezone` is not in our pre-defined list of timezones, if it isn't:
  - add a line indicating that there has been an override with the current `activeTimezone` value
  - add a blank option to the timezone select list
2016-07-26 11:50:24 +01:00
Austin Burdine 7fc02c1007 fix image uploader text handling (again) (#140)
closes TryGhost/Ghost#7127
- image uploader now handles "text" and "alt text" differently
2016-07-24 10:19:49 +01:00
Vijay Kandy 96f1b6342d Added upgrade notification component to About page. (#102)
- Picked some fixes https://github.com/TryGhost/Ghost/pull/5670/files
- Destructured Ember properties
- Removed unused imports and fixed unit test errors.
2016-07-15 16:58:35 -06:00
Austin Burdine a82181fdd6 fix image component displaying alt text in uploader (#105)
closes TryGhost/Ghost#7064
- pull alt text from parsed markdown
- move text to image uploader component proper
2016-07-14 13:27:18 +01:00
Kevin Ansfield e4c0aaf7b9 "400 Version Mismatch" error handling
refs https://github.com/TryGhost/Ghost/issues/6949

Handle version mismatch errors by:
- displaying an alert asking the user to copy any data and refresh
- disabling navigation so that unsaved data is not accidentally lost

Detailed changes:
- add `error` action to application route for global route-based error handling
- remove 404-handler mixin, move logic into app route error handler
- update `.catch` in validation-engine so that promises are rejected with the
  original error objects
- add `VersionMismatchError` and `isVersionMismatchError` to ajax service
- add `upgrade-status` service
  - has a method to trigger the alert and toggle the "upgrade required" mode
  - is injected into all routes by default so that it can be checked before
    transitioning
- add `Route` override
  - updates the `willTransition` hook to check the `upgrade-status` service
    and abort the transition if we're in "upgrade required" mode
- update notifications `showAPIError` method to handle version mismatch errors
- update any areas where we were catching ajax errors manually so that the
  version mismatch error handling is obeyed
- fix redirect tests in editor acceptance test
- fix mirage's handling of 404s for unknown posts in get post requests
- adjust alert z-index to to appear above modal backgrounds
2016-07-08 14:56:26 +01:00
Kevin Ansfield 9fd82f06da Fix un-bound HTML attributes for gh-trim-focus-input
no issue
- updates `gh-trim-focus-input` to extend from `gh-input`/`one-way-input` to get the auto-binding attribute behaviour for passed-in HTML attributes
- renames `focus` property to `shouldFocus` so that we're not overriding default DOM functions
- fixes signin page issues with missing placeholders and no autofocus
2016-06-20 15:20:25 +01:00
Austin Burdine c1367dac34 convert inputs to one-way inputs
no issue
- moves all inputs to use the data-down-actions-up component paradigm
2016-06-18 07:44:23 -04:00
Aileen Nowak 6ce7e14fd7 Scheduler UI
refs TryGhost/Ghost#6413 and TryGhost/Ghost#6870

needs TryGhost/Ghost#6861

- **Post Settings Menu (PSM)**:'Publish Date' input accepts a date from now, min. 2 minutes to allow scheduler processing on the server. Also, there will always be some delay between typing the date and clicking on the 'Schedule Post' button. If the user types a future date for an already published post, the date will be reseted and he sees the message, that the post needs to be unpublished first. Once, the date is accepted, the label will change to 'Scheduled Date'.

- adds a CP 'timeScheduled' to post model, which will return `true` if the publish time is currently in the future.

- **Changes to the button flow in editor**:
- if the the CP `timeScheduled` returns true, a different drop-down-menu will be shown: 'Schedule Post' replaces 'Publish Now' and 'Unschedule' replaces 'Unpublish'.

- Covering the _edge cases_, especially when a scheduled post is about to be published, while the user is in the editor.
	- First, a new CP `scheduleCountdown` will return the remaining time, when the estimated publish time is 15 minutes from now. A notification with this live-ticker is shown next to the save button. Once, we reach a 2 minutes limit, another CP `statusFreeze` will return true and causes the save button to only show `Unschedule` in a red state, until we reach the publish time
	- Once the publish time is reached, a CP `scheduledWillPublish` causes the buttons and the existing code to pretend we're already dealing with a publish post. At the moment, there's no way to make a background-fetch of the now serverside-scheduled post model from the server, so Ember doesn't know about the changed state at that time.
	- Changes in the editor, which are done during this 'status freeze'-process will be saved back correctly, once the user hits 'Update Post' after the buttons changed back. A click on 'Unpublish' will change the status back to a draft.
	- The user will get a regular 'toaster' notification that the post has been published.

- adds CP `isScheduled` for scheduled posts
- adds CP `offset` to component `gh-posts-list-item` and helper `gh-format-time-scheduled` to show schedule date in content overview.
- sets timeout in `gh-spin-button` to 10ms for `Ember.testing`
- changes error message in `gh-editor-base-controller` to be in one line, seperated with a `:`

TODOs:
- [x] new sort order for posts (1. scheduled, 2. draft, 3. published) (refs TryGhost/Ghost#6932)
- [ ] Move posts sorting from posts controller to model and refactor to use `Ember.comparable` mixin
- [x] Flows for draft -> scheduled -> published like described in TryGhost/Ghost#6870 incl. edge cases and button behaviour
- [x] Tests
- [x] new PSM behaviour for time/date in future
- [x] display publishedAt date with timezone offset on posts overview
2016-06-13 17:01:42 +02:00
Austin Burdine 7d693c1f96 internal tags feature
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests
2016-06-13 08:21:41 -06:00
Kevin Ansfield 3ce26bc347
Improve uploader tests + test subscribers CSV import
no issue
- override `x-file-input` in `gh-file-input` to look for a custom property on the change event if we are in testing mode (this is necessary because Ember 2.5+ use native rather than jQuery events so `target.files` is readonly, see https://github.com/emberjs/ember.js/issues/13540)
- migrate unit tests for the uploader components to the integration tests
- add skipped acceptance tests for the subscribers CSV import now that it's possible to simulate file uploads
2016-05-27 13:34:31 +01:00
John O'Nolan bf8571c73c Merge pull request #6764 from TryGhost/subscribe
Subscribers
2016-05-11 13:53:53 +02:00
Kevin Ansfield f69c5125e6 Subscribers: Admin UI updates & fixes
Update for synchronous feature service

Add client-side handling of server-side errors when adding subscribers
- display server-provided error message when we get a server error
- fix the ajax util's `getRequestErrorMessage` method so that it works correctly with Ember's `InvalidError` object instead of the previous request object that it was receiving (*TODO:* this really needs looking at properly so we aren't losing details and Ember Data can do it's stuff)

Styling updates
- proper icon for ascending/descending
- change hover colour to green for "Import CSV" button

Delete subscriber button with confirm modal
- display delete button when hovering over a subscriber row (WARN: really ugly button, styles definitely want looking at)
- show confirm modal when clicking the delete button
- delete subscriber, remove from table, and update total on confirm
2016-05-11 11:22:35 +02:00
Hannah Wolfe 8096659f2f Subscribers: router & form helpers
Form:
- add confirm, location & referrer hidden fields
- add script to populate location & referrer
- add helper for creating the email field
- pass through input class and placeholder for email from top level form helper
- rename subscribe_form template & helper as it sounds more natural
- handle success and error cases differently
- improve error message display
- ensure useful data is passed back so that we can show nice messages
- check for honeypot value being filled out
- refactor error handler to set an error and always still render
2016-05-11 10:28:11 +02:00
Kevin Ansfield 67765897b2 Subscribers: Admin User Interface v1
Initial Subscribers screen
- set up mocked api endpoints
- basic subscribers screen with data loading, infinite scroll

"Add Subscriber" screen
- uses modal to display a new subscriber form
- validates subscriber e-mail address
- moves pagination from route into controller to use filtered/sorted CPs on top of a live-query so that new subscribers are added to the list and the total can be properly managed

TODO:
- there is currently a pretty serious performance issue where the whole table is re-rendered when the live-query is updated. `ember-light-table` doesn't allow for live-binding and has no options to easily manipulate it's rows using an external interface - it's possible to move the page loading into the component so we only render new rows but that leaves it difficult to react to new subscribers being added through the UI. I believe the number of components used within the table is also adding to the performance problems.
  - most likely solution is to drop `ember-light-table` in favour of rendering the table directly - glimmer should do a good job of fast updates even though the underlying array will be completely swapped out

"Import subscribers" screen
- uses modal to display an import subscribers CSV file upload form
- displays upload progress
- displays import stats and reloads subscribers table once import has completed
- adds `gh-file-uploader` component (NB. pared down copy of `gh-image-uploader`, ripe for some refactoring)
- fixes subscribers acceptance test failing because fixtures did not have the labs flag enabled

Unfortunately this doesn't have 100% test coverage as we're limited in how we can simulate file uploads 😞

Fix performance issues with subscribers table
- moves the table definition from the component up to the controller
- switches back to manually manipulating table rows instead of using a live-query

This is a quick-fix in that it allows us to continue using the `ember-light-table` component but it does mean that we lose some flexibility that the live-query gave us. For now it's not much of an issue and it allows us to defer deeper performance/flexibility work until we have a concrete need and requirements.

Hook up Export CSV button
- use a hidden iFrame to trigger the browser to hit the CSV export endpoint and download the file

Re-order subscribers table by clicking column headers
- displays currently sorted column and sort direction
- clicking a column header re-fetches the data from the server with the appropriate query params

Fix scroll triggers for infinite pagination + icon change
- adds a debounce as well as the throttle so that we always get a final scroll trigger once scrolling has stopped
- changes the subscribers icon from the temporary team icon to the mail icon
2016-05-11 10:28:11 +02:00
David Balderston d238b82b01 Fix Transparent Background in Gravatar Showing Background Image
Closes #5882

* If a gravatar image is available, remove the default image behind it
* If gravatar image is not available, keep or replace the default image
2016-05-09 22:09:27 +02:00
Hannah Wolfe 295ca2861a Merge pull request #6802 from kevinansfield/editor-img-perf-makes-me-sad
Fix editor image perf and upload bug
2016-05-08 13:58:54 +02:00
Kevin Ansfield 11261e9b96 Fix editor image perf and upload bug
no issue
- ~10x speedup in processing time taken on each keypress when there are many images/image upload components in the editor
  - edit DOM in memory before changing it in the page to avoid double-render
  - keep upload components around and re-assign them on re-render, adding or removing an image will still re-generate everything
- adds a throttle to the preview rendering so that renders don't get queued up
- fixes occasional bug where uploading an image didn't update the markdown correctly due to a timing issue
2016-05-08 12:55:56 +02:00
Aileen Nowak e99569b6f4 Slack integration
closes #6584
- Frontend Changes:
	- adds 'Apps' to Navigation Menu
	- adds 'Slack' as nested page to Apps
	- adds `apps.css`
	- adds `slack-integration` model and uses `slack-settings` custom transform to parse JSON file
	- adds validation for `slack` model
	- adds fixtures and `slack/test` API endpoint to Mirage
	- adds acceptance tests for `apps-test` and `slack-test`
	- adds unit tests for `slack-settings` and `slack-integration`
- Backend Changes:
	- adds API endpoint `slack/test` to send Test Notification
	- adds default-values for slack model
	- sends payload to slack:
		- text: the url of the blogpost / test message
		- icon_url: url to ghost logo
		- username: Ghost
	- adds `slack/index.js` to send webhook to slack if
		- a new post is published (if slack webhook url is saved in settings)
		- user clicks on 'Send Test Notification' in UI
	- adds `slack.init()` to `server.index.js` to add event listener
	- adds unit test for `slack/index`
2016-05-08 12:49:15 +02:00
Austin Burdine 678274ae72 replace gh-selectize with power-select in gh-search-input
refs #6458
2016-04-19 10:55:10 -05:00
Hannah Wolfe 1ebe96b284 Merge pull request #6651 from kevinansfield/uploader-js-must-die
Replace jQuery-based uploader.js with ember components
2016-04-14 16:57:57 +01:00
Kevin Ansfield 39a175108b Replace jQuery-based uploader.js with ember components
no issue
- adds `gh-image-uploader` that handles image uploads in a fully ember fashion and with no dependency on `uploader.js`
- adds `gh-image-uploader-with-preview` that can fully replace the old `gh-uploader`
- replace uses of `gh-uploader` in PSM & TSM with `gh-image-uploader-with-preview`
- updates the editor preview image handling to use the new `gh-image-uploader-with-preview` component
- updates the image upload modal to use `gh-image-uploader` (utilises the `saveButton=false` flag which means the preview has to be handled externally to avoid auto-replacement when typing a URL)
- removes all old `uploader.js` related code
- adds custom `RequestEntityTooLargeError` and `UnsupportedMediaTypeError` errors to our `ajax` service
2016-04-05 12:03:20 +01:00
Austin Burdine 72e6f2be9f replace hardcoded AWS image url with static image url 2016-03-31 12:09:54 -05:00
Kevin Ansfield c3cb2d8741 Merge pull request #6387 from novaugust/post-deletion
Fix post deletion scroll on content and tag screens
2016-02-15 11:02:42 +00:00
Hannah Wolfe 971afd9042 Merge pull request #6468 from kevinansfield/ember-sortable-nav-items
Replace jquery-ui.sortable with ember-sortable for nav items
2016-02-14 13:44:07 +00:00
Kevin Ansfield 8aaf2e1356 Replace jquery-ui.sortable with ember-sortable for nav items
refs #6458, closes #6457
- replaces jquery-ui.sortable with ember-sortable for drag-n-drop handling
- moves the "new/blank" nav item out of the nav items list
  - allows it to be excluded from the draggable list
  - cleans up handling of the `navigationItems` array as there's no longer a need to ignore/exclude this extra item
- clears validation errors when typing in the respective field
- adds acceptance test for adding/removing nav items
- improves acceptance test for saving nav items to cover more edge cases
2016-02-09 22:08:21 +00:00
Matt Enlow 6c7095a9ba Load more posts after post deletion
Closes #6390
- check if more posts should be loaded whenever one is deleted
- delete dead code from posts controller
- delete duplicate component gh-infinite-scroll-box
- simplify posts-list-item `posts.post` or `editor.edit` link logic by modifying `gh-content-view-container` to yield necessary vars directly and use inline ifs in template
- add `gh-tag` component for rendering tags and updating infinite scroll box on `settings/tags` page
2016-02-09 09:08:31 -07:00
Austin Burdine 75f775ec1c convert feature controller to service
closes #6170
- add gh-feature-flag component to create a checkbox (reduce duplicate code)
2016-02-09 08:37:44 -06:00
Kevin P. Kucharczyk 24cc72cafd Standardise client property names to camelCase
closes #6018
- added keyForAttribute method in application serializer
- override keyForAttribute in settings serializer to not apply camelCase/underscore conversion
- rename under_scored properties to camelCased
2016-01-23 19:12:22 +01:00
Kevin Ansfield ce70ebb1a8 Isolate all markdown editor behaviour into gh-editor component
no issue
- move all existing markdown editor behaviour out of the editor controller and isolate it into a single component that can be swapped out
- split the `register/remove` functions of the `shortcuts-route` out into a separate `shortcuts` mixin
2016-01-13 12:01:31 +00:00
Kevin Ansfield 97bb577496 Refactor modals
refs #5798, closes #5018
- adds new `gh-fullscreen-modal` component - modals are now specified in-context so that they can have deeper interaction with their surrounding components/controller/route, i.e. a modal component can be a thin confirm/deny wrapper over the underlying controller action keeping all context-sensitive logic in one place
- adds spin-buttons to all modals with async behaviour
- adds/improves behaviour of inline-validation in modals
- improves re-authenticate modal to properly handle validation and authentication errors
2016-01-12 20:53:08 +00:00
Kevin Ansfield 08e3feee4c Fix changing text and jumping caret in PSM's date input
refs #5777
- adds new `gh-datetime-input` that takes a one-way-bound value and formats it, only triggering the supplied `update` action on focus-out
- fixes bug in PSM's `setPublishedAt` action if model's `published_at` is a Date object not a Moment object
2015-12-08 10:13:17 +00:00
Austin Burdine f9b4c89e51 deps: ember/ember-data@2.2.0 2015-11-30 12:23:47 -06:00
Hannah Wolfe 5f68b5477a Merge pull request #6017 from kevinansfield/finalize-debounced-gravatar
Finish changes in #5807 (debounced gravatar load in gh-profile-image)
2015-11-02 18:14:53 +00:00
Kevin Ansfield 14a182d691 Mobile fixes for tag management UI
refs #5845, #5969
- when on mobile devices tag management UI will only display a list and when a tag is accessed the tag settings form will slide in from the right
- tag settings form header has a 'back' button when on mobile to go back to tags list
- switching from mobile to standard modes will auto load the first tag as per standard tags screen on desktop
- if no tags are present then the blank-slate template will be shown when on mobile
2015-11-02 13:18:10 +00:00
Kevin Ansfield b06881be04 Finish changes in #5807 (debounced gravatar load in gh-profile-image)
refs #5807, #5797
- add configurable debounce period
- rename `hasEmail` to `displayGravatar` to better reflect it's purpose
- add tests
2015-10-29 11:30:30 +00:00
Kevin Ansfield 4ecdf182e6 Routable tags
refs #5845
- Updates tag settings screen to match content screen behaviour. Each now tag has it's own route that is link-able from other areas of the app
- Updates a number of places where jQuery event handler code was not wrapped in Ember's run loop
2015-10-27 12:48:41 +00:00