Add third-party self-referential relations
Introduce a self-referential many-to-many relation table so a third party can have child third parties. Each relation is directional (parent to child); both directions can coexist as independent rows. Add a first_level boolean on third_parties (default true) with a filter on the list page that defaults to showing only first-level third parties. Frontend adds a "Third Parties" tab on the detail page where users can link existing third parties or create new ones from the common third party catalog (created as non-first-level). The list page gets a First Level/All toggle filter. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -138,6 +138,7 @@ export const paginatedThirdPartiesFragment = graphql`
|
||||
after: { type: "CursorKey", defaultValue: null }
|
||||
before: { type: "CursorKey", defaultValue: null }
|
||||
last: { type: "Int", defaultValue: null }
|
||||
filter: { type: "ThirdPartyFilter", defaultValue: { firstLevel: true } }
|
||||
) {
|
||||
thirdParties(
|
||||
first: $first
|
||||
@@ -145,7 +146,8 @@ export const paginatedThirdPartiesFragment = graphql`
|
||||
last: $last
|
||||
before: $before
|
||||
orderBy: $order
|
||||
) @connection(key: "ThirdPartiesListQuery_thirdParties") {
|
||||
filter: $filter
|
||||
) @connection(key: "ThirdPartiesListQuery_thirdParties", filters: ["filter"]) {
|
||||
__id
|
||||
edges {
|
||||
node {
|
||||
@@ -182,6 +184,7 @@ export const thirdPartyNodeQuery = graphql`
|
||||
... on ThirdParty {
|
||||
name
|
||||
websiteUrl
|
||||
firstLevel
|
||||
canAssess: permission(action: "core:thirdParty:assess")
|
||||
canUpdate: permission(action: "core:thirdParty:update")
|
||||
canDelete: permission(action: "core:thirdParty:delete")
|
||||
@@ -224,6 +227,7 @@ export const thirdPartiesSelectQuery = graphql`
|
||||
id
|
||||
name
|
||||
websiteUrl
|
||||
firstLevel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user