Starts in:
0 DAY
10 HRS
5 MIN
24 SEC
Starts in:
0 D
10 H
5 M
24 S
Open Closed

Suite, n to n code-gen, if Categories and Tags, do we add navigation for both? How to have UI going both ways? #4760


User avatar
0
chauey created
  • ABP Framework version: v7.0.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

If we have n to n for Categories and Tags, we add Tags as n to n navigation for Categories? it will generate a tab to add Tags?

What about the UI for Tags? does it not also have a tab to add Categories?

If we add n to n navigation of Categories to Tags, it will create an additional and separate table? Solutions?


6 Answer(s)
  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    H @chauey,

    If we have n to n for Categories and Tags, we add Tags as n to n navigation for Categories? it will generate a tab to add Tags?

    Yes, it will generate a tab in the create/update modals for you to add tags.

    What about the UI for Tags? does it not also have a tab to add Categories?

    Tags will not have a categories tab.

    If we add n to n navigation of Categories to Tags, it will create an additional and separate table? Solutions?

    It will create a separate db table to save the relation between categories and tags.

  • User Avatar
    0
    chauey created

    Ideally it should be the same table, and the UI on both would be updated to point to that same table/entity/dto? Best options? Other threads/posts/articles about this? thx

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Ideally it should be the same table

    I didn't fully understand why you meant by "same table".

    the UI on both would be updated to point to that same table/entity/dto? Best options?

    We don't want generating a page affects an existing page. But you can copy the codes from one to other if you want the m-m selection in both UI.

  • User Avatar
    0
    chauey created

    if we have TableA and TableB, and create n-to-n relation/navigation on both ends, it creates TableATableB TableBTableA

    it should be a single table. otherwise we have 2 separate tables, both with TableAId, TableBId columns.

  • User Avatar
    0
    alper created
    Support Team Director

    I generally agree with you @chauey, but Suite is designed to create pages with the collection tab on the master entity not the child entity. if you want to have both child entity collection, you need to write code for the second page. for instance, you'll first generate a Category entity then a Tag entity (with a Category relationship), and after that add a Tags tab to your Category page. On the other hand, I see that there's a design problem with your solution. I would go with Enum type instead of a Tag entity. Anyway, without knowing all the requirements of your business logic, it's hard to determine the best practice. So you can follow my suggestion above to achieve this problem.

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    if we have TableA and TableB, and create n-to-n relation/navigation on both ends, it creates TableATableB TableBTableA

    Suite only generates one of them. Not both.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06