Skip to content

Commit

Permalink
Merge pull request #2722 from cozy/feat/VER-848
Browse files Browse the repository at this point in the history
feat: Upgrade packages
  • Loading branch information
JF-Cozy authored Sep 3, 2024
2 parents 9f425a3 + 8d70d2b commit faa691b
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 258 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@cozy/minilog": "^1.0.0",
"@material-ui/styles": "^4.10.0",
"@sentry/integrations": "7.100.1",
"@sentry/react": "7.100.1",
"@sentry/react": "7.119.0",
"@testing-library/react-hooks": "^3.4.2",
"@types/classnames": "^2.3.1",
"bluebird": "3.5.5",
Expand All @@ -125,11 +125,11 @@
"classnames": "2.2.6",
"cozy-bar": "^10.0.0",
"cozy-ci": "0.4.1",
"cozy-client": "^45.7.0",
"cozy-client": "^48.17.0",
"cozy-device-helper": "^2.6.0",
"cozy-doctypes": "1.82.2",
"cozy-flags": "^2.8.7",
"cozy-harvest-lib": "^22.0.1",
"cozy-harvest-lib": "^29.1.0",
"cozy-intent": "^2.7.0",
"cozy-interapp": "0.9.0",
"cozy-keys-lib": "^6.0.0",
Expand All @@ -139,8 +139,8 @@
"cozy-pouch-link": "45.7.0",
"cozy-realtime": "4.2.9",
"cozy-scripts": "^8.3.0",
"cozy-sharing": "3.12.2",
"cozy-ui": "^103.1.1",
"cozy-sharing": "^15.0.3",
"cozy-ui": "^111.8.1",
"d3": "5.11.0",
"date-fns": "1.30.1",
"detect-node": "2.0.4",
Expand Down
72 changes: 39 additions & 33 deletions src/components/Select/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react'
import find from 'lodash/find'

import Icon from 'cozy-ui/transpiled/react/Icon'
import SelectBox, {
SelectBoxWithFixedOptions
} from 'cozy-ui/transpiled/react/SelectBox'
import styles from 'components/Select/styles.styl'
import find from 'lodash/find'
import palette from 'cozy-ui/transpiled/react/palette'
import { mergeStyles } from 'components/Select/styleUtils'

import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme'
import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom'

import { mergeStyles } from 'components/Select/styleUtils'
import styles from 'components/Select/styles.styl'

const smallArrowStyle = { paddingLeft: '0.25rem' }
const IndicatorSeparator = () => null
const SmallArrow = () => (
Expand Down Expand Up @@ -41,7 +42,10 @@ const mkControlStyle = props => base => {
}
}

const singleValueStyle = base => ({ ...base, color: palette.slateGrey })
const singleValueStyle = base => ({
...base,
color: 'var(--secondaryTextColor)'
})
const valueContainerStyle = base => ({ ...base, paddingLeft: 0 })
const menuStyle = base => ({ ...base, minWidth: '9.375rem' })

