Commit Graph

1500 Commits

Author SHA1 Message Date
Katharina Irrgang
97e955a55e fix: choose user when login from test env (#7213)
no issue

- pass userIndex when do testUtils.auth
2016-08-19 07:32:01 +01:00
John O'Nolan
61a8845ab5 Switch to new native system font stack (#7219)
no issue

Based on an increasingly popular trend and modern web typography capabilities, switch out Google Fonts for default native system fonts, tailored in a stack to suit every device. Also makes some very minor visual adjustments to suit.

Nixes all references to Google Fonts, and provides a faster rendering experience and fewer http requests. 💃

Reference material:

https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/
https://medium.design/system-shock-6b1dc6d6596f#.rhqx5fmyz
Dependencies:

TryGhost/Ghost-Admin#211
TryGhost/Ghost-Desktop#190
2016-08-18 20:29:46 +01:00
Katharina Irrgang
663b410fd4 feature: upload validation middleware (#7208)
no issue

- Source out validation logic into a upload validation middleware for all upload types (csv, image, subscribers). This unit can be later used for Ghost 1.0 as a pre validation core unit. 
- More usage of route tests than controller tests. These are use case tests, a use case only changes if the product changes
2016-08-18 20:25:51 +01:00
Katharina Irrgang
9cd9e03fdb fix: notification store without duplicates (#7135)
closes #7133
- ensure we don't add duplicate notifications to the in process notification store
2016-08-11 08:58:51 +01:00
Greenkeeper
dd5775c018 Update mocha to version 3.0.2 🚀 (#7165)
* chore(package): update mocha to version 3.0.2

https://greenkeeper.io/

* fix duplicate done/promise handling
2016-08-11 08:51:19 +01:00
Tim Walling
a0288303f6 Check file type and file extension when importing csv (#7185)
issue #7144
- added a check for file type and file extension
- added an error message to the localization file
- added integration test
2016-08-11 08:46:06 +01:00
Austin Burdine
58bb111c56 ensure static page edit route redirects to editor (#7169)
closes #7168
- double check that page matches the page format in post-lookup
- add tests
2016-08-08 09:42:04 +02:00
Katharina Irrgang
c6f1a8de13 fix: refresh settings cache for migration 006 (#7147)
no issue
- refresh settings cache after 006/001 migration fixture
2016-07-26 13:53:17 +01:00
Katharina Irrgang
e5a0471c9d improvement: set activeTimezone when transforming dates (#7142)
no issue
- sets `settings.activeTimezone` to best-guess based on current server time when performing the timezones migration in order to prevent unexpected changes in timezone when upgrading
2016-07-26 12:05:39 +01:00
Katharina Irrgang
c9dc367bf0 improvement: validate timezones (#7143)
no issue
- add isTimezone to schema validation
2016-07-26 10:23:20 +01:00
Katharina Irrgang
417b9b6b7c fix: enable maintenance mode only if there is an upgrade to perform (#7129)
refs #7125
- create isDatabaseOutOfDate fn for initial migration update checks
- only set maintenance.enabled to true if migration needs to happen
2016-07-26 09:56:07 +01:00
Austin Burdine
218bc06278 don't populate settings defaults twice on startup (#7121) 2016-07-22 20:01:36 +01:00
Vijay Kandy
f2d09df512 Support for custom notifications (#7077)
closes #5071

- Send application/json requests to UpdateCheck service. New UpdateCheck service accepts JSON request
- If UpdateCheck service respponse has messages[] array, iterate over the array and create custom notifications intended for current version
- Save custom notification if its not already in the store AND its uuid is not in seenNotifications array
- When a custom notification is dismissed, store its uuid in seenNotifications array
- setup test fixtures to trigger tests properly
- api_notification_spec test to ensure custom notification can be added to store and added to seenNotifications when dismissed
- update_check_spec test to ensure custom notification can be displayed for a specific Ghost version
- added test to ensure messages meant for other versions don't create notifications
2016-07-22 14:02:10 +01:00
Lukas Strassel
9d1848ce5c Allow usage of blogurl:port inside of navigation (#6998)
closes #6893

- modified logic to allow urls in form of domain:port to be referenced in navigation
- added a test a domain:port link
2016-07-21 14:05:13 +01:00
Kevin Ansfield
302702c740 Revert "fix: ensure we initialise activeTheme on bootstrap (#6950)"
This reverts commit 8f2afeed03.
2016-07-21 12:26:16 +01:00
Katharina Irrgang
8f2afeed03 fix: ensure we initialise activeTheme on bootstrap (#6950)
closes #6948
- the hbs engine was never initialised  when server starts
- when you request a page which does not exist, express jumps directly into the error handlers
- delete some dynamic hbs engine setters in theme handler
2016-07-21 12:09:11 +01:00
Austin Burdine
4305790151
fix test 301 issue 2016-07-19 14:03:24 -06:00
Vijay Kandy
ffd3ec563a fix: "url" field is undefined when restricting returned fields (#7089)
closes #6625

- "url" and "author" fields depend on {id, published_at, slug, author_id} to construct post url.
- implemented a generic solution by defining defaultColumnsToFetch() in
  base class for models.
- findPage() calls defaultColumnsToFetch() before loading models
- results are transformed by filtering out additional properties to return just the requested fields
- Added a test case to check for url and author fields
- Renamed allColumns as requestedColumns and used _.map instead of Promise.map
2016-07-18 22:21:47 +02:00
Austin Burdine
7904253f62 fix test issues on node v6 (#7106) 2016-07-18 18:22:37 +01:00
Joris Berthelot
795a59d677 Allow @ in image name for retina JS support (#7081)
no issue

- Updates unique filename generator to not replace `@` with `-`, but to leave it in place instead.
2016-07-15 17:50:41 +01:00
Katharina Irrgang
8c6ba47b0e fix: offset bug when switching timezones (#7101)
no issue
2016-07-15 17:44:22 +01:00
Katharina Irrgang
748c664b78 feature: maintenance mode (#7019)
closes #6976
- add maintenance mode when running migrations
- refactor update/populate migrations
2016-07-15 17:22:41 +01:00
Lukas Strassel
9222577c27 allow multiple subdirectories (#7062)
refs #6958 (first task of it)
-includes additional tests
-Instead of removing all slashes "/g" we now specifically remove leading and trailing slashes.
2016-07-15 12:35:39 +02:00
Katharina Irrgang
416c215018 change default order of posts (#7096)
closes #6932
- new default order of posts: scheduled, draft, published
- invent orderDefaultRaw fn for each model
- each model is able to create a default raw order query
- separate count and fetch query for fetchPage, because the count query where group/order statements attached
2016-07-15 11:04:10 +01:00
Lukas Strassel
6439d60bc8 meta referrer improvements (#7088)
closes #7060
- changed meta referrer from origin to origin-when-cross-origi
- made referrer policy configurable via referrerPolicy option in config js
- added example to config.example.js
-modified test to reflect new defaul origin-when-cross-origin
-added a test for configuration changed referrerPolicy
2016-07-14 18:14:59 +02:00
zhenkyle
76808d43b3 fix: spam prevention spec (#6992)
closes #6991
2016-07-14 16:11:58 +02:00
Katharina Irrgang
8395a4ec72 fix: migration fixture spec was suddenly failing (#7091)
no issue
2016-07-14 06:30:46 -06:00
Katharina Irrgang
6e1bd2838e improvement: migrations (#7000)
closes #6972, #6574

- run each database version as top level transaction
- run migrations in correct order
2016-07-14 11:59:42 +01:00
Hannah Wolfe
71282a241e Various post-repo-split cleanup (#6910)
no issue

- remove bower from dependencies, greenkeeper ignores & .editorconfig
- remove old custom jscs rule for ember
2016-07-12 11:55:46 -06:00
Aileen Nowak
24c86b49d1 HTML newsletter template for subscribers (#7045)
refs #7023

The template can be used for all cases (different newsletter interval, different amount of blog posts, with or without blog picture).

The template can be filled with the following data structure:
- `blog.logo` is the blog logo from settings
- `blog.title` is the title of the current blog
- `blog.url` is the URL of the blog
- `blog.twitterURL` is the twitter profile URL of the blog from settings
- `blog.facebookURL` is the facebook page URL of the blog from settings
- `blog.unsubscribe` is the link for the reader to unsubscribe from the blog
- `newsletter.interval` is the interval in words like 'weekly', 'daily', 'monthly'
- `newsletter.date` is the date of the newsletter issue in a format like 'June 9th, 2016'
- `blog.post` is expected to be an array:
	- `blog.post[i].picture` is the picture of the blog post. There are also conditionals, which change the inline CSS to either show a border-top if there's no picture (in that case the HTML code, that shows the picture is not active)
	- `blog.post[i].title` is the title of the current blog post
	- `blog.post[i].text` is the text of the current blog post, which needs to be cut down to 278 letters, plus ending with `…`
	- `blog.post[i].url` is the URL of the current blog post
	- `blog.post[i].tag` is the tag of the current blog post
	- `blog.post[i].author` is the author of the current blog post

Important is, that only HEX HTML entities will work, especially in Outlook. So instead of `—` we need to use `—` and `’` instead of `'` or `'` and so on.

Added unit test for newsletter template in `test/unit/mail/utils_spec.js`.
2016-07-08 21:40:32 -06:00
Gergely Nemeth
447cc0cd2e fix(twitter-card): use proper image tag (#7025) 2016-06-29 18:04:43 -06:00
Lukas Strassel
03137ff5cd allow manifest.json in theme root (#6986)
closes #6769
2016-06-29 14:44:01 -06:00
Katharina Irrgang
ded60ba6e8 post-scheduling: delete job but time is null (#7035)
no issue

This is a fix for the default-scheduler.
When a post never had a published_at value, the oldTime for removing the job would be null. And in this case we would try to delete a job with an invalidate date.
2016-06-28 20:14:29 +02:00
Katharina Irrgang
e91e9eadac improvement: mail structure (#7033)
no issue
- in preparation for subscribers V2
- do not implement code in index.js
- create mail utils
2016-06-28 20:13:01 +02:00
Katharina Irrgang
1b3e1df641 fix: date permalink test (#7047)
closes #7044
2016-06-28 11:14:39 -06:00
Austin Burdine
acc08b9702 deps: bookshelf@lodash-upgrade-fix
no issue
- temporarily upgrades bookshelf to latest master commit
- fixes lodash version incompatibility
2016-06-27 08:22:30 -06:00
Austin Burdine
bfaa8ece90 Merge pull request #7016 from kirrg001/fix/6999
fix: url for post path when post is not published
2016-06-21 07:09:11 -04:00
kirrg001
f8ba12481d fix: prev next posts
closes #7015
2016-06-20 15:44:02 +02:00
kirrg001
507677f071 fix: url for post path when post is not published
closes #6999
2016-06-20 14:48:01 +02:00
kirrg001
250d571fe6 improvement: jshint/jscs
no issue
- add mocha option to jshintrc, no need to define globals in files anymore
- call client grunt commands in case of jshint/jscs
2016-06-17 22:59:47 +02:00
Hannah Wolfe
ac63621fe7 Update tags & foreach to respect visibility
refs #6165

- adds lodash.pickby@4.4.0
- new helper util for understanding a visibility attribute
- generalises visibility handling for `{{tags}}` helper
- adds visibility handling to `{{foreach}}` helper
- adds tests which check behaviour + labs flag
2016-06-15 12:37:09 +01:00
kirrg001
9de153ff82 post-scheduling: fix delete bug in default scheduler 2016-06-15 12:21:33 +02:00
kirrg001
a3cd43909b post-scheduling: HTTP 503 retry logic for default adapter 2016-06-15 08:40:18 +02:00
Hannah Wolfe
fe5e0eed48 Merge pull request #6988 from kirrg001/improvement/forward-utc-timestamp-for-scheduler
post-scheduling: forward UTC timestamp to scheduler adapters
2016-06-14 17:05:22 +01:00
kirrg001
80c797c6c2 post-scheduling: forward UTC timestamp to scheduler adapters 2016-06-14 16:34:56 +02:00
kirrg001
b5ebd0200b post-scheduling: flat config for scheduling 2016-06-14 15:13:00 +02:00
“kirrg001”
1421c92ba5 post-scheduling
refs #6413
- PUT endpoint to publish a post/page for the scheduler
- fn endpoint to get all scheduled posts (with from/to query params) for the scheduler
- hardcoded permission handling for scheduler client
- fix event bug: unscheduled
- basic structure for scheduling
- post scheduling basics
- offer easy option to change adapter
- integrate the default scheduler adapter
- update scheduled posts when blog TZ changes
- safety check before scheduler can publish a post (not allowed to publish in the future or past)
- add force flag to allow publishing in the past
- invalidate cache header for /schedules/posts/:id
2016-06-14 10:52:13 +02:00
kirrg001
2e25e4c73d fix: permalink test
issue #6975
2016-06-13 20:50:07 +02:00
kirrg001
7d5baf4e9a fix: put default timezone into config
no issue
- config.theme.timezone can be undefined, when settings are not loaded from the database
- this PR will define the default blog TZ in config
- use `Etc/UTC` as default instead of `Europe/Dublin`
2016-06-13 15:02:52 +02:00
Hannah Wolfe
584e9911c4 Merge pull request #6973 from acburdine/lodash-4
deps: lodash@4.13.1
2016-06-11 21:39:30 +01:00