From e65fdbee16dd113c50eabef1429444c65714b58a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 18 Sep 2020 09:53:54 +0200 Subject: [PATCH 1/6] mixins/pagination: Reorder computed properties This essentially orders them by dependencies, so that the ones that don't depend on others are at the top --- app/mixins/pagination.js | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/app/mixins/pagination.js b/app/mixins/pagination.js index 5c93a6c7363..0da1a9b8dee 100644 --- a/app/mixins/pagination.js +++ b/app/mixins/pagination.js @@ -6,31 +6,9 @@ const VIEWABLE_PAGES = 9; // eslint-disable-next-line ember/no-new-mixins export default Mixin.create({ - // Gives page numbers to the surrounding 9 pages. - pages: computed('currentPage', 'availablePages', function () { - let pages = []; - let currentPage = this.currentPage; - let availablePages = this.availablePages; - let lowerBound = 0; - let upperBound = 0; - - // Always show the same number of pages even if we're - // at the beginning or at the end of the list. - if (availablePages - currentPage < Math.ceil(VIEWABLE_PAGES / 2)) { - lowerBound = Math.max(0, availablePages - VIEWABLE_PAGES); - upperBound = availablePages; - } else if (currentPage <= Math.ceil(VIEWABLE_PAGES / 2)) { - lowerBound = 0; - upperBound = Math.min(availablePages, VIEWABLE_PAGES); - } else { - lowerBound = currentPage - Math.ceil(VIEWABLE_PAGES / 2); - upperBound = currentPage + Math.floor(VIEWABLE_PAGES / 2); - } - for (let i = lowerBound; i < upperBound; i++) { - pages.push(i + 1); - } - return pages; - }), + // wire up these ember-style variables to the expected query parameters + itemsPerPage: readOnly('per_page'), + selectedPage: readOnly('page'), currentPage: computed('selectedPage', function () { return parseInt(this.selectedPage, 10) || 1; @@ -47,6 +25,10 @@ export default Mixin.create({ return Math.min(this.currentPage * this.itemsPerPage, this.totalItems); }), + availablePages: computed('totalItems', 'itemsPerPage', function () { + return Math.ceil(this.totalItems / this.itemsPerPage || 1); + }), + nextPage: computed('currentPage', 'availablePages', function () { let nextPage = this.currentPage + 1; let availablePages = this.availablePages; @@ -66,11 +48,29 @@ export default Mixin.create({ } }), - availablePages: computed('totalItems', 'itemsPerPage', function () { - return Math.ceil(this.totalItems / this.itemsPerPage || 1); - }), + // Gives page numbers to the surrounding 9 pages. + pages: computed('currentPage', 'availablePages', function () { + let pages = []; + let currentPage = this.currentPage; + let availablePages = this.availablePages; + let lowerBound = 0; + let upperBound = 0; - // wire up these ember-style variables to the expected query parameters - itemsPerPage: readOnly('per_page'), - selectedPage: readOnly('page'), + // Always show the same number of pages even if we're + // at the beginning or at the end of the list. + if (availablePages - currentPage < Math.ceil(VIEWABLE_PAGES / 2)) { + lowerBound = Math.max(0, availablePages - VIEWABLE_PAGES); + upperBound = availablePages; + } else if (currentPage <= Math.ceil(VIEWABLE_PAGES / 2)) { + lowerBound = 0; + upperBound = Math.min(availablePages, VIEWABLE_PAGES); + } else { + lowerBound = currentPage - Math.ceil(VIEWABLE_PAGES / 2); + upperBound = currentPage + Math.floor(VIEWABLE_PAGES / 2); + } + for (let i = lowerBound; i < upperBound; i++) { + pages.push(i + 1); + } + return pages; + }), }); From 4d397235c2d811d57a1a25cbb1b502d47303921e Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 18 Sep 2020 09:48:28 +0200 Subject: [PATCH 2/6] mixins/pagination: Extract `pagination` computed property macro --- app/mixins/pagination.js | 120 +++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/app/mixins/pagination.js b/app/mixins/pagination.js index 0da1a9b8dee..2221f7e7667 100644 --- a/app/mixins/pagination.js +++ b/app/mixins/pagination.js @@ -6,71 +6,71 @@ const VIEWABLE_PAGES = 9; // eslint-disable-next-line ember/no-new-mixins export default Mixin.create({ - // wire up these ember-style variables to the expected query parameters - itemsPerPage: readOnly('per_page'), - selectedPage: readOnly('page'), + pagination: pagination(), - currentPage: computed('selectedPage', function () { - return parseInt(this.selectedPage, 10) || 1; - }), + currentPage: readOnly('pagination.currentPage'), + currentPageStart: readOnly('pagination.currentPageStart'), + currentPageEnd: readOnly('pagination.currentPageEnd'), - currentPageStart: computed('currentPage', 'itemsPerPage', 'totalItems', function () { - if (this.totalItems === 0) { - return 0; - } - return (this.currentPage - 1) * this.itemsPerPage + 1; - }), + availablePages: readOnly('pagination.availablePages'), - currentPageEnd: computed('currentPage', 'itemsPerPage', 'totalItems', function () { - return Math.min(this.currentPage * this.itemsPerPage, this.totalItems); - }), + nextPage: readOnly('pagination.nextPage'), + prevPage: readOnly('pagination.prevPage'), - availablePages: computed('totalItems', 'itemsPerPage', function () { - return Math.ceil(this.totalItems / this.itemsPerPage || 1); - }), + pages: readOnly('pagination.pages'), +}); - nextPage: computed('currentPage', 'availablePages', function () { - let nextPage = this.currentPage + 1; - let availablePages = this.availablePages; - if (nextPage <= availablePages) { - return nextPage; - } else { - return this.currentPage; - } - }), +function pagination() { + return computed('page', 'per_page', 'totalItems', function () { + let { page, per_page: perPage, totalItems } = this; + return _pagination(page, perPage, totalItems); + }); +} - prevPage: computed('currentPage', function () { - let prevPage = this.currentPage - 1; - if (prevPage > 0) { - return prevPage; - } else { - return this.currentPage; - } - }), +function _pagination(page, perPage, totalItems) { + let currentPage = parseInt(page, 10) || 1; - // Gives page numbers to the surrounding 9 pages. - pages: computed('currentPage', 'availablePages', function () { - let pages = []; - let currentPage = this.currentPage; - let availablePages = this.availablePages; - let lowerBound = 0; - let upperBound = 0; + let currentPageStart = totalItems === 0 ? 0 : (currentPage - 1) * perPage + 1; + let currentPageEnd = Math.min(currentPage * perPage, totalItems); - // Always show the same number of pages even if we're - // at the beginning or at the end of the list. - if (availablePages - currentPage < Math.ceil(VIEWABLE_PAGES / 2)) { - lowerBound = Math.max(0, availablePages - VIEWABLE_PAGES); - upperBound = availablePages; - } else if (currentPage <= Math.ceil(VIEWABLE_PAGES / 2)) { - lowerBound = 0; - upperBound = Math.min(availablePages, VIEWABLE_PAGES); - } else { - lowerBound = currentPage - Math.ceil(VIEWABLE_PAGES / 2); - upperBound = currentPage + Math.floor(VIEWABLE_PAGES / 2); - } - for (let i = lowerBound; i < upperBound; i++) { - pages.push(i + 1); - } - return pages; - }), -}); + let availablePages = Math.ceil(totalItems / perPage || 1); + + let nextPage = currentPage + 1; + if (nextPage > availablePages) { + nextPage = currentPage; + } + + let prevPage = currentPage - 1; + if (prevPage <= 0) { + prevPage = currentPage; + } + + // Always show the same number of pages even if we're + // at the beginning or at the end of the list. + let lowerBound, upperBound; + if (availablePages - currentPage < Math.ceil(VIEWABLE_PAGES / 2)) { + lowerBound = Math.max(0, availablePages - VIEWABLE_PAGES); + upperBound = availablePages; + } else if (currentPage <= Math.ceil(VIEWABLE_PAGES / 2)) { + lowerBound = 0; + upperBound = Math.min(availablePages, VIEWABLE_PAGES); + } else { + lowerBound = currentPage - Math.ceil(VIEWABLE_PAGES / 2); + upperBound = currentPage + Math.floor(VIEWABLE_PAGES / 2); + } + + let pages = []; + for (let i = lowerBound; i < upperBound; i++) { + pages.push(i + 1); + } + + return { + currentPage, + currentPageStart, + currentPageEnd, + availablePages, + nextPage, + prevPage, + pages, + }; +} From 66014ec49c530078a0e4c88fafd3e263a5ed2793 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 18 Sep 2020 10:05:21 +0200 Subject: [PATCH 3/6] mixins/pagination: Inline alias properties --- app/mixins/pagination.js | 12 ------------ app/templates/categories.hbs | 6 +++--- app/templates/category/index.hbs | 6 +++--- app/templates/crate/reverse-dependencies.hbs | 6 +++--- app/templates/crates.hbs | 6 +++--- app/templates/keyword/index.hbs | 6 +++--- app/templates/keywords.hbs | 6 +++--- app/templates/me/crates.hbs | 6 +++--- app/templates/me/following.hbs | 6 +++--- app/templates/search.hbs | 6 +++--- app/templates/team.hbs | 6 +++--- app/templates/user.hbs | 6 +++--- 12 files changed, 33 insertions(+), 45 deletions(-) diff --git a/app/mixins/pagination.js b/app/mixins/pagination.js index 2221f7e7667..be53f114d1f 100644 --- a/app/mixins/pagination.js +++ b/app/mixins/pagination.js @@ -1,5 +1,4 @@ import { computed } from '@ember/object'; -import { readOnly } from '@ember/object/computed'; import Mixin from '@ember/object/mixin'; const VIEWABLE_PAGES = 9; @@ -7,17 +6,6 @@ const VIEWABLE_PAGES = 9; // eslint-disable-next-line ember/no-new-mixins export default Mixin.create({ pagination: pagination(), - - currentPage: readOnly('pagination.currentPage'), - currentPageStart: readOnly('pagination.currentPageStart'), - currentPageEnd: readOnly('pagination.currentPageEnd'), - - availablePages: readOnly('pagination.availablePages'), - - nextPage: readOnly('pagination.nextPage'), - prevPage: readOnly('pagination.prevPage'), - - pages: readOnly('pagination.pages'), }); function pagination() { diff --git a/app/templates/categories.hbs b/app/templates/categories.hbs index 59af5675704..4303558bac9 100644 --- a/app/templates/categories.hbs +++ b/app/templates/categories.hbs @@ -4,8 +4,8 @@
@@ -37,7 +37,7 @@ {{/each}}
- +
Want to categorize your crate? diff --git a/app/templates/category/index.hbs b/app/templates/category/index.hbs index 39c94ee08a5..c56b7ccc133 100644 --- a/app/templates/category/index.hbs +++ b/app/templates/category/index.hbs @@ -36,8 +36,8 @@

