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
implemented dynamic heights/margins of editor and journals container
Jonas Jabaria9e56757f53b
diff --git a/app/components/work_packages/activities_tab/index_component.html.erb b/app/components/work_packages/activities_tab/index_component.html.erbindex 4d20443186d..3849b33359f 100644--- a/app/components/work_packages/activities_tab/index_component.html.erb+++ b/app/components/work_packages/activities_tab/index_component.html.erb@@ -10,12 +10,12 @@))end- activties_tab_container.with_row(id: "journals-container", data: { "work-packages--activities-tab--index-target": "journalsContainer" }) do+ activties_tab_container.with_row(id: "journals-container", classes: "with-initial-input-compensation", data: { "work-packages--activities-tab--index-target": "journalsContainer" }) dorender(WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:))end- activties_tab_container.with_row(id: "input-container", mt: 3, pt: 3, pb: 3, pl: 3, pr: 2, border: :top, bg: :subtle) do+ activties_tab_container.with_row(id: "input-container", mt: 3, pt: 2, pb: 2, pl: 3, pr: 2, border: :top, bg: :subtle) dorender(WorkPackages::ActivitiesTab::Journals::NewComponent.new(work_package:))diff --git a/app/components/work_packages/activities_tab/index_component.sass b/app/components/work_packages/activities_tab/index_component.sassindex 2a953e5acb7..1ad476c1f66 100644--- a/app/components/work_packages/activities_tab/index_component.sass+++ b/app/components/work_packages/activities_tab/index_component.sass@@ -1,9 +1,10 @@#work-packages-activities-tab-index-component#journals-containeroverflow-y: auto- margin-bottom: 90px // initial margin-bottom, will be increased by stimulus when opening ckeditor+ &.with-initial-input-compensation+ margin-bottom: 75px // initial margin-bottom, will be increased by stimulus when opening ckeditor&.with-input-compensation- margin-bottom: 340px+ margin-bottom: 190px#input-containerposition: absolutemin-height: 60pxdiff --git a/app/components/work_packages/activities_tab/journals/new_component.html.erb b/app/components/work_packages/activities_tab/journals/new_component.html.erbindex 9d4c5352243..f14375d05a8 100644--- a/app/components/work_packages/activities_tab/journals/new_component.html.erb+++ b/app/components/work_packages/activities_tab/journals/new_component.html.erb@@ -22,7 +22,7 @@render(Primer::Beta::IconButton.new(scheme: :default,icon: :"paper-airplane",- "aria-label": "submit comment",+ "aria-label": t("activities.work_packages.activity_tab.label_submit_comment"),disabled: true))end@@ -47,7 +47,7 @@render(Primer::Beta::IconButton.new(scheme: :default,icon: :"paper-airplane",- "aria-label": "submit comment",+ "aria-label": t("activities.work_packages.activity_tab.label_submit_comment"),type: :submit))enddiff --git a/app/components/work_packages/activities_tab/journals/new_component.sass b/app/components/work_packages/activities_tab/journals/new_component.sassindex 27e33c901fe..4dfc1096576 100644--- a/app/components/work_packages/activities_tab/journals/new_component.sass+++ b/app/components/work_packages/activities_tab/journals/new_component.sass@@ -8,6 +8,8 @@display: block#ck-editor-columnwidth: 100%+ @media screen and (max-width: $breakpoint-md)+ width: calc(100% - 40px)// prototypical primer style adoptions.ck-toolbarborder-radius: var(--borderRadius-medium) var(--borderRadius-medium) 0px 0px@@ -16,7 +18,7 @@border-radius: 0px 0px var(--borderRadius-medium) var(--borderRadius-medium).ck-contentbackground: var(--color-scale-white)- height: 235px+ max-height: 40vhoverflow-y: autoborder-radius: var(--borderRadius-medium)margin: 5pxdiff --git a/config/locales/en.yml b/config/locales/en.ymlindex f14b2001091..0cf82993968 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -42,6 +42,7 @@ en:label_sort_asc: "Oldest on top"label_sort_desc: "Newest on top"label_type_to_comment: "Type here to comment"+ label_submit_comment: "Submit comment"admin:diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.tsindex 248b3fdf6cf..92357601352 100644--- a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts+++ b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts@@ -147,6 +147,13 @@ export default class IndexController extends Controller {ckEditorElement.addEventListener('keydown', (event) => {this.onCtrlEnter(event);});+ ckEditorElement.addEventListener('keyup', () => {+ this.adjustJournalContainerMargin();+ });+ }++ adjustJournalContainerMargin() {+ this.journalsContainerTarget.style.marginBottom = `${this.formRowTarget.clientHeight + 40}px`;}onCtrlEnter(event:KeyboardEvent) {@@ -175,11 +182,6 @@ export default class IndexController extends Controller {if (this.journalsContainerTarget) {this.journalsContainerTarget.classList.add('with-input-compensation');- if (this.sortingValue === 'asc') {- this.scrollJournalContainerToBottom(this.journalsContainerTarget);- } else {- // this.scrollJournalContainerToTop(this.journalsContainerTarget);- }}const ckEditorElement = this.getCkEditorElement();@@ -224,6 +226,8 @@ export default class IndexController extends Controller {if (this.journalsContainerTarget) {setTimeout(() => {+ this.journalsContainerTarget.style.marginBottom = '';+ this.journalsContainerTarget.classList.add('with-initial-input-compensation');this.journalsContainerTarget.classList.remove('with-input-compensation');if (this.sortingValue === 'asc') {this.scrollJournalContainerToBottom(this.journalsContainerTarget);