-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(articles): Server-side paging for list #1263
base: master
Are you sure you want to change the base?
Changes from all commits
86df6eb
91c0293
78a72f6
d2377fa
1df16d5
56787c2
d344bdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<h1>{{vm.article._id ? 'Edit Article' : 'New Article'}}</h1> | ||
</div> | ||
<div class="pull-right"> | ||
<a class="btn btn-primary" ng-click="vm.remove()"> | ||
<a class="btn btn-primary" ng-click="vm.remove()" ng-if="!vm.isNew"> | ||
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 unrelated to what this PR is trying to accomplish, but I noticed a bug while developing this new feature. The "Delete" button was visible when the user was in "create" mode here. |
||
<i class="glyphicon glyphicon-trash"></i> | ||
</a> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ exports.invokeRolesPolicies = function () { | |
}, { | ||
resources: '/api/articles/:articleId', | ||
permissions: '*' | ||
}, { | ||
resources: '/api/parameterized-query/articles', | ||
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. I see why you called this route parameterized-query, and we probably want to keep backwards-compatibility, but it does make me wonder whether we could retitle the existing articles routes /api/articles/list and /api/articles/list/:articleId and rename your query /api/articles/query 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. I see what you mean, but I definitely prefer We may end up with something like: I can see this type of API route configuration as a benefit, even if this may seem like a band-aid to a problem with how we're declaring our routes; given that we could have these conflicts. We can definitely look at our router configuration & solve the issue. But it's not something I wanted to do in this PR. |
||
permissions: '*' | ||
}] | ||
}, { | ||
roles: ['user'], | ||
|
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.
Why specify these here when they are only going to be plugged directly into the find() function?
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.
The point is that you may have multiple views, or user inputs, that change the filters and/or sorts.
Furthermore, you could have many different clients sending API requests to the back-end with varying filters & sorts.