Skip to content

Fix admin promotions controller#5943

Merged
tvdeyen merged 2 commits intosolidusio:mainfrom
mamhoff:fix-admin-promotions-controller
Nov 19, 2024
Merged

Fix admin promotions controller#5943
tvdeyen merged 2 commits intosolidusio:mainfrom
mamhoff:fix-admin-promotions-controller

Conversation

@mamhoff
Copy link
Copy Markdown
Contributor

@mamhoff mamhoff commented Nov 19, 2024

Summary

Fix admin promotions index controller: visit the correct URL on row click, and authorize against the right model.

The  `authorization_subject` method from `solidus_admin` assumes that
all models are in the `Spree` namespace.
@mamhoff mamhoff requested a review from a team as a code owner November 19, 2024 08:53
@github-actions github-actions Bot added changelog:solidus_admin changelog:solidus_promotions Changes to the solidus_promotions gem labels Nov 19, 2024
@mamhoff mamhoff force-pushed the fix-admin-promotions-controller branch from 0e66bf5 to 77126cc Compare November 19, 2024 08:55
Copy link
Copy Markdown
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks 👍🏻

The spec helper name is a bit misleading, though

Comment thread admin/lib/solidus_admin/testing_support/feature_helpers.rb Outdated
This controller still did not know how what to authorize against, and
wanted to visit a URL that doesn't exist when clicking on a promotion.

This also changes at least the name of each promotion to be a link
element that can easily be targeted with Capybara and works with all
major browsers.
@mamhoff mamhoff force-pushed the fix-admin-promotions-controller branch from 77126cc to 2eccd6d Compare November 19, 2024 09:24
Copy link
Copy Markdown
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this

@tvdeyen tvdeyen added the backport-v4.4 Backport this pull-request to v4.4 label Nov 19, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.54%. Comparing base (825fb6d) to head (2eccd6d).
Report is 56 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5943   +/-   ##
=======================================
  Coverage   89.54%   89.54%           
=======================================
  Files         782      782           
  Lines       17991    17997    +6     
=======================================
+ Hits        16110    16116    +6     
  Misses       1881     1881           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tvdeyen tvdeyen merged commit e3b326a into solidusio:main Nov 19, 2024
@tvdeyen
Copy link
Copy Markdown
Member

tvdeyen commented Dec 6, 2024

Backport after #6016

@tvdeyen tvdeyen added backport-v4.4 Backport this pull-request to v4.4 and removed backport-v4.4 Backport this pull-request to v4.4 labels Dec 6, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 6, 2024

💚 All backports created successfully

Status Branch Result
v4.4

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v4.4 Backport this pull-request to v4.4 changelog:solidus_promotions Changes to the solidus_promotions gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants