2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Commit graph

694 commits

Author SHA1 Message Date
Jacob Gable
a9cc252b45 Invalidate cache header only for published posts
Closes #1563

- Add new updatedAttributes() functionality to base models
- Update Post.edit(...) to pass along _updatedAttributes values
- Update Post.delete to set statusChanged to true
- Add checking for statusChanged to cacheInvalidationHeader()
- Update route tests that check for cache invalidation header
2014-04-23 09:28:45 -05:00
Hannah Wolfe
9bf02c9e8c Merge pull request #2641 from alarobric/feature/2607TagParentRelation
Tag API response to use parent rather than parent_id
2014-04-23 12:47:37 +01:00
Hannah Wolfe
149a793e28 Merge pull request #2634 from alarobric/feature/2608AuthorRelation
Post API response to use author not author_id
2014-04-23 12:47:25 +01:00
Paul Connolley
dd4f8a5f6a Ensure that the character set is UTF-8 for RSS feed
When setting the Content-Type header for the RSS feeds, the character
set is omitted. However, when running the feed through the
[Feed Validator](http://feedvalidator.org), it became apparent that
there was a problem as the encoding defaults to US-ASCII. See
[RFC 3023](http://www.ietf.org/rfc/rfc3023.txt) for further information
on the default XML charset over HTTP.

I have added a test and simple update to the 'Content-Type' header.
2014-04-23 10:47:25 +01:00
Alan Richards
5877e7d211 Tag API response to use parent rather than parent_id
Closes #2607
- added toJSON method to tag model
- parent_id attribute is replaced by parent
- integration tests will expect parent as an attribute
2014-04-22 23:46:53 -07:00
Alan Richards
686aec7ab5 Post API response to use author not author_id
Closes #2608
- added toJSON method override for post model
- in the event no expanded author relation is present the id will be used
- removed author_id from expected response JSON for posts.
- updated integration tests to check for existence or not of author and author_id
2014-04-22 02:13:33 -07:00
Hannah Wolfe
3eb284e4b5 Update & grunt-groc and fix docs errors
issue #2622

- Updated grunt-groc to 0.4.5
- Fixed the few places which made the docs fail to generate
- There is still a mix of styles
2014-04-21 19:04:20 +01:00
Hannah Wolfe
82897ed949 Merge pull request #2624 from shindakun/editbug2619
Do not redirect to editor if parameter does not equal edit.
2014-04-21 19:05:18 +02:00
Hannah Wolfe
0756b35656 Merge pull request #2551 from szelpe/email-test
[API] Added email sending endpoint to the API.
2014-04-21 18:41:08 +02:00
Jacob Gable
cf7c8aab3b Tag API: Primary Document Format
Closes #2605

- Change tags browse() response to { tags: [...] }
- Update client side collection to use nested tags document
- Update test references to use response.tags
2014-04-20 19:48:59 -05:00
Hannah Wolfe
0ac9c5037f Merge pull request #2617 from sebgie/issue#2604
Post response move pagination -> meta
2014-04-20 23:33:51 +02:00
Steve
87077f2218 Do not redirect to editor if parameter does not equal edit.
Closes #2619
- If edit parameter is 'edit' redirect to editor.
- If edit parameter is anything other then undefined redirect to 404.
- Create edit post tests.
- Test redirect without trailing slash.
- Test redirect to editor.
- Test redirect to 404.
2014-04-20 00:35:56 -07:00
Sebastian Gierlinger
32ea948675 Post response move pagination -> meta
closes #2604
- moved ‚pagination‘ to ‚meta‘ property
- added response test for pagination property
- changed ‚next‘ and ‚prev‘ to be set to null and exist on every
response
- removed unnecessary call to API for RSS author
2014-04-19 17:03:20 +02:00
Sebastian Gierlinger
910bab8a6e Added user to export call
fixes #2612
- added user to db.exportContent()
2014-04-18 09:21:16 +02:00
Sebastian Gierlinger
664b002f43 missing semicolon + console.log 2014-04-16 18:49:07 +02:00
Sebastian Gierlinger
e47e9c62d0 Add permissions to API
closes #2264
- added permissions check to db, users and posts
- added register method to users
- added doesUserExist method to users
- added user from session to internal calls
- changed permissible to overwrite canThis
- removed action map and action type from permissable method
2014-04-16 18:22:22 +02:00
Sebastian Gierlinger
61e94a6e8b Use current user in models
closes #2058
- fixed apiContext as suggested in the issue
- added user to options object for models
- added api.users.register() for public registration
- changed models to use options.user for created_by, updated_by,
author_id and published_by
- added override to session model to avoid created_by and updated_by
values
- added user (id: 1) to tests
- added user (id: 1) for registration
- added user (id: 1) for import, fixtures and default settings
- added user (id: 1) for user update
- added user (id: 1) for settings update (dbHash, installedApps, update
check)
- updated bookshelf to version 0.6.8
2014-04-16 18:20:09 +02:00
Jacob Gable
88d82ff441 canThis() improvements
- Handle passing undefined user to canThis
  - Add existence check to parseContext if statement
  - Add unit test that passes undefined to canThis
- Allow internal canThis() checks
  - Allow passing 'internal' or { internal: true } as context
  - Do not lookup user permissions unless context.user found
  - If context.internal, resolve immediately
  - Add unit tests for passing 'internal' and { internal: true }
2014-04-16 18:17:43 +02:00
Fabian Becker
b8e8f63e44 Adds additional fields to apps schema.
fixes #2356
- Adds slug, version and status fields to apps schema
- Added fields to data generator
2014-04-16 18:16:10 +02:00
Sebastian Gierlinger
c0dc8e95d2 Add new permissions to fixtures
closes #2325
- added new permissions
- added relation to user roles
- added updateFixtures to migrateUp
- removed validation per model to fix tests
2014-04-16 18:16:10 +02:00
Jacob Gable
13d2d04c72 App Permissions from package.json
Progress on #2095

- Add new AppPermissions class with read() method
- has default permissions to read and browse posts
- uses default permissions if no package.json
- uses default permissions if no ghost object in package.json
- errors when reading malformed package.json
- uses ghost.permissions if found in package.json
2014-04-16 18:14:56 +02:00
Fabian Becker
41cef386bc Implements Models & Data API for Apps
closes #2138
- Adds new models for AppField and AppSetting
- Removed permitted attributes from App model (handled by base)
- Added reference from Post to AppFields
- Added fixture data to DataGenerator
- Added integration tests for Apps, AppSettings, AppFields
- Added import for Apps
- Added app_fields to default fixtures
2014-04-16 18:14:56 +02:00
Fabian Becker
7b003beb17 Schema additions for apps.
fixes #2102
- Added app_settings, app_fields, app_fields_relations tables
2014-04-16 18:06:39 +02:00
Jacob Gable
9369dd3bf7 Add app permission checking to canThis
- Pass permissions loading to buildObjectTypeHandlers to eliminate
shared state
- Load both app and user permissions to check
- Check app permissions if present
- Create apps table and App model
- Move effectiveUserPermissions to permissions/effective
- Change permissable interface to take context; user and app.
- Add unit tests for app canThis checks and effective permissions
2014-04-16 18:06:39 +02:00
Hannah Wolfe
9447b4ec2a Merge pull request #2560 from halfdan/filter-context
Implement filter context
2014-04-16 11:39:06 +01:00
Sebastian Gierlinger
9321289c1d Move post API to primary document format
closes #2580
- added new format to post API methods
- added post object parsing and wrapping to admin
- removed unused ‚user‘ object from API response
- updated tests
2014-04-16 12:09:03 +02:00
Peter Szel
2433116cc6 Added email sending endpoint to the API.
closes #2550

- Added new API module named 'mail'
- Added routes for the mail endpoint
- Added 'send a test email' button to the debug settigns page
- Added handler to this button which sends and AJAX request to the mail API endpoint
2014-04-09 23:56:21 +02:00
Hannah Wolfe
0bf2a5ada0 Merge pull request #2566 from jaswilli/fix/issue-2563
Build correct path on image upload when config has custom content path
2014-04-07 15:31:28 +01:00
Jason Williams
e3056990cd Build correct path on image upload when config has custom content path
closes #2563
- build path relative to imagesPath (which contains the custom content path)
  instead of appRoot
- added test for custom content path
- added logic to tests for Windows url building to handle cases where Windows
  functionality is being tested on a unix operating system
2014-04-07 05:01:39 +00:00
Hannah Wolfe
68fe40442b Merge pull request #2545 from joeljfischer/minify-jquery
[WIP] Ghost footer outputs minified jquery
2014-04-06 23:15:48 +01:00
Hannah Wolfe
9e358fb922 Merge pull request #2517 from novaugust/theme_error
Fixed check for a theme's custom error.hbs
2014-04-06 19:22:29 +01:00
Fabian Becker
c2e416fc9d Implement filter context
closes #2559
- Added a new unit test for context based filters
- Accept new parameter `context` in doFilter
2014-04-06 15:43:11 +00:00
Joel Fischer
758f844b8b Ghost footer outputs minified jquery in production
Closes #2524

- Added minifying jquery in grunt prod task

- Add test coverage for altered jquery
2014-04-06 08:42:25 -04:00
Hannah Wolfe
395d7fd3e2 Merge pull request #2516 from novaugust/last_login
Added populate last login time per #2515
2014-04-05 19:50:36 +01:00
Hannah Wolfe
c38c778dbc Merge pull request #2500 from ErisDS/issue-2442
[WIP] Server start refactor, route tests use ghost app
2014-04-04 13:21:28 +01:00
Hannah Wolfe
e6abe9bab7 Server start refactor, route tests use ghost app
closes #2442, issue #2182

- Server start refactored - messaging is just messaging, deferred resolves the httpserver so that the connection can be closed
- Updated travis config to set node env
- Updated example config to be less travis-specific
- Route tests updated to use this new functionality
- Grunt test-routes simplified
2014-04-04 12:45:18 +01:00
Matt Enlow
345fe1a6d4 Fixed check for a theme's custom error.hbs:
Closes #2513
- Checks for property `error.hbs` on active theme
- Added unit test to ensure `error` view is rendered when activeTheme has
  a custom error template.
- Removed unused variable, `userErrorTemplatePath` from errorHandler
- Refactored errorHandler.`updateActiveTheme` to take one argument, the new active theme, and to then check if the active theme has an error.hbs
- Changed errorHandler unit test to use rewire for mocking config.
2014-03-29 08:19:51 -06:00
Hannah Wolfe
7e95b4d291 Merge pull request #2439 from sebgie/move-slug
Rename getSlug to slug
2014-03-28 17:12:55 +00:00
Matt Enlow
f8d90f1cc6 Added populate last login time
closes #2515
- sets last_login when user is saved if user status changed to active
- added integration test in user Basic Operations
2014-03-27 12:29:43 -06:00
Hannah Wolfe
c6c4d5a8a8 Cache invalidation for tag pages 2014-03-26 12:45:54 +00:00
Hannah Wolfe
31fa3bab3a Error handling for require-tree
fixes #2507

- ideally we would create an apps directory if one isn't present, but we can deal with that in later versions
2014-03-25 22:38:48 +00:00
Hannah Wolfe
2f097ce906 Merge pull request #2498 from sebgie/duplicate-tags
Deduplicate upper-/lowercase tags for posts
2014-03-25 13:30:44 +00:00
Hannah Wolfe
438cbab68e Ensure generateSlug gets transaction for tags
fixes #2460

- add transacting to tag saving
- add same to users while we're here
2014-03-25 11:14:17 +00:00
Hannah Wolfe
1fbe4d0be7 Merge pull request #2497 from sebgie/issue#2492
Fix delete button
2014-03-24 18:47:25 +00:00
Sebastian Gierlinger
a3aba2d504 Deduplicate upper-/lowercase tags for posts
server side check for #2478
- added check for duplicate tags in post model
2014-03-24 19:08:06 +01:00
Hannah Wolfe
41d127d5b1 Merge pull request #2489 from ErisDS/user-msgs
Update some server side errors/warnings
2014-03-24 17:58:11 +00:00
Hannah Wolfe
bd417339fc Merge pull request #2494 from halfdan/2493-import-tmp
Unlink import file when finished
2014-03-24 16:24:22 +00:00
Sebastian Gierlinger
b83fc25613 Fix delete button
closes #2492
- added when.all() to wait until all posts are deleted before deleting
tags
- added a test
2014-03-24 14:49:23 +01:00
Hannah Wolfe
ba1c1bd25d Update some server side errors/warnings
issue #2482

- add help messages to all package.json errors/warnings
- change the pageUrl warning to have the correct version numbers
2014-03-24 13:39:44 +00:00
Fabian Becker
f0c6052c73 Unlink import file when finished
fixes #2493
- Update db import version (in case it doesn't exist)
- Properly unlink file after import or error
2014-03-24 10:51:10 +01:00