Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import cozyReact from 'eslint-config-cozy-app/react'

export default [...cozyReact]
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,8 @@
"babel-preset-cozy-app": "2.0.2",
"bundlemon": "3.1.0",
"cozy-app-publish": "^0.41.0",
"eslint": "8.9.0",
"eslint-config-cozy-app": "4.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import-alias": "^1.2.0",
"eslint": "^10.0.0",
"eslint-config-cozy-app": "^7.0.0",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"git-directory-deploy": "1.5.1",
"identity-obj-proxy": "^3.0.0",
"ignore-not-found-export-webpack-plugin": "1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddServiceTile.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'

import { useClient, generateWebLink } from 'cozy-client'
import AppLinker from 'cozy-ui-plus/dist/AppLinker'

import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'

/**
Expand Down
5 changes: 3 additions & 2 deletions src/components/AddTile.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React, { useState } from 'react'

import flag from 'cozy-flags'
import { useClient, generateWebLink } from 'cozy-client'
import flag from 'cozy-flags'
import AppLinker from 'cozy-ui-plus/dist/AppLinker'
import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'
import { useI18n } from 'twake-i18n'

import styles from '@/styles/lists.styl'
import ShortcutCreateModal from './Shortcuts/ShortcutCreateModal'

import styles from '@/styles/lists.styl'

const ShortcutAddTile = () => {
const { t } = useI18n()
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false)
Expand Down
5 changes: 3 additions & 2 deletions src/components/AnimatedWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react'
import { isFlagshipApp } from 'cozy-device-helper'
import homeConfig from '@/config/home.json'
import { RemoveScroll } from 'react-remove-scroll'

import { isFlagshipApp } from 'cozy-device-helper'

import homeConfig from '@/config/home.json'
import App from '@/containers/App'

const RemoveScrollOnFlaghsip = ({ children }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useEffect, useState } from 'react'

import { getAvailableAppHighlightAlerts } from '@/components/AppHighlightAlert/helpers'
import { useClient } from 'cozy-client'
import log from 'cozy-logger'

import { getAvailableAppHighlightAlerts } from '@/components/AppHighlightAlert/helpers'

const AppHighlightAlertWrapper = ({ apps }) => {
const [appHighlightAlerts, setAppHighlightAlerts] = useState([])
const [isAppHighlightAlertsError, setIsAppHighlightAlertsError] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'

import flag from 'cozy-flags'
import { isFlagshipApp } from 'cozy-device-helper'
import flag from 'cozy-flags'
import { useI18n } from 'twake-i18n'

import AppHighlightAlert from '@/components/AppHighlightAlert/AppHighlightAlert'
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHighlightAlert/helpers.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getAvailableAppHighlightAlerts } from '@/components/AppHighlightAlert/helpers'
import { getBackupAppHighlightAlert } from '@/components/AppHighlightAlert/BackupAppHighlightAlert'
import { getGeolocationTrackingAppHighlightAlert } from '@/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert'
import { getAvailableAppHighlightAlerts } from '@/components/AppHighlightAlert/helpers'

jest.mock('components/AppHighlightAlert/BackupAppHighlightAlert')
jest.mock('components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert')
Expand Down
3 changes: 1 addition & 2 deletions src/components/AppTile.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react'
import PropTypes from 'prop-types'
import React from 'react'

import { models } from 'cozy-client'
import AppLinker from 'cozy-ui-plus/dist/AppLinker'
import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'

import { useI18n } from 'twake-i18n'

const { applications } = models
Expand Down
11 changes: 7 additions & 4 deletions src/components/AppTile.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import AppLike from '@/test/AppLike'
import AppTileWrapper from './AppTile'
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
import { render, waitFor, screen } from '@testing-library/react'
import React from 'react'
import { act } from 'react-dom/test-utils'
import { render, waitFor, screen } from '@testing-library/react'

import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
import I18n from 'twake-i18n'

import AppTileWrapper from './AppTile'

import enLocale from '@/locales/en.json'
import AppLike from '@/test/AppLike'

const mockAppReady = {
_id: 'mock-app-id',
Expand Down
29 changes: 15 additions & 14 deletions src/components/AppWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import memoize from 'lodash/memoize'
import React, { createContext, useEffect, useState } from 'react'
import { Provider as ReduxProvider } from 'react-redux'
import memoize from 'lodash/memoize'
import { PersistGate } from 'redux-persist/integration/react'

import flag from 'cozy-flags'
import CozyClient, {
CozyProvider,
RealTimeQueries,
WebFlagshipLink
} from 'cozy-client'
import SharingProvider from 'cozy-sharing'
import { DataProxyProvider } from 'cozy-dataproxy-lib'
import { isFlagshipApp, isFlagshipOfflineSupported } from 'cozy-device-helper'
import CozyDevtools from 'cozy-devtools'
import flag from 'cozy-flags'
import { useWebviewIntent } from 'cozy-intent'
import I18n from 'twake-i18n'
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
import { PersistGate } from 'redux-persist/integration/react'
import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'

import configureStore from '@/store/configureStore'
import { RealtimePlugin } from 'cozy-realtime'
import { isFlagshipApp, isFlagshipOfflineSupported } from 'cozy-device-helper'

import { DataProxyProvider } from 'cozy-dataproxy-lib'
import SharingProvider from 'cozy-sharing'
import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
import I18n from 'twake-i18n'

import schema from '../schema'
import { ConditionalWrapper } from './ConditionalWrapper'
import { WallPaperProvider } from '@/hooks/useWallpaperContext'
import { SectionsProvider } from './Sections/SectionsContext'

import { WallPaperProvider } from '@/hooks/useWallpaperContext'
import configureStore from '@/store/configureStore'

const dictRequire = lang => require(`@/locales/${lang}.json`)

export const AppContext = createContext()
Expand Down Expand Up @@ -111,6 +111,7 @@ const AppWrapper = ({ children }) => {

const newAppContext = setupAppContext(webviewIntent)

// eslint-disable-next-line react-hooks/set-state-in-effect
setAppContext(newAppContext)
}, [webviewIntent])

Expand Down
3 changes: 1 addition & 2 deletions src/components/AppWrapper.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line no-unused-vars
import React from 'react'

import { setupAppContext } from './AppWrapper'
import React from 'react'

const mockClient = {
registerPlugin: jest.fn(),
Expand Down
13 changes: 6 additions & 7 deletions src/components/Applications.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import React, { memo } from 'react'
import cx from 'classnames'

Check warning on line 1 in src/components/Applications.jsx

View workflow job for this annotation

GitHub Actions / Build and publish

'classnames' should be listed in the project's dependencies. Run 'npm i -S classnames' to add it
import memoize from 'lodash/memoize'
import uniqBy from 'lodash/uniqBy'
import { useQuery, useFetchHomeShortcuts, models } from 'cozy-client'
import React, { memo } from 'react'

import { useQuery, useFetchHomeShortcuts, models } from 'cozy-client'
import flag from 'cozy-flags'
import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'
import { useI18n } from 'twake-i18n'
import cx from 'classnames'

import AppHighlightAlertWrapper from '@/components/AppHighlightAlert/AppHighlightAlertWrapper'
import AppTile from '@/components/AppTile'
import LoadingPlaceholder from '@/components/LoadingPlaceholder'
import LogoutTile from '@/components/LogoutTile'
import ShortcutLink from '@/components/ShortcutLink'
import LoadingPlaceholder from '@/components/LoadingPlaceholder'
import AppHighlightAlertWrapper from '@/components/AppHighlightAlert/AppHighlightAlertWrapper'
import homeConfig from '@/config/home.json'
import { appsConn } from '@/queries'

import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'

const {
applications: {
sortApplicationsList,
Expand Down
10 changes: 6 additions & 4 deletions src/components/Applications.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react'
import { render, act } from '@testing-library/react'
import flag from 'cozy-flags'
import React from 'react'

import { createMockClient } from 'cozy-client/dist/mock'
import flag from 'cozy-flags'
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'

import AppLike from '@/test/AppLike'
import { Applications } from './Applications'
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'

import AppLike from '@/test/AppLike'

jest.mock('cozy-flags', () => {
return jest.fn().mockReturnValue(null)
Expand Down
12 changes: 6 additions & 6 deletions src/components/ApplicationsAndServices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import React from 'react'
import flag from 'cozy-flags'
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'

import LogoutTile from '@/components/LogoutTile'
import ShortcutLink from '@/components/ShortcutLink'
import EntrypointLink from '@/components/EntrypointLink'

import AddTile from './AddTile'
import { useApps } from './Applications'
import { useServices } from './Services'
import AssistantTile from './AssistantTile'
import AddTile from './AddTile'
import { useServices } from './Services'

import EntrypointLink from '@/components/EntrypointLink'
import LogoutTile from '@/components/LogoutTile'
import ShortcutLink from '@/components/ShortcutLink'

export const ApplicationsAndServices = () => {
const showLogout = !!flag('home.mainlist.show-logout')
Expand Down
3 changes: 1 addition & 2 deletions src/components/Assistant/AssistantDesktopWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'

import CozyTheme, { useCozyTheme } from 'cozy-ui-plus/dist/providers/CozyTheme'

import { AssistantDesktop } from 'cozy-search'
import CozyTheme, { useCozyTheme } from 'cozy-ui-plus/dist/providers/CozyTheme'

import styles from './assistant.styl'

Expand Down
4 changes: 1 addition & 3 deletions src/components/Assistant/AssistantMobileWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import cx from 'classnames'

Check warning on line 1 in src/components/Assistant/AssistantMobileWrapper.jsx

View workflow job for this annotation

GitHub Actions / Build and publish

'classnames' should be listed in the project's dependencies. Run 'npm i -S classnames' to add it
import React from 'react'

import { getFlagshipMetadata } from 'cozy-device-helper'

import CozyTheme, { useCozyTheme } from 'cozy-ui-plus/dist/providers/CozyTheme'

import { AssistantMobile } from 'cozy-search'
import CozyTheme, { useCozyTheme } from 'cozy-ui-plus/dist/providers/CozyTheme'

import styles from './assistant.styl'

Expand Down
2 changes: 1 addition & 1 deletion src/components/AssistantTile.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'

import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'
import { AssistantLink } from 'cozy-search'
import Icon from 'cozy-ui/transpiled/react/Icon'
import AssistantIcon from 'cozy-ui/transpiled/react/Icons/Assistant'
import SquareAppIcon from 'cozy-ui-plus/dist/SquareAppIcon'

/**
* AssistantTile component.
Expand Down
14 changes: 6 additions & 8 deletions src/components/BackupNotification/BackupNotification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ import React, { useState } from 'react'
import { useClient, generateWebLink } from 'cozy-client'
import { isFlagshipApp } from 'cozy-device-helper'
import { useWebviewIntent } from 'cozy-intent'

import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
import AppLinker from 'cozy-ui-plus/dist/AppLinker'
import Typography from 'cozy-ui/transpiled/react/Typography'
import CircularProgress from 'cozy-ui/transpiled/react/CircularProgress'
import Icon from 'cozy-ui/transpiled/react/Icon'
import CrossCircleOutlineIcon from 'cozy-ui/transpiled/react/Icons/CrossCircleOutline'
import PhoneUploadIcon from 'cozy-ui/transpiled/react/Icons/PhoneUpload'
import ListItem from 'cozy-ui/transpiled/react/ListItem'
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
import CircularProgress from 'cozy-ui/transpiled/react/CircularProgress'
import PhoneUploadIcon from 'cozy-ui/transpiled/react/Icons/PhoneUpload'
import CrossCircleOutlineIcon from 'cozy-ui/transpiled/react/Icons/CrossCircleOutline'
import Typography from 'cozy-ui/transpiled/react/Typography'
import AppLinker from 'cozy-ui-plus/dist/AppLinker'
import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'
import { useI18n } from 'twake-i18n'

import ConfirmStopBackupDialog from '@/components/BackupNotification/ConfirmStopBackupDialog'
import { useBackupData } from '@/components/BackupNotification/useBackupData'

import styles from '@/styles/backupNotification.styl'

const BackupNotification = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'

import Typography from 'cozy-ui/transpiled/react/Typography'
import Button from 'cozy-ui/transpiled/react/Buttons'
import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import Typography from 'cozy-ui/transpiled/react/Typography'
import { useI18n } from 'twake-i18n'

const ConfirmStopBackupDialog = ({ onClose, onStop }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React, { useState } from 'react'

import { useSettings } from 'cozy-client'
import { isFlagshipApp } from 'cozy-device-helper'
import { useWebviewIntent } from 'cozy-intent'
import { useI18n } from 'twake-i18n'
import { makeStyles } from 'cozy-ui/transpiled/react/styles'
import Snackbar from 'cozy-ui/transpiled/react/Snackbar'
import Alert from 'cozy-ui/transpiled/react/Alert'
import Button from 'cozy-ui/transpiled/react/Buttons'
import Icon from 'cozy-ui/transpiled/react/Icon'
import LightbulbIcon from 'cozy-ui/transpiled/react/Icons/Lightbulb'
import Snackbar from 'cozy-ui/transpiled/react/Snackbar'
import { makeStyles } from 'cozy-ui/transpiled/react/styles'
import { useI18n } from 'twake-i18n'

import useIncrementDefaultRedirectionViewCount from './useIncrementDefaultRedirectionViewCount'
import {
HOME_DEFAULT_REDIRECTION,
useShouldShowDefaultRedirectionSnackbar
} from './useShouldShowDefaultRedirectionSnackbar'
import useIncrementDefaultRedirectionViewCount from './useIncrementDefaultRedirectionViewCount'
import { isFlagshipApp } from 'cozy-device-helper'

const useStyles = makeStyles(theme => ({
snackbar: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react'
import { render, fireEvent } from '@testing-library/react'
import React from 'react'

import { useSettings } from 'cozy-client'

import CozyTheme from 'cozy-ui-plus/dist/providers/CozyTheme'

import AppLike from '@/test/AppLike'
import DefaultRedirectionSnackbar from './DefaultRedirectionSnackbar'
import { useShouldShowDefaultRedirectionSnackbar } from './useShouldShowDefaultRedirectionSnackbar'

import AppLike from '@/test/AppLike'

jest.mock('cozy-client', () => ({
...jest.requireActual('cozy-client'),
useQuery: jest.fn(),
Expand Down
Loading
Loading