Skip to content

Commit 5c4f8a8

Browse files
authored
Merge pull request #45 from coder-mind-project/develop
Master integration
2 parents 53bc87f + 03879dd commit 5c4f8a8

142 files changed

Lines changed: 5163 additions & 20924 deletions

File tree

Some content is hidden

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

.circleci/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: node:11.10.1
6+
working_directory: ~/repo
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
keys:
11+
- v1-dependencies-{{ checksum "package.json" }}
12+
- v1-dependencies-
13+
- run: yarn install
14+
- save_cache:
15+
paths:
16+
- node_modules
17+
key: v1-dependencies-{{ checksum "package.json" }}
18+
- run: yarn build

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
![Coder Mind Panel](https://i.imgur.com/Y84oYzJ.png)
22

33
[![code-style-airbnb](https://badgen.net/badge/codestyle/airbnb/ff5a5f.svg?icon=airbnb&color=green)](https://github.com/airbnb/javascript)
4+
[![panel-ci](https://circleci.com/gh/coder-mind-project/panel.svg?style=shield)](https://circleci.com/gh/coder-mind-project/coder-mind-panel)
45
![contributions-welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)
56
![license-BS3](https://img.shields.io/badge/license-BSD%203-green)
67

@@ -11,21 +12,14 @@ Owner: Coder Mind
1112
E-mail: allan@codermind.com.br
1213
___
1314

14-
## Docs:
15-
16-
Coming Soon...
17-
18-
___
1915

2016
## Workflow
2117

2218
Install dependencies with:
2319

2420
`yarn install`
2521

26-
> Disclaimer: use `npm install` it probably won't work, its recommended use just `yarn install`
27-
28-
Run the application with:
22+
Run the application with:
2923

3024
`yarn start`
3125

package-lock.json

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

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
2-
"name": "app-coder-mind",
2+
"name": "coder-mind-panel",
33
"version": "2.0.0",
4-
"description": "App Coder Mind",
4+
"description": "Coder Mind Panel",
55
"author": "Allan Wanderley Alves",
66
"license": "BSD-3-Clause",
77
"private": true,
8+
"engines": {
9+
"yarn": "1.x"
10+
},
811
"dependencies": {
912
"@craco/craco": "^5.6.3",
1013
"@date-io/moment": "^1.3.7",
@@ -16,24 +19,23 @@
1619
"@material-ui/lab": "^4.0.0-alpha.40",
1720
"@material-ui/pickers": "^3.1.1",
1821
"axios": "^0.19.0",
19-
"chart.js": "^2.9.3",
22+
"material-table": "^1.59.0",
2023
"material-ui-image": "^3.2.3",
2124
"material-ui-search-bar": "^1.0.0-beta.13",
2225
"moment": "^2.24.0",
2326
"prop-types": "^15.7.2",
2427
"react": "^16.8.6",
2528
"react-avatar": "^3.6.0",
26-
"react-chartjs-2": "^2.8.0",
2729
"react-custom-scrollbars": "^4.2.1",
2830
"react-dom": "^16.8.6",
2931
"react-google-invisible-recaptcha": "^0.2.11",
3032
"react-icons": "^3.7.0",
3133
"react-infinite-scroller": "^1.2.4",
32-
"react-quill": "^1.3.3",
3334
"react-redux": "^7.1.0",
3435
"react-router-dom": "^5.0.1",
3536
"react-scripts": "^3.3.0",
3637
"react-select": "^3.0.4",
38+
"react-showdown": "^2.1.0",
3739
"redux": "^4.0.1"
3840
},
3941
"scripts": {

src/App.js renamed to src/App.jsx

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import React, { useState, useEffect } from 'react';
2+
import PropTypes from 'prop-types';
3+
import { userType, appTheme, toastConfig } from '@/types';
4+
25
import {
36
BrowserRouter as Router,
47
Route,
@@ -16,18 +19,13 @@ import axios from 'axios';
1619
import { connect } from 'react-redux';
1720
import { bindActionCreators } from 'redux';
1821

19-
// Error Boundary
2022
import ErrorBoundary from '@/components/Errors/ErrorBoundary.jsx';
2123

22-
2324
import { MuiThemeProvider } from '@material-ui/core/styles';
2425
import { standard } from '@/config/themes';
25-
import { WHITE_LIST_ROUTES } from './config/dataProperties';
26-
// Requests imports
27-
import { backendUrl } from './config/backend';
2826

27+
import { WHITE_LIST_ROUTES } from './config/dataProperties';
2928

30-
// Redux imports
3129
import { setUser as defineUser } from './redux/user/userActions';
3230
import { setError as dispatchError } from './redux/error/errorActions';
3331
import { setMenu as callMenu } from './redux/menu/menuActions';
@@ -50,15 +48,12 @@ import Users from './components/Users/Management/Users';
5048
import UserForm from './components/Users/Management/UserForm';
5149
import Categories from './components/Categories/Categories';
5250
import CommentList from './components/Comments/CommentList';
53-
import Articles from './pages/articles-section/Articles';
54-
import Article from './pages/articles-section/Article';
55-
import Stats from './pages/statistics-section/Stats';
51+
import Articles from './components/Articles/Articles';
52+
import Article from './components/Articles/Article/Article';
5653
import MyAccount from './components/Users/MyAccount/MyAccount';
5754

58-
// Css imports
5955
import './index.css';
60-
import { AppContent } from './styles';
61-
56+
import { AppContent, AppContainer } from './styles';
6257

6358
function App(props) {
6459
const {
@@ -70,9 +65,9 @@ function App(props) {
7065
error,
7166
user,
7267
theme,
73-
} = { ...props };
68+
} = props;
7469

75-
const appTheme = standard(theme);
70+
const themeConfig = standard(user && user._id ? theme : 'light');
7671

7772
const [validatingToken, setValidatingToken] = useState(true);
7873
const [path, setPath] = useState('');
@@ -106,7 +101,7 @@ function App(props) {
106101
const token = await JSON.parse(localStorage.getItem('user'));
107102

108103
if (token) {
109-
const url = `${backendUrl}/auth/logged`;
104+
const url = '/auth/logged';
110105
await axios.post(url, token).then((res) => {
111106
if (res.data.user) {
112107
setUser(res.data);
@@ -130,8 +125,8 @@ function App(props) {
130125
}, [setMenu, setUser, setError, validatingToken]);
131126

132127
return (
133-
<MuiThemeProvider theme={appTheme}>
134-
<Grid>
128+
<MuiThemeProvider theme={themeConfig}>
129+
<AppContainer theme={theme}>
135130
{ !validatingToken
136131
&& (
137132
<Router>
@@ -151,7 +146,11 @@ function App(props) {
151146
{ error
152147
&& <Redirect to="/error" />
153148
}
154-
<AppContent user={getPath() === '/confirm-email' ? {} : user} isvalidating={validatingToken ? 'true' : ''}>
149+
<AppContent
150+
user={getPath() === '/confirm-email' ? {} : user}
151+
isvalidating={validatingToken ? 'true' : ''}
152+
theme={theme}
153+
>
155154
<Switch>
156155
<Route path="/" exact component={Articles} />
157156
<Route path="/auth" exact component={Auth} />
@@ -163,16 +162,14 @@ function App(props) {
163162
<Route path="/user" exact component={UserForm} />
164163
<Route path="/user/:id" exact component={UserForm} />
165164
<Route path="/users" exact component={Users} />
166-
<Route path="/article" exact component={Article} />
167-
<Route path="/article/:id" exact component={Article} />
168165
<Route path="/articles" exact component={Articles} />
166+
<Route path="/articles/:key" exact component={Article} />
169167
<Route path="/management" exact component={Management} />
170168
<Route path="/themes" exact component={Themes} />
171169
<Route path="/categories" exact component={Categories} />
172170
<Route path="/my-account" exact component={MyAccount} />
173171
<Route path="/comments" exact component={CommentList} />
174172
<Route path="/error" exact component={Error} />
175-
<Route path="/stats" exact component={Stats} />
176173
<Route component={RouteNotFound} />
177174
</Switch>
178175
</AppContent>
@@ -189,11 +186,25 @@ function App(props) {
189186
</Fade>
190187
)
191188
}
192-
</Grid>
189+
</AppContainer>
193190
</MuiThemeProvider>
194191
);
195192
}
196193

194+
App.propTypes = {
195+
user: userType.isRequired,
196+
error: PropTypes.bool,
197+
theme: appTheme.isRequired,
198+
setMenu: PropTypes.func.isRequired,
199+
setUser: PropTypes.func.isRequired,
200+
setError: PropTypes.func.isRequired,
201+
callToast: PropTypes.func.isRequired,
202+
toast: toastConfig.isRequired,
203+
};
204+
205+
App.defaultProps = {
206+
error: false,
207+
};
197208

198209
const mapStateToProps = (state) => ({
199210
user: state.user,
@@ -202,12 +213,12 @@ const mapStateToProps = (state) => ({
202213
toast: state.toast,
203214
theme: state.theme,
204215
});
216+
205217
const mapDispatchToProps = (dispatch) => bindActionCreators({
206218
setUser: defineUser,
207219
setError: dispatchError,
208220
setMenu: callMenu,
209221
callToast: toastEmitter,
210222
}, dispatch);
211223

212-
213224
export default connect(mapStateToProps, mapDispatchToProps)(App);
-21.1 KB
Binary file not shown.

src/assets/broken-robot-small.png

-229 KB
Binary file not shown.

src/assets/loading-circular.gif

-60.3 KB
Binary file not shown.

src/assets/logo-gestao-branco.png

-35.5 KB
Binary file not shown.
-52.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)