Skip to content

Commit

Permalink
[api/frontend] Fix author field, permission and user delete (#509, #511)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine authored Feb 19, 2020
1 parent c41d68d commit 63edd22
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ class CreatedByRefField extends Component {
setFieldValue(name, {
label: data.identityAdd.name,
value: data.identityAdd.id,
type: data.identityAdd.entity_type,
});
if (typeof onChange === 'function') {
onChange(name, {
label: data.identityAdd.name,
value: data.identityAdd.id,
type: data.identityAdd.entity_type,
});
}
}}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const identityMutation = graphql`
identityAdd(input: $input) {
id
name
entity_type
}
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import CampaignPopover from './CampaignPopover';
import CampaignKnowledgeBar from './CampaignKnowledgeBar';
import StixDomainEntityHeader from '../../common/stix_domain_entities/StixDomainEntityHeader';
import StixDomainEntityKillChain from '../../common/stix_domain_entities/StixDomainEntityKillChain';
import StixDomainEntityVictimology from '../../common/stix_domain_entities/StixDomainEntityVictimology';

const styles = () => ({
container: {
Expand Down Expand Up @@ -100,19 +101,9 @@ class CampaignKnowledgeComponent extends Component {
exact
path="/dashboard/threats/campaigns/:campaignId/knowledge/victimology"
render={(routeProps) => (
<EntityStixRelations
entityId={campaign.id}
relationType="targets"
targetEntityTypes={[
'Organization',
'Sector',
'City',
'Country',
'Region',
]}
<StixDomainEntityVictimology
stixDomainEntityId={campaign.id}
entityLink={link}
exploreLink={`/dashboard/explore/victimology/${campaign.id}`}
creationIsFrom={true}
{...routeProps}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import IncidentPopover from './IncidentPopover';
import IncidentKnowledgeBar from './IncidentKnowledgeBar';
import StixDomainEntityHeader from '../../common/stix_domain_entities/StixDomainEntityHeader';
import StixDomainEntityKillChain from '../../common/stix_domain_entities/StixDomainEntityKillChain';
import StixDomainEntityVictimology from "../../common/stix_domain_entities/StixDomainEntityVictimology";

const styles = () => ({
container: {
Expand Down Expand Up @@ -92,19 +93,9 @@ class IncidentKnowledgeComponent extends Component {
exact
path="/dashboard/threats/incidents/:incidentId/knowledge/victimology"
render={(routeProps) => (
<EntityStixRelations
entityId={incident.id}
relationType="targets"
targetEntityTypes={[
'Organization',
'Sector',
'City',
'Country',
'Region',
]}
<StixDomainEntityVictimology
stixDomainEntityId={incident.id}
entityLink={link}
exploreLink={`/dashboard/explore/victimology/${incident.id}`}
creationIsFrom={true}
{...routeProps}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import MalwarePopover from './MalwarePopover';
import MalwareKnowledgeBar from './MalwareKnowledgeBar';
import StixDomainEntityHeader from '../../common/stix_domain_entities/StixDomainEntityHeader';
import StixDomainEntityKillChain from '../../common/stix_domain_entities/StixDomainEntityKillChain';
import StixDomainEntityVictimology from "../../common/stix_domain_entities/StixDomainEntityVictimology";

const styles = () => ({
container: {
Expand Down Expand Up @@ -128,19 +129,9 @@ class MalwareKnowledgeComponent extends Component {
exact
path="/dashboard/threats/malwares/:malwareId/knowledge/victimology"
render={(routeProps) => (
<EntityStixRelations
entityId={malware.id}
relationType="targets"
targetEntityTypes={[
'Organization',
'Sector',
'City',
'Country',
'Region',
]}
<StixDomainEntityVictimology
stixDomainEntityId={malware.id}
entityLink={link}
exploreLink={`/dashboard/explore/victimology/${malware.id}`}
creationIsFrom={true}
{...routeProps}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ThreatActorKnowledgeBar from './ThreatActorKnowledgeBar';
import StixDomainEntityHeader from '../../common/stix_domain_entities/StixDomainEntityHeader';
import StixDomainEntityKillChain from '../../common/stix_domain_entities/StixDomainEntityKillChain';
import StixDomainEntityThreatKnowledge from '../../common/stix_domain_entities/StixDomainEntityThreatKnowledge';
import StixDomainEntityVictimology from '../../common/stix_domain_entities/StixDomainEntityVictimology';

const styles = () => ({
container: {
Expand Down Expand Up @@ -100,20 +101,9 @@ class ThreatActorKnowledgeComponent extends Component {
exact
path="/dashboard/threats/threat_actors/:threatActorId/knowledge/victimology"
render={(routeProps) => (
<EntityStixRelations
entityId={threatActor.id}
relationType="targets"
targetEntityTypes={[
'Organization',
'Sector',
'City',
'Country',
'Region',
'User',
]}
<StixDomainEntityVictimology
stixDomainEntityId={threatActor.id}
entityLink={link}
exploreLink={`/dashboard/explore/victimology/${threatActor.id}`}
creationIsFrom={true}
{...routeProps}
/>
)}
Expand Down

0 comments on commit 63edd22

Please sign in to comment.