Crates

@@ -60,4 +60,4 @@ {{/each}}
- + diff --git a/app/templates/crate/reverse-dependencies.hbs b/app/templates/crate/reverse-dependencies.hbs index e7085a823ce..dfc7e19c18d 100644 --- a/app/templates/crate/reverse-dependencies.hbs +++ b/app/templates/crate/reverse-dependencies.hbs @@ -4,8 +4,8 @@
@@ -25,4 +25,4 @@ {{/each}}
- \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/crates.hbs b/app/templates/crates.hbs index a4da86f6143..14eae18af7d 100644 --- a/app/templates/crates.hbs +++ b/app/templates/crates.hbs @@ -19,8 +19,8 @@
@@ -43,4 +43,4 @@ {{/each}}
- + diff --git a/app/templates/keyword/index.hbs b/app/templates/keyword/index.hbs index 27a664e082d..e3941a26b79 100644 --- a/app/templates/keyword/index.hbs +++ b/app/templates/keyword/index.hbs @@ -4,8 +4,8 @@
@@ -28,4 +28,4 @@ {{/each}}
- + diff --git a/app/templates/keywords.hbs b/app/templates/keywords.hbs index 3b8f31ac5d2..bd84263e6a5 100644 --- a/app/templates/keywords.hbs +++ b/app/templates/keywords.hbs @@ -4,8 +4,8 @@
@@ -30,4 +30,4 @@ {{/each}}
- + diff --git a/app/templates/me/crates.hbs b/app/templates/me/crates.hbs index 2138d2fb633..40f7482823e 100644 --- a/app/templates/me/crates.hbs +++ b/app/templates/me/crates.hbs @@ -6,8 +6,8 @@
@@ -29,4 +29,4 @@ {{/each}}
- + diff --git a/app/templates/me/following.hbs b/app/templates/me/following.hbs index 31ed7a155ee..0a4f94c3db5 100644 --- a/app/templates/me/following.hbs +++ b/app/templates/me/following.hbs @@ -4,8 +4,8 @@
@@ -24,4 +24,4 @@ {{/each}}
- \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/search.hbs b/app/templates/search.hbs index d44c46134b1..871b47f3a67 100644 --- a/app/templates/search.hbs +++ b/app/templates/search.hbs @@ -13,8 +13,8 @@ {{else if this.hasItems}}
@@ -48,7 +48,7 @@ {{/each}}
- + {{else}}

