Project

General

Profile

Actions

Feature #9309

closed

Add description field to custom queries

Added by Anonymous about 13 years ago. Updated 6 months ago.

Status:
Closed
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 about 13 years ago

  • Category set to Issues
Actions #2

Updated by Christian Zagrodnick about 12 years ago

Indeed. +1

Actions #3

Updated by Go MAEDA over 6 years ago

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

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.

Actions #5

Updated by Go MAEDA 12 months ago

From #39047 posted by Liane Hampe:

Actions #6

Updated by Go MAEDA 12 months ago

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

Updated by Takenori TAKAKI 10 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 10 months ago

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

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.

Actions #10

Updated by Go MAEDA 7 months 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 7 months 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 months 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 months ago

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

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.

Actions #15

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.

Actions #16

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 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 #17

Updated by Marius BĂLTEANU 6 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF