Skip to content

Commit 5843930

Browse files
authored
Merge pull request #281 from AppQuality/develop
Pull Request triggered from POEditor
2 parents 6188606 + a721d91 commit 5843930

File tree

112 files changed

+7438
-3270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+7438
-3270
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = {
5252
unnamedComponents: 'arrow-function',
5353
},
5454
],
55+
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
5556
'react/prop-types': 'off', // Since we do not use prop-types
5657
'react/require-default-props': 'off', // Since we do not use prop-types
5758
'react/jsx-props-no-spreading': 'off', // This is an anti-pattern, to be removed.
@@ -69,4 +70,12 @@ module.exports = {
6970
fetch: true,
7071
HeadersInit: true,
7172
},
73+
overrides: [
74+
{
75+
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
76+
rules: {
77+
'no-undef': 'off',
78+
},
79+
},
80+
],
7281
};

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ npm-debug.log*
2323
yarn-debug.log*
2424
yarn-error.log*
2525

26-
.eslintcache
26+
.eslintcache
27+
28+
generate-devel-token.json
29+
30+
.vscode

i18next-parser.config.js

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
module.exports = {
2+
contextSeparator: '_',
3+
// Key separator used in your translation keys
4+
5+
createOldCatalogs: false,
6+
// Save the \_old files
7+
8+
defaultNamespace: 'translation',
9+
// Default namespace used in your i18next config
10+
11+
defaultValue: '',
12+
// Default value to give to keys with no value
13+
// You may also specify a function accepting the locale, namespace, key, and value as arguments
14+
15+
indentation: 2,
16+
// Indentation of the catalog files
17+
18+
keepRemoved: false,
19+
// Keep keys from the catalog that are no longer in code
20+
21+
keySeparator: ':::',
22+
// Key separator used in your translation keys
23+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
24+
25+
// see below for more details
26+
lexers: {
27+
hbs: ['HandlebarsLexer'],
28+
handlebars: ['HandlebarsLexer'],
29+
30+
htm: ['HTMLLexer'],
31+
html: ['HTMLLexer'],
32+
33+
mjs: ['JavascriptLexer'],
34+
js: ['JavascriptLexer'], // if you're writing jsx inside .js files, change this to JsxLexer
35+
ts: ['JavascriptLexer'],
36+
jsx: ['JsxLexer'],
37+
tsx: ['JsxLexer'],
38+
39+
default: ['JavascriptLexer'],
40+
},
41+
42+
lineEnding: 'auto',
43+
// Control the line ending. See options at https://github.com/ryanve/eol
44+
45+
locales: ['en', 'it'],
46+
// An array of the locales in your applications
47+
48+
namespaceSeparator: false,
49+
// Namespace separator used in your translation keys
50+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
51+
52+
output: 'src/locales/$LOCALE/$NAMESPACE.json',
53+
// Supports $LOCALE and $NAMESPACE injection
54+
// Supports JSON (.json) and YAML (.yml) file formats
55+
// Where to write the locale files relative to process.cwd()
56+
57+
pluralSeparator: '_',
58+
// Plural separator used in your translation keys
59+
// If you want to use plain english keys, separators such as `_` might conflict. You might want to set `pluralSeparator` to a different string that does not occur in your keys.
60+
61+
input: undefined,
62+
// An array of globs that describe where to look for source files
63+
// relative to the location of the configuration file
64+
65+
sort: true,
66+
// Whether or not to sort the catalog. Can also be a [compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#parameters)
67+
68+
verbose: false,
69+
// Display info about the parsing including some stats
70+
71+
failOnWarnings: false,
72+
// Exit with an exit code of 1 on warnings
73+
74+
failOnUpdate: false,
75+
// Exit with an exit code of 1 when translations are updated (for CI purpose)
76+
77+
customValueTemplate: null,
78+
// If you wish to customize the value output the value as an object, you can set your own format.
79+
// ${defaultValue} is the default value you set in your translation function.
80+
// Any other custom property will be automatically extracted.
81+
//
82+
// Example:
83+
// {
84+
// message: "${defaultValue}",
85+
// description: "${maxLength}", // t('my-key', {maxLength: 150})
86+
// }
87+
88+
resetDefaultValueLocale: null,
89+
// The locale to compare with default values to determine whether a default value has been changed.
90+
// If this is set and a default value differs from a translation in the specified locale, all entries
91+
// for that key across locales are reset to the default value, and existing translations are moved to
92+
// the `_old` file.
93+
94+
i18nextOptions: null,
95+
// If you wish to customize options in internally used i18next instance, you can define an object with any
96+
// configuration property supported by i18next (https://www.i18next.com/overview/configuration-options).
97+
// { compatibilityJSON: 'v3' } can be used to generate v3 compatible plurals.
98+
99+
yamlOptions: null,
100+
// If you wish to customize options for yaml output, you can define an object here.
101+
// Configuration options are here (https://github.com/nodeca/js-yaml#dump-object---options-).
102+
// Example:
103+
// {
104+
// lineWidth: -1,
105+
// }
106+
};

