-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow ProjectQuery to be marked as public #15609
Conversation
c3775a3
to
5afa381
Compare
f4be342
to
0996000
Compare
app/contracts/queries/projects/project_queries/base_contract.rb
Outdated
Show resolved
Hide resolved
add_column :project_queries, :public, :boolean, default: false, null: false | ||
add_index :project_queries, :public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if there are instances with enough projects to make this slow (presence of default value) and is it a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ulferts Can you maybe chime in? I don't think that there are instances where we have too many project queries, that adding a default will slow us down significantly. We can always go ahead and split up the migration and add a background job to add the default value everywhere. But I suppose that this is a non issue.
Also, it seems like Postgres 11 changed the way how new columns with default values are added so it does not change every row in the table, but has a more efficient way to insert.
spec/contracts/queries/projects/project_queries/shared_contract_examples.rb
Show resolved
Hide resolved
518c28e
to
08b5f71
Compare
08b5f71
to
92a8327
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just few more nitpicks.
I'm still not convinced about show
action, but the rest looks fine, so I leave it up to you
This implements the portion of making project lists public.
public
flagpublic
andprivate
scopes to theProjectQuery
modelmanage_public_project_queries
permission...
menu to change public status of a querywhere(user:)
topublic.or(private)
It is intended to be a self contained spike that is not relying on the modal or anything, hence why we are temporarily adding the menu items.
Implements https://community.openproject.org/work_packages/55159