Commit Graph

6532 Commits

Author SHA1 Message Date
Kevin Ansfield
72fe327c3b Fix cmd-s shortcut not saving changes in text fields with focusout
closes #4556
- when <kbd>CMD-S</kbd> is used, if the focused element is an input, trigger it's `focusout` handler then schedule the save action to happen after any actions resulting from the trigger
2016-05-11 11:59:36 +02:00
kirrg001
77fc9ea265 Subscribers: Move read CSV into separate utility
- split out read CSV function into utility and add tests
- update API response to follow JSONAPI more closely
- update the UI to match the new API response
2016-05-11 11:22:35 +02:00
Kevin Ansfield
4f1fae5e7d 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
kirrg001
804fcffa6c Subscribers: store post id using the postlookup fn 2016-05-11 10:28:12 +02:00
kirrg001
ef605c5191 Subscribers: finish permission handling
no issue
- add some more tests, optimise tests and finish tests
- subscriber model checks external context permissions in permissible fn
- add missing permissions for subscriber csv
2016-05-11 10:28:12 +02:00
kirrg001
a836081f54 Subscribers: keep original referrer & location if set 2016-05-11 10:28:11 +02:00
Hannah Wolfe
6ef79534e4 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
74b83766bc 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
Kevin Ansfield
b5cd640bd9 deps: ember-light-table@0.1.9 2016-05-11 10:28:10 +02:00
Sebastian Gierlinger
01ae7ae49f Subscribers: Model, API & CSV import/export
- subscriber model
- subscriber app updates
- subscriber end points
- import/export CSV
- added headers to export file
- added dynamic email field detection for import
- returns stats object after CSV import
- mask error message from DB
2016-05-11 10:28:10 +02:00
Hannah Wolfe
4ca0c67f9c Subscribers: Adding subscribe app + tpl + helper
- added new internal app "subscribers"
- app has a template "subscribe.hbs"
- adds a new helper called "form_subscribe"
2016-05-11 10:28:10 +02:00
Hannah Wolfe
c41c09ef97 Subscribers: Migrations for new table + perms
refs #6301

- add new subscribers table with tests
- add permissions for subscribers endpoint
- minor improvments to test code
2016-05-11 10:28:10 +02:00
Sebastian Gierlinger
85c1e1407f Merge pull request #6804 from kirrg001/adds/permission-improvements
add small permission improvements
2016-05-11 10:27:32 +02:00
Kevin Ansfield
4f2f610811 Improve gh-profile-image tests for #6640
refs #6640
- add `NotFoundError` to ajax service and test against that when catching errors in `gh-profile-image`
- don't use `passthrough` in Mirage for gravatar requests to avoid network calls during testing
- add additional tests for `gh-profile-image` and put the debounced gravatar test back in place
2016-05-09 22:14:12 +02:00
David Balderston
11b2396e18 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
cf8d8474fa Merge pull request #6784 from AileenCGN/facebook-twitter-user
Structured Data 3.0
2016-05-08 18:41:42 +02:00
Aileen Nowak
b7bd6d9968 Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
2016-05-08 17:43:59 +02:00
Katharina Irrgang
f644d99460 add small permission improvements
no issue
- do not check client type in auth middleware
- offer filtering for findAll function in base
- add isInternalContext to base model
2016-05-08 14:22:55 +02:00
Kevin Ansfield
d928cd2ec2 Merge pull request #6803 from ErisDS/remove-jsdoc
deps: remove jscs-jsdoc
2016-05-08 14:17:07 +02:00
Hannah Wolfe
5eb5c2b3ef Merge pull request #6788 from kevinansfield/synchronous-labs-flags
Synchronous feature service
2016-05-08 13:59:31 +02:00
Hannah Wolfe
79b18f9566 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
Hannah Wolfe
3ac143d21f Merge pull request #6795 from AileenCGN/slack-integration
Slack integration
2016-05-08 13:58:28 +02:00
Hannah Wolfe
5101913db1 deps: remove jscs-jsdoc
- jscs-jsdoc is now part of jsdoc itself, and the additional plugin is no longer required
2016-05-08 13:17:19 +02:00
Kevin Ansfield
49414d0843 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
35ecaee6d3 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
Hannah Wolfe
2744fed5d8 Merge pull request #6800 from kirrg001/fix/null-problem
fix: delete null values from incoming objects
2016-05-08 09:58:48 +02:00
kirrg001
7d4107fec4 delete null values from incoming objects
no issue
- add more power to validation phase (checkObject) to get rid of null values
2016-05-08 09:18:44 +02:00
Hannah Wolfe
dac44b4d4b Merge pull request #6797 from kirrg001/fix/005-update-ghost-client-secrets-brace
fix brace mistake in 005/01-update-ghost-client-secrets.js
2016-05-07 17:31:36 +02:00
Sebastian Gierlinger
f7310f77b6 Merge pull request #6739 from ErisDS/cors-update
Add config URLS to CORS whitelist
2016-05-07 17:14:04 +02:00
kirrg001
6238dbc784 fix brace mistake in 005/01-update-ghost-client-secrets.js 2016-05-07 16:19:38 +02:00
Kevin Ansfield
3f6a67bc1f Synchronous feature service
supersedes #6773
- update `feature` service and `gh-feature-flag` component to work synchronously rather than async
- use the application route's `afterModel` hook so that settings are loaded before first load
- override `session` service's `authenticate` method to load the settings after successful authentication before any other routes are processed
2016-05-07 15:00:06 +02:00
Hannah Wolfe
a689998223 Merge pull request #6790 from TryGhost/greenkeeper-body-parser-1.15.1
Update body-parser to version 1.15.1 🚀
2016-05-07 13:47:16 +02:00
greenkeeperio-bot
e6008cd6d1 chore(package): update body-parser to version 1.15.1
https://greenkeeper.io/
2016-05-06 07:44:46 +02:00
Sebastian Gierlinger
ddb18e68f2 Merge pull request #6789 from ErisDS/postlookup
Split post lookup out of frontend controller
2016-05-05 17:46:56 +02:00
Hannah Wolfe
fd2cfd12db Merge pull request #6783 from TryGhost/greenkeeper-express-hbs-1.0.1
Update express-hbs to version 1.0.1 🚀
2016-05-05 17:06:23 +02:00
Hannah Wolfe
ae2f34c910 Split post lookup out of frontend controller
no issue

