Skip to content

Commit 2069db2

Browse files
committed
resolved log errors
1 parent 7460d62 commit 2069db2

Some content is hidden

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

79 files changed

+21681
-9663
lines changed

.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
SKIP_PREFLIGHT_CHECK=true
1+
# List of env variables
2+
3+
#Replace your django-crm API URL below
4+
REACT_APP_BASE_URL= "https://8000-wispy-waterfall-04823641.eu-ws3.runcode.io/api/"

.eslintrc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
"plugin:react/recommended",
66
"plugin:jsx-a11y/recommended"
77
],
8-
{
9-
"plugins": [
8+
"plugins": [
109
"jsx-a11y"
11-
]
12-
},
10+
],
1311
"rules": {
1412
"jsx-a11y/anchor-is-valid": [ "error", {
1513
"components": [ "Link" ],

.eslintrc.js

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

.eslintrc.json

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 2022,
4+
"ecmaFeatures": {
5+
"jsx": true
6+
},
7+
"sourceType": "module"
8+
},
9+
10+
"env": {
11+
"es2021": true,
12+
"node": true
13+
},
14+
15+
"plugins": [
16+
"import",
17+
"n",
18+
"promise"
19+
],
20+
21+
"globals": {
22+
"document": "readonly",
23+
"navigator": "readonly",
24+
"window": "readonly"
25+
},
26+
27+
"rules": {
28+
"no-var": "warn",
29+
"object-shorthand": ["warn", "properties"],
30+
31+
"accessor-pairs": ["error", { "setWithoutGet": true, "enforceForClassMembers": true }],
32+
"array-bracket-spacing": ["error", "never"],
33+
"array-callback-return": ["error", {
34+
"allowImplicit": false,
35+
"checkForEach": false
36+
}],
37+
"arrow-spacing": ["error", { "before": true, "after": true }],
38+
"block-spacing": ["error", "always"],
39+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
40+
"camelcase": ["error", {
41+
"allow": ["^UNSAFE_"],
42+
"properties": "never",
43+
"ignoreGlobals": true
44+
}],
45+
"comma-dangle": ["error", {
46+
"arrays": "never",
47+
"objects": "never",
48+
"imports": "never",
49+
"exports": "never",
50+
"functions": "never"
51+
}],
52+
"comma-spacing": ["error", { "before": false, "after": true }],
53+
"comma-style": ["error", "last"],
54+
"computed-property-spacing": ["error", "never", { "enforceForClassMembers": true }],
55+
"constructor-super": "error",
56+
"curly": ["error", "multi-line"],
57+
"default-case-last": "error",
58+
"dot-location": ["error", "property"],
59+
"dot-notation": ["error", { "allowKeywords": true }],
60+
"eol-last": "error",
61+
"eqeqeq": ["error", "always", { "null": "ignore" }],
62+
"func-call-spacing": ["error", "never"],
63+
"generator-star-spacing": ["error", { "before": true, "after": true }],
64+
"indent": ["error", 2, {
65+
"SwitchCase": 1,
66+
"VariableDeclarator": 1,
67+
"outerIIFEBody": 1,
68+
"MemberExpression": 1,
69+
"FunctionDeclaration": { "parameters": 1, "body": 1 },
70+
"FunctionExpression": { "parameters": 1, "body": 1 },
71+
"CallExpression": { "arguments": 1 },
72+
"ArrayExpression": 1,
73+
"ObjectExpression": 1,
74+
"ImportDeclaration": 1,
75+
"flatTernaryExpressions": false,
76+
"ignoreComments": false,
77+
"ignoredNodes": ["TemplateLiteral *", "JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXFragment", "JSXOpeningFragment", "JSXClosingFragment", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"],
78+
"offsetTernaryExpressions": true
79+
}],
80+
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
81+
"keyword-spacing": ["error", { "before": true, "after": true }],
82+
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
83+
"multiline-ternary": ["error", "always-multiline"],
84+
"new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }],
85+
"new-parens": "error",
86+
"no-array-constructor": "error",
87+
"no-async-promise-executor": "error",
88+
"no-caller": "error",
89+
"no-case-declarations": "error",
90+
"no-class-assign": "error",
91+
"no-compare-neg-zero": "error",
92+
"no-cond-assign": "error",
93+
"no-const-assign": "error",
94+
"no-constant-condition": ["error", { "checkLoops": false }],
95+
"no-control-regex": "error",
96+
"no-debugger": "error",
97+
"no-delete-var": "error",
98+
"no-dupe-args": "error",
99+
"no-dupe-class-members": "error",
100+
"no-dupe-keys": "error",
101+
"no-duplicate-case": "error",
102+
"no-useless-backreference": "error",
103+
"no-empty": ["error", { "allowEmptyCatch": true }],
104+
"no-empty-character-class": "error",
105+
"no-empty-pattern": "error",
106+
"no-eval": "error",
107+
"no-ex-assign": "error",
108+
"no-extend-native": "error",
109+
"no-extra-bind": "error",
110+
"no-extra-boolean-cast": "error",
111+
"no-extra-parens": ["error", "functions"],
112+
"no-fallthrough": "error",
113+
"no-floating-decimal": "error",
114+
"no-func-assign": "error",
115+
"no-global-assign": "error",
116+
"no-implied-eval": "error",
117+
"no-import-assign": "error",
118+
"no-invalid-regexp": "error",
119+
"no-irregular-whitespace": "error",
120+
"no-iterator": "error",
121+
"no-labels": ["error", { "allowLoop": false, "allowSwitch": false }],
122+
"no-lone-blocks": "error",
123+
"no-loss-of-precision": "error",
124+
"no-misleading-character-class": "error",
125+
"no-prototype-builtins": "error",
126+
"no-useless-catch": "error",
127+
"no-mixed-operators": ["error", {
128+
"groups": [
129+
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
130+
["&&", "||"],
131+
["in", "instanceof"]
132+
],
133+
"allowSamePrecedence": true
134+
}],
135+
"no-mixed-spaces-and-tabs": "error",
136+
"no-multi-spaces": "error",
137+
"no-multi-str": "error",
138+
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
139+
"no-new": "error",
140+
"no-new-func": "error",
141+
"no-new-object": "error",
142+
"no-new-symbol": "error",
143+
"no-new-wrappers": "error",
144+
"no-obj-calls": "error",
145+
"no-octal": "error",
146+
"no-octal-escape": "error",
147+
"no-proto": "error",
148+
"no-redeclare": ["error", { "builtinGlobals": false }],
149+
"no-regex-spaces": "error",
150+
"no-return-assign": ["error", "except-parens"],
151+
"no-self-assign": ["error", { "props": true }],
152+
"no-self-compare": "error",
153+
"no-sequences": "error",
154+
"no-shadow-restricted-names": "error",
155+
"no-sparse-arrays": "error",
156+
"no-tabs": "error",
157+
"no-template-curly-in-string": "error",
158+
"no-this-before-super": "error",
159+
"no-throw-literal": "error",
160+
"no-trailing-spaces": "error",
161+
"no-undef": "error",
162+
"no-undef-init": "error",
163+
"no-unexpected-multiline": "error",
164+
"no-unmodified-loop-condition": "error",
165+
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
166+
"no-unreachable": "error",
167+
"no-unreachable-loop": "error",
168+
"no-unsafe-finally": "error",
169+
"no-unsafe-negation": "error",
170+
"no-unused-expressions": ["error", {
171+
"allowShortCircuit": true,
172+
"allowTernary": true,
173+
"allowTaggedTemplates": true
174+
}],
175+
"no-unused-vars": ["error", {
176+
"args": "none",
177+
"caughtErrors": "none",
178+
"ignoreRestSiblings": true,
179+
"vars": "all"
180+
}],
181+
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
182+
"no-useless-call": "error",
183+
"no-useless-computed-key": "error",
184+
"no-useless-constructor": "error",
185+
"no-useless-escape": "error",
186+
"no-useless-rename": "error",
187+
"no-useless-return": "error",
188+
"no-void": "error",
189+
"no-whitespace-before-property": "error",
190+
"no-with": "error",
191+
"object-curly-newline": ["error", { "multiline": true, "consistent": true }],
192+
"object-curly-spacing": ["error", "always"],
193+
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
194+
"one-var": ["error", { "initialized": "never" }],
195+
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before", "|>": "before" } }],
196+
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
197+
"prefer-const": ["error", {"destructuring": "all"}],
198+
"prefer-promise-reject-errors": "error",
199+
"prefer-regex-literals": ["error", { "disallowRedundantWrapping": true }],
200+
"quote-props": ["error", "as-needed"],
201+
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
202+
"rest-spread-spacing": ["error", "never"],
203+
"semi": ["error", "never"],
204+
"semi-spacing": ["error", { "before": false, "after": true }],
205+
"space-before-blocks": ["error", "always"],
206+
"space-before-function-paren": ["error", "always"],
207+
"space-in-parens": ["error", "never"],
208+
"space-infix-ops": "error",
209+
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
210+
"spaced-comment": ["error", "always", {
211+
"line": { "markers": ["*package", "!", "/", ",", "="] },
212+
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
213+
}],
214+
"symbol-description": "error",
215+
"template-curly-spacing": ["error", "never"],
216+
"template-tag-spacing": ["error", "never"],
217+
"unicode-bom": ["error", "never"],
218+
"use-isnan": ["error", {
219+
"enforceForSwitchCase": true,
220+
"enforceForIndexOf": true
221+
}],
222+
"valid-typeof": ["error", { "requireStringLiterals": true }],
223+
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
224+
"yield-star-spacing": ["error", "both"],
225+
"yoda": ["error", "never"],
226+
227+
"import/export": "error",
228+
"import/first": "error",
229+
"import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }],
230+
"import/no-duplicates": "error",
231+
"import/no-named-default": "error",
232+
"import/no-webpack-loader-syntax": "error",
233+
234+
"n/handle-callback-err": ["error", "^(err|error)$" ],
235+
"n/no-callback-literal": "error",
236+
"n/no-deprecated-api": "error",
237+
"n/no-exports-assign": "error",
238+
"n/no-new-require": "error",
239+
"n/no-path-concat": "error",
240+
"n/process-exit-as-throw": "error",
241+
242+
"promise/param-names": "error"
243+
}
244+
}

.runcode.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
onCreate:
22
- sudo apt-get update -y
3-
- sudo apt-get upgrade -y
43
- sudo corepack enable
54
- yarn
65
- cp ENV.md .env

ENV.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# List of env variables
22

3-
#Replace your django-crm API URL below
4-
REACT_APP_BASE_URL= "https://api.bottle-dev.com/api/"
3+
REACT_APP_BASE_URL= "https://8000-wispy-waterfall-04823641.eu-ws2.runcode.io/api/"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
CRM UI developed in react for django-crm
44

5+
### Configuration
6+
need to add REACT_APP_BASE_URL in your env to point django-crm api
7+
58
[![RunCode](https://runcode-app-public.s3.amazonaws.com/images/dark_btn.png)](https://runcode.io)
69

710
### standards to follow
811
* two space indentation
912
* images should have img_ prefix
13+
standard from https://github.com/standard/eslint-config-standard

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "workspace",
2+
"name": "react-crm",
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
@@ -44,5 +44,9 @@
4444
"last 1 firefox version",
4545
"last 1 safari version"
4646
]
47+
},
48+
"devDependencies": {
49+
"npm-check-updates": "^16.3.8",
50+
"standard": "^17.0.0"
4751
}
4852
}

src/App.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import React from "react";
2-
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
3-
import { Registration } from "./containers/auth/Register";
4-
import { LogIn } from "./containers/auth/Login";
5-
import { ForgotPassword } from "./containers/auth/ForgotPassword";
6-
import { Home } from "./containers/Home/Home";
1+
import React from 'react'
2+
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
3+
import { Registration } from './containers/auth/Register'
4+
import { LogIn } from './containers/auth/Login'
5+
import { ForgotPassword } from './containers/auth/ForgotPassword'
6+
import { Home } from './containers/Home/Home'
77

8-
function App() {
8+
function App () {
99
return (
1010
<div>
1111
<Router>
1212
<Routes>
13-
<Route path="*" element={<Home />} />
14-
<Route path="/register" element={<Registration />} />
15-
<Route path="/login" element={<LogIn />} />
16-
<Route path="/forgotpassword" element={<ForgotPassword />} />
17-
13+
<Route path='*' element={<Home />} />
14+
<Route path='/register' element={<Registration />} />
15+
<Route path='/login' element={<LogIn />} />
16+
<Route path='/forgotpassword' element={<ForgotPassword />} />
17+
1818
</Routes>
1919
</Router>
2020
</div>
21-
);
21+
)
2222
}
2323

24-
export default App;
24+
export default App

src/App.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { render, screen } from '@testing-library/react';
2-
import App from './App';
1+
import { render, screen } from '@testing-library/react'
2+
import App from './App'
33

44
test('renders learn react link', () => {
5-
render(<App />);
6-
const linkElement = screen.getByText(/learn react/i);
7-
expect(linkElement).toBeInTheDocument();
8-
});
5+
render(<App />)
6+
const linkElement = screen.getByText(/learn react/i)
7+
expect(linkElement).toBeInTheDocument()
8+
})

0 commit comments

Comments
 (0)