Browse Source

Allow the default project change list query to be customized

Change-Id: I84a5f701db52425ddbeac566eed45889a98a685b
changes/35/109635/3
James E. Blair 7 years ago
parent
commit
492a857764
  1. 6
      gertty.yaml-sample
  2. 3
      gertty/config.py
  3. 2
      gertty/view/project_list.py

6
gertty.yaml-sample

@ -31,6 +31,12 @@ commentlinks:
text: "{id}"
query: "changeid:{id}"
# This is the query used for the list of changes when a project is
# selected. The default is "status:open"; if you don't want to see
# WIP changes, use a query like this:
#
# change-list-query: "status:open not label:Workflow=-1"
dashboards:
- name: "My changes"
query: "owner:self status:open"

3
gertty/config.py

@ -89,6 +89,7 @@ class ConfigSchema(object):
'commentlinks': self.commentlinks,
'dashboards': self.dashboards,
'reviewkeys': self.reviewkeys,
'change-list-query': str,
})
return schema
@ -141,6 +142,8 @@ class Config(object):
text="{url}",
url="{url}"))])))
self.project_change_list_query = self.config.get('change-list-query', 'status:open')
self.dashboards = OrderedDict()
for d in self.config.get('dashboards', []):
self.dashboards[d['key']] = d

2
gertty/view/project_list.py

@ -129,7 +129,7 @@ class ProjectListView(urwid.WidgetWrap):
project_key, project_name = data
self.app.changeScreen(view_change_list.ChangeListView(
self.app,
"_project_key:%s status:open" % project_key,
"_project_key:%s %s" % (project_key, self.app.config.project_change_list_query),
project_name, unreviewed=True))
def keypress(self, size, key):

Loading…
Cancel
Save