Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
firestoreConnect((props) => [
{
collection: 'projects',
doc: props.match.params.projectId,
storeAs: 'activeProject',
},
{
collection: `projects/${props.match.params.projectId}/features`,
storeAs: 'mapFeatures',
},
]);
// Mount feature data onto store based on current projectId and featureId in
// path.
const connectFeature =
firestoreConnect((props) => [
{
collection: `projects/${props.match.params.projectId}/records`,
where: [
['featureId', '==', props.match.params.featureId],
],
storeAs: 'featureRecords',
},
]);
const exportKml = () => (projectId, featureTypeId) => {
window.location.href = `${
firebaseConfig.functionsURL
}/exportKml?project=${projectId}&featureType=${featureTypeId}`;
};
export {
};
const mapStateToProps = (state, ownProps) => {
const { id } = ownProps.match.params;
const { projects } = state.firestore.data;
const project = projects ? projects[id] : null;
return {
project,
auth: state.firebase.auth,
};
};
export default compose(
connect(mapStateToProps),
firestoreConnect([
{ collection: 'projects' },
]),
)(ProjectDetails);
AfterLoginContainer.propTypes = {
hackerApplication: PropTypes.object.isRequired,
storeHackerApplication: PropTypes.func.isRequired,
};
const mapDispatchToProps = (dispatch) => {
return {
storeHackerApplication: (application) => {
dispatch(addHackerApplication(application));
},
};
};
export default compose(
firebaseConnect(),
firestoreConnect((props) => {
const { firebase } = props;
const auth = firebase.auth();
const { currentUser: { uid } } = auth;
return [
{
collection: 'applications_hacker',
doc: uid,
storeAs: 'hackerApplication',
},
];
}),
connect(mapStateToProps, mapDispatchToProps),
)(AfterLoginContainer);
joinedPaths: state.paths.joinedPaths,
publicPaths: publicPathSelector(state),
currentPathTab: state.paths.currentPathTab,
pathStats:state.firestore.data.pathStats
});
const mapDispatchToProps = dispatch => ({
pathsOpen: () => dispatch(pathsOpen()),
pathDialogShow: pathInfo => dispatch(pathDialogShow(pathInfo)),
pathChangeRequest: pathInfo => dispatch(pathChangeRequest(pathInfo)),
pathDialogHide: () => dispatch(pathDialogHide()),
handleSwitchPathTab: tabIndex => dispatch(switchPathTab(tabIndex))
});
export default compose(
firestoreConnect((ownProps, store)=>[
{
path: "/path_statistics",
collection:"path_statistics",
storeAs: "pathStats",
orderBy: ['endDate', 'desc'],
limit:1
}]),
firebaseConnect((ownProps, store) => {
const firebaseAuth = store.getState().firebase.auth;
return [
{
path: "/paths",
storeAs: "publicPaths",
queryParams: ["orderByChild=isPublic", "equalTo=true"]
}
].concat(
);
} else {
return ;
}
}
}
ClientDetails.propTypes = {
firestore: PropTypes.object.isRequired
};
export default compose(
firestoreConnect(props => [
{ collection: 'clients', storeAs: 'client', doc: props.match.params.id }
]),
connect(({ firestore: { ordered } }, props) => ({
client: ordered.client && ordered.client[0]
}))
)(ClientDetails);
const mapStateToProps = (state, oldProps) => {
return {
auth: state.firebase.auth,
}
}
const mapDispatchToProps = (dispatch) => {
return {
deleteBlog : (id) => dispatch(deleteBlog(id)),
like : (p1,p2,p3,p4) => dispatch(likeBlog(p1,p2,p3,p4)),
}
}
export default withRouter(compose(
connect(mapStateToProps, mapDispatchToProps),
firestoreConnect([
{collection : 'likes'},
])
)(BlogSummary));
);
} else {
return ;
}
}
}
EditClient.propTypes = {
firestore: PropTypes.object.isRequired
};
export default compose(
firestoreConnect(props => [
{ collection: 'clients', storeAs: 'client', doc: props.match.params.id }
]),
connect(({ firestore: { ordered }, settings }, props) => ({
client: ordered.client && ordered.client[0],
settings
}))
)(EditClient);
changeSelectedUser: (uid, roomId) => {
dispatch(ChangeSelectedUser(uid, roomId));
}
};
};
const mapStateToProps = (state, ownProps) => {
return {
selectedUser: state.chat
};
};
export default compose(
connect(
mapStateToProps,
mapDispatchToProps
),
firestoreConnect()
)(MessageBox);
);
}
}
ApplicantInfo.propTypes = {
firestore: PropTypes.object,
applicantType: PropTypes.string,
applicantId: PropTypes.string,
showAssessmentFieldsOnly: PropTypes.bool,
className: PropTypes.string,
};
export default compose(
firebaseConnect(),
firestoreConnect(mapPropsToQueries),
connect((state) => {
return {
firestore: state.firestore,
};
}),
)(ApplicantInfo);