Skip to content

[#71653] Sharing of templates #22191

Merged
mrmir merged 7 commits intodevfrom
feature/71653-sharing-of-templates
Mar 9, 2026
Merged

[#71653] Sharing of templates #22191
mrmir merged 7 commits intodevfrom
feature/71653-sharing-of-templates

Conversation

@mrmir
Copy link
Copy Markdown
Contributor

@mrmir mrmir commented Mar 4, 2026

Ticket

https://community.openproject.org/work_packages/71653

What approach did you choose and why?

  • Add a new sharing attribute to Meeting that is an enum with 3 levels corresponding to none, descendants, and system
  • Add a class method to see templates visible in a project, which is then used in places that onetime_templates.where(project: @project) was used before
  • Add a new onetime template only sidepanel component that allows changing of sharing

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@mrmir mrmir force-pushed the feature/71653-sharing-of-templates branch 2 times, most recently from d271e28 to 52fdb8a Compare March 5, 2026 16:51
@mrmir mrmir marked this pull request as ready for review March 5, 2026 17:13
@mrmir mrmir force-pushed the feature/71653-sharing-of-templates branch from 52fdb8a to 2e719ba Compare March 6, 2026 07:37
Copy link
Copy Markdown
Contributor

@klaustopher klaustopher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the enum needs a bit of work. Rest looks fine.

@@ -44,5 +44,6 @@ def self.model
attribute :start_time_hour
attribute :template
attribute :notify
attribute :sharing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add a validation here in the contract that sharing can only be set on templates?

expect(described_class.new).to be_shown_in_overview_sidebar
class AddSharingToMeetings < ActiveRecord::Migration[8.1]
def change
add_column :meetings, :sharing, :integer, null: false, default: 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of using integer enums. They are brittle and looking just at the DB gives you no knowledge about what is happening. All the other places that have a sharing enum use a string column. It would be better to do this here as well.

Also, I think we should make this column nullable. As we only want sharing on meeting templates.

This is possible in the model:

enum :sharing, { none: "none", project: "project", system: "system" }, validate: { allow_nil: true }

I would even go ahead and add a validation to the model that sharing must be blank, when the meeting is not a template.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Deploying openproject with PullPreview

Field Value
Latest commit 523598b
Job deploy
Status ✅ Deploy successful
Preview URL https://pr-22191-71653-sharing-o-ip-138-201-154-123.my.opf.run:443

View logs

@mrmir mrmir requested a review from klaustopher March 9, 2026 07:34
@mrmir mrmir removed the pullpreview label Mar 9, 2026
@mrmir mrmir merged commit e9d08ed into dev Mar 9, 2026
18 checks passed
@mrmir mrmir deleted the feature/71653-sharing-of-templates branch March 9, 2026 09:29
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants