🐛 Fixed infinite loading on posts screen (#967)

closes https://github.com/TryGhost/Ghost/issues/9493

- bump `ember-infinity` to 1.0.0-alpha for Ember Data 3.0 support
  - update posts and users routes for change in API
- bump `ember-in-viewport` to 3.0.0 (fixes offset on posts screen with new version of ember-infinity)
This commit is contained in:
Kevin Ansfield 2018-03-12 10:43:53 +00:00 committed by Aileen Nowak
parent 654beb7e2f
commit 6b73930b74
4 changed files with 19 additions and 26 deletions

View File

@ -28,8 +28,6 @@ export default AuthenticatedRoute.extend(InfinityRoute, {
titleToken: 'Content', titleToken: 'Content',
perPage: 30, perPage: 30,
perPageParam: 'limit',
totalPagesParam: 'meta.pagination.pages',
_type: null, _type: null,
@ -37,6 +35,10 @@ export default AuthenticatedRoute.extend(InfinityRoute, {
return this.get('session.user').then((user) => { return this.get('session.user').then((user) => {
let queryParams = this._typeParams(params.type); let queryParams = this._typeParams(params.type);
let filterParams = {tag: params.tag}; let filterParams = {tag: params.tag};
let paginationParams = {
perPageParam: 'limit',
totalPagesParam: 'meta.pagination.pages'
};
if (params.type === 'featured') { if (params.type === 'featured') {
filterParams.featured = true; filterParams.featured = true;
@ -65,7 +67,7 @@ export default AuthenticatedRoute.extend(InfinityRoute, {
queryParams.formats = 'mobiledoc,plaintext'; queryParams.formats = 'mobiledoc,plaintext';
let perPage = this.get('perPage'); let perPage = this.get('perPage');
let paginationSettings = assign({perPage, startingPage: 1}, queryParams); let paginationSettings = assign({perPage, startingPage: 1}, paginationParams, queryParams);
return this.infinityModel('post', paginationSettings); return this.infinityModel('post', paginationSettings);
}); });

View File

@ -11,8 +11,6 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, Infinit
modelPath: 'controller.activeUsers', modelPath: 'controller.activeUsers',
perPage: 15, perPage: 15,
perPageParam: 'limit',
totalPagesParam: 'meta.pagination.pages',
model() { model() {
return this.get('session.user').then((user) => { return this.get('session.user').then((user) => {
@ -24,7 +22,9 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, Infinit
modelPath, modelPath,
perPage, perPage,
filter: 'status:-inactive', filter: 'status:-inactive',
startingPage: 1 startingPage: 1,
perPageParam: 'limit',
totalPagesParam: 'meta.pagination.pages'
}) })
}; };

View File

@ -73,8 +73,8 @@
"ember-element-resize-detector": "0.1.5", "ember-element-resize-detector": "0.1.5",
"ember-export-application-global": "2.0.0", "ember-export-application-global": "2.0.0",
"ember-fetch": "3.4.4", "ember-fetch": "3.4.4",
"ember-in-viewport": "2.2.1", "ember-in-viewport": "3.0.0",
"ember-infinity": "0.2.8", "ember-infinity": "1.0.0-alpha.9",
"ember-inline-svg": "0.1.11", "ember-inline-svg": "0.1.11",
"ember-invoke-action": "1.5.0", "ember-invoke-action": "1.5.0",
"ember-light-table": "1.8.6", "ember-light-table": "1.8.6",

View File

@ -3147,7 +3147,7 @@ ember-cli-htmlbars@2.0.3, ember-cli-htmlbars@^2.0.1, ember-cli-htmlbars@^2.0.3:
json-stable-stringify "^1.0.0" json-stable-stringify "^1.0.0"
strip-bom "^3.0.0" strip-bom "^3.0.0"
ember-cli-htmlbars@^1.0.1, ember-cli-htmlbars@^1.0.10, ember-cli-htmlbars@^1.0.11, ember-cli-htmlbars@^1.0.3, ember-cli-htmlbars@^1.1.1: ember-cli-htmlbars@^1.0.10, ember-cli-htmlbars@^1.0.11, ember-cli-htmlbars@^1.0.3, ember-cli-htmlbars@^1.1.1:
version "1.3.4" version "1.3.4"
resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-1.3.4.tgz#461289724b34af372a6a0c4b6635819156963353" resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-1.3.4.tgz#461289724b34af372a6a0c4b6635819156963353"
dependencies: dependencies:
@ -3586,21 +3586,18 @@ ember-in-viewport@2.1.1:
ember-cli-babel "^5.1.6" ember-cli-babel "^5.1.6"
ember-getowner-polyfill "^1.1.1" ember-getowner-polyfill "^1.1.1"
ember-in-viewport@2.2.1: ember-in-viewport@3.0.0, ember-in-viewport@~3.0.0:
version "2.2.1" version "3.0.0"
resolved "https://registry.yarnpkg.com/ember-in-viewport/-/ember-in-viewport-2.2.1.tgz#16888231f91a22d7088dd724d9ffb6dedbc649a4" resolved "https://registry.yarnpkg.com/ember-in-viewport/-/ember-in-viewport-3.0.0.tgz#2dec3fbbb70e3290b8dcedd2f1946d2362d12758"
dependencies: dependencies:
ember-cli-babel "^6.6.0" ember-cli-babel "^6.6.0"
ember-getowner-polyfill "^2.0.0"
ember-infinity@0.2.8: ember-infinity@1.0.0-alpha.9:
version "0.2.8" version "1.0.0-alpha.9"
resolved "https://registry.yarnpkg.com/ember-infinity/-/ember-infinity-0.2.8.tgz#813a24d0828446a44d09c21fee5adf371897d8dd" resolved "https://registry.yarnpkg.com/ember-infinity/-/ember-infinity-1.0.0-alpha.9.tgz#b1a80c8008f15ef17746eca5bf85cbf2f1f888f0"
dependencies: dependencies:
ember-cli-babel "^5.1.5" ember-cli-babel "^6.6.0"
ember-cli-htmlbars "^1.0.1" ember-in-viewport "~3.0.0"
ember-cli-version-checker "^1.0.2"
ember-version-is "0.0.3"
ember-inflector@^1.9.2: ember-inflector@^1.9.2:
version "1.12.1" version "1.12.1"
@ -3897,12 +3894,6 @@ ember-truth-helpers@2.0.0, ember-truth-helpers@^2.0.0:
dependencies: dependencies:
ember-cli-babel "^6.8.2" ember-cli-babel "^6.8.2"
ember-version-is@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/ember-version-is/-/ember-version-is-0.0.3.tgz#7d54ec39ed5e03f0df11cf8a5e22dc20b0810b1a"
dependencies:
ember-cli-babel "^5.0.0"
ember-weakmap@^3.0.0, ember-weakmap@^3.1.0: ember-weakmap@^3.0.0, ember-weakmap@^3.1.0:
version "3.1.1" version "3.1.1"
resolved "https://registry.yarnpkg.com/ember-weakmap/-/ember-weakmap-3.1.1.tgz#2ae6e0080b5b80cf0d108f7752dc69ea9603dbd7" resolved "https://registry.yarnpkg.com/ember-weakmap/-/ember-weakmap-3.1.1.tgz#2ae6e0080b5b80cf0d108f7752dc69ea9603dbd7"