Skip to content

Commit

Permalink
[frontend] refactor root query with knowledge bar fragment (#8115)
Browse files Browse the repository at this point in the history
  • Loading branch information
delemaf committed Jan 2, 2025
1 parent 34456b1 commit 34172ba
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ const channelQuery = graphql`
name
aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Channel_channel
...ChannelKnowledge_channel
...FileImportViewer_entity
Expand Down Expand Up @@ -124,7 +121,7 @@ const RootChannel = ({ queryRef, channelId }: RootChannelProps) => {
'sightings',
'channels',
]}
stixCoreObjectsDistribution={channel.stixCoreObjectsDistribution}
queryRef={channel}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ const malwareQuery = graphql`
name
aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Malware_malware
...MalwareKnowledge_malware
...FileImportViewer_entity
Expand Down Expand Up @@ -131,7 +128,7 @@ const RootMalware = ({ queryRef, malwareId }: RootMalwareProps) => {
'infrastructures',
'sightings',
]}
stixCoreObjectsDistribution={malware.stixCoreObjectsDistribution}
queryRef={malware}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ const toolQuery = graphql`
name
aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Tool_tool
...ToolKnowledge_tool
...FileImportViewer_entity
Expand Down Expand Up @@ -125,7 +122,7 @@ const RootTool = ({ queryRef, toolId }: RootToolProps) => {
'observables',
'sightings',
]}
stixCoreObjectsDistribution={tool.stixCoreObjectsDistribution}
queryRef={tool}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ const vulnerabilityQuery = graphql`
name
x_opencti_aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Vulnerability_vulnerability
...VulnerabilityKnowledge_vulnerability
...FileImportViewer_entity
Expand Down Expand Up @@ -124,9 +121,9 @@ const RootVulnerability = ({ queryRef, vulnerabilityId }: RootVulnerabilityProps
'sightings',
'infrastructures',
]}
stixCoreObjectsDistribution={vulnerability.stixCoreObjectsDistribution}
queryRef={vulnerability}
/>
}
}
/>
</Routes>
<div style={{ paddingRight }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ const eventQuery = graphql`
entity_type
name
aliases
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Event_event
...EventKnowledge_event
...FileImportViewer_entity
Expand Down Expand Up @@ -121,7 +118,7 @@ const RootEvent = ({ eventId, queryRef }: RootEventProps) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={event.stixCoreObjectsDistribution}
queryRef={event}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ const individualQuery = graphql`
entity_type
name
x_opencti_aliases
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Individual_individual
...IndividualKnowledge_individual
...FileImportViewer_entity
Expand Down Expand Up @@ -155,7 +152,7 @@ const RootIndividual = ({ individualId, queryRef }: RootIndividualProps) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={individual.stixCoreObjectsDistribution}
queryRef={individual}
/>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ const organizationQuery = graphql`
entity_type
name
x_opencti_aliases
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Organization_organization
...OrganizationKnowledge_organization
...FileImportViewer_entity
Expand Down Expand Up @@ -153,7 +150,7 @@ const RootOrganization = ({ organizationId, queryRef }: RootOrganizationProps) =
'vulnerabilities',
'observables',
]}
stixCoreObjectsDistribution={organization.stixCoreObjectsDistribution}
queryRef={organization}
/>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ const sectorQuery = graphql`
name
x_opencti_aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Sector_sector
...SectorKnowledge_sector
...FileImportViewer_entity
Expand Down Expand Up @@ -123,7 +120,7 @@ const RootSector = ({ sectorId, queryRef }: RootSectorProps) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={sector.stixCoreObjectsDistribution}
queryRef={sector}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ const systemQuery = graphql`
entity_type
name
x_opencti_aliases
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...System_system
...SystemKnowledge_system
...FileImportViewer_entity
Expand Down Expand Up @@ -148,7 +145,7 @@ const RootSystem = ({ systemId, queryRef }: RootSystemProps) => {
'observables',
'vulnerabilities',
]}
stixCoreObjectsDistribution={system.stixCoreObjectsDistribution}
queryRef={system}
/>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ const incidentQuery = graphql`
name
aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Incident_incident
...IncidentKnowledge_incident
...StixCoreObjectContent_stixCoreObject
Expand Down Expand Up @@ -123,7 +120,7 @@ const RootIncidentComponent = ({ queryRef }) => {
'vulnerabilities',
'observables',
]}
stixCoreObjectsDistribution={incident.stixCoreObjectsDistribution}
queryRef={incident}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ const administrativeAreaQuery = graphql`
name
x_opencti_aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...AdministrativeArea_administrativeArea
...AdministrativeAreaKnowledge_administrativeArea
...FileImportViewer_entity
Expand Down Expand Up @@ -120,7 +117,7 @@ const RootAdministrativeAreaComponent = ({ queryRef, administrativeAreaId }) =>
'tools',
'observables',
]}
stixCoreObjectsDistribution={administrativeArea.stixCoreObjectsDistribution}
queryRef={administrativeArea}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ const cityQuery = graphql`
name
x_opencti_aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...City_city
...CityKnowledge_city
...FileImportViewer_entity
Expand Down Expand Up @@ -118,7 +115,7 @@ const RootCityComponent = ({ queryRef, cityId }) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={city.stixCoreObjectsDistribution}
queryRef={city}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ const countryQuery = graphql`
name
x_opencti_aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Country_country
...CountryKnowledge_country
...FileImportViewer_entity
Expand Down Expand Up @@ -120,7 +117,7 @@ const RootCountryComponent = ({ queryRef, countryId }) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={country.stixCoreObjectsDistribution}
queryRef={country}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ const positionQuery = graphql`
entity_type
name
x_opencti_aliases
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Position_position
...PositionKnowledge_position
...FileImportViewer_entity
Expand Down Expand Up @@ -125,7 +122,7 @@ const RootPosition = ({ positionId, queryRef }: RootPositionProps) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={position.stixCoreObjectsDistribution}
queryRef={position}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ const regionQuery = graphql`
name
x_opencti_aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Region_region
...RegionKnowledge_region
...FileImportViewer_entity
Expand Down Expand Up @@ -122,7 +119,7 @@ const RootRegionComponent = ({ queryRef, regionId }) => {
'tools',
'observables',
]}
stixCoreObjectsDistribution={region.stixCoreObjectsDistribution}
queryRef={region}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ const infrastructureKnowledgeFragment = graphql`
aliases
first_seen
last_seen
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
}
`;

Expand All @@ -39,7 +36,7 @@ const InfrastructureKnowledge = ({ infrastructure }: { infrastructure: Infrastru
<>
<StixCoreObjectKnowledgeBar
stixCoreObjectLink={link}
stixCoreObjectsDistribution={infrastructureData.stixCoreObjectsDistribution}
queryRef={infrastructureData}
availableSections={[
'threats',
'threat_actors',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ const attackPatternQuery = graphql`
name
aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...AttackPattern_attackPattern
...AttackPatternKnowledge_attackPattern
...FileImportViewer_entity
Expand Down Expand Up @@ -122,7 +119,7 @@ const RootAttackPattern = ({ attackPatternId, queryRef }: RootAttackPatternProps
'indicators',
'observables',
]}
stixCoreObjectsDistribution={attackPattern.stixCoreObjectsDistribution}
queryRef={attackPattern}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ const narrativeQuery = graphql`
name
aliases
x_opencti_graph_data
stixCoreObjectsDistribution(field: "entity_type", operation: count) {
label
value
}
...StixCoreObjectKnowledgeBar_stixCoreObject
...Narrative_narrative
...NarrativeKnowledge_narrative
...FileImportViewer_entity
Expand Down Expand Up @@ -118,7 +115,7 @@ const RootNarrative = ({ narrativeId, queryRef }: RootNarrativeProps) => {
'observables',
'sightings',
]}
stixCoreObjectsDistribution={narrative.stixCoreObjectsDistribution}
queryRef={narrative}
/>
}
/>
Expand Down
Loading

0 comments on commit 34172ba

Please sign in to comment.