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

[#45011] No info about changes in activity when use checkbox in the custom field

Dombi Attilaaed72f9f8e8f
diff --git a/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts b/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts
index 8d5f9fc1aff..7e481543417 100644
--- a/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts
@@ -132,8 +132,8 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
this.$element.bind('focusin', this.focus.bind(this));
this.$element.bind('focusout', this.blur.bind(this));
- _.each(this.activity.details, (detail:any) => {
- this.details.push(detail.html);
+ _.each(this.activity.details, (detail:{ html:string }) => {
+ this.details.push(this.sanitization.bypassSecurityTrustHtml(detail.html));
});
this
diff --git a/spec/features/work_packages/tabs/activity_tab_spec.rb b/spec/features/work_packages/tabs/activity_tab_spec.rb
index 8f635421175..69b284706a7 100644
--- a/spec/features/work_packages/tabs/activity_tab_spec.rb
+++ b/spec/features/work_packages/tabs/activity_tab_spec.rb
@@ -35,13 +35,26 @@ RSpec.describe 'Activity tab',
js: true,
selenium: true do
def alter_work_package_at(work_package, attributes:, at:, user: User.current)
+ work_package.custom_field_values = attributes.delete(:custom_field_values)
work_package.update(attributes.merge(updated_at: at))
note_journal = work_package.journals.last
note_journal.update(created_at: at, updated_at: at, user:)
end
- let(:project) { create(:project_with_types, public: true) }
+ let(:string_cf) { create(:text_wp_custom_field) }
+
+ let(:type_with_cf) do
+ create(:type, custom_fields: [string_cf])
+ end
+
+ let(:project) do
+ create(:project_with_types,
+ types: [type_with_cf],
+ work_package_custom_fields: [string_cf],
+ public: true)
+ end
+
let!(:work_package) do
work_package = create(:work_package,
project:,
@@ -65,7 +78,13 @@ RSpec.describe 'Activity tab',
end
let!(:note1) do
- attributes = { subject: 'New subject', description: 'Some not so long description.' }
+ attributes = {
+ subject: 'New subject',
+ description: 'Some not so long description.',
+ custom_field_values: {
+ string_cf.id => "* [x] Task 1\n* [ ] Task 2"
+ }
+ }
alter_work_package_at(work_package,
attributes:,
@@ -208,6 +227,15 @@ RSpec.describe 'Activity tab',
expect(page).to have_selector('.user-comment > .message', count: 3)
expect(page).to have_selector('.user-comment > .message blockquote')
end
+
+ it 'can render checkboxes as part of the activity' do
+ task_list = page.all('[data-qa-activity-number="2"] ul.op-uc-list_task-list li.op-uc-list--item')
+ expect(task_list.size).to eq(2)
+ expect(task_list[0]).to have_text('Task 1')
+ expect(task_list[0]).to have_checked_field(disabled: true)
+ expect(task_list[1]).to have_text('Task 2')
+ expect(task_list[1]).to have_unchecked_field(disabled: true)
+ end
end
context 'with no permission' do