0 crates found. Get started and create your own.

{{/if}} diff --git a/app/templates/team.hbs b/app/templates/team.hbs index 64084b0947f..24d18cbabaf 100644 --- a/app/templates/team.hbs +++ b/app/templates/team.hbs @@ -17,8 +17,8 @@
@@ -40,4 +40,4 @@ {{/each}}
- \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/user.hbs b/app/templates/user.hbs index 3676e8923b9..1e41128e2a3 100644 --- a/app/templates/user.hbs +++ b/app/templates/user.hbs @@ -10,8 +10,8 @@
@@ -33,4 +33,4 @@ {{/each}}
- \ No newline at end of file + \ No newline at end of file From 6faf89379da3a018578bd841551133e928751f1a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 18 Sep 2020 10:09:03 +0200 Subject: [PATCH 4/6] Inline `pagination` mixin --- app/controllers/categories.js | 5 +++-- app/controllers/category/index.js | 5 +++-- app/controllers/crate/reverse-dependencies.js | 5 +++-- app/controllers/crates.js | 5 +++-- app/controllers/keyword/index.js | 5 +++-- app/controllers/keywords.js | 5 +++-- app/controllers/me/crates.js | 5 +++-- app/controllers/me/following.js | 5 +++-- app/controllers/search.js | 5 +++-- app/controllers/team.js | 5 +++-- app/controllers/user.js | 5 +++-- app/{mixins => utils}/pagination.js | 8 +------- 12 files changed, 34 insertions(+), 29 deletions(-) rename app/{mixins => utils}/pagination.js (89%) diff --git a/app/controllers/categories.js b/app/controllers/categories.js index 0e667960afc..686da8e548a 100644 --- a/app/controllers/categories.js +++ b/app/controllers/categories.js @@ -2,15 +2,16 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../mixins/pagination'; +import { pagination } from '../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 100, sort: 'alpha', totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { return this.sort === 'crates' ? '# Crates' : 'Alphabetical'; diff --git a/app/controllers/category/index.js b/app/controllers/category/index.js index 0ab971918c7..3a4bcd70b88 100644 --- a/app/controllers/category/index.js +++ b/app/controllers/category/index.js @@ -2,15 +2,16 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../../mixins/pagination'; +import { pagination } from '../../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'recent-downloads', totalItems: readOnly('model.meta.total'), + pagination: pagination(), category: null, diff --git a/app/controllers/crate/reverse-dependencies.js b/app/controllers/crate/reverse-dependencies.js index ab3aafb5a9c..24636d01d5b 100644 --- a/app/controllers/crate/reverse-dependencies.js +++ b/app/controllers/crate/reverse-dependencies.js @@ -1,13 +1,14 @@ import Controller from '@ember/controller'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../../mixins/pagination'; +import { pagination } from '../../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page'], page: '1', per_page: 10, crate: null, totalItems: readOnly('model.meta.total'), + pagination: pagination(), }); diff --git a/app/controllers/crates.js b/app/controllers/crates.js index b6369004882..c9a296d2ba7 100644 --- a/app/controllers/crates.js +++ b/app/controllers/crates.js @@ -2,9 +2,9 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../mixins/pagination'; +import { pagination } from '../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['letter', 'page', 'per_page', 'sort'], letter: null, page: '1', @@ -13,6 +13,7 @@ export default Controller.extend(PaginationMixin, { alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''), totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { if (this.sort === 'downloads') { diff --git a/app/controllers/keyword/index.js b/app/controllers/keyword/index.js index a7f76115611..0f588c2074d 100644 --- a/app/controllers/keyword/index.js +++ b/app/controllers/keyword/index.js @@ -2,15 +2,16 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../../mixins/pagination'; +import { pagination } from '../../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'recent-downloads', totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { if (this.sort === 'downloads') { diff --git a/app/controllers/keywords.js b/app/controllers/keywords.js index 22df46994e0..8ca522b429e 100644 --- a/app/controllers/keywords.js +++ b/app/controllers/keywords.js @@ -2,15 +2,16 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../mixins/pagination'; +import { pagination } from '../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'crates', totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { return this.sort === 'crates' ? '# Crates' : 'Alphabetical'; diff --git a/app/controllers/me/crates.js b/app/controllers/me/crates.js index 40d968d18a4..dc11b0a4097 100644 --- a/app/controllers/me/crates.js +++ b/app/controllers/me/crates.js @@ -2,17 +2,18 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../../mixins/pagination'; +import { pagination } from '../../utils/pagination'; // TODO: reduce duplicatoin with controllers/crates -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'alpha', totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { if (this.sort === 'downloads') { diff --git a/app/controllers/me/following.js b/app/controllers/me/following.js index 05d09617a71..dda2fb85a30 100644 --- a/app/controllers/me/following.js +++ b/app/controllers/me/following.js @@ -2,17 +2,18 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../../mixins/pagination'; +import { pagination } from '../../utils/pagination'; // TODO: reduce duplicatoin with controllers/me/crates -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'alpha', totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { return this.sort === 'downloads' ? 'Downloads' : 'Alphabetical'; diff --git a/app/controllers/search.js b/app/controllers/search.js index 12cadc630cf..c1f2ad89285 100644 --- a/app/controllers/search.js +++ b/app/controllers/search.js @@ -4,9 +4,9 @@ import { bool, readOnly } from '@ember/object/computed'; import { task } from 'ember-concurrency'; -import PaginationMixin from '../mixins/pagination'; +import { pagination } from '../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['all_keywords', 'page', 'per_page', 'q', 'sort'], q: null, page: '1', @@ -23,6 +23,7 @@ export default Controller.extend(PaginationMixin, { }), totalItems: readOnly('model.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { if (this.sort === 'downloads') { diff --git a/app/controllers/team.js b/app/controllers/team.js index 661b0b0bab3..8bde864382a 100644 --- a/app/controllers/team.js +++ b/app/controllers/team.js @@ -2,15 +2,16 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../mixins/pagination'; +import { pagination } from '../utils/pagination'; -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'alpha', totalItems: readOnly('model.crates.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { if (this.sort === 'downloads') { diff --git a/app/controllers/user.js b/app/controllers/user.js index 81aa7690b91..2719f1c1797 100644 --- a/app/controllers/user.js +++ b/app/controllers/user.js @@ -2,17 +2,18 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { readOnly } from '@ember/object/computed'; -import PaginationMixin from '../mixins/pagination'; +import { pagination } from '../utils/pagination'; // TODO: reduce duplication with controllers/crates -export default Controller.extend(PaginationMixin, { +export default Controller.extend({ queryParams: ['page', 'per_page', 'sort'], page: '1', per_page: 10, sort: 'alpha', totalItems: readOnly('model.crates.meta.total'), + pagination: pagination(), currentSortBy: computed('sort', function () { if (this.sort === 'downloads') { diff --git a/app/mixins/pagination.js b/app/utils/pagination.js similarity index 89% rename from app/mixins/pagination.js rename to app/utils/pagination.js index be53f114d1f..525523293d0 100644 --- a/app/mixins/pagination.js +++ b/app/utils/pagination.js @@ -1,14 +1,8 @@ import { computed } from '@ember/object'; -import Mixin from '@ember/object/mixin'; const VIEWABLE_PAGES = 9; -// eslint-disable-next-line ember/no-new-mixins -export default Mixin.create({ - pagination: pagination(), -}); - -function pagination() { +export function pagination() { return computed('page', 'per_page', 'totalItems', function () { let { page, per_page: perPage, totalItems } = this; return _pagination(page, perPage, totalItems); From e389c506f82f8f71e5b7385b1da1b60cf3a63757 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 18 Sep 2020 10:10:11 +0200 Subject: [PATCH 5/6] ESLint: Enable `ember/no-mixins` rule --- .eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 4746b61e968..dcdaa7c7dde 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,7 +18,6 @@ module.exports = { 'ember/no-empty-attrs': 'off', 'ember/no-get': 'off', - 'ember/no-mixins': 'off', 'ember/require-computed-property-dependencies': 'off', 'import-helpers/order-imports': [ From 26e770abb3ff3d1088a227c70d6eb15cf412fa6a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 18 Sep 2020 10:22:59 +0200 Subject: [PATCH 6/6] Pagination: Accept `pagination` object instead of individual arguments --- app/components/pagination.hbs | 6 +++--- app/templates/categories.hbs | 2 +- app/templates/category/index.hbs | 2 +- app/templates/crate/reverse-dependencies.hbs | 2 +- app/templates/crates.hbs | 2 +- app/templates/keyword/index.hbs | 2 +- app/templates/keywords.hbs | 2 +- app/templates/me/crates.hbs | 2 +- app/templates/me/following.hbs | 2 +- app/templates/search.hbs | 2 +- app/templates/team.hbs | 2 +- app/templates/user.hbs | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/components/pagination.hbs b/app/components/pagination.hbs index d719fd17f38..8e7c4f1c6e4 100644 --- a/app/components/pagination.hbs +++ b/app/components/pagination.hbs @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/app/templates/categories.hbs b/app/templates/categories.hbs index 4303558bac9..f591598e2db 100644 --- a/app/templates/categories.hbs +++ b/app/templates/categories.hbs @@ -37,7 +37,7 @@ {{/each}}
- +
Want to categorize your crate? diff --git a/app/templates/category/index.hbs b/app/templates/category/index.hbs index c56b7ccc133..e66ae510ead 100644 --- a/app/templates/category/index.hbs +++ b/app/templates/category/index.hbs @@ -60,4 +60,4 @@ {{/each}}
- + diff --git a/app/templates/crate/reverse-dependencies.hbs b/app/templates/crate/reverse-dependencies.hbs index dfc7e19c18d..81bda14ed1d 100644 --- a/app/templates/crate/reverse-dependencies.hbs +++ b/app/templates/crate/reverse-dependencies.hbs @@ -25,4 +25,4 @@ {{/each}} - \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/crates.hbs b/app/templates/crates.hbs index 14eae18af7d..92cb183d622 100644 --- a/app/templates/crates.hbs +++ b/app/templates/crates.hbs @@ -43,4 +43,4 @@ {{/each}} - + diff --git a/app/templates/keyword/index.hbs b/app/templates/keyword/index.hbs index e3941a26b79..1f781f114ec 100644 --- a/app/templates/keyword/index.hbs +++ b/app/templates/keyword/index.hbs @@ -28,4 +28,4 @@ {{/each}} - + diff --git a/app/templates/keywords.hbs b/app/templates/keywords.hbs index bd84263e6a5..22e437fcaae 100644 --- a/app/templates/keywords.hbs +++ b/app/templates/keywords.hbs @@ -30,4 +30,4 @@ {{/each}} - + diff --git a/app/templates/me/crates.hbs b/app/templates/me/crates.hbs index 40f7482823e..598d0ee258e 100644 --- a/app/templates/me/crates.hbs +++ b/app/templates/me/crates.hbs @@ -29,4 +29,4 @@ {{/each}} - + diff --git a/app/templates/me/following.hbs b/app/templates/me/following.hbs index 0a4f94c3db5..6345ea5b1d1 100644 --- a/app/templates/me/following.hbs +++ b/app/templates/me/following.hbs @@ -24,4 +24,4 @@ {{/each}} - \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/search.hbs b/app/templates/search.hbs index 871b47f3a67..7a6e54556b2 100644 --- a/app/templates/search.hbs +++ b/app/templates/search.hbs @@ -48,7 +48,7 @@ {{/each}} - + {{else}}

0 crates found. Get started and create your own.

{{/if}} diff --git a/app/templates/team.hbs b/app/templates/team.hbs index 24d18cbabaf..e2cbcce55b7 100644 --- a/app/templates/team.hbs +++ b/app/templates/team.hbs @@ -40,4 +40,4 @@ {{/each}} - \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/user.hbs b/app/templates/user.hbs index 1e41128e2a3..0fc9c055c7a 100644 --- a/app/templates/user.hbs +++ b/app/templates/user.hbs @@ -33,4 +33,4 @@ {{/each}} - \ No newline at end of file + \ No newline at end of file