Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mapStateToProps: MapState = state => ({
/** Profile */
profileError: path(['read'], state.__resources.profile.error),
linodes: state.__resources.linodes.entities,
linodesError: path(['read'], state.__resources.linodes.error),
domainsError: state.__resources.domains.error.read,
imagesError: path(['read'], state.__resources.images.error),
notificationsError: state.__resources.notifications.error,
settingsError: state.__resources.accountSettings.error.read,
typesError: state.__resources.types.error,
regionsError: state.__resources.regions.error,
volumesError: path(['read'], state.__resources.volumes.error),
bucketsError: state.__resources.buckets.error,
userId: path(['data', 'uid'], state.__resources.profile),
username: pathOr('', ['data', 'username'], state.__resources.profile),
accountData: state.__resources.account.data,
documentation: state.documentation,
isLoggedInAsCustomer: pathOr(
false,
['authentication', 'loggedInAsCustomer'],
state
),
accountCapabilities: pathOr(
[],
['__resources', 'account', 'data', 'capabilities'],
state
),
accountSettingsLoading: pathOr(
true,
['__resources', 'accountSettings', 'loading'],
state
get curFilter() {
return R.pathOr('', ['js'], self.filters.toJSON())
},
render() {
const { dummy } = this.props;
const { scrollToIndex } = this.state;
const list = dummy
? []
: this.filterList(pathOr([], ['sectors', 'edges'], this.props.data));
const listLength = this.props.relay.isLoading()
? list.length + 25
: list.length;
const rowCount = dummy
? listLength > 0
? listLength - 1
: 24
: listLength;
return (
{({
height, isScrolling, onChildScroll, scrollTop,
}) => (
<div>
</div>
}
if (
hasBackups &&
typeDisplayInfo &&
typeDisplayInfo.backupsMonthly
) {
displaySections.push(
renderBackupsDisplaySection(
accountBackupsEnabled,
typeDisplayInfo.backupsMonthly
)
);
}
let calculatedPrice = pathOr(0, ['monthly'], typeDisplayInfo);
if (
hasBackups &&
typeDisplayInfo &&
typeDisplayInfo.backupsMonthly
) {
calculatedPrice += typeDisplayInfo.backupsMonthly;
}
return (
setDrawerOpen(false)}
/>
);
};
const accountProp = (propName, def) => R.pathOr(def, ['category', propName]);
}).then((data) => {
const result = pathOr([], ['threatActors', 'edges'], data)
.concat(pathOr([], ['intrusionSets', 'edges'], data))
.concat(pathOr([], ['campaigns', 'edges'], data))
.concat(pathOr([], ['incidents', 'edges'], data))
.concat(pathOr([], ['malwares', 'edges'], data));
const threats = map(
n => ({
label: n.node.name,
value: n.node.id,
type: n.node.entity_type,
}),
result,
);
this.setState({ threats: union(this.state.threats, threats) });
});
}
render() {
const {
t, threatActor, editUsers, me,
} = this.props;
const createdByRef = pathOr(null, ['createdByRef', 'node', 'name'], threatActor) === null
? ''
: {
label: pathOr(null, ['createdByRef', 'node', 'name'], threatActor),
value: pathOr(null, ['createdByRef', 'node', 'id'], threatActor),
relation: pathOr(
null,
['createdByRef', 'relation', 'id'],
threatActor,
),
};
const killChainPhases = pipe(
pathOr([], ['killChainPhases', 'edges']),
map((n) => ({
label: `[${n.node.kill_chain_name}] ${n.node.phase_name}`,
value: n.node.id,
relationId: n.relation.id,
const useCacheRehydrationData = (): RehydrationData => {
const eventData = pathOr(null, ['eeEditorData', 'event'], window);
const currentUser = pathOr(null, ['eeEditorData', 'currentUser'], window);
const generalSettings = pathOr(null, ['eeEditorData', 'generalSettings'], window);
return { ...eventData, currentUser, generalSettings };
};
setDialogError = (errorResponse: Linode.ApiFieldError) => {
const { updateDialog } = this.state;
const fallbackError = [{ reason: 'Unable to detach volume.' }];
const apiError = pathOr(fallbackError, ['response', 'data', 'errors'], errorResponse);
const error = apiError[0].reason;
this.setState({
updateDialog: {
...updateDialog,
error,
submitting: false,
}
})
}