プロジェクト

全般

プロフィール

Vote #80812

完了

Load default custom queries when running redmine:load_default_data rake task

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Filters_59
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
59
version_id:
152
issue_org_id:
33296
author_id:
332
assigned_to_id:
332
comments:
14
status_id:
5
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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.

!{width: 911px; border: 1px solid grey;}.default-queries.png!

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.

!{width: 502px; border: 1px solid grey;}.jira-default-queries.png!


journals

+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|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.
--------------------------------------------------------------------------------
Nice idea.

Maybe it's a good idea to add some default queries on a fresh install and not only as default data?
--------------------------------------------------------------------------------
Updated the patch. Now the rake task adds project queries and time entry queries.
--------------------------------------------------------------------------------
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.

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

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Let’s do it then.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
r19731 caused test failures.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> r19731 caused test failures.

Fixed in r19733.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリFilters_59 にセット
  • 対象バージョン4.2.0_152 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0