Feature #33296
closedLoad default custom queries when running redmine:load_default_data rake task
0%
Description
redmine:load_default_data loads various kinds of default data such as roles, permissions, issue statuses, trackers, workflows, and enumerations, to a fresh installation of Redmine. These default data will save users time and allow them to learn how to configure Redmine.
I think it would be great if the rake task also creates default queries for the reasons as follows:
- Users can easily learn about the query feature. Currently, it is a bit difficult for beginners to find the feature. "Save" button is the only way to find it
- Providing some typical queries by default is convenient for many users
The attached patch improves redmine:load_default_data rake task to add four queries by default. The queries are "Issues assigned to me", "Reported issues", "Updated issues", and "Watched issues", equivalent to blocks available on My page.
This idea came to me when I tried using Jira. There are some queries such as "My open issues" and "Reported by me" in a fresh Jira project.
Files
Related issues
Updated by Mischa The Evil over 4 years ago
- Wouldn't such default custom queries be useful also for the other
Query
subclasses? - Regarding your comment that "[...] Currently, it is a bit difficult for beginners to find the feature. "Save" button is the only way to find it [...]": what about the documentation? It may be rudimentary, but it is clearly explained in RedmineIssueList#Applying-and-saving-filters that filters can be saved. I agree though that this is not (yet) the case for
Query
subclasses other thanIssueQuery
. - On a more general note: I wouldn't suggest to run redmine:load_default_data while provisioning a new Redmine instance in a (corporate) production environment in the first place, but this depends heavily on the scale of the deployment and the kind of environment it's deployed in, so, YMMV.
Updated by Marius BĂLTEANU over 4 years ago
- Target version set to Candidate for next major release
Nice idea.
Maybe it's a good idea to add some default queries on a fresh install and not only as default data?
Updated by Go MAEDA over 4 years ago
- File load_default_query.patch load_default_query.patch added
Updated the patch. Now the rake task adds project queries and time entry queries.
Updated by Mischa The Evil over 4 years ago
I'll combine my response on two notes:
Marius BALTEANU wrote in #note-2:
Maybe it's a good idea to add some default queries on a fresh install and not only as default data?
Do you mean via (a) Rails migration(s) or somehow programatically?
Go MAEDA wrote in #note-3:
Updated the patch. Now the rake task adds project queries and time entry queries.
The patch file seems to miss the time entry queries changes.
Updated by Marius BĂLTEANU over 4 years ago
Mischa The Evil wrote:
I'll combine my response on two notes:
Marius BALTEANU wrote in #note-2:
Maybe it's a good idea to add some default queries on a fresh install and not only as default data?
Do you mean via (a) Rails migration(s) or somehow programatically?
Yes, via a migration that should run only when the queries table has no entries. But it's just an idea :)
Updated by Go MAEDA over 4 years ago
- File load_default_query.patch load_default_query.patch added
Mischa The Evil wrote:
Go MAEDA wrote in #note-3:
Updated the patch. Now the rake task adds project queries and time entry queries.
The patch file seems to miss the time entry queries changes.
Sorry, here is the latest patch.
Updated by Go MAEDA over 4 years ago
Marius BALTEANU wrote:
Marius BALTEANU wrote in #note-2:
Maybe it's a good idea to add some default queries on a fresh install and not only as default data?
Do you mean via (a) Rails migration(s) or somehow programatically?
Yes, via a migration that should run only when the queries table has no entries. But it's just an idea :)
Since only JPL can add new migrations, I think the way will take a longer time to be implemented. On the other hand, updating lib/redmine/default_data/loader.rb is much easier to implement.
Updated by Marius BĂLTEANU over 4 years ago
- Target version changed from Candidate for next major release to 4.2.0
Let’s do it then.
Updated by Go MAEDA over 4 years ago
- Subject changed from Load default issue queries when runnning redmine:load_default_data rake task to Load default custom queries when runnning redmine:load_default_data rake task
- Category changed from Issues list to Filters
Updated by Jean-Philippe Lang over 4 years ago
I confirm that this should not be done in migrations. It's generally a bad idea to use models in migrations and we should avoid this whenever it's possible.
Updated by Go MAEDA over 4 years ago
- Subject changed from Load default custom queries when runnning redmine:load_default_data rake task to Load default custom queries when running redmine:load_default_data rake task
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch.
Updated by Go MAEDA over 4 years ago
- Status changed from Closed to Reopened
r19731 caused test failures.
Updated by Go MAEDA over 1 year ago
- Related to Feature #10142: Add quick filter "Assigned to me" to saved issue filters added