Expand Down Expand Up @@ -85,33 +89,35 @@ class Select extends React.Component {
const Component = this.Component

return (
<Component
value={
value ? find(options, option => option.value == value) : options[0]
}
isSearchable={false}
getOptionLabel={x => x.name}
components={componentsOptions}
classNamePrefix="needsclick cz"
formatOptionLabel={option => (
<span className="needsclick">{option.name}</span>
)}
styles={mergeStyles(
{
singleValue: singleValueStyle,
control: this.controlStyle,
valueContainer: valueContainerStyle,
menu: menuStyle
},
styles
)}
name={name}
placeholder={placeholder}
onChange={option => {
onChange(option.value, options.indexOf(option.value), name)
}}
options={options}
/>
<CozyTheme variant="normal">
<Component
value={
value ? find(options, option => option.value == value) : options[0]
}
isSearchable={false}
getOptionLabel={x => x.name}
components={componentsOptions}
classNamePrefix="needsclick cz"
formatOptionLabel={option => (
<span className="needsclick">{option.name}</span>
)}
styles={mergeStyles(
{
singleValue: singleValueStyle,
control: this.controlStyle,
valueContainer: valueContainerStyle,
menu: menuStyle
},
styles
)}
name={name}
placeholder={placeholder}
onChange={option => {
onChange(option.value, options.indexOf(option.value), name)
}}
options={options}
/>
</CozyTheme>
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectDates/SelectDates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const mobileMenuStyle = base => ({
})

const textStyle = () => ({
color: 'var(--primaryColor)'
color: 'var(--primaryContrastTextColor)'
})

const getSelectStyle = (isMobile, isPrimary, type) => {
Expand Down
27 changes: 7 additions & 20 deletions src/components/Title/__snapshots__/Title.spec.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,12 @@ exports[`Title should extend className 1`] = `
`;

exports[`Title should handle theme 1`] = `
<Context.Provider
value={
Object {
"type": "light",
"variant": "inverted",
}
}
<DumbCozyTheme
ignoreItself={true}
variant="inverted"
>
<MuiCozyTheme
type="light"
variant="inverted"
>
<div
className="CozyTheme--light-inverted u-dc"
>
<Title>
content
</Title>
</div>
</MuiCozyTheme>
</Context.Provider>
<Title>
content
</Title>
</DumbCozyTheme>
`;
32 changes: 1 addition & 31 deletions src/ducks/settings/HarvestModal.jsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
import React from 'react'
import flag from 'cozy-flags'
import Dialog from 'cozy-ui/transpiled/react/Dialog'
import { withStyles } from 'cozy-ui/transpiled/react/styles'
import { useVaultUnlockContext } from 'cozy-keys-lib'
import { useDialogContext } from 'cozy-harvest-lib/dist/components/DialogContext'
import { DialogCloseButton } from 'cozy-ui/transpiled/react/CozyDialogs'

const withHarvestDialogStyles = () => {
/**
* When this flag is enabled, tabs are removed, and the layout shift between
* data and configuration screens is not as disturbing as with tabs. So we do
* not need to customize styles to align the dialog at the top anymore and we
* can just return the identity function. This whole HOC should be able to be
* removed at the same time as the flag. See the next comment for the former
* behavior.
*/
if (flag('harvest.inappconnectors.enabled')) {
return component => component
}
/**
* Dialog will not be centered vertically since we need the modal to "stay in
* place" when changing tabs. Since tabs content's height is not the same
* between the data tab and the configuration, having the modal vertically
* centered makes it "jump" when changing tabs.
*/
return withStyles({
scrollPaper: {
alignItems: 'start'
},

// Necessary to prevent warnings at runtime
paper: {}
})
}

/**
* This component copies the functionality of the modal in Harvest and its Routes component.
*/
Expand All @@ -53,4 +23,4 @@ const HarvestModal = ({ children, onDismiss }) => {
)
}

export default withHarvestDialogStyles()(HarvestModal)
export default HarvestModal
11 changes: 8 additions & 3 deletions src/ducks/transactions/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export const makeEarliestLatestQueries = baseQuery => {
* - If we have a selector on an account AND this selector doesn't
* containt any special operator (aka starting by $)
* (see https://forum.cozy.io/t/impossible-de-remonter-jusquau-bout-de-lhistorique-doperations-dans-analyse-apres-import-ach/7547),
* then the index should be indexed by account first and then we ensure
* then the index should be indexed by account first and then we ensure
* that we have the date within the index
*
*
* - If we don't have a slector on an account, then the index
* should be indexed first by the date and then by the account
*
Expand All @@ -123,7 +123,12 @@ export const makeEarliestLatestQueries = baseQuery => {

const selectors = Object.keys(baseQuery.selector)
let indexedFields
if (selectors.includes('account') && !Object.values(baseQuery.selector).some(a => Object.keys(a)[0].startsWith('$')) ){
if (
selectors.includes('account') &&
!Object.values(baseQuery.selector).some(a =>
Object.keys(a)[0].startsWith('$')
)
) {
indexedFields = selectors
indexedFields.push('date')
} else {
Expand Down
Loading

0 comments on commit faa691b

Please sign in to comment.