Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/**
96 changes: 92 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,103 @@
{
"extends": [
"cozy-app/react"
],
"extends": ["cozy-app/react"],
"rules": {
"no-console": 1
"no-console": 1,
"no-param-reassign": "error",
"react-hooks/exhaustive-deps": "error",
"import/order": [
"warn",
{
"alphabetize": { "order": "asc" },
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling", "index"]
],
"pathGroups": [
{
"pattern": "{cozy-*,cozy-*/**}",
"group": "internal",
"position": "after"
},
{
"pattern": "**/*.styl",
"group": "index",
"position": "after"
},
{
"pattern": "test/**/*",
"group": "index"
},
{
"pattern": "lib/**/*",
"group": "index"
},
{
"pattern": "hooks/**/*",
"group": "index"
},
{
"pattern": "components/**/*",
"group": "index"
},
{
"pattern": "modules/**/*",
"group": "index"
},
{
"pattern": "assets/**/*",
"group": "index"
},
{
"pattern": "models/**/*",
"group": "index"
},
{
"pattern": "config/**/*",
"group": "index"
},
{
"pattern": "constants/**/*",
"group": "index"
},
{
"pattern": "config/**/*",
"group": "index"
},
{
"pattern": "locales/**/*",
"group": "index"
},
{
"pattern": "queries",
"group": "index"
}
],
"distinctGroup": true,
"pathGroupsExcludedImportTypes": ["{cozy-*,cozy-*/**}"],
"newlines-between": "always",
"warnOnUnassignedImports": true
}
]
},
"globals": {
"fixture": false
},
"settings": {
"react": {
"version": "detect"
}
},
"overrides": [
{
"files": ["*.spec.js[x]"],
"rules": {
"react/display-name": "off"
}
}

],
"parserOptions": {
"project": "tsconfig.json"
}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
20
5 changes: 5 additions & 0 deletions manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
"description": "Required by the cozy-bar to display the icons of the apps",
"type": "io.cozy.apps",
"verbs": ["GET", "POST", "PUT"]
},
"contacts": {
"description": "Required by the cozy-bar to display contacts",
"type": "io.cozy.contacts",
"verbs": ["GET"]
},
"konnectors": {
"description": "Required to get the list of konnectors",
Expand Down
29 changes: 23 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
},
"homepage": "https://github.com/cozy/cozy-settings#readme",
"devDependencies": {
"@babel/eslint-parser": "7.23.3",
"@babel/plugin-syntax-import-meta": "7.10.4",
"@babel/plugin-syntax-top-level-await": "7.14.5",
"@babel/polyfill": "^7.10.4",
"@rsbuild/core": "^1.1.6",
"@swc/core": "^1.10.7",
Expand All @@ -36,27 +39,40 @@
"@testing-library/user-event": "14.5.1",
"@types/react-input-mask": "3.0.2",
"@types/ua-parser-js": "0.7.37",
"babel-preset-cozy-app": "2.0.3",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"babel-preset-cozy-app": "2.1.0",
"browser-resolve": "2.0.0",
"bundlemon": "3.1.0",
"cozy-app-publish": "0.34.0",
"eslint-config-cozy-app": "5.1.0",
"eslint": "8.56.0",
"eslint-config-cozy-app": "6.1.0",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jest": "27.6.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"jest": "28.1.3",
"jest-environment-jsdom": "28.1.3",
"npm-run-all": "4.1.5",
"prettier": "2.8.8",
"react-hot-loader": "4.13.0",
"react-test-renderer": "18.2.0",
"rsbuild-config-cozy-app": "^0.3.0",
"rsbuild-config-cozy-app": "^0.5.0",
"swc_mut_cjs_exports": "^8.0.1",
"typescript": "5.5.2",
"typescript-plugin-css-modules": "3.4.0"
},
"dependencies": {
"@material-ui/lab": "4.0.0-alpha.61",
"@sentry/integrations": "7.118.0",
"@sentry/react": "7.118.0",
"classnames": "2.3.1",
"cozy-bar": "^16.1.0",
"cozy-client": "^57.5.0",
"cozy-bar": "^19.2.0",
"cozy-client": "^57.6.0",
"cozy-dataproxy-lib": "^4.1.0",
"cozy-device-helper": "^3.8.0",
"cozy-devtools": "^1.3.0",
"cozy-doctypes": "^1.97.2",
Expand All @@ -65,10 +81,11 @@
"cozy-intent": "^2.30.0",
"cozy-interapp": "^0.16.0",
"cozy-keys-lib": "^6.3.0",
"cozy-pouch-link": "^57.6.1",
"cozy-realtime": "^5.6.4",
"cozy-sharing": "^25.0.0",
"cozy-stack-client": "^57.2.0",
"cozy-ui": "^121.1.1",
"cozy-ui": "^122.1.1",
"identity-obj-proxy": "^3.0.0",
"piwik-react-router": "0.12.1",
"prop-types": "15.8.1",
Expand Down
1 change: 0 additions & 1 deletion src/assets/icons/icon-device-browser.svg

This file was deleted.

7 changes: 0 additions & 7 deletions src/assets/icons/icon-device-laptop.svg

This file was deleted.

8 changes: 0 additions & 8 deletions src/assets/icons/icon-device-phone.svg

This file was deleted.

10 changes: 10 additions & 0 deletions src/components/AppProviders.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import React from 'react'
import { HashRouter } from 'react-router-dom'
import { Provider, connect } from 'react-redux'
import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
import {
FILES_DOCTYPE,
CONTACTS_DOCTYPE,
APPS_DOCTYPE
} from '@/doctypes'
import { DataProxyProvider } from 'cozy-dataproxy-lib'

import I18n from 'cozy-ui/transpiled/react/providers/I18n'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
Expand Down Expand Up @@ -44,11 +50,15 @@ const AppProviders = ({ client, store, children }) => {
<BreakpointsProvider>
<AlertProvider>
<CozyTheme className="u-w-100">
<DataProxyProvider options={{
doctypes: [FILES_DOCTYPE, CONTACTS_DOCTYPE, APPS_DOCTYPE]
}}>
<BarProvider>
<PremiumProvider>
<HashRouter>{children}</HashRouter>
</PremiumProvider>
</BarProvider>
</DataProxyProvider>
</CozyTheme>
</AlertProvider>
</BreakpointsProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ Object {
class="MuiDialogActions-root cozyDialogActions"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-outlined customColor-primary MuiButton-outlinedPrimary MuiButton-disableElevation"
class="MuiButtonBase-root MuiButton-root MuiButton-outlined customColor-primary customSize-default MuiButton-outlinedPrimary MuiButton-disableElevation"
tabindex="0"
type="button"
>
Expand All @@ -1376,7 +1376,7 @@ Object {
/>
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained customColor-primary MuiButton-containedPrimary MuiButton-disableElevation"
class="MuiButtonBase-root MuiButton-root MuiButton-contained customColor-primary customSize-default MuiButton-containedPrimary MuiButton-disableElevation"
tabindex="0"
type="button"
>
Expand Down
13 changes: 7 additions & 6 deletions src/components/Devices/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import semver from 'semver'
import flag from 'cozy-flags'

import { COZY_DESKTOP_SOFTWARE_ID } from '@/lib/deviceConfigurationHelper'
import mobileIcon from '@/assets/icons/icon-device-phone.svg'
import browserIcon from '@/assets/icons/icon-device-browser.svg'
import laptopIcon from '@/assets/icons/icon-device-laptop.svg'

import PhoneIcon from 'cozy-ui/transpiled/react/Icons/Phone'
import LaptopIcon from 'cozy-ui/transpiled/react/Icons/Laptop'
import DeviceBrowserIcon from 'cozy-ui/transpiled/react/Icons/DeviceBrowser'

const deviceKindToIcon = {
mobile: mobileIcon,
browser: browserIcon
mobile: PhoneIcon,
browser: DeviceBrowserIcon
}

export const getDeviceIcon = device => {
return deviceKindToIcon[device.client_kind] || laptopIcon
return deviceKindToIcon[device.client_kind] || LaptopIcon
}

const isCozyDesktopApp = device =>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GlobeIcon from 'cozy-ui/transpiled/react/Icons/Globe'
import PaletteIcon from 'cozy-ui/transpiled/react/Icons/Palette'
import GraphCircle from 'cozy-ui/transpiled/react/Icons/GraphCircle'
import HandIcon from 'cozy-ui/transpiled/react/Icons/Hand'
import HelpIcon from 'cozy-ui/transpiled/react/Icons/Help'
import HelpOutlinedIcon from 'cozy-ui/transpiled/react/Icons/HelpOutlined'
import LockScreen from 'cozy-ui/transpiled/react/Icons/LockScreen'
import Logout from 'cozy-ui/transpiled/react/Icons/Logout'
import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People'
Expand Down Expand Up @@ -108,7 +108,7 @@ export const Sidebar = (): JSX.Element => {
primary={t('Nav.primary_faq')}
href={routes.external_faq}
target="_blank"
icon={HelpIcon}
icon={HelpOutlinedIcon}
/>
<MenuItemNavLink
to={routes.support}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Subscription/SubscriptionMenuItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'

import flag from 'cozy-flags'
import CozyCircle from 'cozy-ui/transpiled/react/Icons/CozyCircle'
import CloudIcon from 'cozy-ui/transpiled/react/Icons/Cloud'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import { MenuItemAnchor } from '@/components/menu/MenuItemAnchor'
Expand All @@ -21,7 +21,7 @@ const SubscriptionMenuItem = () => {
<MenuItemNavLink
to={routes.subscription}
primary={t('Nav.primary_plan')}
icon={CozyCircle}
icon={CloudIcon}
/>
)
}
Expand All @@ -32,7 +32,7 @@ const SubscriptionMenuItem = () => {
primary={t('Nav.primary_plan')}
href={premiumLink}
target="_blank"
icon={CozyCircle}
icon={CloudIcon}
/>
)
}
Expand Down
2 changes: 2 additions & 0 deletions src/doctypes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export const KONNECTORS_DOCTYPE = 'io.cozy.konnectors'
export const REMOTE_REQUEST_DOCTYPES = 'io.cozy.remote.requests'
export const SETTINGS_DOCTYPE = 'io.cozy.settings'
export const OAUTH_CLIENTS_DOCTYPE = 'io.cozy.oauth.clients'
export const FILES_DOCTYPE = 'io.cozy.files'
export const CONTACTS_DOCTYPE = 'io.cozy.contacts'
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"connected_devices": "Connected devices",
"email_notifications": "E-mail notifications",
"header_data": "Security and data",
"header_flagship": "Cozy App",
"header_flagship": "Twake App",
"header_general": "Overview",
"header_other": "More",
"permissions": "Permissions",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"connected_devices": "Appareils connectés",
"email_notifications": "Notifications par e-mail",
"header_data": "Sécurité et accès aux données",
"header_flagship": "Application Cozy",
"header_flagship": "Application Twake",
"header_general": "Général",
"header_other": "Autres",
"permissions": "Permissions",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/nl_NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"connected_devices": "Verbonden diensten",
"email_notifications": "E-mailmeldingen",
"header_data": "Beveiliging en gegevens",
"header_flagship": "Cozy-app",
"header_flagship": "Twake App",
"header_general": "Overzicht",
"header_other": "Meer",
"permissions": "Bevoegdheden",
Expand Down
4 changes: 4 additions & 0 deletions test/jestLib/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jest.mock('../../src/actions/domUtils.js', () => ({
getStackToken: () => 'http://test.mycozy.cloud'
}))

jest.mock('cozy-dataproxy-lib', () => ({
DataProxyProvider: ({ children }) => children
}))

// polyfill for requestAnimationFrame
/* istanbul ignore next */
global.requestAnimationFrame = cb => {
Expand Down
Loading