Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
humble beginnings with React components
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short committed Jun 25, 2018
1 parent 4384959 commit c47ad93
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion client/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["es2015", "stage-2"],
"presets": ["env", "react", "stage-2"],
"plugins": [
"angularjs-annotate",
"transform-object-assign",
Expand Down
2 changes: 2 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
settings: {
"import/resolver": "webpack"
},
parser: "babel-eslint",
env: {
"browser": true,
"node": true
Expand All @@ -21,6 +22,7 @@ module.exports = {
"no-multi-assign": "off",
"no-lonely-if": "off",
"consistent-return": "off",
"no-control-regex": "off",
"max-len": ['error', 120, 2, {
ignoreUrls: true,
ignoreComments: false,
Expand Down
22 changes: 22 additions & 0 deletions client/app/components/footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { react2angular } from 'react2angular';

class Footer extends React.Component {
render() {
const version = this.props.clientConfig.version;
const newVersionAvailable = this.props.clientConfig.newVersionAvailable && this.props.currentUser.isAdmin;
return (
<div id="footer">
<a href="http://redash.io">Redash</a> {version}{ <small><a href="https://version.redash.io/">(New Redash version available)</a></small> ? newVersionAvailable : ''}
&#8226;
<a href="https://redash.io/help/">Documentation</a>
&#8226;
<a href="http://github.com/getredash/redash">Contribute</a>
</div>
);
}
}

export default function init(ngModule) {
ngModule.component('footer', react2angular(Footer, [], ['clientConfig', 'currentUser']));
}
7 changes: 0 additions & 7 deletions client/app/components/footer/footer.html

This file was deleted.

13 changes: 0 additions & 13 deletions client/app/components/footer/index.js

This file was deleted.

13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
},
"homepage": "https://redash.io/",
"dependencies": {
"@types/prop-types": "^15.5.2",
"@types/react": "^16.3.13",
"@types/react-dom": "^16.0.5",
"angular": "~1.5.8",
"angular-base64-upload": "^0.1.23",
"angular-messages": "~1.5.8",
Expand All @@ -38,6 +41,7 @@
"angular-ui-ace": "^0.2.3",
"angular-ui-bootstrap": "^2.5.0",
"angular-vs-repeat": "^1.1.7",
"babel-preset-react": "^6.24.1",
"bootstrap": "^3.3.7",
"brace": "^0.10.0",
"chroma-js": "^1.3.6",
Expand All @@ -53,6 +57,7 @@
"leaflet": "^1.2.0",
"leaflet.markercluster": "^1.1.0",
"leaflet-fullscreen": "^1.0.2",
"lodash": "^4.17.10",
"markdown": "0.5.0",
"material-design-iconic-font": "^2.2.0",
"moment": "^2.19.3",
Expand All @@ -62,17 +67,25 @@
"pace-progress": "git+https://github.com/getredash/pace.git",
"pivottable": "^2.15.0",
"plotly.js": "1.30.1",
"prop-types": "^15.6.1",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react2angular": "^3.2.1",
"ui-select": "^0.19.8",
"underscore": "^1.8.3",
"underscore.string": "^3.3.4"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-angularjs-annotate": "^0.8.2",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"copy-webpack-plugin": "^4.3.1",
"css-loader": "^0.28.7",
Expand Down
5 changes: 0 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ const config = {
resolve: {
alias: {
"@": appPath,
// Currently `lodash` is used only by `gridstack.js`, but it can work
// with `underscore` as well, so set an alias to avoid bundling both `lodash` and
// `underscore`. When adding new libraries, check if they can work
// with `underscore`, otherwise remove this line
lodash: "underscore"
}
},
plugins: [
Expand Down

0 comments on commit c47ad93

Please sign in to comment.