Project

General

Profile

Actions

Feature #33296

closed

Load default custom queries when running redmine:load_default_data rake task

Added by Go MAEDA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Filters
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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

default-queries.png (92.8 KB) default-queries.png Go MAEDA, 2020-04-16 13:29
jira-default-queries.png (66.3 KB) jira-default-queries.png Go MAEDA, 2020-04-16 13:36
load_default_query.patch (2.98 KB) load_default_query.patch Go MAEDA, 2020-04-16 13:38
load_default_query.patch (3.66 KB) load_default_query.patch Go MAEDA, 2020-04-18 09:39
load_default_query.patch (4 KB) load_default_query.patch Go MAEDA, 2020-04-19 06:20

Related issues

Related to Redmine - Feature #10142: Add quick filter "Assigned to me" to saved issue filtersClosed

Actions
Actions #1

Updated by Mischa The Evil over 4 years ago

+1 for the integration of this proposal. A few notes nevertheless:
  • 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 than IssueQuery.
  • 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.
Actions #2

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?

Actions #3

Updated by Go MAEDA over 4 years ago

Updated the patch. Now the rake task adds project queries and time entry queries.

Actions #4

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.

Actions #5

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 :)

Actions #6

Updated by Go MAEDA over 4 years ago

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.

Actions #7

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.

Actions #8

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.

Actions #9

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
Actions #10

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.

Actions #11

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.

Actions #12

Updated by Go MAEDA over 4 years ago

  • Status changed from New to Closed
Actions #13

Updated by Go MAEDA over 4 years ago

  • Status changed from Closed to Reopened

r19731 caused test failures.

Actions #14

Updated by Go MAEDA over 4 years ago

  • Status changed from Reopened to Closed

Go MAEDA wrote:

r19731 caused test failures.

Fixed in r19733.

Actions #15

Updated by Go MAEDA over 1 year ago

  • Related to Feature #10142: Add quick filter "Assigned to me" to saved issue filters added
Actions

Also available in: Atom PDF