Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
props: ({ data }) => {
if (data.error || data.loading) {
return {
error: data.error,
timeline: [], // empty timeline to avoid to block the whole app until timeline data is loaded
timelineLoading: data.loading
};
}
const filteredPhases = filter(TimelineQuery, { timeline: data.timeline });
const phasesForStore = filteredPhases.timeline.map(phase => ({
id: phase.id,
identifier: phase.identifier,
isThematicsTable: phase.isThematicsTable,
start: phase.start,
end: phase.end,
image: phase.image,
title: phase.title,
description: phase.description
}));
return {
error: data.error,
timelineLoading: data.loading,
timeline: phasesForStore
};
}
putTextFieldsInStore(textFields) {
if (textFields) {
const filtered = filter(TextFields, { textFields: textFields });
this.props.updateTextFields(filtered.textFields);
}
}
function Profile({ data: { User } }) {
if (!User) {
return ;
}
return (
<div>
<style>{`
.profile {
margin: 0 1em;
}
`}</style>
{User.facilitatedRetreats.length > 0 &&
}
{User.tracks.length > 0 && }
</div>
);
}
.then(result => {
observer.next({ data: filter(operation.query, result) })
observer.complete()
})
.catch(err => {
const resolveGraphQLQuery = (document: any, options: any = {}) => {
const { filterResult, rootValue, context, variables } = options;
const result = graphql(
resolver,
document,
rootValue,
context,
variables
);
if (filterResult) {
return filter(document, result);
}
return result;
};
putSectionsInStore = (sections) => {
if (sections) {
const filteredSections = filter(SectionsQuery, {
sections: sections.filter(section => section.sectionType !== 'ADMINISTRATION')
});
this.props.updateSections(filteredSections.sections);
}
};
.map(u => )}
putLandingPageModulesInStore = (landingPageModules) => {
if (landingPageModules) {
const filtered = filter(LandingPageModules, { landingPageModules: landingPageModules });
const landingPageModulesWithUpdatedTitles = addEnumSuffixToModuleTitles(filtered.landingPageModules);
this.props.updateLandingPageModules(landingPageModulesWithUpdatedTitles);
}
};
static filter = data => filter(FollowList.fragments.user, data);