From 099a9adcb30054b7a58bcea61c5bd5d39c17f9ad Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 1 Sep 2022 05:25:04 +0000 Subject: [PATCH] Add description field to custom fields API (#37617). Patch by Holger Just and Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@21793 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/custom_fields/index.api.rsb | 1 + test/fixtures/custom_fields.yml | 1 + test/integration/api_test/custom_fields_test.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/views/custom_fields/index.api.rsb b/app/views/custom_fields/index.api.rsb index 8233ed140..9f46f89f2 100644 --- a/app/views/custom_fields/index.api.rsb +++ b/app/views/custom_fields/index.api.rsb @@ -3,6 +3,7 @@ api.array :custom_fields do api.custom_field do api.id field.id api.name field.name + api.description field.description api.customized_type field.class.customized_class.name.underscore if field.class.customized_class api.field_format field.field_format api.regexp field.regexp diff --git a/test/fixtures/custom_fields.yml b/test/fixtures/custom_fields.yml index 98dccdfcb..0ca34ab9f 100644 --- a/test/fixtures/custom_fields.yml +++ b/test/fixtures/custom_fields.yml @@ -1,6 +1,7 @@ --- custom_fields_001: name: Database + description: Select one of the databases regexp: "" is_for_all: true is_filter: true diff --git a/test/integration/api_test/custom_fields_test.rb b/test/integration/api_test/custom_fields_test.rb index 4db397b1a..30a5c6f7a 100644 --- a/test/integration/api_test/custom_fields_test.rb +++ b/test/integration/api_test/custom_fields_test.rb @@ -30,6 +30,7 @@ class Redmine::ApiTest::CustomFieldsTest < Redmine::ApiTest::Base assert_select 'custom_fields' do assert_select 'custom_field' do assert_select 'name', :text => 'Database' + assert_select 'description', :text => 'Select one of the databases' assert_select 'id', :text => '2' assert_select 'customized_type', :text => 'issue' assert_select 'possible_values[type=array]' do -- 2.39.5