Skip to content

Commit f08f985

Browse files
committed
initial working version
0 parents  commit f08f985

24 files changed

+8961
-0
lines changed

.babelrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
],
6+
"plugins": [
7+
"@babel/plugin-proposal-class-properties"
8+
]
9+
}

.eslintrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
export default {
3+
"parser": "babel-eslint",
4+
5+
"plugins": [
6+
"react"
7+
]
8+
};

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules/
2+
.vscode/
3+
dist/
4+
5+
.env
6+
npm-debug.log
7+
yarn-error.log
8+
.DS_Store
9+
*.twbr
10+
*.twb
11+
*.twbx

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Takashi Binns
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

nodemon.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"watch": ["src/"]
3+
}

package.json

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "tableau-sample-web-app",
3+
"version": "1.0.0",
4+
"description": "Example of how modern web apps can integrate with Tableau Server",
5+
"main": "src/server/index.js",
6+
"scripts": {
7+
"build": "webpack --mode production",
8+
"production": "npm run build && node src/server/index.js",
9+
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
10+
"server": "nodemon src/server/index.js",
11+
"debug-server": "nodemon --inspect src/server/index.js",
12+
"dev": "concurrently \"npm run debug-server\" \"npm run client\"",
13+
"start": "node src/server/index.js",
14+
"postinstall": "npm run build"
15+
},
16+
"author": "Takashi Binns",
17+
"license": "ISC",
18+
"dependencies": {
19+
"@tableau/tableau-ui": "^3.0.0",
20+
"axios": "^0.18.0",
21+
"babel-polyfill": "^6.26.0",
22+
"crypto-js": "^3.1.9-1",
23+
"csv-parse": "^4.4.3",
24+
"csv-writer": "^1.6.0",
25+
"dotenv": "^8.2.0",
26+
"express": "^4.16.3",
27+
"moment": "^2.24.0",
28+
"ramda": "^0.27.0",
29+
"react": "^16.5.2",
30+
"react-bootstrap": "^1.0.0-beta.6",
31+
"react-dom": "^16.5.2",
32+
"react-router-dom": "^5.2.0",
33+
"react-spinkit": "^3.0.0",
34+
"react-toastify": "^5.1.0",
35+
"simple-node-logger": "^18.12.24",
36+
"webpack": "^4.43.0",
37+
"webpack-cli": "^3.3.12"
38+
},
39+
"devDependencies": {
40+
"@babel/core": "^7.0.0",
41+
"@babel/plugin-proposal-class-properties": "^7.0.0",
42+
"@babel/preset-env": "^7.0.0",
43+
"@babel/preset-react": "^7.0.0",
44+
"@fortawesome/fontawesome-free": "^5.8.2",
45+
"babel-eslint": "^10.0.0",
46+
"babel-loader": "^8.0.0",
47+
"clean-webpack-plugin": "^1.0.0",
48+
"concurrently": "^4.0.0",
49+
"css-loader": "^2.0.0",
50+
"eslint": "^5.0.0",
51+
"eslint-config-airbnb": "^17.0.0",
52+
"eslint-plugin-import": "^2.11.0",
53+
"eslint-plugin-jsx-a11y": "^6.0.3",
54+
"eslint-plugin-react": "^7.7.0",
55+
"file-loader": "^3.0.0",
56+
"html-webpack-plugin": "^3.2.0",
57+
"nodemon": "^1.17.3",
58+
"style-loader": "^0.23.0",
59+
"url-loader": "^1.0.1",
60+
"webpack-dev-server": "^3.1.3"
61+
},
62+
"engines": {
63+
"node": "14.x"
64+
}
65+
}

public/favicon.ico

9.9 KB
Binary file not shown.

public/index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<script src="https://cdn.jsdelivr.net/gh/tableau/extensions-api@master/lib/tableau.extensions.1.latest.js"></script>
9+
<title>Tableau Extension</title>
10+
</head>
11+
12+
<body>
13+
<div id="root"></div>
14+
</body>
15+
16+
</html>

public/loading.gif

89.4 KB
Loading

src/client/App.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
// Import dependencies used throughout the application
3+
import React, { Component } from 'react';
4+
import { ToastContainer } from 'react-toastify';
5+
import 'react-toastify/dist/ReactToastify.css';
6+
import {
7+
BrowserRouter as Router,
8+
useLocation
9+
} from 'react-router-dom';
10+
import Extension from './Extension/Extension';
11+
import Config from './Config/Config';
12+
13+
function Navigator() {
14+
15+
// Get the location object
16+
const location = useLocation();
17+
18+
// Decide whether to show the extension or config popup
19+
const output = () => {
20+
if (location.hash === '#config') {
21+
return <Config/>;
22+
}
23+
return <Extension/>;
24+
};
25+
return (
26+
<div>
27+
{ output() }
28+
</div>
29+
);
30+
}
31+
32+
export default function App() {
33+
return (
34+
<Router>
35+
<ToastContainer position="top-center" autoClose={2000} hideProgressBar newestOnTop
36+
closeOnClick rtl={false} pauseOnFocusLoss draggable={false} pauseOnHover
37+
/>
38+
<Navigator />
39+
</Router>
40+
);
41+
}

src/client/Config/Config.css

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/************************************************/
2+
/* CSS for Tableau Extension's popup dialog */
3+
/************************************************/
4+
5+
/* Defaults */
6+
body {
7+
font: 12px "Benton Sans Book";
8+
}
9+
div.container{
10+
padding:0;
11+
}
12+
13+
/* Top Title Bar */
14+
.tableau-titlebar {
15+
height: 30px;
16+
background-color: rgb(245, 245, 245);
17+
padding-top:7px;
18+
}
19+
.tableau-titlebar-label {
20+
margin-left: 18px;
21+
}
22+
.tableau-titlebar-close-button {
23+
float: right;
24+
text-align: center;
25+
width: 30px;
26+
cursor: pointer;
27+
text-transform: uppercase;
28+
}
29+
30+
/* Main config UI */
31+
.tableau-section-title{
32+
font: 12px "Benton Sans Medium";
33+
color: black;
34+
opacity: 0.8;
35+
padding-top: 18px;
36+
padding-bottom: 18px;
37+
}
38+
.tableau-section-label{
39+
float: left;
40+
font-size: 10px;
41+
color: black;
42+
opacity: 0.56;
43+
margin-right: 18px;
44+
width: 100px;
45+
padding-top:6px;
46+
}
47+
48+
49+
/* Bottom save buttons */
50+
.tableau-footer {
51+
float: right;
52+
}
53+
54+
.tableau-footer button {
55+
margin-right: 12px;
56+
}

0 commit comments

Comments
 (0)