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
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
15 changes: 0 additions & 15 deletions .github/pull_request_template.md

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
20
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# General code owners
* @JF-Cozy @zatteo @Ldoppea
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/actions/email.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { cozyFetch } from '@/actions'

import { STACK_DOMAIN } from '@/actions'

export const SEND_EMAIL = 'SEND_EMAIL'
Expand Down
3 changes: 2 additions & 1 deletion src/actions/email.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import createStore from '../store'
import { createMockClient } from 'cozy-client/dist/mock'

import { sendMessageToSupport } from './email'
import { cozyFetch } from './index'
import createStore from '../store'

jest.mock('./index', () => {
const actions = jest.requireActual('./index')
Expand Down
1 change: 0 additions & 1 deletion src/actions/import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { cozyFetch } from '@/actions'

import { STACK_DOMAIN } from '@/actions'

export const PRECHECK_IMPORT = 'PRECHECK_IMPORT'
Expand Down
3 changes: 2 additions & 1 deletion src/actions/passphrase.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { cozyFetch } from '@/actions'
import { WebVaultClient } from 'cozy-keys-lib'

import { cozyFetch } from '@/actions'

export const UPDATE_PASSPHRASE = 'UPDATE_PASSPHRASE'
export const UPDATE_PASSPHRASE_SUCCESS = 'UPDATE_PASSPHRASE_SUCCESS'
export const UPDATE_PASSPHRASE_FAILURE = 'UPDATE_PASSPHRASE_FAILURE'
Expand Down
5 changes: 2 additions & 3 deletions src/actions/services.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable promise/always-return */
import Intents from 'cozy-interapp'
import { Q } from 'cozy-client'

import CLAUDY_ACTIONS from '@/config/claudyActions'
import Intents from 'cozy-interapp'

import { cozyFetch, fetchDevices } from '@/actions'
import CLAUDY_ACTIONS from '@/config/claudyActions'

export const FETCH_CLAUDY_INFOS = 'FETCH_CLAUDY_INFOS'
export const FETCH_CLAUDY_INFOS_SUCCESS = 'FETCH_CLAUDY_INFOS_SUCCESS'
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.

8 changes: 4 additions & 4 deletions src/components/2FA/Activate2FA.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useState, useMemo, useCallback } from 'react'

import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import Button from 'cozy-ui/transpiled/react/Buttons'
import { useClient } from 'cozy-client'
import Button from 'cozy-ui/transpiled/react/Buttons'
import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import ActivationConfirmation from '@/components/2FA/ActivationConfirmation'
import TwoFactorCode from '@/components/2FA/TwoFactorCode'
import ActivationConfirmed from '@/components/2FA/ActivationConfirmed'
import CreatePassword from '@/components/2FA/CreatePassword'
import TwoFactorCode from '@/components/2FA/TwoFactorCode'
import { useHasPassword } from '@/hooks/useHasPassword'

/**
Expand Down
7 changes: 4 additions & 3 deletions src/components/2FA/ActivationConfirmation.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import Typography from 'cozy-ui/transpiled/react/Typography'
import { Media, Img, Bd } from 'cozy-ui/transpiled/react/deprecated/Media'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import ReactMarkdownWrapper from '@/components/ReactMarkdownWrapper'
import twoFaModalBanner from '@/assets/images/double_authent_prez_banner.svg'
import twoFaModalProtect from '@/assets/images/protect_data_point.svg'
import twoFaModalSecu from '@/assets/images/niv_secu_point.svg'
import twoFaModalProtect from '@/assets/images/protect_data_point.svg'
import ReactMarkdownWrapper from '@/components/ReactMarkdownWrapper'

export const ActivationConfirmation = ({ error }) => {
const { t } = useI18n()
Expand Down
2 changes: 1 addition & 1 deletion src/components/2FA/ActivationConfirmed.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'

import { useClient, useQuery } from 'cozy-client'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import Buttons from 'cozy-ui/transpiled/react/Buttons'
import Typography from 'cozy-ui/transpiled/react/Typography'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import { buildSettingsInstanceQuery } from '@/lib/queries'

Expand Down
10 changes: 5 additions & 5 deletions src/components/2FA/CreatePassword.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useMemo, useState } from 'react'

import { useClient } from 'cozy-client'
import Typography from 'cozy-ui/transpiled/react/Typography'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import PasswordInput from 'cozy-ui/transpiled/react/Labs/PasswordInput'
import Stack from 'cozy-ui/transpiled/react/Stack'
import Button from 'cozy-ui/transpiled/react/Buttons'
import FormTextHelper from 'cozy-ui/transpiled/react/FormHelperText'
import PasswordInput from 'cozy-ui/transpiled/react/Labs/PasswordInput'
import Stack from 'cozy-ui/transpiled/react/Stack'
import Typography from 'cozy-ui/transpiled/react/Typography'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import passwordHelper from '@/lib/passwordHelper'
import CreatePasswordHint from '@/components/2FA/CreatePasswordHint'
import { forceSetPassphrase } from '@/components/2FA/helpers'
import passwordHelper from '@/lib/passwordHelper'

const initialData = {
passphrase: '',
Expand Down
4 changes: 2 additions & 2 deletions src/components/2FA/CreatePasswordHint.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState } from 'react'

import Button from 'cozy-ui/transpiled/react/Buttons'
import Stack from 'cozy-ui/transpiled/react/Stack'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import Icon from 'cozy-ui/transpiled/react/Icon'
import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom'
import RightIcon from 'cozy-ui/transpiled/react/Icons/Right'
import Stack from 'cozy-ui/transpiled/react/Stack'
import TextField from 'cozy-ui/transpiled/react/TextField'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

const CreatePasswordHint = ({ value, onChange, sameAsPassword }) => {
const { t } = useI18n()
Expand Down
5 changes: 3 additions & 2 deletions src/components/2FA/Desactivate2FA.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import { useClient } from 'cozy-client'
import Buttons from 'cozy-ui/transpiled/react/Buttons'
import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import Typography from 'cozy-ui/transpiled/react/Typography'
import { useClient } from 'cozy-client'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

export const Desactivate2FA = ({ closeModal, onDesactivation }) => {
const { t } = useI18n()
Expand Down
5 changes: 3 additions & 2 deletions src/components/2FA/Passphrase2FA.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { Component } from 'react'
import { translate } from 'cozy-ui/transpiled/react/providers/I18n'

import Buttons from 'cozy-ui/transpiled/react/Buttons'
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import Input from 'cozy-ui/transpiled/react/Input'
import Typography from 'cozy-ui/transpiled/react/Typography'
import Buttons from 'cozy-ui/transpiled/react/Buttons'
import { translate } from 'cozy-ui/transpiled/react/providers/I18n'

import ReactMarkdownWrapper from '@/components/ReactMarkdownWrapper'
import settingsConfig from '@/config'
Expand Down
2 changes: 1 addition & 1 deletion src/components/2FA/TwoFactorCode.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from 'react'

import { useClient, useQuery } from 'cozy-client'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import Button from 'cozy-ui/transpiled/react/Buttons'
import TextField from 'cozy-ui/transpiled/react/TextField'
import Typography from 'cozy-ui/transpiled/react/Typography'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import ReactMarkdownWrapper from '@/components/ReactMarkdownWrapper'
import { buildSettingsInstanceQuery } from '@/lib/queries'
Expand Down
Loading