piccolo-orm / piccolo_admin

A powerful web admin for your database.
https://piccolo-orm.com/ecosystem/
MIT License
316 stars 37 forks source link

table group option in the table menu #278

Closed sinisaos closed 1 year ago

sinisaos commented 1 year ago

Related to this disussion. Changed Playwright tests as page.locator API changed in v1.27.0.

codecov-commenter commented 1 year ago

Codecov Report

Merging #278 (b6acada) into master (5924c4e) will decrease coverage by 0.31%. The diff coverage is 93.75%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #278      +/-   ##
==========================================
- Coverage   93.57%   93.27%   -0.31%     
==========================================
  Files           5        5              
  Lines         327      342      +15     
==========================================
+ Hits          306      319      +13     
- Misses         21       23       +2     
Impacted Files Coverage Δ
piccolo_admin/endpoints.py 92.55% <93.75%> (-0.31%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

sumitsharansatsangi commented 1 year ago

Thanks @sinisaos for the PR. @dantownsend , All checks have passed. Can you please merge it, if it is good to go ?

dantownsend commented 1 year ago

@sumitsharansatsangi I think it's almost there.

@sinisaos It's looking good. One thing I spotted is the two tables at the bottom look like they belong to the same group, but they don't - the bottom most one doesn't have a group.

Screenshot 2023-01-25 at 22 30 38

There's a couple of solutions:

  1. The ones without a group should go at the top.
  2. We visually distinguish them more - for example, make the background darker if it's in a group.

I'll have a play around.

sumitsharansatsangi commented 1 year ago

@sinisaos , Two things I want to suggest are as follows:-

create_admin(
group_first=True
...
)

Thank you.

dantownsend commented 1 year ago

I had a play around with it.

I made it so any tables without a group go at the top.

It's all sorted alphabetically now - first by group name, then table name.

@sinisaos What you did was really good. The changes I made were basically just sorting the sidebar. I styled the group name slightly differently to make it easier to differentiate. What do you think?

Screenshot 2023-01-26 at 11 39 29
dantownsend commented 1 year ago

I've made the groups collapsible. If you're both happy with this, I'll release it and we can always improve upon it in future PRs.

dantownsend commented 1 year ago

@sinisaos Thanks, will merge it in.

sumitsharansatsangi commented 1 year ago

@dantownsend , please release it (One more awesome contribution of @sinisaos and yours).