Skip to content

Commit 084404e

Browse files
committed
Merge branch 'main' into dev
# Conflicts: # package.json # src/App.js # src/components/AppContent.js # yarn.lock
2 parents 7ba4df8 + 0a9cd7b commit 084404e

File tree

11 files changed

+1747
-1721
lines changed

11 files changed

+1747
-1721
lines changed

.github/workflows/stale.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '15 14 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v3
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions'
25+
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions'
26+
stale-issue-label: 'no-issue-activity'
27+
stale-pr-label: 'no-pr-activity'

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
# dependencies
44
/node_modules
5-
/.pnp
6-
.pnp.js
5+
package-lock.json
76

87
# testing
98
/coverage

CRA.md

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

migration.md

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,3 @@
1-
# Migration from version 4.1 to 4.2
2-
3-
In version 4.2 we updated "react-scripts" to 5.0.0 and "react-router-dom" to 6.2.1
4-
5-
Please check also React Router 6 migration guide https://reactrouter.com/docs/en/v6/upgrading/v5
6-
7-
## Updated files
8-
9-
- .browserlistrc
10-
- eslintrc.js
11-
- package.json
12-
- src/App.js
13-
- src/App.test.js
14-
- src/index.js
15-
- src/setupTests.js
16-
- src/components/AppBreadcrumb.js
17-
- src/components/AppHeader.js\
18-
removed `activeClassName: 'active',` from NavLink, because React Router Dom 6 doesn't support it
19-
- src/components/AppSidebarNav.js\
20-
removed `activeClassName: 'active',` from NavLink, because React Router Dom 6 doesn't support it
21-
- src/components/index.js
22-
- src/layout/DefaultLayout.js
23-
24-
## Removed files
25-
26-
- src/serviceWorker.js is removed use src/reportWebVitals.js
27-
- src/components/AppContent.js\
28-
Routes map has been moved to src/App.js
29-
30-
## Dependencies and devDependencies
31-
32-
### Removed
33-
34-
- @wojtekmaj/enzyme-adapter-react-17,
35-
- enzyme
36-
37-
### Added
38-
39-
- @testing-library/jest-dom
40-
- @testing-library/react
41-
- @testing-library/user-event
42-
- web-vitals
1+
# Migration from version 3
432