i18next-scanner.config.js

Lines changed: 0 additions & 159 deletions
This file was deleted.

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.4.0",
44
"private": true,
55
"dependencies": {
6-
"@appquality/unguess-design-system": "2.12.17",
6+
"@appquality/unguess-design-system": "2.12.37",
77
"@headwayapp/react-widget": "^0.0.4",
88
"@reduxjs/toolkit": "^1.8.0",
99
"@rtk-query/codegen-openapi": "^1.0.0-alpha.1",
@@ -15,6 +15,7 @@
1515
"async": "^3.2.3",
1616
"date-fns": "^2.28.0",
1717
"formik": "^2.2.9",
18+
"history": "^5.3.0",
1819
"i18n-iso-countries": "^7.3.0",
1920
"i18next": "^21.6.14",
2021
"i18next-browser-languagedetector": "^6.1.3",
@@ -29,6 +30,7 @@
2930
"react-router-dom": "^6.2.2",
3031
"react-scripts": "4.0.3",
3132
"react-scroll": "^1.8.7",
33+
"react-transition-group": "^4.4.5",
3234
"styled-components": "^5.3.3",
3335
"typescript": "^4.6.2",
3436
"universal-cookie": "^4.0.4",
@@ -41,7 +43,7 @@
4143
"test": "react-scripts test",
4244
"recover": "yarn install --check-files",
4345
"eject": "react-scripts eject",
44-
"translate": "i18next-scanner",
46+
"translate": "i18next 'src/**/*.{js,jsx,ts,tsx}' ",
4547
"generate-schema": ". ./.env.local; npx openapi-typescript $REACT_APP_API_URL/reference/ --output src/common/schema.ts ",
4648
"generate-api": ". ./.env.local; API_URL=$REACT_APP_API_URL/reference/ npx @rtk-query/codegen-openapi src/features/api/config.ts",
4749
"generate-strapi": "npx @rtk-query/codegen-openapi src/features/backoffice/config.ts",
@@ -96,6 +98,7 @@
9698
"@types/react-gtm-module": "^2.0.1",
9799
"@types/react-helmet": "^6.1.5",
98100
"@types/react-scroll": "^1.8.3",
101+
"@types/react-transition-group": "^4.4.5",
99102
"@types/styled-components": "^5.1.24",
100103
"@typescript-eslint/eslint-plugin": "^5.26.0",
101104
"@typescript-eslint/parser": "^5.26.0",
@@ -110,10 +113,10 @@
110113
"eslint-plugin-react-hooks": "^4.5.0",
111114
"eslint-plugin-security": "^1.5.0",
112115
"husky": ">=6",
113-
"i18next-scanner": "^3.1.0",
114-
"i18next-scanner-typescript": "^1.0.6",
116+
"i18next-parser": "^7.0.3",
115117
"lint-staged": ">=10",
116118
"npm-run-all": "^4.1.5",
119+
"openapi-typescript": "^5.1.0",
117120
"prettier": "^2.6.2",
118121
"ts-node": "^10.7.0"
119122
},
@@ -131,4 +134,4 @@
131134
"lint-staged": {
132135
"*.{tsx,ts,js,css,md}": "prettier --write"
133136
}
134-
}
137+
}

src/app/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import '../i18n';
2-
import { GlobalStyle, theme } from '@appquality/unguess-design-system';
2+
import { GlobalStyle } from '@appquality/unguess-design-system';
33
import { ThemeProvider } from '@zendeskgarden/react-theming';
44
import { BrowserRouter } from 'react-router-dom';
55
import { useTranslation } from 'react-i18next';
66
import Helmet from 'react-helmet';
77
import Pages from 'src/common/Pages';
8+
import { theme } from 'src/app/theme';
89
import { Provider } from 'react-redux';
910
import { store } from './store';
1011

src/app/theme.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {
2+
theme as baseTheme,
3+
CHARTS_COLOR_PALETTE,
4+
} from '@appquality/unguess-design-system';
5+
6+
export const SEVERITY_COLORS: Record<Severities, string> = {
7+
critical: CHARTS_COLOR_PALETTE.mattone,
8+
high: CHARTS_COLOR_PALETTE.gubbioLight,
9+
medium: CHARTS_COLOR_PALETTE.blueRoyal,
10+
low: CHARTS_COLOR_PALETTE.darkPine,
11+
};
12+
13+
const theme = {
14+
...baseTheme,
15+
colors: {
16+
...baseTheme.colors,
17+
bySeverity: SEVERITY_COLORS,
18+
darkPine: CHARTS_COLOR_PALETTE.darkPine,
19+
},
20+
};
21+
22+
export { theme };

0 commit comments

Comments
 (0)