From 107d080b07d77ca2c5f72c25edeb1acbf80e3b80 Mon Sep 17 00:00:00 2001 From: augustovilarins Date: Tue, 13 Nov 2018 20:43:59 -0300 Subject: [PATCH 01/13] [UPDATE] fga-eps-mds/2018.2-GamesBI#254 Updating homepage buttons and changing collor from game dashboard page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André --- package-lock.json | 28 +++++++++++++++++++++------- src/components/SideBar.js | 4 ++-- src/components/game/GameDashboard.js | 4 ++-- src/components/game/index.css | 2 +- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87ce37b..43a0c52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4996,11 +4996,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5013,15 +5015,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5124,7 +5129,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5134,6 +5140,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5146,17 +5153,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5173,6 +5183,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5245,7 +5256,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5255,6 +5267,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5360,6 +5373,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/src/components/SideBar.js b/src/components/SideBar.js index 626a7ae..6715216 100644 --- a/src/components/SideBar.js +++ b/src/components/SideBar.js @@ -14,8 +14,8 @@ class SideBar extends Component {
@@ -32,7 +28,7 @@ class SideBar extends Component { From a56783318203ccc46aaeec538c1559b32c563f40 Mon Sep 17 00:00:00 2001 From: augustovilarins Date: Tue, 13 Nov 2018 21:18:38 -0300 Subject: [PATCH 05/13] [UPDATE] fga-eps-mds/2018.2-GamesBI#254 Removing console logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André --- src/components/LineGraphic.js | 3 --- src/components/SearchBar.js | 1 - src/components/TableRank.js | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/components/LineGraphic.js b/src/components/LineGraphic.js index dc4e948..d4b40a9 100644 --- a/src/components/LineGraphic.js +++ b/src/components/LineGraphic.js @@ -15,7 +15,6 @@ class LineGraphic extends Component { } componentDidMount() { - console.log(this.props.y_axis); let URL; if (this.props.gamename){ URL = CROSSDATA_URL + '/api/get_data/line/'+this.props.y_axis+'/'+this.props.x_axis+'/'+this.props.gamename; @@ -23,7 +22,6 @@ class LineGraphic extends Component { } else { URL = CROSSDATA_URL + '/api/get_data/line/'+this.props.y_axis+'/'+this.props.x_axis+'/'; - console.log(URL); } fetch(URL) .then(res => res.json()) @@ -58,7 +56,6 @@ class LineGraphic extends Component { ] } }); - console.log(result.y_axis); }, // Note: it's important to handle errors here // instead of a catch() block so that we don't swallow diff --git a/src/components/SearchBar.js b/src/components/SearchBar.js index 1608d86..3a5b13e 100644 --- a/src/components/SearchBar.js +++ b/src/components/SearchBar.js @@ -37,7 +37,6 @@ class SearchBar extends Component { render() { - console.log(this.state.data) return (
diff --git a/src/components/TableRank.js b/src/components/TableRank.js index b0fb151..9e2b054 100644 --- a/src/components/TableRank.js +++ b/src/components/TableRank.js @@ -61,8 +61,6 @@ class TableRank extends Component { render() { - console.log(this.state.data) - let rows = this.state.data.map(game => { return( From 1105e09356649b4209e3432134b86c287b30d30b Mon Sep 17 00:00:00 2001 From: augustovilarins Date: Wed, 14 Nov 2018 12:32:51 -0300 Subject: [PATCH 06/13] [UPDATE] fga-eps-mds/2018-2GamesBI#254 Change search bar text parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André --- src/components/SearchBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SearchBar.js b/src/components/SearchBar.js index 3a5b13e..7460e26 100644 --- a/src/components/SearchBar.js +++ b/src/components/SearchBar.js @@ -42,7 +42,7 @@ class SearchBar extends Component {
- this.search = input} onChange={this.handleInputChange} /> From fc02d4d97a555e5265b389a1dabe0679d153ce60 Mon Sep 17 00:00:00 2001 From: Andre Eduardo Date: Wed, 14 Nov 2018 15:45:16 -0200 Subject: [PATCH 07/13] [UPDATE] fga-eps-mds/2018-2GamesBI#254 refactor game page Co-authored-by: Augusto --- src/components/game/DataGame.js | 40 +++++++++++ src/components/game/GameDashboard.js | 104 ++++----------------------- src/components/game/Nav.js | 20 ++++++ src/components/game/TopBar.js | 22 ++++++ 4 files changed, 96 insertions(+), 90 deletions(-) create mode 100644 src/components/game/DataGame.js create mode 100644 src/components/game/Nav.js create mode 100644 src/components/game/TopBar.js diff --git a/src/components/game/DataGame.js b/src/components/game/DataGame.js new file mode 100644 index 0000000..2abcd38 --- /dev/null +++ b/src/components/game/DataGame.js @@ -0,0 +1,40 @@ +import React, { Component } from 'react'; +import GameInfo from './GameInfo' +import SideCard from '../SideCard' +class DataGame extends Component { + + render() { + return ( + +
+ +
+ +

Linguagens: {lang}

+
+ + +

Generos: {genr}

+
+ +

Numero de views: {this.props.countViews}

+
+ +

Numero de likes: {this.props.countLikes}

+
+ +

Quantidade de donos: {this.props.owners}

+
+ +

Preço: $ {(this.props.price)}

+
+
+
+
+
+ ) + } +} + + +export default TopBar; diff --git a/src/components/game/GameDashboard.js b/src/components/game/GameDashboard.js index 4c698b1..0556834 100644 --- a/src/components/game/GameDashboard.js +++ b/src/components/game/GameDashboard.js @@ -4,11 +4,12 @@ import SearchBar from '../SearchBar' import TableRank from '../TableRank' import HeaderCards from '../HeaderCards' import GraphicCard from '../GraphicCard' -import SideCard from '../SideCard' +import DataGame from '../DataGame' import LineGraphic from '../LineGraphic' -import Title from './Title' +import TopBar from './TopBar' import GameInfo from './GameInfo' import PaletaDeCor from './PaletaDeCor' +import Nav from './Nav' import Button from "../Button" import './index.css' @@ -23,7 +24,6 @@ const CROSSDATA_URL = env.REACT_APP_CROSSDATA_URL class GameDashboard extends Component { constructor(props) { super(props); - this.state = { data: {}, img: "https://mlsoft.com.br/wp-content/uploads/2018/06/Picture1.png", @@ -31,124 +31,48 @@ constructor(props) { data2:{}, y_axis:"average_2weeks", legend:"Played Time ", - title:"Average played time in the last 2 weeks" - } - - } + title:"Average played time in the last 2 weeks" }} componentWillMount() { axios.get(CROSSDATA_URL + `/api/?name=${this.state.param.paramArray}`) .then(res => this.setState({ data: res.data })) - this.setState({ data2: ImportGame(this.state.param.paramArray) }) -} - - - + this.setState({ data2: ImportGame(this.state.param.paramArray) })} render() { let lang=[] for(let language in this.state.data.languages){ - lang.push(this.state.data.languages[language]+", ") - } + lang.push(this.state.data.languages[language]+", ") } let genr=[] for(let genre in this.state.data.genres){ - genr.push(this.state.data.genres[genre]+", ") - } - - // console.log(this.state.data.screenshots); - + genr.push(this.state.data.genres[genre]+", ") } return ( -
- - - -
-
-
-
- test - {this.state.param.paramArray} -
-
+
-
- - - - - -
- }> - - - +
}> + - -

