Commit c6003c80 authored by Bruno López Trigo's avatar Bruno López Trigo

Engadido soporte para Google Analytics

parent 67023705
......@@ -6,14 +6,14 @@
"_location": "/react-dom",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "react-dom",
"name": "react-dom",
"escapedName": "react-dom",
"fetchSpec": "latest",
"name": "react-dom",
"raw": "react-dom",
"rawSpec": "",
"registry": true,
"saveSpec": null,
"fetchSpec": "latest"
"type": "tag"
},
"_requiredBy": [
"#USER",
......@@ -43,17 +43,18 @@
},
"deprecated": false,
"description": "React package for working with the DOM.",
"devDependencies": {},
"files": [
"LICENSE",
"README.md",
"cjs/",
"index.js",
"server.js",
"server.browser.js",
"server.js",
"server.node.js",
"test-utils.js",
"unstable-native-dependencies.js",
"cjs/",
"umd/"
"umd/",
"unstable-native-dependencies.js"
],
"homepage": "https://reactjs.org/",
"keywords": [
......@@ -62,9 +63,12 @@
"license": "MIT",
"main": "index.js",
"name": "react-dom",
"optionalDependencies": {},
"peerDependencies": {
"react": "^16.0.0"
},
"readme": "# `react-dom`\n\nThis package serves as the entry point of the DOM-related rendering paths. It is intended to be paired with the isomorphic React, which will be shipped as `react` to npm.\n\n## Installation\n\n```sh\nnpm install react react-dom\n```\n\n## Usage\n\n### In the browser\n\n```js\nvar React = require('react');\nvar ReactDOM = require('react-dom');\n\nclass MyComponent extends React.Component {\n render() {\n return <div>Hello World</div>;\n }\n}\n\nReactDOM.render(<MyComponent />, node);\n```\n\n### On the server\n\n```js\nvar React = require('react');\nvar ReactDOMServer = require('react-dom/server');\n\nclass MyComponent extends React.Component {\n render() {\n return <div>Hello World</div>;\n }\n}\n\nReactDOMServer.renderToString(<MyComponent />);\n```\n\n## API\n\n### `react-dom`\n\n- `findDOMNode`\n- `render`\n- `unmountComponentAtNode`\n\n### `react-dom/server`\n\n- `renderToString`\n- `renderToStaticMarkup`\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/react.git"
......
......@@ -6,14 +6,14 @@
"_location": "/react-router-dom",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "react-router-dom",
"name": "react-router-dom",
"escapedName": "react-router-dom",
"fetchSpec": "latest",
"name": "react-router-dom",
"raw": "react-router-dom",
"rawSpec": "",
"registry": true,
"saveSpec": null,
"fetchSpec": "latest"
"type": "tag"
},
"_requiredBy": [
"#USER",
......@@ -87,25 +87,28 @@
"es",
"index.js",
"matchPath.js",
"withRouter.js",
"umd"
"umd",
"withRouter.js"
],
"homepage": "https://github.com/ReactTraining/react-router#readme",
"keywords": [
"history",
"link",
"react",
"router",
"route",
"routing",
"history",
"link"
"router",
"routing"
],
"license": "MIT",
"main": "index.js",
"module": "es/index.js",
"name": "react-router-dom",
"optionalDependencies": {},
"peerDependencies": {
"react": ">=15"
},
"readme": "# react-router-dom\n\nDOM bindings for [React Router](https://reacttraining.com/react-router).\n\n## Installation\n\nUsing [npm](https://www.npmjs.com/):\n\n $ npm install --save react-router-dom\n\nThen with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:\n\n```js\n// using ES6 modules\nimport { BrowserRouter, Route, Link } from 'react-router-dom'\n\n// using CommonJS modules\nvar BrowserRouter = require('react-router-dom').BrowserRouter\nvar Route = require('react-router-dom').Route\nvar Link = require('react-router-dom').Link\n```\n\nThe UMD build is also available on [unpkg](https://unpkg.com):\n\n```html\n<script src=\"https://unpkg.com/react-router-dom/umd/react-router-dom.min.js\"></script>\n```\n\nYou can find the library on `window.ReactRouterDOM`.\n\n## Issues\n\nIf you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues).\n\n## Credits\n\nReact Router is built and maintained by [React Training](https://reacttraining.com).\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/ReactTraining/react-router.git"
......
......@@ -8,14 +8,14 @@
"asap": "2.0.6"
},
"_requested": {
"type": "tag",
"registry": true,
"raw": "react-scripts",
"name": "react-scripts",
"escapedName": "react-scripts",
"fetchSpec": "latest",
"name": "react-scripts",
"raw": "react-scripts",
"rawSpec": "",
"registry": true,
"saveSpec": null,
"fetchSpec": "latest"
"type": "tag"
},
"_requiredBy": [
"#USER",
......@@ -95,6 +95,8 @@
"optionalDependencies": {
"fsevents": "^1.1.3"
},
"readme": "# react-scripts\n\nThis package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>\nPlease refer to its documentation:\n\n* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.\n* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/facebookincubator/create-react-app.git"
......
......@@ -6,21 +6,23 @@
"_location": "/react",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "react",
"name": "react",
"escapedName": "react",
"fetchSpec": "latest",
"name": "react",
"raw": "react",
"rawSpec": "",
"registry": true,
"saveSpec": null,
"fetchSpec": "latest"
"type": "tag"
},
"_requiredBy": [
"#USER",
"/"
"/",
"/react-ga"
],
"_resolved": "https://registry.npmjs.org/react/-/react-16.3.2.tgz",
"_shasum": "fdc8420398533a1e58872f59091b272ce2f91ea9",
"_shrinkwrap": null,
"_spec": "react",
"_where": "/home/brilemau/Documents/expliclas",
"browserify": {
......@@ -40,14 +42,15 @@
},
"deprecated": false,
"description": "React is a JavaScript library for building user interfaces.",
"devDependencies": {},
"engines": {
"node": ">=0.10.0"
},
"files": [
"LICENSE",
"README.md",
"index.js",
"cjs/",
"index.js",
"umd/"
],
"homepage": "https://reactjs.org/",
......@@ -57,6 +60,9 @@
"license": "MIT",
"main": "index.js",
"name": "react",
"optionalDependencies": {},
"readme": "# react\n\nAn npm package to get you immediate access to [React](https://reactjs.org/),\nwithout also requiring the JSX transformer. This is especially useful for cases where you\nwant to [`browserify`](https://github.com/substack/node-browserify) your module using\n`React`.\n\n**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages.\n\nTo use React in production mode, set the environment variable `NODE_ENV` to `production`. A minifier that performs dead-code elimination such as [UglifyJS](https://github.com/mishoo/UglifyJS2) is recommended to completely remove the extra code present in development mode.\n\n## Example Usage\n\n```js\nvar React = require('react');\n```\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/react.git"
......
{
"name": "expliclas",
"homepage":"http://demos.citius.usc.es/ExpliClas",
"homepage": "http://demos.citius.usc.es/ExpliClas",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-ga": "^2.5.3",
"react-global-configuration": "^1.2.1",
"react-router-dom": "^4.2.2",
"react-router-ga": "^1.0.0",
"react-scripts": "1.1.4"
},
"scripts": {
......
......@@ -29,6 +29,7 @@ import Footer from './components/Footer';
import NotFound from './components/NotFound';
import Alert from './components/Alert';
import About from './components/About';
import Analytics from 'react-router-ga';
import { API_ROOT, HOME } from './config';
......@@ -56,7 +57,7 @@ class App extends Component {
this.closeAlert = this.closeAlert.bind(this);
this.showSessionAlert = this.showSessionAlert.bind(this);
}
showSessionAlert(){
window.location.assign(`${HOME}`);
var token = localStorage.getItem("token");
......@@ -148,6 +149,8 @@ class App extends Component {
render() {
//ReactGA.initialize('UA-XXXXXXXX');
if(localStorage.getItem('token')!=null){
var breadcrumb = <Progress ownlog={this.state.ownlog} step={this.state.step} />;
}
......@@ -218,22 +221,24 @@ class App extends Component {
var footer = localStorage.getItem('token') !== null ? <Footer />:"";
return (
<Router basename="/">
<div className="App">
{breadcrumb}
{this.state.alert ? <Alert message={this.state.messageAlert} closeAlert={this.closeAlert} alertType={this.state.alertType}/>:""}
<Switch>
{routeHome}
{routeDatasets}
{routeBuild}
{routeLogs}
{routeClassifier}
{routeExplanation}
{about}
{notFound}
</Switch>
{footer}
</div>
<Router basename="/" >
<Analytics id="UA-126813440-1" debug>
<div className="App">
{breadcrumb}
{this.state.alert ? <Alert message={this.state.messageAlert} closeAlert={this.closeAlert} alertType={this.state.alertType}/>:""}
<Switch>
{routeHome}
{routeDatasets}
{routeBuild}
{routeLogs}
{routeClassifier}
{routeExplanation}
{about}
{notFound}
</Switch>
{footer}
</div>
</Analytics>
</Router>
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment