Commit Graph

5555 Commits

Author SHA1 Message Date
Sebastian Gierlinger
9fc991d76a Merge pull request #5938 from ErisDS/no-casper-travis
Don't run Casper.js tests by default
2015-10-13 10:07:16 +02:00
Kevin Ansfield
156260343b Avoid duplicate alerts, clear alerts on successful retry or sign-in
closes #5903, refs #5409
- switch alert/notification component tests from unit to integration where appropriate
- rename `notifications.closeAll` to `notifications.clearAll` to better represent it's behaviour
- add concept of a "key" to alerts/notifications and ability to close only specified keys through notifications service
- close duplicate alerts/notifications before showing a new one
- specify a key for all existing alerts
- close failure alerts on successful retries
- clear all currently displayed alerts on successful sign-in
2015-10-12 19:21:30 +01:00
Kevin Ansfield
ff73f1af92 deps: grunt-jscs@2.1.0
no issue
- update grunt-jscs dependency
- fix deprecated `validateJSDoc` configuration
- fix numerous linting errors, including:
  - use of future-reserved `public` and `private` variable names
  - use of `[]` instead of dot-notation (especially `express['static']` and `cacheRules['x']`)
  - extra spaces in `const { run } = Ember` style constructs

One issue that did become apparent is that there are conflicting rules that prevent the use of object function shorthand such that both of these:

```
{ myFunc() {} }
{ myFunc () {} }
```

are called out due to either the missing or the extra space before the `(`
2015-10-12 19:21:16 +01:00
Kevin Ansfield
4acb7b44f3 deps: ember-mocha@0.8.4 2015-10-12 18:57:43 +01:00
Hannah Wolfe
32d797432a Merge pull request #5923 from vdemedes/require-tree-refactor
Refactor require-tree and split it into different modules
2015-10-12 18:27:38 +01:00
Hannah Wolfe
9c691f6d05 Don't run Casper.js tests by default
- remove casper tests from `grunt validate`
- the tests are still in the codebase & runnable manually for now
2015-10-12 18:01:52 +01:00
vdemedes
20fec74c73 Refactor require-tree and split it into models
closes #5492
- remove core/server/require-tree.js and split it into modules
- add read-directory module to recursively read directories
- add validate-themes module to scan themes and return errors/warnings
- add parse-package-json module to parse json and validate requirements
- rewrite core/server/models/index.js to manually require models
2015-10-12 17:48:37 +02:00
Hannah Wolfe
7f3a9f5675 Merge pull request #5927 from olsio/fix-issue-5913
fix for page deletion not updating sitemap-page.xml
2015-10-12 15:43:53 +01:00
Sebastian Gierlinger
c68a9587f9 Merge pull request #5932 from ErisDS/issue-5379-markdown-icon
Add titles to key icons
2015-10-12 10:37:06 +02:00
Sebastian Gierlinger
bfefbabfdc Merge pull request #5931 from ErisDS/issue-5905-context
Fix /author/ pages crashing & permit /tag/
2015-10-12 10:35:37 +02:00
Hannah Wolfe
3b9f465635 Add titles to key icons
closes #5379, refs #3964

- add 'Markdown Help' title to markdown logo
- add 'Post Settings' title to post settings cog
- add 'Edit this post' title to edit icon on content screen
2015-10-12 09:04:16 +01:00
Oliver Schneider
13adaec6e7 fix for page deletion not updating sitemap-page.xml
closes #5913

Sitemap deletion is based on the page.unpublished event. The previous
logic was always sending post.unpublished instead. If page or post
event is triggered is based on the ‘page’ attribute of the model. When
the destroyed handler all attributes are already cleared from the model
which makes this logic always fall back to post.

The fix is to move to the destroying event which still has all the
model values in place.
2015-10-12 09:26:26 +02:00
Sebastian Gierlinger
b6c7d14359 Merge pull request #5936 from ErisDS/middleware-cleanup
Simplify theme middleware + improve tests
2015-10-12 09:11:35 +02:00
Hannah Wolfe
4e29d9e987 Simplify theme middleware + improve tests
refs #5286, #4172, #5888

- no need to pass blogApp around in middleware
- improve test coverage to 100%
2015-10-11 22:26:43 +01:00
Sebastian Gierlinger
debdfa74df Merge pull request #5934 from ErisDS/findall-partial-revert
Revert to using findAll for internal tools
2015-10-11 18:28:18 +02:00
Sebastian Gierlinger
69e93eb5cb Merge pull request #5929 from ErisDS/issue-5373-emitters
Set a higher maxListeners value
2015-10-11 18:24:23 +02:00
Hannah Wolfe
3e40637cd4 The {{#get}} helper
closes #4439

- adds basic get helper which works with the current API
- allows theme developers to make requests against the API
- supports block params and @error message
- includes 100% test coverage using posts

----

The `{{#get}}` helper is an asynchronous block helper which allows for making
requests for data from the API. This allows theme developers to customise the
data which can be shown on a particular page of a blog.

Requests can be made to the posts, tags or users API endpoints:

```
{{#get "posts" limit="3"}}
  {{#foreach posts}}
     <a href="{{url}}">{{title}}</a>
  {{/foreach}}
{{/get}}
```

The `{{#get}}` helper must be used as a block helper, it supports `{{else}}`
logic, for when no data matching the request is available or if an error has
occurred:

```
{{#get "posts" tag="photo"}}
  ...
{{else}}
  {{#if @error}}
    <p>Something went wrong: {{@error}}</p>
  {{else}}
    <p>No posts found</p>
  {{/if}}
{{/get}}
```

The helper also supports block params, meaning the data it outputs can be
given a different name:

```
{{#get "posts" featured="true" as |featured|}}
  {{#foreach featured}}
    ...
  {{/foreach}}
{{/get}}
```

Please Note: At present asynchronous helpers cannot be nested.
2015-10-11 16:51:12 +01:00
Hannah Wolfe
0764c775a7 Revert to using findAll for internal tools
refs #5909, #4577

- removes accidental '.only' which was hiding issues with the findAll changes
- deleteAllContent and importer still need to use a hard 'findAll' as findPage({limit: 'all'}) doesn't have the same behaviour
2015-10-10 17:07:10 +01:00
Hannah Wolfe
26231d5bd3 Fix /author/ pages crashing & permit /tag/
fixes #5905

- update context patterns to correctly match author & tag pages
- remove 'tag' and 'tags' from reserved slugs - we'll handle this in terms of overrides in future
2015-10-10 14:52:23 +01:00
Hannah Wolfe
b943948d24 Set a higher maxListeners value
fixes #5373

- Set Max Listeners on our Event Emitter to 100
- Stops the '11 listeners added' error on node 0.12 during tests
2015-10-09 19:27:49 +01:00
Sebastian Gierlinger
4c1828c027 Merge pull request #5877 from ErisDS/pr-5864-nav-url
Support for more URL schemes in url helpers
2015-10-09 09:46:56 +02:00
Austin Burdine
19b117d33d add tag description validation to tag settings menu
refs #5845

- adds validation to description field
- fixes css to word-wrap on words that are too long
2015-10-08 23:01:59 -05:00
Leonard Camacho
35c533effc Shows image on Tag settings
closes #5800
2015-10-08 14:27:41 -04:30
Hannah Wolfe
eed6879845 Merge pull request #5892 from yanntech/fix/pg-upgrade
Public is the default schema but if you use different name your are
2015-10-08 08:54:12 +01:00
Hannah Wolfe
6e8bb1d979 Merge pull request #5916 from kevinansfield/fix-persisting-nav-settings
Fix unsaved nav settings persisting across transitions
2015-10-07 17:46:32 +01:00
Kevin Ansfield
8c4a9105b7 Fix unsaved nav settings persisting across transitions
closes #5852
- resets navigation settings controller's model when transitioning away
- fixes `locationType` config setting so acceptance tests don't mess with the URL
- configure the ephemeral session store for ember-simple-auth during tests
- adds dummy env-config meta fields so acceptance tests don't fail
- adds `ember-cli-simple-auth-testing` dependency for auth testing helpers
- adds Pretender dependency to mock API requests for acceptance tests
2015-10-07 15:57:14 +01:00
Hannah Wolfe
62acd48c6b Merge pull request #5920 from kevinansfield/fix-upload-autoscroll
Fix preview scroll jump when adding/removing images
2015-10-07 12:46:56 +01:00
Hannah Wolfe
b77326bc7a Merge pull request #5839 from kevinansfield/ember-1-13-9
Ember-cli, Ember, & Ember Data 1.13.x upgrades
2015-10-07 10:55:33 +01:00
Hannah Wolfe
b784ba0f4c Merge pull request #5921 from kevinansfield/standardise-test-names
Standardize ember test names and file names
2015-10-06 18:49:10 +01:00
Kevin Ansfield
739443bb72 Standardize ember test names and file names
no issue
- standardize on "{TestType}: {ModuleType}: {module-name}" for test description strings
- standardize on `{module-name}-test.js` for test file names
- fix deprecation notices for ember component unit tests without explicit `unit: test` or `needs: []`
2015-10-06 17:31:03 +01:00
Yann Verry
eb5a03c8d8 Ghost can now handle a different schema than the default 'public' in PostgreSQL
closes #5891
- use CURRENT_SCHEMA() instead of 'public'
- remove the WHERE condition
2015-10-06 18:19:23 +02:00
Kevin Ansfield
a0ec07f797 Ember-cli, Ember, & Ember Data 1.13.x upgrades
closes #5630
- upgrade ember-cli to latest version
- upgrade ember to latest 1.13.x release
- upgrade ember data to latest 1.13.x release
    - update custom adapters and serialisers for new internal JSON-API compatible formats [(docs)][1]
    - update all store queries to use new standardised query methods [(docs)][2]
    - add ember-data-filter addon ready for store.filter removal in ember-data 2.0 [(docs)][3]
- remove use of prototype extensions for computed properties and observers
- consolidate pagination into a single route mixin and simplify configuration

[1]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_transition-to-the-new-jsonserializer-and-restserializer-apis
[2]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_simplified-find-methods
[3]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_ds-store-filter-moved-to-an-addon
2015-10-06 16:09:05 +01:00
Kevin Ansfield
746fd237fe Fix preview scroll jump when adding/removing images
closes #5917
- fixes duplication of dropzone event handlers by filtering for an added data-attribute
- avoid running dropzone code if only scrollPosition attr changes
- fix scroll position jump when adding/removing images by only adjusting preview scroll position when editor scroll position changes
2015-10-06 14:47:06 +01:00
Sebastian Gierlinger
6ee930ea22 Merge pull request #5909 from delgermurun/remove-findall
Remove findAll from models that has findPage
2015-10-06 15:20:53 +02:00
Hannah Wolfe
1bfd5768bc Merge pull request #5704 from kevinansfield/export-default-cleanup
Standardize on var-less `export default` across ember app
2015-10-06 13:39:31 +01:00
Kevin Ansfield
3f361f8742 Standardize on var-less export default across ember app
no issue
- drops the `var Foo = Ember.Thing.extend({}); export default Foo;` syntax in favour of exporting directly, eg: `export default Ember.Thing.extend({})`
- discussion on this change [here](https://github.com/TryGhost/Ghost/pull/5340#issuecomment-105828423) and [here](https://github.com/TryGhost/Ghost/pull/5694#discussion-diff-37511606)
2015-10-06 10:59:50 +01:00
Delgermurun
a501711e71 Remove findAll from models that has findPage
closes #4577
- removed findAll from Post and User
- refactored deleteAllContent and data importer
2015-10-02 18:01:35 +08:00
Sebastian Gierlinger
f7015600b8 Merge pull request #5899 from ErisDS/theme-lookup
Remove unnecessary API lookup for activeTheme
2015-09-29 23:27:57 +02:00
Hannah Wolfe
b0f6a15433 Merge pull request #5886 from javorszky/iss_5885
Make grunt test fail if no filename provided
2015-09-29 23:05:37 +02:00
Hannah Wolfe
390d5fcea2 Remove unnecessary API lookup for activeTheme
- the active theme is already managed and kept up to date as a property
of the express app
- this can be accessed via `req.app` inside of middleware
2015-09-29 22:54:55 +02:00
Hannah Wolfe
794bd87e04 Merge pull request #5896 from JohnONolan/byeforum
Remove forum mentions
2015-09-29 16:08:21 +02:00
John O'Nolan
1add453733 Remove forum mentions 2015-09-29 13:10:04 +02:00
Gabor Javorszky
309356e90c Make grunt test fail if no filename provided
Closes #5885

Instead of hiding a notice in a sea of printed stack traces among the
eventual error, this change will cause grunt test to halt and output an
error message with some helpful info as to what went wrong.
2015-09-27 18:30:59 +01:00
Hannah Wolfe
f8caa1f091 Version bump to 0.7.1 2015-09-27 14:36:14 +01:00
Kevin Ansfield
769d6bfe13 Merge pull request #5871 from cobbspur/preventEnter
Prevent enter button reloading page when focus is on meta-title in PSM
2015-09-27 14:03:47 +01:00
cobbspur
a8121c8230 Prevent enter button reloading page when focus is on meta-title in PSM
closes #5854

- adds an action that returns false on form submission
2015-09-27 13:59:08 +01:00
Hannah Wolfe
77447fc42d Merge pull request #5876 from sebgie/issue#5872
Fix client.secret for new installs
2015-09-27 13:50:36 +01:00
Hannah Wolfe
20273f3e12 Merge pull request #5843 from kevinansfield/fix-nav-regressions
Fix nav regressions in admin client
2015-09-27 13:36:04 +01:00
Hannah Wolfe
20c192557d Test support for various URL schemes
refs #5801
2015-09-27 10:31:49 +01:00
Sebastian Gierlinger
dbc53dc853 Merge pull request #5858 from ErisDS/issue-5808
Show a single 422 error for invalid values
2015-09-26 12:14:12 +02:00