Skip to content

Commit 29779b9

Browse files
committed
Merge branch 'main' into custom-input-v2
2 parents a990872 + 9d5641f commit 29779b9

File tree

68 files changed

+2465
-721
lines changed

Some content is hidden

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

68 files changed

+2465
-721
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ ANNOUNCEMENT_BANNER_MSG=
3838
LOGIN_PAGE_IMAGE=
3939
LOGIN_PAGE_IMAGE_BG=
4040
HIDE_DEFAULT_CLUSTER=false
41+
GLOBAL_API_TIMEOUT=60000
42+
TRIGGER_API_TIMEOUT=60000

.eslintignore

Lines changed: 751 additions & 0 deletions
Large diffs are not rendered by default.

.eslintrc.js

Lines changed: 89 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,115 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser',
3-
plugins: ['@typescript-eslint'],
3+
plugins: ['@typescript-eslint', 'react', 'prettier'],
44
env: {
55
commonjs: true,
66
browser: true,
7-
es6: true,
7+
// ESLint 6 supports till ES2020 only
8+
es2020: true,
89
},
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:react/recommended',
13+
'plugin:react/jsx-runtime',
14+
'plugin:@typescript-eslint/recommended',
15+
'plugin:@typescript-eslint/eslint-recommended',
16+
'airbnb',
17+
'airbnb/hooks',
18+
'plugin:prettier/recommended',
19+
],
920
parserOptions: {
10-
ecmaVersion: 2018,
21+
ecmaVersion: 2020,
1122
sourceType: 'module',
1223
ecmaFeatures: {
1324
jsx: true,
1425
},
1526
project: ['./tsconfig.json'],
1627
},
1728
rules: {
29+
'no-console': 'warn',
1830
'no-var': 'error',
1931
'no-duplicate-imports': 'error',
32+
curly: ['error', 'all'],
33+
'keyword-spacing': 'error',
34+
'prettier/prettier': ['error'],
35+
'linebreak-style': ['error', 'unix'],
36+
'no-shadow': 'off',
37+
'@typescript-eslint/no-shadow': 'warn',
2038
'@typescript-eslint/explicit-function-return-type': 'off',
21-
'@typescript-eslint/no-explicit-any': 'off',
22-
'@typescript-eslint/no-use-before-define': 'off',
2339
'@typescript-eslint/explicit-member-accessibility': 'off',
24-
curly: [2, 'all'],
25-
'keyword-spacing': 'error',
26-
'prettier/prettier': ['error', { semi: false }],
40+
// Since we are using typescript, we can disable the no-unused-vars rule for enum,etc
41+
'no-unused-vars': 'off',
42+
'@typescript-eslint/no-unused-vars': 'error',
43+
'react/jsx-filename-extension': [
44+
'error',
45+
{
46+
extensions: ['tsx'],
47+
},
48+
],
49+
'react/jsx-props-no-spreading': 'off',
50+
'react/prefer-stateless-function': 'off',
51+
'jsx-a11y/click-events-have-key-events': 'off',
52+
'jsx-a11y/no-static-element-interactions': 'off',
53+
'jsx-a11y/no-noninteractive-element-interactions': 'off',
54+
'no-underscore-dangle': 'off',
55+
'import/no-extraneous-dependencies': [
56+
'warn',
57+
{
58+
devDependencies: true,
59+
},
60+
],
61+
'no-plusplus': [
62+
'error',
63+
{
64+
allowForLoopAfterthoughts: true,
65+
},
66+
],
67+
// Since we dont use prop-types, we can disable this rule
68+
'react/require-default-props': 'off',
69+
'react-hooks/exhaustive-deps': 'off',
70+
'react/function-component-definition': [
71+
'warn',
72+
{
73+
namedComponents: 'arrow-function',
74+
unnamedComponents: 'arrow-function',
75+
},
76+
],
77+
// FIXME: Turn this OFF once react-scripts is upgraded or removed
78+
'react/jsx-uses-react': 'warn',
79+
'react/react-in-jsx-scope': 'warn',
80+
// additional rules:
81+
'@typescript-eslint/no-floating-promises': 'error',
82+
'import/extensions': [
83+
'warn',
84+
'ignorePackages',
85+
{
86+
js: 'never',
87+
jsx: 'never',
88+
ts: 'never',
89+
tsx: 'never',
90+
},
91+
],
92+
// Turning off as ESLint 6.x doesn't support optional chaining.
93+
// FIXME: Remove once ESLint is upgraded to latest version
94+
'dot-notation': 'off',
2795
},
28-
extends: [
29-
'eslint:recommended',
30-
'plugin:@typescript-eslint/eslint-recommended',
31-
'plugin:@typescript-eslint/recommended',
32-
'prettier/@typescript-eslint',
33-
'plugin:prettier/recommended',
34-
'plugin:react/recommended',
96+
overrides: [
97+
{
98+
files: ['*.ts', '*.tsx'],
99+
rules: {
100+
'no-undef': 'off',
101+
},
102+
},
35103
],
36104
settings: {
37105
react: {
38106
version: 'detect',
39107
},
108+
'import/resolver': {
109+
node: {
110+
moduleDirectory: ['src', 'node_modules'],
111+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
112+
},
113+
},
40114
},
41115
}

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Dashboard CI
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- edited
9+
- reopened
10+
11+
jobs:
12+
ci:
13+
permissions:
14+
contents: read
15+
packages: read
16+
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
22+
- name: Use Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version-file: '.nvmrc'
26+
cache: 'yarn'
27+
registry-url: https://npm.pkg.github.com/
28+
29+
- name: Install dependencies
30+
run: yarn install
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Check linting issues
35+
run: yarn lint

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn tsc --noEmit
5+
yarn lint-staged

.lintstagedrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"*.{js,jsx,ts,tsx}": [
3+
"yarn eslint"
4+
]
5+
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13.0

config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
| LOGIN_PAGE_IMAGE | "" | Login page image url |
2929
| LOGIN_PAGE_IMAGE_BG | "" | Login page image background color code |
3030
| DEFAULT_CI_TRIGGER_TYPE_MANUAL | "false" | Change default trigger behaviour of newly created ci-pipeline to manual |
31+
| GLOBAL_API_TIMEOUT | 60000 | Default timeout for all API requests in DASHBOARD |
32+
| TRIGGER_API_TIMEOUT | 60000 | Default timeout for all API requests for Trigger calls (Deploy artifacts, charts) in DASHBOARD |
3133

3234
# DASHBOARD CONFIG SECRET

package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "0.0.48",
7+
"@devtron-labs/devtron-fe-common-lib": "0.0.53",
88
"@rjsf/core": "^5.13.3",
99
"@rjsf/utils": "^5.13.3",
1010
"@rjsf/validator-ajv8": "^5.13.3",
@@ -55,8 +55,9 @@
5555
"yamljs": "^0.3.0"
5656
},
5757
"scripts": {
58-
"lint": "eslint src/**/*.tsx",
59-
"lint-fix": "eslint --fix src/**/*.tsx",
58+
"prepare": "husky install",
59+
"lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
60+
"lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
6061
"start": "react-app-rewired start",
6162
"build": "react-app-rewired build",
6263
"build-light": "GENERATE_SOURCEMAP=false react-app-rewired build",
@@ -66,10 +67,8 @@
6667
"test-coverage": "npm run test -- --coverage --watchAll=false",
6768
"test:ci": "./node_modules/.bin/react-app-rewired test --watchAll=false --ci --json --coverage --testLocationInResults --outputFile=report.json",
6869
"eject": "react-app-rewired eject",
69-
"jest": "jest"
70-
},
71-
"eslintConfig": {
72-
"extends": "react-app"
70+
"jest": "jest",
71+
"lint-staged": "lint-staged"
7372
},
7473
"browserslist": [
7574
">0.2%",
@@ -91,15 +90,22 @@
9190
"@types/react-transition-group": "^4.4.4",
9291
"@types/recharts": "^1.8.23",
9392
"@types/recompose": "^0.30.10",
94-
"@typescript-eslint/eslint-plugin": "^5.15.0",
95-
"@typescript-eslint/parser": "^5.15.0",
93+
"@typescript-eslint/eslint-plugin": "^4.33.0",
94+
"@typescript-eslint/parser": "^4.33.0",
9695
"env-cmd": "10.1.0",
96+
"eslint": "^6.1.0",
97+
"eslint-config-airbnb": "^18.2.1",
98+
"eslint-plugin-import": "^2.22.1",
99+
"eslint-plugin-jsx-a11y": "^6.4.1",
100+
"eslint-plugin-react": "^7.22.0",
101+
"eslint-plugin-react-hooks": "^4.2.0",
97102
"eslint-config-prettier": "^8.5.0",
98-
"eslint-plugin-prettier": "^4.0.0",
103+
"eslint-plugin-prettier": "^3.4.1",
99104
"husky": "^7.0.4",
100105
"jest-extended": "^2.0.0",
101106
"jest-junit": "^13.0.0",
102107
"jsdom-worker": "^0.2.1",
108+
"lint-staged": "12.5.0",
103109
"mock-socket": "^9.2.1",
104110
"prettier": "^2.6.0",
105111
"react-scripts": "3.2.0",
@@ -128,14 +134,9 @@
128134
"monaco-yaml": "<rootDir>/node_modules/react-monaco-editor"
129135
}
130136
},
131-
"husky": {
132-
"hooks": {
133-
"pre-commit": "yarn eslint"
134-
}
135-
},
136137
"resolutions": {
137-
"**/@typescript-eslint/eslint-plugin": "^5.15.0",
138-
"**/@typescript-eslint/parser": "^5.15.0",
138+
"**/@typescript-eslint/eslint-plugin": "^4.33.0",
139+
"**/@typescript-eslint/parser": "^4.33.0",
139140
"react-error-overlay": "6.0.9"
140141
}
141142
}

src/GlobalConfigurations/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)