3+
https://coreui.io/react/docs/4.0/migration/v4/

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@
2727
},
2828
"dependencies": {
2929
"@coreui/chartjs": "^3.0.0",
30-
"@coreui/coreui": "^4.1.0",
30+
"@coreui/coreui": "^4.1.2",
3131
"@coreui/icons": "^2.1.0",
3232
"@coreui/icons-react": "^2.0.1",
33-
"@coreui/react": "^4.1.1",
33+
"@coreui/react": "^4.1.2",
3434
"@coreui/react-chartjs": "^2.0.3",
3535
"@coreui/utils": "^1.3.1",
36-
"chart.js": "^3.7.0",
36+
"chart.js": "^3.7.1",
3737
"classnames": "^2.3.1",
38-
"core-js": "^3.20.2",
38+
"core-js": "^3.21.1",
3939
"prop-types": "^15.8.1",
4040
"react": "^17.0.2",
4141
"react-app-polyfill": "^3.0.0",
4242
"react-dom": "^17.0.2",
4343
"react-redux": "^7.2.6",
44-
"react-router-dom": "^6.2.1",
44+
"react-router-dom": "^6.2.2",
4545
"redux": "4.1.2",
4646
"simplebar-react": "^2.3.6"
4747
},
4848
"devDependencies": {
49-
"@testing-library/jest-dom": "^5.16.1",
50-
"@testing-library/react": "^12.1.2",
49+
"@testing-library/jest-dom": "^5.16.2",
50+
"@testing-library/react": "^12.1.3",
5151
"@testing-library/user-event": "^13.5.0",
52-
"auto-changelog": "~2.3.0",
53-
"eslint-config-prettier": "^8.3.0",
52+
"auto-changelog": "~2.4.0",
53+
"eslint-config-prettier": "^8.5.0",
5454
"eslint-plugin-prettier": "^4.0.0",
5555
"prettier": "2.5.1",
5656
"react-scripts": "5.0.0",
57-
"sass": "^1.46.0",
58-
"web-vitals": "^2.1.3"
57+
"sass": "^1.49.9",
58+
"web-vitals": "^2.1.4"
5959
},
6060
"engines": {
6161
"node": ">=10",

src/App.js

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import React, { Component, Suspense } from 'react'
2-
import { HashRouter, Navigate, Route, Routes } from 'react-router-dom'
3-
import { CSpinner } from '@coreui/react'
2+
import { HashRouter, Route, Routes } from 'react-router-dom'
43
import './scss/style.scss'
54

6-
// routes config
7-
import routes from './routes'
5+
const loading = (
6+
<div className="pt-3 text-center">
7+
<div className="sk-spinner sk-spinner-pulse"></div>
8+
</div>
9+
)
810

911
// Containers
1012
const DefaultLayout = React.lazy(() => import('./layout/DefaultLayout'))
@@ -19,28 +21,13 @@ class App extends Component {
1921
render() {
2022
return (
2123
<HashRouter>
22-
<Suspense fallback={<CSpinner color="primary" />}>
24+
<Suspense fallback={loading}>
2325
<Routes>
2426
<Route exact path="/login" name="Login Page" element={<Login />} />
25-
<Route exact path="/register" name="Register Page" render={<Register />} />
27+
<Route exact path="/register" name="Register Page" element={<Register />} />
2628
<Route exact path="/404" name="Page 404" element={<Page404 />} />
2729
<Route exact path="/500" name="Page 500" element={<Page500 />} />
28-
<Route path="/" name="Home" element={<DefaultLayout />}>
29-
<Route index element={<Navigate to="/dashboard" />} />
30-
{routes.map((route, idx) => {
31-
return (
32-
route.component && (
33-
<Route
34-
key={idx}
35-
path={route.path}
36-
exact={route.exact}
37-
name={route.name}
38-
element={<route.component />}
39-
/>
40-
)
41-
)
42-
})}
43-
</Route>
30+
<Route path="*" name="Home" element={<DefaultLayout />} />
4431
</Routes>
4532
</Suspense>
4633
</HashRouter>

src/components/AppContent.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React, { Suspense } from 'react'
2+
import { Navigate, Route, Routes } from 'react-router-dom'
3+
import { CContainer, CSpinner } from '@coreui/react'
4+
5+
// routes config
6+
import routes from '../routes'
7+
8+
const AppContent = () => {
9+
return (
10+
<CContainer lg>
11+
<Suspense fallback={<CSpinner color="primary" />}>
12+
<Routes>
13+
{routes.map((route, idx) => {
14+
return (
15+
route.element && (
16+
<Route
17+
key={idx}
18+
path={route.path}
19+
exact={route.exact}
20+
name={route.name}
21+
element={<route.element />}
22+
/>
23+
)
24+
)
25+
})}
26+
<Route path="/" element={<Navigate to="dashboard" replace />} />
27+
</Routes>
28+
</Suspense>
29+
</CContainer>
30+
)
31+
}
32+
33+
export default React.memo(AppContent)

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AppBreadcrumb from './AppBreadcrumb'
2+
import AppContent from './AppContent'
23
import AppFooter from './AppFooter'
34
import AppHeader from './AppHeader'
45
import AppHeaderDropdown from './header/AppHeaderDropdown'
@@ -9,6 +10,7 @@ import DocsExample from './DocsExample'
910

1011
export {
1112
AppBreadcrumb,
13+
AppContent,
1214
AppFooter,
1315
AppHeader,
1416
AppHeaderDropdown,

src/layout/DefaultLayout.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import React, { Suspense } from 'react'
2-
import { Outlet } from 'react-router-dom'
3-
import { CContainer, CSpinner } from '@coreui/react'
4-
import { AppSidebar, AppFooter, AppHeader } from '../components/index'
1+
import React from 'react'
2+
import { AppContent, AppSidebar, AppFooter, AppHeader } from '../components/index'
53

64
const DefaultLayout = () => {
75
return (
@@ -10,11 +8,7 @@ const DefaultLayout = () => {
108
<div className="wrapper d-flex flex-column min-vh-100 bg-light">
119
<AppHeader />
1210
<div className="body flex-grow-1 px-3">
13-
<CContainer lg>
14-
<Suspense fallback={<CSpinner color="primary" />}>
15-
<Outlet />
16-
</Suspense>
17-
</CContainer>
11+
<AppContent />
1812
</div>
1913
<AppFooter />
2014
</div>

0 commit comments

Comments
 (0)