Project

General

Profile

Actions

Feature #9309

open

Add description field to custom queries

Added by Anonymous over 12 years ago. Updated 6 days ago.

Status:
Resolved
Priority:
Normal
Category:
Issues
Target version:
Start date:
2011-09-23
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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


Related issues

Has duplicate Redmine - Feature #28533: Add a description in a custom queriesClosed

Actions
Has duplicate Redmine - Feature #39047: Add description field for issue queriesClosed

Actions
Actions #1

Updated by Etienne Massip over 12 years ago

  • Category set to Issues
Actions #2

Updated by Christian Zagrodnick over 11 years ago

Indeed. +1

Actions #3

Updated by Go MAEDA about 6 years ago

  • Has duplicate Feature #28533: Add a description in a custom queries added
Actions #4

Updated by Tuan-Tu Tran over 4 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.

Actions #5

Updated by Go MAEDA 5 months ago

From #39047 posted by Liane Hampe:

Actions #6

Updated by Go MAEDA 5 months ago

  • Has duplicate Feature #39047: Add description field for issue queries added
Actions #7

Updated by Takenori TAKAKI 4 months ago

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

Actions #8

Updated by Go MAEDA 4 months ago

  • Target version set to Candidate for next major release
Actions #9

Updated by Takenori TAKAKI 4 months ago

The patch attached in #note-7 was missing the migration file.
Attach a patch with the migration file added.

Actions #10

Updated by Go MAEDA 14 days ago

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:

Actions #11

Updated by Go MAEDA 13 days ago

  • Target version changed from Candidate for next major release to 6.0.0

Setting the target version to 6.0.0.

Actions #12

Updated by Marius BĂLTEANU 7 days ago

  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed

Patch committed, thanks!

Actions #13

Updated by Marius BĂLTEANU 7 days ago

  • Subject changed from Descriptions in Saved Queries to Add description field to custom queries
Actions #14

Updated by Mizuki ISHIKAWA 6 days 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.

Actions #15

Updated by Go MAEDA 6 days 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.

Actions #16

Updated by Go MAEDA 6 days 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 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.

Committed the fix in r22859.

Actions

Also available in: Atom PDF