Repository navigation
Conversation
| { page: page_param, per_page: per_page_param } | ||
| end | ||
|
|
||
| def admin_types_migration_filter? = params[:created_by_migration].presence == "t" |
There was a problem hiding this comment.
Magic "t" would benefit from:
| def admin_types_migration_filter? = params[:created_by_migration].presence == "t" | |
| def admin_types_migration_filter? = params[:created_by_migration].presence == WorkPackageTypes::MigrationFilterComponent::MIGRATED |
Or maybe some other way to share this "intelligence".
| def deletion_from_variants_tab? | ||
| params[:back_url].to_s.start_with?(type_variants_path(type_id: @type.id)) | ||
| end | ||
|
|
||
| # A deletion posts from a paginated/filtered list, but that state travels inside | ||
| # back_url. Restore so morphing keeps the same state | ||
| def restore_list_view_state | ||
| search = params[:back_url].to_s.split("?", 2).second | ||
| return if search.blank? | ||
|
|
||
| restored = Rack::Utils.parse_nested_query(search) | ||
| .slice(*LIST_VIEW_STATE_KEYS) | ||
| .select { |_, value| value.is_a?(String) } | ||
| params.merge!(restored) | ||
| end |
There was a problem hiding this comment.
Here is a lot of URL massaging, and I’m usually not a big fan of it. Building in the view, deconstructing in the controller, building something else… I wonder if passing around the whole state would not be better in the end, instead of serializing it in a URL 🤔
I was satisfied with the back_url until now. Tbh, I’m torn.
Are there more specific repro steps than just filtering and then deleting one? Because it works fine for me and doesn't show unfiltered options after deletion, but maybe I'm missing something |
Make default/remove default still used it. This makes them also morph based on the passed through params, keeping consistency with the delete action
91c124e to
ca03ceb
Compare
|
@dfriquet I went ahead and switched to param passing + morphing for all the relevant variant actions that would have edited the page (deletion + marking/unmarking default) to get rid of the |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
dfriquet
left a comment
There was a problem hiding this comment.
Apart from the filtering bug I already submitted, this new version LGTM 👍
Let’s hope the fix won’t cause too much trouble.
There was a problem hiding this comment.
I don’t know if it’s up to this PR to update Node 🤷
There was a problem hiding this comment.
Def not, that was a stray. Removed
736680e to
6fbd1ce
Compare
|
One last time I hope @dfriquet. I wasn't passing those params through properly after the update, but that should hopefully be fixed by the last commit |
| query: params[:query], | ||
| created_by_migration: params[:created_by_migration] |
There was a problem hiding this comment.
Works in my browser 👍
I think I would have added a spec to prevent regressions, but I won’t block a complete bugfix so close to release just for that reason.





Ticket
https://community.openproject.org/wp/OP-20783
What are you trying to accomplish?
What approach did you choose and why?
AI involvement
Collaborative – AI generated a substantial part of the code; I reviewed and understand every line.
Merge checklist