[OAuth2Provider] Add OAuth2 client app listing page and form into account preference page
Review Request #7900 — Created Jan. 20, 2016 and discarded
Add a starting point for user to view all of their OAuth2 client apps.
Similar to the group page, user can search for certain OAuth2 client
rapplications. The page will ask for user confirmation if user want to
remove a client app. The page also display a nonfunctional form for user to edit
and add new application. There is no backend support for all operations
Manually open the page with 1 OAuth client app and type to filter it out.
I cannot find any automate test for the page and form as well as the BackboneJS part.
Description | From | Last Updated |
---|---|---|
How about OAuth2AppForm? |
brennie | |
"This form" |
brennie | |
"view" |
brennie | |
Mention that the JS will be responsible for doing this over the API? |
brennie | |
"Get" -> "Return" Missing a Returns block, e.g. ```python """... Returns: dict: An explanation of the return value. """ |
brennie | |
We can express this in a more Pythonic fashion by using a list comprehension: serialized_oauth2_client_apps = [ self._serialize_oauth2_client_app(client_app) for client_app … |
brennie | |
How about serialized_apps ? |
brennie | |
_serialize_app? Needs a docstring. |
brennie | |
How about OAuth2Page ? |
brennie | |
Needs a doc-comment. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
This would be better formatted as: ```javascript this.actions = [ { id: 'remove', label: gettext('Remove') }, { id: 'edit', label: … |
brennie | |
Two lines between top-level declarations/definitions. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
Two blank lines. |
brennie | |
Needs a doc comment. |
brennie | |
If you're not actually doing any substitution, it will be faster to just make this a string instead of using … |
brennie | |
Should use dashes instead of underscores. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
Needs a doc comment. |
brennie | |
This is returning a dict. |
chipx86 | |
This can be one statement without impacting readability. |
chipx86 | |
This is returning a dict. |
chipx86 | |
No blank line here. |
chipx86 | |
Should be in alphabetical order. |
chipx86 | |
This should document the model attributes. See https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/#documenting-models |
chipx86 | |
No trailing comma. |
chipx86 | |
Should use .apply(this, arguments). |
chipx86 | |
This is a no-op. We already have it set, since that's how we're setting this again. Let's remove this. |
chipx86 | |
No traiing comma. |
chipx86 | |
Best to put a big /* XXX This is for testing */ or something here and below, so it doesn't … |
chipx86 | |
No trailing comma. |
chipx86 | |
The href should have a value. At the very least, "#". |
chipx86 | |
Text needs to be localized. |
chipx86 | |
Should document the options. See https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/#documenting-function-options |
chipx86 | |
Needs a "Returns:" section. |
chipx86 | |
"Return a list of a user's ..." |
chipx86 | |
Descriptions are saying list, but it's not a list. |
chipx86 | |
This is wrapping too early. |
chipx86 | |
Missing a period. |
chipx86 | |
Missing a period. |
chipx86 | |
Missing a period. |
chipx86 | |
Space before {. Same below. |
chipx86 | |
Indentation levels in .less files should be 2 spaces. |
chipx86 | |
Ideally, these should be in alphabetical order. |
chipx86 | |
"an OAuth2" |
chipx86 | |
"string", lowercase. |
chipx86 | |
Missing a period. |
chipx86 | |
.extend isn't the right thing here. |
chipx86 | |
"Initialize." |
chipx86 | |
"object", lowercase. |
chipx86 | |
Missing a period. |
chipx86 | |
No blank line here. |
chipx86 | |
"Create". Function/method comments should be in the form of "Create", "Return", "Set", etc., rather than "Creates", "Returns", "Sets", etc. |
chipx86 | |
"object" |
chipx86 | |
Missing period. Check further docs for this as well. |
chipx86 | |
Including templates in this way can be very dangerous, and isn't something we want to do. Looking through those templates, … |
chipx86 | |
Should be removed. |
chipx86 | |
This should be wrapped in gettext(). |
chipx86 | |
This should be wrapped in gettext(). |
chipx86 | |
Due to how the gettext localization string gathering works, you can't actually split lines and concatenate them. So they'll need … |
chipx86 | |
render functions must return this, and should document that in the function docs. Same with others below. |
chipx86 | |
No blank line. |
chipx86 | |
Space before {. |
chipx86 | |
Should be wrapped with gettext(). |
chipx86 | |
Two blank lines between these. |
chipx86 | |
This needs a doc header. Same with the functions. |
chipx86 | |
If this isn't needed in this change, it should be removed and implemented only in the change where it'll be … |
chipx86 | |
If these aren't needed in this change, they should be removed. |
chipx86 | |
IDs should be in the same form as class names, rather than CamelCase. Also, we're assigning too much meaning to … |
chipx86 |
-
Since this is a WIP, please put [WIP] in the summary.
-
-
-
-
-
"Get" -> "Return"
Missing a
Returns
block, e.g.```python
"""...Returns:
dict: An explanation of the return value.
""" -
We can express this in a more Pythonic fashion by using a list comprehension:
serialized_oauth2_client_apps = [ self._serialize_oauth2_client_app(client_app) for client_app in oauth2_client_apps ]
-
-
-
-
-
-
-
-
-
This would be better formatted as:
```javascript
this.actions = [
{
id: 'remove',
label: gettext('Remove')
},
{
id: 'edit',
label: gettext('Edit')
}
]; -
-
-
-
-
-
-
If you're not actually doing any substitution, it will be faster to just make this a string instead of using
_.template
. -
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
-
-
-
-
-
-
-
This should document the model attributes. See https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/#documenting-models
-
-
-
This is a no-op. We already have it set, since that's how we're setting this again. Let's remove this.
-
-
Best to put a big
/* XXX This is for testing */
or something here and below, so it doesn't slip through the cracks.If these functions aren't used yet, it's probably best to not include them in the change.
Also, models should never know or care about UI, so they shouldn't be raising alerts or editing anything.
-
-
-
-
Should document the options. See https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/#documenting-function-options
-
- Change Summary:
-
Add a different listing page with remove confirmation, and client app form
- Summary:
-
[OAuth2Provider] Add OAuth2 client application listing page into account preference page[OAuth2Provider] [WIP] Add OAuth2 client app listing page and form into account preference page
- Description:
-
Add a starting point for user to view all of their OAuth2 client apps.
Similar to the group page, user can search for certain OAuth2 client ~ applications. Apart from the filtering, there is no interaction on the page yet ~ rapplications. The page will ask for user confirmation if user want to + remove a client app. The page also display a nonfunctional form for user to edit + and add new application. There is no backend support for all operations - Depends On:
-
- Diff:
Revision 4 (+530 -1)
- Added Files:
-
Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
- Change Summary:
-
Simplify the CSS
- Diff:
-
Revision 5 (+533 -1)
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
- Change Summary:
-
Fix search bar issue
- Diff:
-
Revision 6 (+533 -1)
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
- Change Summary:
-
Update from master
- Diff:
-
Revision 7 (+485 -3)
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/accounts/oauth2_client_application.html reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
"Create".
Function/method comments should be in the form of "Create", "Return", "Set", etc., rather than "Creates", "Returns", "Sets", etc.
-
-
-
Including templates in this way can be very dangerous, and isn't something we want to do.
Looking through those templates, we'd be much better off doing what other similar views do. Each of these views should define the HTML needed inline, rather than assuming the page has outputted it to some hidden element.
By defining inline, we only have it when we need it, and we have an easier way to unit test it (since the unit tests don't need to duplicate the template here).
Also, important note: Using
$('...').text()
will filter out tags, and return content that may contain things like the word<script>
. That would then be turned into HTML, resulting in a security vulnerability. It's actually very, very dangerous to do this kind of thing.Same below.
-
-
-
-
Due to how the gettext localization string gathering works, you can't actually split lines and concatenate them. So they'll need to be one long string, each. This only needs to happen in JavaScript code.
This violates the standard rule of fitting content into 80 columns, but for gettext strings, we make an exception.
-
render
functions must returnthis
, and should document that in the function docs.Same with others below.
-
-
-
-
-
-
If this isn't needed in this change, it should be removed and implemented only in the change where it'll be used.
Best to keep individual changes to only the code needed in that change.
-
-
IDs should be in the same form as class names, rather than CamelCase.
Also, we're assigning too much meaning to
backbone-template
. It's a vague class name with a very specific purpose, but different ways it could be interpreted. However, with my suggestions above, you won't need this anymore.
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less
- Change Summary:
-
Update cr and use oauth2_oauth2clientapplication instead of oauth2_provider_application. Add period and clien_id
- Diff:
-
Revision 9 (+483 -3)
-
Tool: Pyflakes Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js reviewboard/static/rb/css/pages/my-account.less