Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/54733 primerise the activity panel #15643

Open
wants to merge 114 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
0f1a49d
[#54733] Primerise the Activity panel
jjabari-op May 13, 2024
97f28b5
introducing primerized work package activities
jjabari-op May 16, 2024
55d67ef
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op May 21, 2024
932bb52
WIP: primerizing work_package activities, editing not yet implemented…
jjabari-op May 22, 2024
40be17c
minor cleanup
jjabari-op May 22, 2024
46c8d5d
activate primierized activities in pullpreview env
jjabari-op May 22, 2024
bae0317
enable editing
jjabari-op May 27, 2024
1149522
prevent edit state form being overwritten and added basic polling for…
jjabari-op May 27, 2024
ad87a56
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op May 27, 2024
fc5f94b
changed polling frequency to 1 minute
jjabari-op May 31, 2024
a0b5141
added comments only filter
jjabari-op Jun 5, 2024
7fd2ac8
added i18n
jjabari-op Jun 5, 2024
cb44f59
highlight journal items with unread notification, minor refactoring
jjabari-op Jun 5, 2024
435368f
changed filter component as seen on updated mockups
jjabari-op Jun 7, 2024
7ad0e2f
added sorting update directly in activity tab
jjabari-op Jun 7, 2024
21a7eea
implemented sticky bottom editor approach, file upload and mentions n…
jjabari-op Jun 11, 2024
83a4948
group journals by day
jjabari-op Jun 13, 2024
32d50a7
optimized syncing approach
jjabari-op Jun 13, 2024
a9e5675
implemented dynamic heights/margins of editor and journals container
jjabari-op Jun 18, 2024
ee3b501
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Jun 18, 2024
78ca627
minor adjustments towards resource injection, not restricting the edi…
jjabari-op Jun 19, 2024
2da5d8b
Merge remote-tracking branch 'refs/remotes/origin/feature/54733-prime…
jjabari-op Jun 19, 2024
7ae79e8
support mentions and uploads based on feedback from @oliverguenther
jjabari-op Jun 19, 2024
971bcd4
added quoting
jjabari-op Jun 20, 2024
222d309
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Jul 1, 2024
66fca73
fixed sass imports
jjabari-op Jul 1, 2024
dc350dd
fixed bg colors of inputs
jjabari-op Jul 1, 2024
a1a2577
close editor on blur and keep editor open after submit for a more cha…
jjabari-op Jul 1, 2024
0c127d9
fixed blur event listener
jjabari-op Jul 2, 2024
d2ade88
decreased timeout as much as possible
jjabari-op Jul 2, 2024
ce38f76
fixed rendering after sorting update
jjabari-op Jul 2, 2024
d7bd52b
mobile adjustments following iteration made for the mobile concept
jjabari-op Jul 2, 2024
e3e80c2
adjusted max height of editor as requested and fixed margin adjustment
jjabari-op Jul 2, 2024
9a855c5
decreased polling interval as requested by @wielinde, optimization ba…
jjabari-op Jul 2, 2024
b3754c5
fixed paddings
jjabari-op Jul 2, 2024
ec8367c
optimized polling approach in order to avoid unnecessary requests
jjabari-op Jul 8, 2024
8b4b138
avoid editor data loss on tab change or other browser events unmounti…
jjabari-op Jul 8, 2024
66bab81
implemented github PR style
jjabari-op Jul 10, 2024
674ffae
fixed detail update streams
jjabari-op Jul 10, 2024
b09c50d
fixed filter behavior
jjabari-op Jul 10, 2024
0c48308
quickly adjusted font rendering of detail descriptions, refactoring r…
jjabari-op Jul 10, 2024
0e005be
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Jul 10, 2024
f8915bf
added first specs for primerized workpackage activities
jjabari-op Jul 18, 2024
eb4ac8f
implemented feedback from product team and adjusted micro behaviors, …
jjabari-op Aug 6, 2024
9b3a08a
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Aug 6, 2024
9521a2c
fixed bottom detection for md viewports
jjabari-op Aug 7, 2024
8b138e8
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Aug 19, 2024
0f276c7
implemented feedback from product team, finalized new specs, cleanup,…
jjabari-op Aug 20, 2024
c9b011e
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Aug 20, 2024
8c4811c
cleanup temp test code
jjabari-op Aug 20, 2024
228f95a
fixing eslint issues
jjabari-op Aug 20, 2024
1288435
enable primerized workpackages feature flag in ci
jjabari-op Aug 20, 2024
2717246
reenabled and fixed failing spec
jjabari-op Aug 20, 2024
87ec0da
refactored to resolve rubocop issues
jjabari-op Aug 20, 2024
75a358f
more refactorings to resolve rubocop issues
jjabari-op Aug 20, 2024
d5ca1a5
fixed ckeditor bottom margin
jjabari-op Aug 27, 2024
6759bd9
hide stem connection when empty
jjabari-op Aug 27, 2024
64c6494
refactored and fixed stem behaviour for filter states
jjabari-op Aug 27, 2024
47ae87f
auto-reset filter when adding a comment which would not be visible, m…
jjabari-op Aug 27, 2024
66014cd
text adjustments as requested by Parimal
jjabari-op Aug 27, 2024
077593f
fixed margin bottom for desc sorting
jjabari-op Aug 27, 2024
205af10
fixed permissions, handle permissions on UI, added permission specs
jjabari-op Aug 28, 2024
9f121c8
added and refactore permission specs
jjabari-op Aug 28, 2024
aa79dee
WIP: adding controller spec and exception handling
jjabari-op Aug 28, 2024
045aabd
added exception handling and controller specs
jjabari-op Sep 2, 2024
3d22248
refactored CSS and applied BEM notations
jjabari-op Sep 3, 2024
ed653df
fixed specs after refactoring
jjabari-op Sep 3, 2024
7243d3a
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Sep 3, 2024
d308500
fixed stem for filter states
jjabari-op Sep 3, 2024
bca765c
mobile UX fixes
jjabari-op Sep 3, 2024
9ebdc7e
temporarly removed meta data as its consuming too much width with lon…
jjabari-op Sep 3, 2024
f203d9a
ckeditor fixes due to more toolbar items, open editor when dragover, …
jjabari-op Sep 3, 2024
518dbe7
fixed positioning issues caused by anchor scrolls via url and click o…
jjabari-op Sep 4, 2024
27e5956
added support for retracted journal entries
jjabari-op Sep 4, 2024
db65e97
disabling some rubocop checks as the permission specs seem not to fol…
jjabari-op Sep 4, 2024
a609070
WIP: implementing review feedback from @oliverguenther
jjabari-op Sep 5, 2024
867aebc
make ckeditor primer adjustments reusable following input from @olive…
jjabari-op Sep 5, 2024
2c3cf42
WIP implementing review feedback from Oliver
jjabari-op Sep 6, 2024
9ef7760
added generic error handling for initial and subsequent requests
jjabari-op Sep 9, 2024
0481ed3
moved ckeditor code as requested by @oliverguenther
jjabari-op Sep 10, 2024
fc45e41
js refactoring as requested by @oliverguenther
jjabari-op Sep 10, 2024
4cc43ff
extended permission controller specs
jjabari-op Sep 10, 2024
a86e4b9
rubocop fixes
jjabari-op Sep 10, 2024
cfd4a13
styling fixes
jjabari-op Sep 10, 2024
52d8fcf
fixed specs, eslint errors and prevent multi form submission
jjabari-op Sep 11, 2024
657590a
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Sep 11, 2024
0a7537a
fixed flaky specs
jjabari-op Sep 11, 2024
8329d1b
fixed flaky specs and styling fixes
jjabari-op Sep 11, 2024
73a87f8
refactored http request as requested by @oliverguenther
jjabari-op Sep 16, 2024
7663f2c
note future required code maintenance on js based view port checks
jjabari-op Sep 16, 2024
de14988
fix stem rendering as requested by @psatyal
jjabari-op Sep 16, 2024
72d4a3f
adjusted notification dot color as requested by @psatyal
jjabari-op Sep 16, 2024
7f5f1f8
fixed scrolling behaviour on mobile screens
jjabari-op Sep 16, 2024
97656e0
restrict polling interval env to test env
jjabari-op Sep 16, 2024
541cbaa
fixed ellipsis
jjabari-op Sep 16, 2024
352e4b7
trying to avoid flaky spec
jjabari-op Sep 16, 2024
9c5bf53
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Sep 16, 2024
6082e6d
trying to fix flaky spec through a more dynamic waiting approach
jjabari-op Sep 17, 2024
274faed
removed obsolete sleeps
jjabari-op Sep 17, 2024
deaef80
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Sep 17, 2024
b575b02
fixing auto-scrollings due to content wrapper changes resolving ancho…
jjabari-op Sep 17, 2024
6107dcd
only perform scrolling when really required
jjabari-op Sep 17, 2024
2f9c64e
fixed eslint error
jjabari-op Sep 17, 2024
ca0e80f
update workpackage attributes on main workpackage section when change…
jjabari-op Sep 25, 2024
2f05a53
fixed attachement links in changesets
jjabari-op Sep 25, 2024
f087bf7
added missing labels and aria-labels, adjusted username width in orde…
jjabari-op Sep 25, 2024
65e0211
fixed stem styling
jjabari-op Sep 25, 2024
4890d01
rename sorting labels as requested
jjabari-op Sep 25, 2024
453a2a7
removed latest activties from overview tab as requested by @wielinde …
jjabari-op Sep 25, 2024
ecfdb39
update the count in the primerized activty tab header when new activi…
jjabari-op Sep 25, 2024
6757eba
Merge branch 'dev' into feature/54733-primerise-the-activity-panel
jjabari-op Sep 25, 2024
66aa229
prototypical implementation of the toggle singel notifications featur…
jjabari-op Oct 1, 2024
a5a17ba
prototypical changes to the notification center and its behaviour whe…
jjabari-op Oct 1, 2024
86efb41
decrease polling interval via env var for pullpreview
jjabari-op Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pullpreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
echo "OPENPROJECT_FEATURE__SHOW__CHANGES__ACTIVE=true" >> .env.pullpreview
echo "OPENPROJECT_LOOKBOOK__ENABLED=true" >> .env.pullpreview
echo "OPENPROJECT_HSTS=false" >> .env.pullpreview
echo "OPENPROJECT_FEATURE_PRIMERIZED_WORK_PACKAGE_ACTIVITIES_ACTIVE=true" >> .env.pullpreview
echo "OPENPROJECT_NOTIFICATIONS_POLLING_INTERVAL=10000" >> .env.pullpreview
- name: Boot as BIM edition
if: contains(github.ref, 'bim/') || contains(github.head_ref, 'bim/')
run: |
Expand Down
5 changes: 5 additions & 0 deletions app/components/_index.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@import "work_packages/activities_tab/index_component"
@import "work_packages/activities_tab/journals/new_component"
@import "work_packages/activities_tab/journals/index_component"
@import "work_packages/activities_tab/journals/item_component"
@import "work_packages/activities_tab/journals/item_component/details"
@import "shares/modal_body_component"
@import "shares/invite_user_form_component"
@import "work_packages/details/tab_component"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%=
content_tag("turbo-frame", id: "work-package-activities-tab-content") do
unless error_message.blank?
render(Primer::Alpha::Banner.new(scheme: :danger)) { error_message }
end
end
%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module ActivitiesTab
class ErrorFrameComponent < ApplicationComponent
include ApplicationHelper
include OpPrimer::ComponentHelpers

def initialize(error_message: nil)
super

@error_message = error_message
end

attr_reader :error_message
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%=
component_wrapper do
unless error_message.blank?
render(Primer::Alpha::Banner.new(scheme: :danger, dismiss_scheme: :hide)) { error_message }
end
end
%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module ActivitiesTab
class ErrorStreamComponent < ApplicationComponent
include ApplicationHelper
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable

def initialize(error_message: nil)
super

@error_message = error_message
end

attr_reader :error_message
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<%=
content_tag("turbo-frame", id: "work-package-activities-tab-content") do
flex_layout(classes: "work-packages-activities-tab-index-component") do |activties_tab_wrapper_container|
activties_tab_wrapper_container.with_row(classes: "work-packages-activities-tab-index-component--errors") do
render(
WorkPackages::ActivitiesTab::ErrorStreamComponent.new
)
end
activties_tab_wrapper_container.with_row do
component_wrapper(data: wrapper_data_attributes) do
flex_layout do |activties_tab_container|
activties_tab_container.with_row(mb: 2) do
render(
WorkPackages::ActivitiesTab::Journals::FilterAndSortingComponent.new(
work_package:,
filter:
)
)
end
activties_tab_container.with_row(flex_layout: true, mt: 3) do |journals_wrapper_container|
journals_wrapper_container.with_row(
classes: "work-packages-activities-tab-index-component--journals-container work-packages-activities-tab-index-component--journals-container_with-initial-input-compensation",
data: { "work-packages--activities-tab--index-target": "journalsContainer" }
) do
render(
WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:)
)
end
if adding_comment_allowed?
journals_wrapper_container.with_row(
classes: "work-packages-activities-tab-index-component--input-container work-packages-activities-tab-index-component--input-container_sort-#{journal_sorting}",
mt: 3,
mb: [3, nil, nil, nil, 0],
pt: 2,
pb: 2,
pl: 3,
pr: [3, nil, nil, nil, 2],
border: [nil, nil, nil, nil, :top],
border_radius: [2, nil, nil, nil, 0],
bg: :subtle
) do
render(
WorkPackages::ActivitiesTab::Journals::NewComponent.new(work_package:)
)
end
end
end
end
end
end
end
end
%>
84 changes: 84 additions & 0 deletions app/components/work_packages/activities_tab/index_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module ActivitiesTab
class IndexComponent < ApplicationComponent
include ApplicationHelper
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable

