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

Add visibility explainer

Kabiru Mwenjabb00f00d601e
diff --git a/app/components/work_packages/activities_tab/journals/new_component.html.erb b/app/components/work_packages/activities_tab/journals/new_component.html.erb
index 683fa5f716f..418ce2f289e 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
@@ -57,7 +57,18 @@
concat(
flex_layout do |flex|
flex.with_row(mb: 3) do
- render(WorkPackages::ActivitiesTab::Journals::RestrictedNoteForm.new(f))
+ flex_layout(flex_wrap: :wrap) do |restricted_note_container|
+ restricted_note_container.with_column(mr: 2) do
+ render(WorkPackages::ActivitiesTab::Journals::RestrictedNoteForm.new(f))
+ end
+
+ restricted_note_container.with_column(
+ display: :none,
+ data: { "work-packages--activities-tab--restricted-comment-target": "visibilityExplainer" }
+ ) do
+ render(Primer::Beta::Text.new(color: :subtle)) { restricted_visibility_explainer }
+ end
+ end
end
end
)
diff --git a/app/components/work_packages/activities_tab/journals/new_component.rb b/app/components/work_packages/activities_tab/journals/new_component.rb
index 1ab04e2cd4a..05645746f83 100644
--- a/app/components/work_packages/activities_tab/journals/new_component.rb
+++ b/app/components/work_packages/activities_tab/journals/new_component.rb
@@ -62,6 +62,14 @@ module WorkPackages
# TODO: change to use permissions
true
end
+
+ def restricted_visibility_explainer
+ href = ::OpenProject::Static::Links.url_for(:user_guides_work_package_activity)
+ I18n.t("activities.work_packages.activity_tab.restricted_visibility_explainer",
+ who_link_text: render(Primer::Beta::Link.new(href:, target: "_blank")) do
+ I18n.t("activities.work_packages.activity_tab.label_who")
+ end).html_safe
+ end
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 192295d3609..e7875b4887b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -43,12 +43,14 @@ en:
label_sort_desc: "Newest on top"
label_type_to_comment: "Add a comment. Type @ to notify people."
label_submit_comment: "Submit comment"
+ label_who: Who?
changed_on: "changed on"
created_on: "created this on"
changed: "changed"
created: "created"
commented: "commented"
restricted_visibility: Restricted visibility
+ restricted_visibility_explainer: Only visible to a limited group of members. %{who_link_text}
restricted_journal: Only visible to a limited group of members.
admin:
diff --git a/config/static_links.yml b/config/static_links.yml
index 97699a849b4..dc2e8c30d72 100644
--- a/config/static_links.yml
+++ b/config/static_links.yml
@@ -19,6 +19,9 @@ upsale_get_quote:
user_guides:
href: https://www.openproject.org/docs/user-guide/
label: homescreen.links.user_guides
+user_guides_work_package_activity:
+ href: https://www.openproject.org/docs/user-guide/activity/#work-package-activity
+ label: noscript_learn_more
installation_guides:
href: https://www.openproject.org/docs/installation-and-operations/installation/
label: :label_installation_guides
diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/restricted-comment.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/restricted-comment.controller.ts
index 90b6b3cd30a..8980564c934 100644
--- a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/restricted-comment.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/restricted-comment.controller.ts
@@ -31,10 +31,11 @@
import { Controller } from '@hotwired/stimulus';
export default class RestrictedCommentController extends Controller {
- static targets = ['checkbox', 'formContainer'];
+ static targets = ['checkbox', 'formContainer', 'visibilityExplainer'];
declare readonly checkboxTarget:HTMLInputElement;
declare readonly formContainerTarget:HTMLElement;
+ declare readonly visibilityExplainerTarget:HTMLElement;
onCheckboxChange():void {
const restrictedCommentBgColorClass = 'work-packages-activities-tab-journals-new-component__journal-notes-body--restricted-comment';
@@ -45,9 +46,11 @@ export default class RestrictedCommentController extends Controller {
if (this.checkboxTarget.checked) {
this.formContainerTarget.classList.remove(primerBgColorClass);
this.formContainerTarget.classList.add(restrictedCommentBgColorClass);
+ this.visibilityExplainerTarget.classList.remove('d-none');
} else {
this.formContainerTarget.classList.remove(restrictedCommentBgColorClass);
this.formContainerTarget.classList.add(primerBgColorClass);
+ this.visibilityExplainerTarget.classList.add('d-none');
}
}
}