Add a Dashboard toggle to show or hide archived review requests
Review Request #7109 — Created March 23, 2015 and submitted
This adds a toggle on the Dashboard datagrid to show or hide archived review requests, similar to that of the All Review Requests datagrid for showing and hiding closed review requests.
- a new template block is loaded in the dashboard to expose the toggle button
- when the pressed, a
show-archived
query is appended to the existing URL query show-archived=0
filters the archived review requests (those that are archived or muted)show-archived=1
includes all review requests, regardless of their state of visibility
NB: When show-archived
is not specified, its default value of is 0.
Manual tests: Archived and muted several review requests. In the dashboard, they disappeared when setting
show-archived=0
and reappeared when settingshow-archived=1
Unit tests: Added to reviewboard.datagrids.tests to test if archived review requests would appear in the datagrid for a particular user for
show-archived=0
andshow-archived=1
. Also tested for a different user who had not archived any of the same review requests. All tests passed.
Description | From | Last Updated |
---|---|---|
Could you alphabetize these? |
brennie | |
I have the same question here as in the other review request about why we aren't using default_show_hidden as the … |
brennie | |
Can you chang the formatting so we don't use a backslash, e.g. parent_profile_changed = super(DashboardDataGrid, self).load_extra_state( profile, allow_hide_closed=False) |
brennie | |
Will {{datagrid.queries}} expand to have a & in it if there are queries? |
brennie | |
Can we move this down to be in an else clause of the if profile and self.show_hidden != default_show_hidden: conditional? |
david | |
In order to address Barret's question, how about this, which looks somewhat more similar to ShowClosedReviewRequestsMixin if profile and 'show_hidden' … |
david | |
Can we wrap this a little differently? parent_profile_changed = \ super(DashboardDataGrid, self).load_extra_state( profile, allow_hide_closed=False) |
david | |
Can we do this in DashboardDataGrid.__init__ instead? |
david | |
This shouldn't be indented at all. |
david | |
I think we should call these "Show/Hide archived" rather than "hidden". It's true that it isn't totally correct (since it … |
david | |
Instead of using \, can you add parens around this and wrap after and? if (profile and self.show_archived != profile.extra_data.get('show_archived')): |
david | |
This is the only change in this file now--can you revert it? |
david | |
Col: 13 E113 unexpected indentation |
reviewbot | |
Col: 13 E112 expected an indented block |
reviewbot | |
I think it's just under 80 columns if you were to put this all on one line. |
david |
-
-
-
I have the same question here as in the other review request about why we aren't using
default_show_hidden
as the default parameter. -
Can you chang the formatting so we don't use a backslash, e.g.
parent_profile_changed = super(DashboardDataGrid, self).load_extra_state( profile, allow_hide_closed=False)
-
- Summary:
-
[WIP] Add a toggle on the Dashboard datagrid to show or hide hidden review requests.Add a Dashboard toggle to show or hide hidden review requests
- Description:
-
~ Added a toggle on the Dashboard datagrid to show or hide hidden review requests
~ This adds a toggle on the Dashboard datagrid to show or hide hidden review requests, similar to that of the All Review Requests datagrid for showing and hiding closed review requests.
+ + - a new template block is loaded in the dashboard to expose the toggle button
+ - when the pressed, a
show-hidden
query is appended to the existing URL query
+ show-hidden=0
filters the hidden review requests (those that are archived or muted)
+ show-hidden=1
includes all review requests, regardless of their state of visibility
+ + NB: When
show-hidden
is not specified, its default value of is 0. - Testing Done:
-
+ Manual tests: Archived and muted several review requests. In the dashboard, they disappeared when setting
show-hidden=0
and reappeared when settingshow-hidden=1
+ + Unit tests: Added to reviewboard.datagrids.tests to test if hidden review requests would appear in the datagrid for a particular user for
show-hidden=0
andshow-hidden=1
. Also tested for a different user who had not hidden any of the same review requests. All tests passed. - Groups:
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less
-
-
Can we move this down to be in an else clause of the
if profile and self.show_hidden != default_show_hidden:
conditional? -
Can we wrap this a little differently?
parent_profile_changed = \ super(DashboardDataGrid, self).load_extra_state( profile, allow_hide_closed=False)
-
-
-
I think we should call these "Show/Hide archived" rather than "hidden". It's true that it isn't totally correct (since it also shows muted), but calling them "hidden" means that we're introducing a third term.
-
-
In order to address Barret's question, how about this, which looks somewhat more similar to
ShowClosedReviewRequestsMixin
if profile and 'show_hidden' in profile.extra_data: self.show_hidden = profile.extra_data['show_hidden'] try: show = self.request.GET.get('show-hidden', self.show_hidden) self.show_hidden = int(show) != 0 except ValueError: pass
-
Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less
-
Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less
-
-
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/accounts/evolutions/reviewrequestvisit_visibility.py reviewboard/datagrids/tests.py Ignored Files: reviewboard/templates/datagrids/hideable_listview.html reviewboard/static/rb/css/common.less
- Summary:
-
Add a Dashboard toggle to show or hide hidden review requestsAdd a Dashboard toggle to show or hide archived review requests
- Description:
-
~ This adds a toggle on the Dashboard datagrid to show or hide hidden review requests, similar to that of the All Review Requests datagrid for showing and hiding closed review requests.
~ This adds a toggle on the Dashboard datagrid to show or hide archived review requests, similar to that of the All Review Requests datagrid for showing and hiding closed review requests.
- a new template block is loaded in the dashboard to expose the toggle button
~ - when the pressed, a
show-hidden
query is appended to the existing URL query
~ show-hidden=0
filters the hidden review requests (those that are archived or muted)
~ show-hidden=1
includes all review requests, regardless of their state of visibility
~ - when the pressed, a
show-archived
query is appended to the existing URL query
~ show-archived=0
filters the archived review requests (those that are archived or muted)
~ show-archived=1
includes all review requests, regardless of their state of visibility
~ NB: When
show-hidden
is not specified, its default value of is 0.~ NB: When
show-archived
is not specified, its default value of is 0. - Testing Done:
-
~ Manual tests: Archived and muted several review requests. In the dashboard, they disappeared when setting
show-hidden=0
and reappeared when settingshow-hidden=1
~ Manual tests: Archived and muted several review requests. In the dashboard, they disappeared when setting
show-archived=0
and reappeared when settingshow-archived=1
~ Unit tests: Added to reviewboard.datagrids.tests to test if hidden review requests would appear in the datagrid for a particular user for
show-hidden=0
andshow-hidden=1
. Also tested for a different user who had not hidden any of the same review requests. All tests passed.~ Unit tests: Added to reviewboard.datagrids.tests to test if archived review requests would appear in the datagrid for a particular user for
show-archived=0
andshow-archived=1
. Also tested for a different user who had not archived any of the same review requests. All tests passed.