def initialize(work_package:, filter: :all)
super

@work_package = work_package
@filter = filter
end

private

attr_reader :work_package, :filter

def wrapper_data_attributes
{
test_selector: "op-wp-activity-tab",
controller: "work-packages--activities-tab--index",
"application-target": "dynamic",
"work-packages--activities-tab--index-update-streams-url-value": update_streams_work_package_activities_url(
work_package
),
"work-packages--activities-tab--index-sorting-value": journal_sorting,
"work-packages--activities-tab--index-filter-value": filter,
"work-packages--activities-tab--index-user-id-value": User.current.id,
"work-packages--activities-tab--index-work-package-id-value": work_package.id,
"work-packages--activities-tab--index-polling-interval-in-ms-value": polling_interval,
"work-packages--activities-tab--index-notification-center-path-name-value": notifications_path
}
end

def journal_sorting
User.current.preference&.comments_sorting || "desc"
end

def polling_interval
# Polling interval should only be adjustable in test environment
if Rails.env.test?
ENV["WORK_PACKAGES_ACTIVITIES_TAB_POLLING_INTERVAL_IN_MS"].presence || 10000
else
10000
end
end

def adding_comment_allowed?
User.current.allowed_in_project?(:add_work_package_notes, @work_package.project)
end
end
end
end
36 changes: 36 additions & 0 deletions app/components/work_packages/activities_tab/index_component.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.work-packages-activities-tab-index-component
&--errors
position: absolute
width: calc(100% - 22px)
z-index: 11
@media screen and (max-width: $breakpoint-xl)
position: fixed
bottom: 20px
width: calc(100% - 30px)
&--journals-container
z-index: 10
padding-top: 3px
overflow-y: auto

&_with-initial-input-compensation
margin-bottom: 65px // initial margin-bottom, will be increased by stimulus when opening ckeditor
@media screen and (max-width: $breakpoint-xl)
margin-bottom: -16px

&_with-input-compensation
margin-bottom: 180px
@media screen and (max-width: $breakpoint-xl)
margin-bottom: -16px

&--input-container
z-index: 10
@media screen and (min-width: $breakpoint-xl)
position: absolute
min-height: 60px
bottom: 0
left: 0
right: 0

&_sort-desc
@media screen and (max-width: $breakpoint-xl)
order: -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<%=
component_wrapper do
render(Primer::Beta::Blankslate.new(
border: true,
data: { test_selector: "op-wp-journals-container-empty"})) do |component|
component.with_visual_icon(icon: :pulse)
component.with_heading(tag: :h2).with_content(t("activities.work_packages.activity_tab.no_results_title_text"))
component.with_description { t("activities.work_packages.activity_tab.no_results_description_text") }
end
end
%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module ActivitiesTab
module Journals
class EmptyComponent < ApplicationComponent
include ApplicationHelper
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable
end
end
end
end
Loading
Loading