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

Use BEM-compliant styling for user-activity (#9235)

Oliver Güntherb4a89e245462
diff --git a/frontend/src/app/components/wp-activity/user/user-activity.component.html b/frontend/src/app/components/wp-activity/user/user-activity.component.html
index 4bd524ec2a2..693334f8781 100644
--- a/frontend/src/app/components/wp-activity/user/user-activity.component.html
+++ b/frontend/src/app/components/wp-activity/user/user-activity.component.html
@@ -10,14 +10,14 @@
[hide-name]="true"
></op-principal>
- <span class="user">
- <user-link [user]="user"></user-link>
- </span>
+ <div>
+ <user-link class="op-user-activity--user-name" [user]="user"></user-link>
+ <span class="op-user-activity--date">
+ {{ isInitial ? text.label_created_on : text.label_updated_on }}
+ <op-date-time [dateTimeValue]="activity.createdAt"></op-date-time>
+ </span>
+ </div>
</div>
- <span class="date">
- {{ isInitial ? text.label_created_on : text.label_updated_on }}
- <op-date-time [dateTimeValue]="activity.createdAt"></op-date-time>
- </span>
<div class="comments-number">
<activity-link [workPackage]="workPackage"
[activityNo]="activityNo">
diff --git a/frontend/src/app/components/wp-activity/user/user-activity.component.sass b/frontend/src/app/components/wp-activity/user/user-activity.component.sass
index 0182a9a38ad..d7a6ed86b38 100644
--- a/frontend/src/app/components/wp-activity/user/user-activity.component.sass
+++ b/frontend/src/app/components/wp-activity/user/user-activity.component.sass
@@ -1,3 +1,15 @@
.op-user-activity
&--user-line
- display: flex
\ No newline at end of file
+ display: flex
+ align-items: center
+
+ &--user-name
+ display: block
+ font-weight: bold
+ line-height: 16px
+ margin-bottom: 3px
+
+ &--date
+ display: block
+ font-size: 0.8rem
+ color: var(--gray-dark)
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_activities.sass b/frontend/src/global_styles/content/work_packages/tabs/_activities.sass
index d4b504e1178..c1f74d3dcb2 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_activities.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_activities.sass
@@ -111,17 +111,6 @@ h4.comment
float: left
margin: -3px 7px 0 0
- .user
- display: block
- font-weight: bold
- line-height: 16px
- margin-bottom: 3px
-
- .date
- display: block
- font-size: 0.8rem
- color: var(--gray-dark)
-
.comments-icons
a:hover
text-decoration: none
diff --git a/spec/features/work_packages/edit_work_package_spec.rb b/spec/features/work_packages/edit_work_package_spec.rb
index 509b297d221..ceed2f6fa14 100644
--- a/spec/features/work_packages/edit_work_package_spec.rb
+++ b/spec/features/work_packages/edit_work_package_spec.rb
@@ -170,7 +170,7 @@ describe 'edit work package', js: true do
wp_page.visit!
# Another (empty) journal should exist now
- expect(page).to have_selector('.work-package-details-activities-activity-contents .user',
+ expect(page).to have_selector('.op-user-activity--user-name',
text: work_package.journals.last.user.name,
wait: 10,
count: 2)
diff --git a/spec/features/work_packages/shared_contexts.rb b/spec/features/work_packages/shared_contexts.rb
index 96940f807ac..4490c1af0af 100644
--- a/spec/features/work_packages/shared_contexts.rb
+++ b/spec/features/work_packages/shared_contexts.rb
@@ -37,7 +37,7 @@ shared_context 'ensure wp details pane update done' do
# safeguard to ensure all backend queries
# have been answered before starting a new spec
- expect(page).to have_selector('.work-package-details-activities-activity-contents .user',
+ expect(page).to have_selector('.op-user-activity--user-name',
text: update_user.name)
end
end
diff --git a/spec/features/work_packages/tabs/activity_tab_spec.rb b/spec/features/work_packages/tabs/activity_tab_spec.rb
index 14bc26acc66..bc66f3d1972 100644
--- a/spec/features/work_packages/tabs/activity_tab_spec.rb
+++ b/spec/features/work_packages/tabs/activity_tab_spec.rb
@@ -89,7 +89,7 @@ describe 'Activity tab', js: true, selenium: true do
activity = page.find("#activity-#{idx + 1}")
if journal.id != note_1.id
- expect(activity).to have_selector('.user', text: journal.user.name)
+ expect(activity).to have_selector('.op-user-activity--user-line', text: journal.user.name)
expect(activity).to have_selector('.user-comment > .message', text: journal.notes, visible: :all)
end
diff --git a/spec/support/pages/work_packages/abstract_work_package.rb b/spec/support/pages/work_packages/abstract_work_package.rb
index f93116a9071..a9f0da8c86b 100644
--- a/spec/support/pages/work_packages/abstract_work_package.rb
+++ b/spec/support/pages/work_packages/abstract_work_package.rb
@@ -93,7 +93,7 @@ module Pages
def ensure_page_loaded
expect_angular_frontend_initialized
- expect(page).to have_selector('.work-package-details-activities-activity-contents .user',
+ expect(page).to have_selector('.op-user-activity--user-name',
text: work_package.journals.last.user.name,
minimum: 1,
wait: 10)
@@ -130,7 +130,7 @@ module Pages
container = '#work-package-activites-container'
container += " #activity-#{number}" if number
- expect(page).to have_selector(container + ' .user', text: user.name)
+ expect(page).to have_selector(container + ' .op-user-activity--user-line', text: user.name)
end
def expect_activity_message(message)