Skip to content

Initial interface of O2M & M2M Table View#12820

Merged
azrikahar merged 38 commits intodirectus:mainfrom
u12206050:feat/interface-o2m-table-view
Aug 18, 2022
Merged

Initial interface of O2M & M2M Table View#12820
azrikahar merged 38 commits intodirectus:mainfrom
u12206050:feat/interface-o2m-table-view

Conversation

@u12206050
Copy link
Contributor

O2M Table View

Supports

  • search
  • sorting
  • add new / existing

@rijkvanzanten
Copy link
Member

Seeing that the setup and logic is so similar, would it be possible / make sense to make this an option of the existing one to many interface? 🤔 Like a toggle to go between a list and a table view

@u12206050
Copy link
Contributor Author

Seeing that the setup and logic is so similar, would it be possible / make sense to make this an option of the existing one to many interface? 🤔 Like a toggle to go between a list and a table view

Yes actually, although it is the difference between choosing a template vs set of fields.

Is it possible to toggle an option based on another option value?

@rijkvanzanten
Copy link
Member

Is it possible to toggle an option based on another option value?

Yeah! The options function in the interface index file gets the current configured options, so you can dynamically change the form of options 👍🏻

@u12206050
Copy link
Contributor Author

Done. Love the new approach, also allows for searching now even on list view when more than 1 page

@u12206050
Copy link
Contributor Author

Let me know if you have any other ideas with this. I actually think a miniature tabluar layout view as interface could be the next logical step for really large relationships, or even just for better navigation.

Laravel Nova has this type of layout if you want inspiration.

@u12206050
Copy link
Contributor Author

Might have over done it now but I like it :)
o2m-interface-v3

@u12206050 u12206050 force-pushed the feat/interface-o2m-table-view branch from 2d345ec to 1ad8c13 Compare April 18, 2022 18:45
@u12206050
Copy link
Contributor Author

@rijkvanzanten Done :)

@Nitwel
Copy link
Member

Nitwel commented Apr 18, 2022

Looks awesome!

Here my thoughts:

  • it would make sense to add these options to all relational multiple interfaces so files, list-m2a, list-m2m and list-02m just to make it consistent.
  • limit -> items per page just as the translation
  • I'm not sure if we'd want to put the buttons on the top.
  • We might wan't to disable search/filtering when only having 1 page to keep it clean.

Other than that I really like it and it is a good enhancement.

@u12206050
Copy link
Contributor Author

u12206050 commented Apr 18, 2022

Looks awesome!

Here my thoughts:

  • it would make sense to add these options to all relational multiple interfaces so files, list-m2a, list-m2m and list-02m just to make it consistent.
  • limit -> items per page just as the translation
  • I'm not sure if we'd want to put the buttons on the top.
  • We might wan't to disable search/filtering when only having 1 page to keep it clean.

Other than that I really like it and it is a good enhancement.

Good Suggestions:

Search/filtering doesn't show at all if there isn't more than 1 page
I had the buttons at the bottom, but it becomes quite cramped with pagination on slightly smaller screens
I see "Per page" exists, so am using that for now.

Agree with getting the same options on the other interfaces, just not sure how, since for example,

  • list-m2a isn't a fixed set of fields?
  • list-m2m could work
  • this is currently list-o2m

@LasseRosenow
Copy link
Contributor

LasseRosenow commented Apr 19, 2022

Not sure if you already thought about this and might have some good reasons for why you went with the boolean checkbox, but for what its worth I think a dropdown might be more user friendly here:

image

Especially the Table or List(default) title is a bit hacky and would not be necessary with a dropdown that just could be set to List by default

@sksar
Copy link

sksar commented Apr 19, 2022

Can the option to hide/show the external link (open the related collection item) be configured to show or hidden?
From what it seems like that if you click on the row, the drawer opens, but if you click the external link icon, then it opens in full.
Can there be an option to basically hide the external link icons?
Like a toggle:

  • Show external link

@u12206050
Copy link
Contributor Author

Screenshot 2022-04-21 at 19 17 03

Options added.

O2M & M2M supported.

O2M with many items
Screenshot 2022-04-21 at 19 18 23

M2M with few items
Screenshot 2022-04-21 at 19 18 45

@sksar
Copy link

sksar commented Apr 21, 2022

This looks good, this looks really good! Wish to have this feature soon @rijkvanzanten

@LasseRosenow
Copy link
Contributor

I don't know if its ideal that the Create New and Add Existing buttons change their location depending on if there is a paginator.

Wouldn't it make more sense to just blend in the paginator within the already free space and keeping the rest as is?

@rijkvanzanten rijkvanzanten requested a review from benhaynes April 21, 2022 19:26
@u12206050
Copy link
Contributor Author

I don't know if its ideal that the Create New and Add Existing buttons change their location depending on if there is a paginator.

Wouldn't it make more sense to just blend in the paginator within the already free space and keeping the rest as is?

Good catch, that was an unintentional side affect of the paginator not showing in that case. Fixing now.

@u12206050
Copy link
Contributor Author

Screenshot 2022-04-21 at 21 37 04

Fixed

@benhaynes
Copy link
Member

Really excited for this one, thank you for all this great work, @u12206050!! Not being a proper dev myself (to pull this PR and text locally), I'd love an updated MP4 of the latest UX/UI to review. ❤️

