Skip to content
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

[Admin] Add products#show #5373

Merged
merged 8 commits into from
Sep 15, 2023
Merged

[Admin] Add products#show #5373

merged 8 commits into from
Sep 15, 2023

Conversation

elia
Copy link
Member

@elia elia commented Sep 6, 2023

Summary

There are still a few rough edges, but we can go from here. We're keeping track of lacking or broken things in an internal GH project (e.g. we'll build a component that will replace the original select2 behavior).

The Manage … links are pointing to sections in the original admin that still need to be ported to the new UI, e.g. adding a media uploading component (which is better handled in a separate PR).

image image

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia self-assigned this Sep 6, 2023
@github-actions github-actions bot added changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_admin labels Sep 6, 2023
@elia elia force-pushed the elia/products/show branch from 916e85a to c0f4d03 Compare September 6, 2023 18:30
@elia elia force-pushed the elia/products/show branch 2 times, most recently from 7614e9c to 94cbb8d Compare September 13, 2023 10:04
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Sep 13, 2023
@elia elia force-pushed the elia/products/show branch from 94cbb8d to 5e19b8d Compare September 13, 2023 16:08
@github-actions github-actions bot removed changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Sep 13, 2023
@elia elia requested a review from rainerdema September 13, 2023 16:11
@elia elia marked this pull request as ready for review September 13, 2023 16:11
@elia elia requested a review from a team as a code owner September 13, 2023 16:11
@elia elia force-pushed the elia/products/show branch from 5e19b8d to cfced44 Compare September 13, 2023 16:14
@tvdeyen
Copy link
Member

tvdeyen commented Sep 13, 2023

Wondering if this should be product#edit instead, since we display forms? 🤔

@elia
Copy link
Member Author

elia commented Sep 14, 2023

Wondering if this should be product#edit instead, since we display forms? 🤔

@tvdeyen yes, that's a good call, I did some research on how REST conceptualizes this stuff because I was torn between the this page being the only representation we have for the resource in the admin (there's no traditional show page) and this containing a form to modify the resource. I came out of that with the conclusion that /edit is an alternative representation of the same resource and that having no main representation (i.e. show page) that would become the main one.

With this in mind there are other considerations:

  • do we want to stick to the legacy solidus_backend url?
  • should we use get "/product/:id", as: :edit so only the url changes?

and so on and so forth.

I'm still conflicted so I'd like to hear from you, given the context above.
Renaming at this stage is cheap anyway ☺️

@elia elia force-pushed the elia/products/show branch from cfced44 to 4058b44 Compare September 14, 2023 10:30
@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #5373 (6a907e0) into nebulab/admin (14c0127) will increase coverage by 0.13%.
The diff coverage is 92.42%.

@@                Coverage Diff                @@
##           nebulab/admin    #5373      +/-   ##
=================================================
+ Coverage          88.72%   88.86%   +0.13%     
=================================================
  Files                614      615       +1     
  Lines              14841    14860      +19     
=================================================
+ Hits               13168    13205      +37     
+ Misses              1673     1655      -18     
Files Changed Coverage Δ
...omponents/solidus_admin/products/show/component.rb 76.92% <76.92%> (ø)
...p/controllers/solidus_admin/products_controller.rb 94.87% <84.61%> (-5.13%) ⬇️
...mponents/solidus_admin/products/index/component.rb 91.66% <100.00%> (ø)
...ponents/solidus_admin/ui/forms/select/component.rb 82.97% <100.00%> (-17.03%) ⬇️
...nts/solidus_admin/ui/forms/text_field/component.rb 100.00% <100.00%> (ø)
...app/components/solidus_admin/ui/panel/component.rb 100.00% <100.00%> (ø)
admin/lib/solidus_admin.rb 100.00% <100.00%> (ø)
admin/lib/solidus_admin/configuration.rb 100.00% <100.00%> (ø)
admin/lib/solidus_admin/engine.rb 100.00% <100.00%> (ø)
admin/lib/solidus_admin/importmap.rb 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

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

🌟 Amazing work! 🌟

@tvdeyen
Copy link
Member

tvdeyen commented Sep 14, 2023 via email

@elia
Copy link
Member Author

elia commented Sep 14, 2023

That are good arguments. What is the point of displaying a resource in an admin area anyway, right? And if we also consider authorization into account it makes even more sense to use the show route as it might be the case an unauthorized user only sees static values anyway. If we go with show routes, what about using it for all ongoing routes as well? So that we at least have a pattern here?

For sure, we'll head that way for all the routes of the new dashboard and ensure that you can go back and forth during the transition time 👍

@elia elia force-pushed the elia/products/show branch 3 times, most recently from 38bb704 to 4ce7e55 Compare September 14, 2023 14:18
@elia elia force-pushed the elia/products/show branch from 4ce7e55 to 2cf93ab Compare September 14, 2023 21:18
@elia elia force-pushed the elia/products/show branch from 2cf93ab to 6a907e0 Compare September 15, 2023 08:30
@elia elia merged commit ffe49be into nebulab/admin Sep 15, 2023
@elia elia deleted the elia/products/show branch September 15, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants