Skip to content

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

[#54347] Open notes for new agenda items (#15346)

Mir Bhatia548153465eff
diff --git a/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts
index dd20e439e3d..8044ac14d65 100644
--- a/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts
@@ -45,6 +45,7 @@ export default class extends Controller {
connect():void {
this.focusInput();
+ this.addNotes();
}
focusInput():void {
@@ -52,9 +53,7 @@ export default class extends Controller {
setTimeout(() => {
this.element.scrollIntoView({ block: 'center' });
- if (window.getComputedStyle(this.notesInputTarget).display !== 'none') {
- this.focusCkEditor();
- } else if (titleInput) {
+ if (titleInput) {
(titleInput as HTMLInputElement).focus();
}
}, 100);
@@ -77,16 +76,5 @@ export default class extends Controller {
addNotes() {
this.notesInputTarget.classList.remove('d-none');
- this.notesAddButtonTarget.classList.add('d-none');
- this.focusCkEditor();
- }
-
- private focusCkEditor() {
- setTimeout(() => {
- const ckContent = this.element.querySelector<HTMLElement>('.ck-content');
- if (ckContent) {
- ckContent.focus();
- }
- }, 50);
}
}
diff --git a/modules/meeting/app/components/meeting_agenda_items/form_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/form_component.html.erb
index 063d0fa056e..8199fea6263 100644
--- a/modules/meeting/app/components/meeting_agenda_items/form_component.html.erb
+++ b/modules/meeting/app/components/meeting_agenda_items/form_component.html.erb
@@ -29,20 +29,6 @@
render(MeetingAgendaItem::Notes.new(f))
end
- grid.with_area(:add_note,
- display: display_notes_add_button_value,
- data: { 'meeting-agenda-item-form-target': "notesAddButton" }) do
- render(Primer::Beta::Button.new(
- scheme: :secondary,
- data: {
- action: 'click->meeting-agenda-item-form#addNotes keydown.enter->meeting-agenda-item-form#addNotes'
- }
- )) do |component|
- component.with_leading_visual_icon(icon: :plus)
- MeetingAgendaItem.human_attribute_name(:notes)
- end
- end
-
grid.with_area(:actions) do
flex_layout do |flex|
flex.with_column(mr: 2) do
diff --git a/modules/meeting/spec/features/structured_meetings/attachment_upload_spec.rb b/modules/meeting/spec/features/structured_meetings/attachment_upload_spec.rb
index 01d2e32a25e..994436f7351 100644
--- a/modules/meeting/spec/features/structured_meetings/attachment_upload_spec.rb
+++ b/modules/meeting/spec/features/structured_meetings/attachment_upload_spec.rb
@@ -52,9 +52,8 @@ RSpec.describe "Upload attachment to meetings", :js do
it "can upload an image to new and existing meeting agenda item via drag & drop in editor" do
show_page.visit!
- show_page.add_agenda_item(save: false) do
- click_on "Notes"
- end
+ click_on "Add"
+ click_on "Agenda item"
# adding an image
editor.drag_attachment image_fixture.path, "Image uploaded the first time"
diff --git a/modules/meeting/spec/features/structured_meetings/history_spec.rb b/modules/meeting/spec/features/structured_meetings/history_spec.rb
index 184087f12b8..909cc988e6f 100644
--- a/modules/meeting/spec/features/structured_meetings/history_spec.rb
+++ b/modules/meeting/spec/features/structured_meetings/history_spec.rb
@@ -313,7 +313,6 @@ RSpec.describe "history",
show_page.add_agenda_item do
fill_in "Title", with: "My agenda item"
- click_on "Notes"
end
show_page.expect_agenda_item(title: "My agenda item")