-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add pagination to namespace list view #13195
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
469aaf6
Add client side pagination to namespaces
arnav28 76d3e21
Update namespace list after delete operation
arnav28 9953626
Added changelog
arnav28 a9a0e8a
Added tests
arnav28 3010171
Clean up
arnav28 55f351b
Added comment for test
arnav28 e2f6589
Try ember run loop
arnav28 c803829
Run test only in enterprise
arnav28 d272958
Fixed test
arnav28 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 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,3 @@ | ||
```release-note:improvement | ||
ui: Added client side paging for namespace list view | ||
``` |
This file contains 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 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 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 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 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 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,40 @@ | ||
import { currentRouteName } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
import page from 'vault/tests/pages/access/namespaces/index'; | ||
import authPage from 'vault/tests/pages/auth'; | ||
import logout from 'vault/tests/pages/logout'; | ||
|
||
module('Acceptance | /access/namespaces', function(hooks) { | ||
setupApplicationTest(hooks); | ||
setupMirage(hooks); | ||
|
||
hooks.beforeEach(function() { | ||
return authPage.login(); | ||
}); | ||
|
||
hooks.afterEach(function() { | ||
return logout.visit(); | ||
}); | ||
|
||
test('it navigates to namespaces page', async function(assert) { | ||
assert.expect(1); | ||
await page.visit(); | ||
assert.equal( | ||
currentRouteName(), | ||
'vault.cluster.access.namespaces.index', | ||
'navigates to the correct route' | ||
); | ||
}); | ||
|
||
test('it should render correct number of namespaces', async function(assert) { | ||
assert.expect(3); | ||
await page.visit(); | ||
const store = this.owner.lookup('service:store'); | ||
// Default page size is 15 | ||
assert.equal(store.peekAll('namespace').length, 15, 'Store has 15 namespaces records'); | ||
assert.dom('.list-item-row').exists({ count: 15 }); | ||
assert.dom('[data-test-list-view-pagination]').exists(); | ||
}); | ||
}); |
This file contains 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,5 @@ | ||
import { create, visitable } from 'ember-cli-page-object'; | ||
|
||
export default create({ | ||
visit: visitable('/vault/access/namespaces'), | ||
}); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add
Enterprise
to this module name, since namespaces are enterprise onlyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You saved my day...Thanks!! 😅