Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend] Apply the Bulk Relationship POC on all required entities (#7500) #8294

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Box from '@mui/material/Box';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import useQueryLoading from 'src/utils/hooks/useQueryLoading';
import useForceUpdate from '@components/common/bulk/useForceUpdate';
import StixCoreObjectContentRoot from '../../common/stix_core_objects/StixCoreObjectContentRoot';
import Channel from './Channel';
import ChannelKnowledge from './ChannelKnowledge';
Expand Down Expand Up @@ -95,6 +96,8 @@ const RootChannel = ({ queryRef, channelId }: RootChannelProps) => {
connectorsForImport,
} = usePreloadedQuery<RootChannelQuery>(channelQuery, queryRef);

const { forceUpdate } = useForceUpdate();

const paddingRight = getPaddingRight(location.pathname, channelId, '/dashboard/arsenal/channels');
const link = `/dashboard/arsenal/channels/${channelId}/knowledge`;
return (
Expand Down Expand Up @@ -210,7 +213,11 @@ const RootChannel = ({ queryRef, channelId }: RootChannelProps) => {
/>
<Route
path="/knowledge/*"
element={<ChannelKnowledge channel={channel} />}
element={
<div key={forceUpdate}>
<ChannelKnowledge channel={channel} />
</div>
}
/>
<Route
path="/content/*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import useQueryLoading from 'src/utils/hooks/useQueryLoading';
import { GraphQLSubscriptionConfig } from 'relay-runtime';
import useForceUpdate from '@components/common/bulk/useForceUpdate';
import StixCoreObjectContentRoot from '../../common/stix_core_objects/StixCoreObjectContentRoot';
import StixCoreObjectSimulationResult from '../../common/stix_core_objects/StixCoreObjectSimulationResult';
import Malware from './Malware';
Expand Down Expand Up @@ -99,6 +100,8 @@ const RootMalware = ({ queryRef, malwareId }: RootMalwareProps) => {
connectorsForImport,
} = usePreloadedQuery<RootMalwareQuery>(malwareQuery, queryRef);

const { forceUpdate } = useForceUpdate();

const isOverview = location.pathname === `/dashboard/arsenal/malwares/${malwareId}`;
const paddingRight = getPaddingRight(location.pathname, malwareId, '/dashboard/arsenal/malwares');
const link = `/dashboard/arsenal/malwares/${malwareId}/knowledge`;
Expand Down Expand Up @@ -226,7 +229,11 @@ const RootMalware = ({ queryRef, malwareId }: RootMalwareProps) => {
/>
<Route
path="/knowledge/*"
element={<MalwareKnowledge malware={malware} />}
element={
<div key={forceUpdate}>
<MalwareKnowledge malware={malware} />
</div>
}
/>
<Route
path="/content/*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Box from '@mui/material/Box';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import useQueryLoading from 'src/utils/hooks/useQueryLoading';
import useForceUpdate from '@components/common/bulk/useForceUpdate';
import StixCoreObjectContentRoot from '../../common/stix_core_objects/StixCoreObjectContentRoot';
import Tool from './Tool';
import ToolKnowledge from './ToolKnowledge';
Expand Down Expand Up @@ -97,6 +98,8 @@ const RootTool = ({ queryRef, toolId }: RootToolProps) => {
connectorsForImport,
} = usePreloadedQuery<RootToolQuery>(toolQuery, queryRef);

const { forceUpdate } = useForceUpdate();

const paddingRight = getPaddingRight(location.pathname, toolId, '/dashboard/arsenal/tools');
const link = `/dashboard/arsenal/tools/${toolId}/knowledge`;
return (
Expand Down Expand Up @@ -211,7 +214,11 @@ const RootTool = ({ queryRef, toolId }: RootToolProps) => {
/>
<Route
path="/knowledge/*"
element={<ToolKnowledge tool={tool} />}
element={
<div key={forceUpdate}>
<ToolKnowledge tool={tool} />
</div>
}
/>
<Route
path="/content/*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Box from '@mui/material/Box';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import useQueryLoading from 'src/utils/hooks/useQueryLoading';
import useForceUpdate from '@components/common/bulk/useForceUpdate';
import StixCoreObjectContentRoot from '../../common/stix_core_objects/StixCoreObjectContentRoot';
import Vulnerability from './Vulnerability';
import VulnerabilityKnowledge from './VulnerabilityKnowledge';
Expand Down Expand Up @@ -95,6 +96,8 @@ const RootVulnerability = ({ queryRef, vulnerabilityId }: RootVulnerabilityProps
connectorsForImport,
} = usePreloadedQuery<RootVulnerabilityQuery>(vulnerabilityQuery, queryRef);

const { forceUpdate } = useForceUpdate();

const paddingRight = getPaddingRight(location.pathname, vulnerabilityId, '/dashboard/arsenal/vulnerabilities');
const link = `/dashboard/arsenal/vulnerabilities/${vulnerabilityId}/knowledge`;
return (
Expand Down Expand Up @@ -213,7 +216,11 @@ const RootVulnerability = ({ queryRef, vulnerabilityId }: RootVulnerabilityProps
/>
<Route
path="/knowledge/*"
element={<VulnerabilityKnowledge vulnerability={vulnerability}/>}
element={
<div key={forceUpdate}>
<VulnerabilityKnowledge vulnerability={vulnerability}/>
</div>
}
/>
<Route
path="/content/*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import EntityStixCoreRelationships from '../../common/stix_core_relationships/En
import StixDomainObjectKnowledge from '../../common/stix_domain_objects/StixDomainObjectKnowledge';
import StixCoreRelationship from '../../common/stix_core_relationships/StixCoreRelationship';
import StixSightingRelationship from '../../events/stix_sighting_relationships/StixSightingRelationship';
import withRouter from '../../../../utils/compat_router/withRouter';

class EventKnowledgeComponent extends Component {
render() {
Expand Down Expand Up @@ -204,4 +203,4 @@ const EventKnowledge = createFragmentContainer(EventKnowledgeComponent, {
`,
});

export default withRouter(EventKnowledge);
export default EventKnowledge;
Loading