Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
}
}
function mapStateToProps(state) {
return {
groupedExpenses: getGroupedFilteredExpenses(state),
currentPeriod: getPeriod(state),
filteringDoc: getFilteringDoc(state)
}
}
const Reimbursements = compose(
translate(),
queryConnect({
transactions: transactionsConn
}),
connect(mapStateToProps),
withFilters,
// We need to have a different query name otherwise we end with an infinite
// loading
withBrands({ queryName: 'reimbursementsPageTriggers' })
)(DumbReimbursements)
export default Reimbursements
)
}
}
// TODO reactivate when we understand how sharings work
// const fetchAccountsSharingInfo = props => {
// return Promise.resolve([])
// const { accounts } = props
// with cozy-client
// return Promise.all(accounts.data.map(account => {
// return props.dispatch(fetchSharingInfo(ACCOUNT_DOCTYPE, account._id))
// }))
// }
export default compose(
queryConnect({
accountsCollection: accountsConn,
apps: { query: () => Q(APP_DOCTYPE), as: 'apps' }
}),
translate()
)(AccountsSettings)
// Use static property to be able to override
TransactionPageErrors.errorTypeToComponent = {
'errored-trigger': TriggerErrorCard
}
TransactionPageErrors.propTypes = {
triggerCol: PropTypes.object.isRequired,
accounts: PropTypes.array.isRequired
}
export default compose(
connect(state => ({
accounts: getFilteredAccounts(state)
})),
queryConnect({
triggerCol: {
...triggersConn,
fetchPolicy: CozyClient.fetchPolicies.noFetch
}
}),
React.memo
)(TransactionPageErrors)
}
export const DumbTransactionsPage = TransactionsPage
export const UnpluggedTransactionsPage = compose(
withRouter,
translate(),
withBreakpoints()
)(TransactionsPage)
UnpluggedTransactionsPage.propTypes = {
filteredTransactions: PropTypes.array.isRequired
}
const ConnectedTransactionsPage = compose(
withRouter,
queryConnect({
accounts: accountsConn,
groups: groupsConn,
triggers: triggersConn,
transactions: transactionsConn
}),
connect(mapStateToProps)
)(UnpluggedTransactionsPage)
export const TransactionsPageWithBackButton = props => (
)
export default ConnectedTransactionsPage
isImportant
/>
)
}
const outdatedKonnectors = {
query: () =>
Q(KONNECTOR_DOCTYPE).where({ available_version: { $exists: true } }),
fetchPolicy: CozyClient.fetchPolicies.olderThan(30 * 1000),
as: 'outdatedKonnectors'
}
export default compose(
withClient,
queryConnect({
outdatedKonnectors
}),
withBreakpoints(),
React.memo
)(KonnectorUpdateInfo)
accounts={accounts}
transactions={transactions}
/>
)}
)
}
export const DumbBalanceHeader = BalanceHeader
export default compose(
withBreakpoints(),
memo,
queryConnect({
transactions: transactionsConn
})
)(BalanceHeader)
<p>
<button>}
label={t('Groups.create')}
theme="text"
onClick={() => router.push('/settings/groups/new')}
/>
<p></p>
)
}
}
)
export default compose(
queryConnect({
groups: groupsConn,
accounts: accountsConn
}),
translate()
)(Groups)
</button></p>
})
const mapStateToProps = (state, ownProps) => {
return {
categories: getCategoriesData(state, ownProps),
filteringDoc: getFilteringDoc(state),
filteredTransactionsByAccount: getTransactionsFilteredByAccount(state)
}
}
export default compose(
withRouter,
withBreakpoints(),
translate(),
withClient,
queryConnect({
accounts: accountsConn,
transactions: transactionsConn,
settings: settingsConn,
groups: groupsConn
}),
connect(
mapStateToProps,
mapDispatchToProps
)
)(CategoriesPage)
onToggle={onToggleFlag('amount_blur')}
enabled={Boolean(flag('amount_blur'))}
name="amountBlur"
/>
{Configuration.renderExtraItems()}
)
}
}
export default compose(
withClient,
queryConnect({
settingsCollection: settingsConn
}),
withAccountOrGroupLabeller('getAccountOrGroupLabel'),
flag.connect,
translate()
)(Configuration)
onChange={onSwitchChange}
/>
{showUpdatedAtOutside && (
<div>
</div>
)}
)
}
}
export default compose(
queryConnect({
triggersCol: {
...triggersConn,
fetchPolicy: CozyClient.fetchPolicies.noFetch
}
}),
connect((state, { account }) => {
const warningLimits = getWarningLimitPerAccount(state)
const accountLimit = warningLimits[account._id]
return {
hasWarning: accountLimit ? accountLimit > account.balance : false
}
}),
withBreakpoints(),
translate(),
React.memo,
withClient