OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
fixed default value display approach
Jonas Jabari95242af34a03
diff --git a/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.html.erb b/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.html.erbindex 09204591f3f..a7ae2774671 100644--- a/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.html.erb+++ b/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.html.erb@@ -9,11 +9,11 @@custom_field_value_container.with_row doif not_set?- if @project_custom_field.default_value.present?- render(Primer::Beta::Text.new()) { render_formatted_default_value }- else+ # if @project_custom_field.default_value.present?+ # render(Primer::Beta::Text.new()) { render_formatted_default_value }+ # elserender(Primer::Beta::Text.new()) { t('label_not_set_yet') }- end+ # endelserender(Primer::Beta::Text.new()) { render_formatted_value }enddiff --git a/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb b/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rbindex eed3c401f36..97aba36d81e 100644--- a/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb+++ b/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb@@ -225,7 +225,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'does not show the default value for the project custom field if no value given' doboolean_project_custom_field.update!(default_value: true)overview_page.visit_page@@ -233,7 +233,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(boolean_project_custom_field) doexpect(page).to have_text 'Boolean field'- expect(page).to have_text 'Yes'+ expect(page).to have_text 'Not set yet'endend@@ -244,7 +244,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(boolean_project_custom_field) doexpect(page).to have_text 'Boolean field'- expect(page).to have_text 'No'+ expect(page).to have_text 'Not set yet'endendend@@ -298,7 +298,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'does not show the default value for the project custom field if no value given' dostring_project_custom_field.update!(default_value: 'Bar')overview_page.visit_page@@ -306,7 +306,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(string_project_custom_field) doexpect(page).to have_text 'String field'- expect(page).to have_text 'Bar'+ expect(page).to have_text 'Not set yet'endendend@@ -360,7 +360,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'does not show the default value for the project custom field if no value given' dointeger_project_custom_field.update!(default_value: 456)overview_page.visit_page@@ -368,7 +368,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(integer_project_custom_field) doexpect(page).to have_text 'Integer field'- expect(page).to have_text '456'+ expect(page).to have_text 'Not set yet'endendend@@ -422,7 +422,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'does not show the default value for the project custom field if no value given' dodate_project_custom_field.update!(default_value: Date.new(2024, 2, 2))overview_page.visit_page@@ -430,7 +430,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(date_project_custom_field) doexpect(page).to have_text 'Date field'- expect(page).to have_text '02/02/2024'+ expect(page).to have_text 'Not set yet'endendend@@ -484,7 +484,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'dies not show the default value for the project custom field if no value given' dofloat_project_custom_field.update!(default_value: 456.789)overview_page.visit_page@@ -492,7 +492,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(float_project_custom_field) doexpect(page).to have_text 'Float field'- expect(page).to have_text '456.789'+ expect(page).to have_text 'Not set yet'endendend@@ -546,7 +546,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'does not show the default value for the project custom field if no value given' dotext_project_custom_field.update!(default_value: 'Dolor sit amet')overview_page.visit_page@@ -554,7 +554,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(text_project_custom_field) doexpect(page).to have_text 'Text field'- expect(page).to have_text 'Dolor sit amet'+ expect(page).to have_text 'Not set yet'endendend@@ -608,7 +608,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value for the project custom field if no value given' do+ it 'does not show the default value for the project custom field if no value given' dolist_project_custom_field.custom_options.first.update!(default_value: true)overview_page.visit_page@@ -616,7 +616,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(list_project_custom_field) doexpect(page).to have_text 'List field'- expect(page).to have_text 'Option 1'+ expect(page).to have_text 'Not set yet'endendend@@ -759,7 +759,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withendend- it 'shows the default value(s) for the project custom field if no value given' do+ it 'does not show the default value(s) for the project custom field if no value given' domulti_list_project_custom_field.custom_options.first.update!(default_value: true)multi_list_project_custom_field.custom_options.second.update!(default_value: true)@@ -768,7 +768,7 @@ RSpec.describe 'Show project custom fields on project overview page', :js, :withoverview_page.within_async_loaded_sidebar dooverview_page.within_custom_field_container(multi_list_project_custom_field) doexpect(page).to have_text 'Multi list field'- expect(page).to have_text 'Option 1, Option 2'+ expect(page).to have_text 'Not set yet'endendend