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
[#66688] Last changes in formula when submitting by pressing Enter/Return inside formula are not saved
Ivan Kuchin85ff1d4f45da
diff --git a/frontend/src/stimulus/controllers/pattern-input.controller.ts b/frontend/src/stimulus/controllers/pattern-input.controller.tsindex 84db0f1dfa6..98ba0fb89cb 100644--- a/frontend/src/stimulus/controllers/pattern-input.controller.ts+++ b/frontend/src/stimulus/controllers/pattern-input.controller.ts@@ -97,6 +97,7 @@ export default class PatternInputController extends Controller {input_keydown(event:KeyboardEvent) {if (event.key === 'Enter') {event.preventDefault();+ this.updateFormInputValue();this.formInputTarget.form?.requestSubmit();return;}diff --git a/spec/features/admin/custom_fields/projects/calculated_value_spec.rb b/spec/features/admin/custom_fields/projects/calculated_value_spec.rbindex e98cc6d91e9..4cf9ca558b8 100644--- a/spec/features/admin/custom_fields/projects/calculated_value_spec.rb+++ b/spec/features/admin/custom_fields/projects/calculated_value_spec.rb@@ -122,6 +122,18 @@ RSpec.describe "Edit project custom field calculated value", :js, with_flag: { cexpect(calculated_value.reload.formula_string).to eq(original_formula)end++ it "allows submitting formula by pressing Enter/Return" do+ formula = "2 + 2"++ pattern_input = find(:xpath, "//input[@id='custom_field_formula']/parent::div//div[@contenteditable='true']")++ pattern_input.set("#{formula}\n")++ expect(page).to have_text("Successful update")++ expect(calculated_value.reload.formula_string).to eq(formula)+ endendcontext "without the feature flag", with_flag: { calculated_value_project_attribute: false } do