diff --git a/assets/components/tracking/watchlist/diagram/watchlistToEdges.tsx b/assets/components/tracking/watchlist/diagram/watchlistToEdges.tsx index 8c5aac3..b4cc977 100644 --- a/assets/components/tracking/watchlist/diagram/watchlistToEdges.tsx +++ b/assets/components/tracking/watchlist/diagram/watchlistToEdges.tsx @@ -6,8 +6,13 @@ import {rolesToColor} from "../../../../utils/functions/rolesToColor"; export function domainEntitiesToEdges(d: Domain, withRegistrar = false) { const rdapRoleTranslated = rdapRoleTranslation() + const sponsor = d.entities.find(e => !e.deleted && e.roles.includes('sponsor')) return d.entities - .filter(e => !e.deleted && (!withRegistrar ? !e.roles.includes('registrar') : true)) + .filter(e => + !e.deleted && + (withRegistrar || !e.roles.includes('registrar')) && + (!sponsor || !e.roles.includes('registrar') || e.roles.includes('sponsor')) + ) .map(e => ({ id: `e-${d.ldhName}-${e.entity.handle}`, source: e.roles.includes('registrant') || e.roles.includes('registrar') ? e.entity.handle : d.ldhName, diff --git a/assets/components/tracking/watchlist/diagram/watchlistToNodes.tsx b/assets/components/tracking/watchlist/diagram/watchlistToNodes.tsx index 967328c..1909185 100644 --- a/assets/components/tracking/watchlist/diagram/watchlistToNodes.tsx +++ b/assets/components/tracking/watchlist/diagram/watchlistToNodes.tsx @@ -12,18 +12,25 @@ export const domainToNode = (d: Domain) => ({ } }) -export const domainEntitiesToNode = (d: Domain, withRegistrar = false) => d.entities - .filter(e => !e.deleted && (!withRegistrar ? !e.roles.includes('registrar') : true)) - .map(e => { - return { - id: e.entity.handle, - type: e.roles.includes('registrant') || e.roles.includes('registrar') ? 'input' : 'output', - data: {label: entityToName(e)}, - style: { - width: 200 +export const domainEntitiesToNode = (d: Domain, withRegistrar = false) => { + const sponsor = d.entities.find(e => !e.deleted && e.roles.includes('sponsor')) + return d.entities + .filter(e => + !e.deleted && + (withRegistrar || !e.roles.includes('registrar')) && + (!sponsor || !e.roles.includes('registrar') || e.roles.includes('sponsor')) + ) + .map(e => { + return { + id: e.entity.handle, + type: e.roles.includes('registrant') || e.roles.includes('registrar') ? 'input' : 'output', + data: {label: entityToName(e)}, + style: { + width: 200 + } } - } - }) + }) +} export const tldToNode = (tld: Tld) => ({ id: tld.tld,