@u12206050
Copy link
Contributor Author

RelationshipTableView
@benhaynes Here you go, let me know if you want to look at anything specific

@benhaynes
Copy link
Member

Thank you!! This is looking great. Could you explain the "link" feature? That is not clear to me.

Also, we might want to get the search/filter bar background consistent with the background (white in this case)... but that's super minor. :)

@u12206050
Copy link
Contributor Author

The link feature is for navigating directly to a related item, whilst keeping the history, ie, when going back you go back to the item.

My experience has been that users tend to navigate through the collection that is easiest to search, and in a heavy relationship based system, it isn't required to update related items within a transaction of initial item.

Another important use case is the fact that the field in a O2M relationship doesn't show up in the side panel when editing. Meaning if I want to change the actual relationship on a related item, I first need to find the ID, go to the collection view, search for the ID, select and then update. Being able to navigate directly greatly increases the UX

Arguably link feature should also be on on the select-dropdown-m2o interface, but will leave that for another PR.

In regards to search bar, if it is same as background, which is a bit greyish, wouldn't it seem a bit disabled?

@LasseRosenow
Copy link
Contributor

Maybe the greyish background should be white instead. I think its a bit inconsistent with the rest of directus right now, because directus usually does not draw those kind of grey boxes around fields 🤔 Just my two thoughts on that :)

@u12206050
Copy link
Contributor Author

I do agree that it is a bit different.
It is using the v-sheet component, and it is to visually group the table with the search. It could be a simple border can accomplish the same affect.

@benhaynes
Copy link
Member

The background of the search should be white (page background)... I was commenting on the parts under the search icons looking gray, but maybe that's just the GIF compression. Also, I agree with @LasseRosenow that the gray background feels a bit different than the rest of the core app... this should probably just look like the table layout (white on white, see below). I think the search bar will still feel "connected"... though I wonder if there's anything else we can add to that header to make it even more useful. The ability to change/override the default fields?
Screen Shot 2022-04-24 at 9 31 03 AM

@u12206050
Copy link
Contributor Author

u12206050 commented Apr 24, 2022

What do you think about this @benhaynes ?
Screenshot 2022-04-24 at 15 41 16
Screenshot 2022-04-24 at 15 42 01

@azrikahar azrikahar changed the title Initial interface of a O2M Table View Initial interface of O2M & M2M Table View Aug 4, 2022
@mark-james
Copy link

Hi @u12206050, how easy would it be to turn this interface into an extension?

@u12206050
Copy link
Contributor Author

@mark-james currently it isn't too easy. As I would have then created it quite a while back. So I am also eagerly awaiting it being merged.

@azrikahar azrikahar added this to the Next Release milestone Aug 18, 2022
Copy link
Member

@licitdev licitdev left a comment

Choose a reason for hiding this comment

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

The table view works well in M2M! 👍
However there are some glitches for O2M, as shown in the video below. 🤔 Might be existing issues within the O2M interface.

Screen.Recording.2022-08-19.at.12.08.23.AM.mov
Screen.Recording.2022-08-19.at.12.12.50.AM.mov

@azrikahar
Copy link
Contributor

The table view works well in M2M! 👍 However there are some glitches for O2M, as shown in the video below. 🤔 Might be existing issues within the O2M interface.

I believe it's related to existing O2M issues such as #15120 and #13537, though now it seems to not be exactly the same with them in this PR, so I think we'll need to investigate said issues first. 👍

@azrikahar azrikahar removed this from the Next Release milestone Aug 18, 2022
@u12206050
Copy link
Contributor Author

@azrikahar Don't you think those issues would be fixed outside of this PR, and thus that this PR could be merged none the less?

@azrikahar azrikahar merged commit 9c10451 into directus:main Aug 18, 2022
@azrikahar azrikahar added this to the Next Release milestone Aug 18, 2022
qborisb pushed a commit to qborisb/directus that referenced this pull request Aug 31, 2022
* Fix lint issues
Merge in main

* Add support for resizing columns.
Disable sorting on json columns

* Replaced static text with translations

* remove unused variables

* add no collection/fields states to system-fields

* turn columns to notice when creating list-m2m

* tweak system-fields no fields background color

* add danger styling for deselect in table layout

* add tooltips

* prevent linking to items without ID yet

* fix launch icon for list layout

* tweak padding for per page

* Update missing types

* resolve ::v-deep to :deep warning

* minor style tweaks

* fix search

* fix destructuring crashing when no permissions

* remove unused variables

Co-authored-by: Azri Kahar <[email protected]>
qborisb pushed a commit to qborisb/directus that referenced this pull request Aug 31, 2022
* Fix lint issues
Merge in main

* Add support for resizing columns.
Disable sorting on json columns

* Replaced static text with translations

* remove unused variables

* add no collection/fields states to system-fields

* turn columns to notice when creating list-m2m

* tweak system-fields no fields background color

* add danger styling for deselect in table layout

* add tooltips

* prevent linking to items without ID yet

* fix launch icon for list layout

* tweak padding for per page

* Update missing types

* resolve ::v-deep to :deep warning

* minor style tweaks

* fix search

* fix destructuring crashing when no permissions

* remove unused variables

Co-authored-by: Azri Kahar <[email protected]>
@u12206050
Copy link
Contributor Author

u12206050 commented Oct 11, 2022 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.