Feature #9309
closedAdd description field to custom queries
Added by Anonymous about 13 years ago. Updated 6 months ago.
0%
Description
Especially for public queries, it would be really useful to provide a simple description field where one could describe what the query displays and what it's used for.
Files
clipboard-202402151202-fg4bo.png (90.2 KB) clipboard-202402151202-fg4bo.png | Takenori TAKAKI, 2024-02-15 04:02 | ||
add-query-description.patch (16.3 KB) add-query-description.patch | Takenori TAKAKI, 2024-02-15 04:02 | ||
add-query-description-with-migration.patch (16.8 KB) add-query-description-with-migration.patch | Takenori TAKAKI, 2024-02-22 02:51 | ||
clipboard-202405291159-tpdwu.png (58.2 KB) clipboard-202405291159-tpdwu.png | Go MAEDA, 2024-05-29 04:59 | ||
clipboard-202405291159-5gk7x.png (59.3 KB) clipboard-202405291159-5gk7x.png | Go MAEDA, 2024-05-29 04:59 | ||
add-query-description-with-migration-v2.patch (16.9 KB) add-query-description-with-migration-v2.patch | Go MAEDA, 2024-05-29 05:04 |
Related issues
Updated by Go MAEDA over 6 years ago
- Has duplicate Feature #28533: Add a description in a custom queries added
Updated by Tuan-Tu Tran almost 5 years ago
Diego Gonzalez wrote in #28533:
I have more than 40 different querys and it would be practical to be able to add to each one, a description of the results that it brings.
Updated by Go MAEDA 12 months ago
- Has duplicate Feature #39047: Add description field for issue queries added
Updated by Takenori TAKAKI 10 months ago
- File clipboard-202402151202-fg4bo.png clipboard-202402151202-fg4bo.png added
- File add-query-description.patch add-query-description.patch added
+1
I made a patch to implement this feature.
I attach a patch that can be tested with the latest trunk.
On the sidebar, the description is displayed as hover text for the query link.
Updated by Takenori TAKAKI 10 months ago
The patch attached in #note-7 was missing the migration file.
Attach a patch with the migration file added.
Updated by Go MAEDA 7 months ago
- File clipboard-202405291159-tpdwu.png clipboard-202405291159-tpdwu.png added
- File clipboard-202405291159-5gk7x.png clipboard-202405291159-5gk7x.png added
- File add-query-description-with-migration-v2.patch add-query-description-with-migration-v2.patch added
I have updated the patch to add a subtitle
class to the p
element for displaying the description.
The subtitle
class is already used in boards/show.html.erb
and activities/index.html.erb
. I think the change makes the UI more consistent.
Before:
After:
Updated by Marius BĂLTEANU 7 months ago
- Status changed from New to Resolved
- Assignee set to Marius BĂLTEANU
- Resolution set to Fixed
Patch committed, thanks!
Updated by Marius BĂLTEANU 7 months ago
- Subject changed from Descriptions in Saved Queries to Add description field to custom queries
Updated by Mizuki ISHIKAWA 7 months ago
It seems that the migration fails due to changes in r22856.
If you revert to ActiveRecord::Migration[6.1], it does not fail.
Here is the log when the failure occurs:
== 20231113131245 EnsureDefaultNotificationOptionIsStoredInDb: migrating ====== == 20231113131245 EnsureDefaultNotificationOptionIsStoredInDb: migrated (0.0019s) == 20240213101801 AddQueriesDescription: migrating ============================ -- add_column(:queries, :description, :string, {:after=>:name}) rake aborted! StandardError: An error has occurred, this and all later migrations canceled: Unknown key: :after. Valid keys are: :limit, :precision, :scale, :default, :null, :collation, :comment, :primary_key, :if_exists, :if_not_exists, :array, :using, :cast_as, :as, :type, :enum_type, :stored /var/lib/redmine/db/migrate/20240213101801_add_queries_description.rb:3:in `up' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `<main>' Caused by: ArgumentError: Unknown key: :after. Valid keys are: :limit, :precision, :scale, :default, :null, :collation, :comment, :primary_key, :if_exists, :if_not_exists, :array, :using, :cast_as, :as, :type, :enum_type, :stored /var/lib/redmine/db/migrate/20240213101801_add_queries_description.rb:3:in `up' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `<main>' Tasks: TOP => db:migrate:reset => db:migrate (See full trace by running task with --trace)
The Redmine build status showed that it failed when PostgreSQL and SQLite.
Updated by Go MAEDA 7 months ago
Mizuki ISHIKAWA wrote in #note-14:
It seems that the migration fails due to changes in r22856.
If you revert to ActiveRecord::Migration[6.1], it does not fail.
I found that the :after
option for add_column
is only supported by MySQL. You can check the available options for add_column
here:
https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_column
When using a database other than MySQL, the :after
option was silently ignored in Rails 6.1, but in Rails 7.1 it raises an exception.
I will remove the :after
option from db/migrate/20240213101801_add_queries_description.rb
.
Updated by Go MAEDA 7 months ago
Go MAEDA wrote in #note-15:
Mizuki ISHIKAWA wrote in #note-14:
It seems that the migration fails due to changes in r22856.
If you revert to ActiveRecord::Migration[6.1], it does not fail.I found that the
:after
option foradd_column
is only supported by MySQL. You can check the available options foradd_column
here:
https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_columnWhen using a database other than MySQL, the
:after
option was silently ignored in Rails 6.1, but in Rails 7.1 it raises an exception.I will remove the
:after
option fromdb/migrate/20240213101801_add_queries_description.rb
.
Committed the fix in r22859.