- move the post lookup functionality into its own file
- handle the pre and post lookup checks to verify that we found the correct post
- checking that the URL matches handles checking that a post looked up with pagePermalink is a page
- all cases where there is no match throws a 404 directly, this could just call next() ?
2016-05-05 15:53:17 +02:00
Austin Burdine
6714a0c961 Merge pull request #6786 from kevinansfield/deps-esa-110-beta5
deps: ember-simple-auth@1.1.0-beta.5
2016-05-05 06:31:53 -05:00
Kevin Ansfield
090c18da21 deps: ember-simple-auth@1.1.0-beta.5
no issue
- fixes last remaining 1.1.0 issue, will quite likely be last beta before final release
2016-05-05 12:55:42 +02:00
greenkeeperio-bot
c3780efc86 chore(package): update express-hbs to version 1.0.1
https://greenkeeper.io/
2016-05-04 13:57:42 +02:00
Hannah Wolfe
3f50f1194d Merge pull request #6781 from TryGhost/greenkeeper-sinon-1.17.4
Update sinon to version 1.17.4 🚀
2016-05-03 22:43:32 +02:00
greenkeeperio-bot
09bb961072 chore(package): update sinon to version 1.17.4
https://greenkeeper.io/
2016-05-03 22:19:27 +02:00
Hannah Wolfe
cf62db847d Merge pull request #6776 from TryGhost/greenkeeper-update-all
Update all dependencies 🌴
2016-05-03 21:57:41 +02:00
greenkeeperio-bot
04cde39657 chore(package): update dependencies
https://greenkeeper.io/
2016-05-03 21:22:43 +02:00
Kevin Ansfield
6f9d7913b6 Merge pull request #6772 from acburdine/remove-feature-controller
Remove unused feature controller
2016-05-02 08:31:33 +01:00
Hannah Wolfe
b3facbf84f Merge pull request #6747 from jaswilli/grunt
deps: grunt@1.0.1 + related updates
2016-04-29 21:35:55 +01:00
Austin Burdine
1a6568d8e2 remove unused feature controller 2016-04-28 12:22:54 -05:00
Kevin Ansfield
77134ad583 Merge pull request #6768 from acburdine/more-action-fixes
More action cleanup
2016-04-28 16:58:35 +01:00
Austin Burdine
d5a2bc0b63 convert more action calls to the ember-invoke-action syntax 2016-04-28 10:34:36 -05:00
Jason Williams
7a8c064c42 deps: grunt@1.0.1 + related updates
- Gets all grunt dependencies in line with the
  grunt 1.0 release.
- deps: grunt-cli@1.2.0.
- deps: grunt-bg-shell@2.3.3.
- deps: grunt-contrib-clean@1.0.0.
- deps: grunt-contrib-compress@1.2.0.
- deps: grunt-contrib-copy@1.0.0.
- deps: grunt-contrib-jshint@1.0.0.
- deps: grunt-contrib-watch@1.0.0.
- deps: grunt-docker@0.0.11.
- deps: grunt-express-server@0.5.3.
- deps: grunt-jscs@2.8.0.
- deps: grunt-mocha-cli@2.1.0.
- deps: grunt-mocha-istanbul@4.0.2.
- deps: grunt-shell@1.3.0.
- deps: istanbul@0.4.3.
2016-04-28 09:18:27 -05:00
Kevin Ansfield
d085c827ca Merge pull request #6519 from acburdine/esa-1.1
Upgrade ember-simple-auth to 1.1-beta
2016-04-28 14:58:15 +01:00