-
Notifications
You must be signed in to change notification settings - Fork 648
Add pagination to the "Pending Owner Invites" page #5185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0809f82
chore(mirage): provide fixtures for mocking invites
LeoBorai 8c60753
fix: comment parsing for `crate_id` on serializer
LeoBorai 712abe1
feat: render pagination component
LeoBorai cd92237
fix: remove dead code
LeoBorai 9855ff5
feat: provide support for pagination
LeoBorai 6eb4a45
fix: linting issues improvements
LeoBorai c664493
fix: update tests to support `meta` field
LeoBorai c99229b
feat: provide pagination
LeoBorai 539fb30
fix: remove fixtures for crate owner invitations
LeoBorai 6a44750
fix: remove numeric based pagination
LeoBorai 78d249b
feat: seek pagination support
LeoBorai 95f9b64
Merge branch 'master' of github.com:rust-lang/crates.io into fix/owne…
LeoBorai 80db2b4
feat: provide a seek pagination component
LeoBorai 18ad7b9
fix: remove ptintln left behind
LeoBorai fee2365
fix: remove unused `total` field
LeoBorai 2409f0e
Merge branch 'master' of github.com:rust-lang/crates.io into fix/owne…
LeoBorai eb93218
revert: `src/controllers/crate_owner_invitation.rs`
LeoBorai 1b140b5
fix: parse `seek` from meta next_page
LeoBorai 11fafa7
fix: remove unused `queryParams`
LeoBorai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Controller from '@ember/controller'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
import { reads } from 'macro-decorators'; | ||
|
||
import { pagination } from '../../utils/pagination'; | ||
|
||
export default class PendingInvitesController extends Controller { | ||
queryParams = ['page', 'per_page']; | ||
@tracked page = '1'; | ||
@tracked per_page = 10; | ||
|
||
@reads('model.meta.total') totalItems; | ||
@pagination() pagination; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.list { | ||
background: white; | ||
margin-bottom: 2rem; | ||
} | ||
|
||
.row { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
export default [ | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'mock-dev-deps', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'postgres', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'nom', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'rusted_cypher', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'nanomsg', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'postgres', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'nom', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'nanomsg', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'external_mixin', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'rustless', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'serde', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'rustful', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'quickcheck', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'rusted_cypher', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'external_mixin', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'rustless', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'serde', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'rustful', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'quickcheck', | ||
}, | ||
{ | ||
inviteeId: 1, | ||
inviterId: 2, | ||
crateId: 'mock-dev-deps', | ||
}, | ||
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,9 @@ export default BaseSerializer.extend({ | |
delete hash.id; | ||
delete hash.token; | ||
|
||
hash.crate_id = Number(hash.crate_id); | ||
// TODO: Check this further, `crate_id` are strings in the current fixtures | ||
// when attempting to parse into number we will get `NaN`s here. | ||
// hash.crate_id = Number(hash.crate_id); | ||
Comment on lines
-27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is causing some trouble when retrieving crates by its ID, given that crates IDs are actually strings with the name of such crate. |
||
|
||
let crate = this.schema.crates.find(hash.crate_id); | ||
hash.crate_name = crate.name; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.