Commit Graph

9061 Commits

Author SHA1 Message Date
Hannah Wolfe
8d6324185e Update .travis.yml - no slack success msgs
- only notify success after failure
2019-03-12 11:42:51 +00:00
kirrg001
811ba83b19 🐛 Fixed {{body_class}} helper when using data: page.{slug} in routes
refs #10082

- throwed a 500 because this.page was not handled
- v2 differentiates between page and post
2019-03-12 12:34:16 +01:00
kirrg001
555dc2f180 🐛 Fixed {{meta_title}} output when using data: page.{slug} in routes
refs #10082

- meta_title output wrong meta title

Only solves meta_title outout for this use case:

```
routes:
  /:
    data: page.{slug}
    template: t
```
2019-03-12 12:34:16 +01:00
kirrg001
3b4edccf62 🐛 Fixed {{meta_description}} output when using data: page.{slug} in routes
refs #10599

- meta_description output wrong meta description

Only solves meta_description for this use case:

```
routes:
  /:
    data: page.{slug}
    template: t
```
2019-03-12 12:34:16 +01:00
kirrg001
fef0aa44d3 🐛 Fixed meta twitter_image output when using data: post.{slug} for routes
refs #10082

```
routes:
  /news/:
    data: post.news
```

The twitter_image was not available, because the context is [news, post] and the data is in `data.post`.
The context helper was incorrect. I think it is still not fully correct, but only focused on this use case.
The meta layer needs a full refactoring.
2019-03-12 12:13:47 +01:00
Naz Gargol
34fad7eaaf
Added Canonical URL support to posts&pages in Admin & Content API v2 (#10594)
refs #10593

- Added `canonical_url` field to post&pages resources in Admin & Content APIs
- Support for canonical URL on metadata layer (used in {{ghost_head}} helper)
- Made sure the new field is not accessible from API v0.1 
- Added handling same domain relative and absolute URLs
2019-03-12 17:51:29 +08:00
Hannah Wolfe
c1abcc8dc6 Update .travis.yml - notifications retry
- try regenerating the key
- turn success notifications on until we've got it working
2019-03-11 21:41:57 +00:00
kirrg001
0c8373afb7 Removed 'null' parsing in settings model
refs #10582

- I don't think this is a good idea
- If a user passses "null", we should treat it as a string
- I am not aware of a use case why people have "null" in their database
- If people send "null" via the API, we should respect this and accept a string
2019-03-11 20:07:48 +01:00
kirrg001
0c583135ba Added TODO to settings input serializers
no issue

- we need these rules globally
2019-03-11 20:07:48 +01:00
Nazar Gargol
e19cd6a919 Modified export/import regression test so it doesn't leave leftover files 2019-03-11 20:07:48 +01:00
kirrg001
255b55cab5 Added proper importer regression tests
refs #10582
2019-03-11 20:07:48 +01:00
kirrg001
145a9456a2 Updated settings validations
refs #10582

- the db input formatter ensures we always forward "true" or "false" for boolean fields
2019-03-11 20:07:48 +01:00
kirrg001
20ab9651dc Removed force_i18n in API v2 settings serializer
refs #10582

- deprecated
- won't serve
- won't save
2019-03-11 20:07:48 +01:00
kirrg001
bfccaa8d2e Added db formatter for settings model
refs #10582

- ensure we won't forward booleans to database
- type TEXT will transform booleans to "0"/"1!
2019-03-11 20:07:48 +01:00
kirrg001
037ac4d748 Added input serialization for settings API v2 to transform "0"/"1" booleans
refs #10582

- otherwise we will forward string booleans to model layer
- causes trouble if we trigger events
- causes trouble if we want to add conditions to the model e.g. setting.get('value') ?
2019-03-11 20:07:48 +01:00
kirrg001
f80a9429b9 Added migration to normalize booleans
refs #10582
2019-03-11 20:07:48 +01:00
kirrg001
fca05453fe 🐛 Fixed site requests showing 422 if path is not a valid slug
no issue

- e.g. /feed.xml/ was showing a 422
- any other none slug site requests showed a 422
- should be a 404
- context: site is talking to Content API
  - it can happen that the API returns a 422
  - the routing layer needs to handle this and always show a 404
- catched error in routing error handling
- need to see if there are more cases
2019-03-11 19:40:51 +01:00
Hannah Wolfe
6970555dd1 Update .travis.yml - switch to xenial 2019-03-11 16:54:30 +00:00
Hannah Wolfe
6baf4c0dae Update .travis.yml - fix linting derp 2019-03-11 16:39:17 +00:00
Hannah Wolfe
6b0f865f89 Update .travis.yml - use std notifications 2019-03-11 16:30:25 +00:00
Hannah Wolfe
9efc06255f Simplify lint build in travis & grunt
refs #9441

- We have logic in travis and in grunt and in package.json, this simplifies things.
- `grunt lint` is now just an alias
2019-03-11 16:25:56 +00:00
Hannah Wolfe
cc84f6d6a1
Update .travis.yml - remove coverage report
- no one was using this
2019-03-11 15:58:39 +00:00
Hannah Wolfe
ce57718b93
Update .travis.yml - preparation for renovate
- attempt to do a regression build for cron OR renovate
- we want to run all tests when dependencies are updated, and on nightlies
2019-03-11 14:31:55 +00:00
Aileen Nowak
23215e7d74 Added event to integrations when created (#10588)
no issue

- There was no model event being sent yet when a new integration is being created
- Added this event type to our analytics listener
2019-03-11 15:28:17 +01:00
kirrg001
160d50a258 🐛 Fixed /edit url redirecting to wrong admin client url
no issue

- admin client has fixed showing a 500
- we now show a 404 if the url is wrong
- server side has corrected the editor url
2019-03-11 15:26:13 +01:00
Kevin Ansfield
0a846002f8 Renamed blog->site in error messages and welcome e-mail (#10586)
no issue

- general `blog` -> `site` wording switch
2019-03-11 15:25:21 +01:00
Fabien O'Carroll
a2aa66ca73
🐛 Fixed img-url to output relative url by default (#10596)
closes #10595

* Added breaking test for img-url helper

Input from the content API was absolute, adding this test to verify my fix

* Updated existing test to breaking test for img-url

Had made a dumb assumption when building images sizes, this updates the
test to fail so we can verify the fix

* Refactored img-url to return as early as possible

This makes it a little easier to parse what's going on, and it also
allows us to remove the check for existence of the image url in the
getImageSizes function

* Refactored img-url config parsing to clean up core logic

Superficial refactor to make future changes able to focus on what rather
than how.

* Refactored internal image detection into helper

We're gonna need to know if the image is internal or not, when we force
the path to relative, if we pull this out now, we have access in the top
level logic

* Removed duplicate checks for internal image

Cleaning up and moving "higher-level" logic into the main function of
the module

* Renamed attr -> requestedImageUrl

Superficial refactor, trying to be more explicit about identifiers

* 🐛 Fixed img-url to output relative url by default

Includes a check to isInternalImage as we never want to make external
images relative.

* Returned early if img-url recieves external url

After realising we never want to deal with external urls, we can
continue to return as early as possible, letting us remove checks and
simplify the more complex logic for internal images.

* Cleaned up the internal image logic

Defining the three functions in order helps to see what operations are
going to happen and in which order, we can then return the result of
each operation applied to the next operation.
2019-03-11 15:20:05 +01:00
Hannah Wolfe
812986b215
Update travis.yml - remove greenkeeper ref
- we no longer use greenkeeper, and are switching to renovate, so this is unnecessary
2019-03-11 13:59:04 +00:00
Nazar Gargol
659c63c98a Fixed regression tests
no issue

- Descreased ammount of posts inserted by 'posts:mu' fixture so that Travis doesn't timeout.
- The fix is just a patch, needs investigation into what change caused the timeout in the first place
2019-03-11 14:19:30 +08:00
David Sánchez
49cf18fe33 🐛 Changed subscribed page title from hardcoded to site title (#10589)
no issue

- The subscribed title was being hardcoded as "Ghost" instead of using the title of the site.
2019-03-11 14:07:37 +08:00
Nazar Gargol
b95547c3a2 Bumped ghost-ignition version to 3.0.4 2019-03-11 12:01:14 +08:00
Nazar Gargol
9a831d1306 Fixed url for settings images saved in the db
closes #10590

- All images stored in the db should be relative urls and should only be served as absolute
2019-03-11 11:59:06 +08:00
Hannah Wolfe
d2b1e0d4b7 Attr pass-thru & full context in partial helpers
refs #5162

- allow pagination and navigation partial helpers to have attributes passed through to them
    - e.g. {{navigation header=true}} -> {{#if header}} will now work
    - allows styling navigation to be done differently for different sections of the page
- properly create a data frame, and pass through "this" context
    - means {{navigation header=true}} is the same as {{> navigation header=true navigation=@site.navigation}}
    - our partial helpers, have the same behaviour exactly as if the partial was called directly
- this is additive, and improves behaviour
2019-03-09 21:21:01 +00:00
John O'Nolan
82788f2f5c
Create FUNDING.yml 2019-03-07 15:23:12 +02:00
Nazar Gargol
942324b60e 🐛 Fixed private blogging getting enabled after import
refs #10582

- Importer should do similar conversion introduced in 04c60b4ce1
2019-03-07 18:44:47 +08:00
kirrg001
e2757d18f8 Added fix for cron job
no issue

- crob job is running acceptance tests and not regression tests
- not 100% sure this is the cause, but let's try it
2019-03-07 10:37:00 +01:00
Nazar Gargol
3124d23ccf 🐛 Fixed force_i18n import validation error
closes #10580

- The validation was failing because boolean values in settings can also be "0" and "1". 04c60b4ce1 explains the reason why these 2 new values are allowed
2019-03-07 16:42:11 +08:00
Nazar Gargol
363d10cc29 Bumped ghost-ignition version to 3.0.3
no issue
2019-03-07 14:29:03 +08:00
Naz Gargol
9810834f7b
Removed redundant errorDetail and context stringification in errors (#10572)
no issue

- Additional JSON.stringify call is redundant because it is already happening internally in Ignition (https://github.com/TryGhost/Ignition/blob/master/lib/logging/GhostLogger.js#L241)
- Left stringification in importer as is, because the use case there is also
putting errors into 'problems' array and seems like those values have to
be stringified
2019-03-07 12:58:44 +08:00
Kevin Ansfield
4428ed5f79 Version bump to 2.16.4 2019-03-06 12:19:06 +00:00
Kevin Ansfield
c8e5391897 Updated Ghost-Admin to 2.16.4 2019-03-06 12:19:06 +00:00
Katharina Irrgang
04c60b4ce1
🐛 Fixed private blogging getting enabled when saving any setting (#10576)
no issue

- Reported here: https://forum.ghost.org/t/in-version-2-16-3-found-bug/6065/3

---

Admin Client sends false or true booleans for `is_private` key.

The settings table has two columns "key" and "value". And "value" is always type TEXT.

If you pass value=false, the db will transform this value into "0".
`settingsCache.get('is_private')` is then always true, even though the value is meant to be false.

We should add a migration in v3 and normalize all setting values to ensure consistent database values. Furthermore, we should improve the handling around settings values in general.

For now, we protect parsing values from DB, which we anyway need to transform the values into the correct data type, because we always save strings. This will protect values being stored as "false" or "1" or whatever.
2019-03-06 12:56:26 +01:00
kirrg001
ac26436c10 🐛 Fixed v0.1 username/password authentication
no issue

- refs 39edb7646e
2019-03-06 10:48:21 +01:00
kirrg001
5b73e8238e 🐛 Fixed email address not being returned with admin api key authentication
no issue

- bug in model layer
- we have to drop these context checks when dropping v0.1
2019-03-06 10:48:21 +01:00
Dan Sloan
fba277ce1d 🐛 Fixed custom certificate usage for MySQL (#10573)
closes #10570

Added a conditional to only run makePathsAbsolute when database:client
is sqlite3, which keeps expected behaviour (make the
"database:connection:filename" path absolute when running SQLite) while
not breaking MySQL behaviour.
2019-03-06 10:28:10 +01:00
Kevin Ansfield
7e55715f3d Added circular dependency grunt dev build log filter
no issue
- ember-data 3.6.0 outputs some benign "Circular dependency" warnings which get shown in `grunt dev` build output and cause the "Building admin client..." messages to stop repeating
- adds a filter to ignore any lines containing "Circular dependency" to keep output clean and allow the repeating build message to continue
2019-03-06 09:03:14 +00:00
Fabien O'Carroll
52ad2711b7
Fixed grunt master to work with submodules correctly (#10566)
refs #9441

`grunt master` should only error if there are changes to tracked files which have not been committed - this ensures no work is lost.
2019-03-06 09:03:01 +01:00
Kevin Ansfield
4fc6b11d79 Version bump to 2.16.3 2019-03-05 10:46:57 +00:00
Kevin Ansfield
2839f259ad Updated Ghost-Admin to 2.16.3 2019-03-05 10:46:57 +00:00
Kevin Ansfield
39edb7646e
Improved error message when attempting to use disabled v0.1 Public API (#10562)
no issue
- trying to use the v0.1 Public API when it was disabled led to a confusing error message, see https://forum.ghost.org/t/403-forbidden-error-on-postman-api-call/6017
- adds an explicit check for the Public API being enabled in the client authentication step and throws a useful error message if client auth is attempted when it's disabled
2019-03-05 10:41:07 +00:00