-
- -
- -

Linguagens: {lang}

-
- - -

Generos: {genr}

-
- -

Numero de views: {this.state.data.count_views}

-
- -

Numero de likes: {this.state.data.count_likes}

-
- -

Quantidade de donos: {this.state.data.owners}

-
- -

Preço: $ {(this.state.data.price)/100}

-
-
-
+
-
-
-
- - ); - } -} + ); }} export default GameDashboard; diff --git a/src/components/game/Nav.js b/src/components/game/Nav.js new file mode 100644 index 0000000..b98c332 --- /dev/null +++ b/src/components/game/Nav.js @@ -0,0 +1,20 @@ +import React, { Component } from 'react'; +class Nav extends Component { + + render() { + return ( + + ) + } +} + + +export default Nav; diff --git a/src/components/game/TopBar.js b/src/components/game/TopBar.js new file mode 100644 index 0000000..bd29a9f --- /dev/null +++ b/src/components/game/TopBar.js @@ -0,0 +1,22 @@ +import React, { Component } from 'react'; +import Title from './Title' +class TopBar extends Component { + + render() { + return ( +
+
+
+
+ test + {this.props.paramArray} +
+
+
+
+ ) + } +} + + +export default TopBar; From 2c46a507d23acfed5bdb0ddb05d70006bddd6de9 Mon Sep 17 00:00:00 2001 From: Andre Eduardo Date: Thu, 22 Nov 2018 16:32:43 -0200 Subject: [PATCH 08/13] [UPDATE] fga-eps-mds/2018-2GamesBI#254 Solve import errors --- src/components/game/DataGame.js | 10 +++++----- src/components/game/GameDashboard.js | 6 +++--- src/components/game/Nav.js | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/game/DataGame.js b/src/components/game/DataGame.js index 2abcd38..4fc4c1c 100644 --- a/src/components/game/DataGame.js +++ b/src/components/game/DataGame.js @@ -5,16 +5,16 @@ class DataGame extends Component { render() { return ( - +
-

Linguagens: {lang}

+

Linguagens: {this.props.lang}

-

Generos: {genr}

+

Generos: {this.props.genr}

Numero de views: {this.props.countViews}

@@ -31,10 +31,10 @@ class DataGame extends Component {
- + ) } } -export default TopBar; +export default DataGame; diff --git a/src/components/game/GameDashboard.js b/src/components/game/GameDashboard.js index 0556834..78050a8 100644 --- a/src/components/game/GameDashboard.js +++ b/src/components/game/GameDashboard.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import Footer from '../Footer' -import SearchBar from '../SearchBar' + import TableRank from '../TableRank' import HeaderCards from '../HeaderCards' import GraphicCard from '../GraphicCard' -import DataGame from '../DataGame' +import DataGame from './DataGame' import LineGraphic from '../LineGraphic' import TopBar from './TopBar' import GameInfo from './GameInfo' @@ -68,7 +68,7 @@ constructor(props) {
- +