datajunction-ui 0.0.1-rc.1 → 0.0.1-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { useParams } from 'react-router-dom';
3
- import { useEffect, useState } from 'react';
4
- import { DataJunctionAPI } from '../../services/DJService';
3
+ import { useContext, useEffect, useState } from 'react';
5
4
  import Tab from '../../components/Tab';
6
5
  import NamespaceHeader from '../../components/NamespaceHeader';
7
6
  import NodeInfoTab from './NodeInfoTab';
8
7
  import NodeColumnTab from './NodeColumnTab';
9
8
  import NodeLineage from './NodeGraphTab';
9
+ import DJClientContext from '../../providers/djclient';
10
10
 
11
11
  export function NodePage() {
12
+ const djClient = useContext(DJClientContext).DataJunctionAPI;
12
13
  const [state, setState] = useState({
13
14
  selectedTab: 0,
14
15
  });
@@ -35,11 +36,11 @@ export function NodePage() {
35
36
 
36
37
  useEffect(() => {
37
38
  const fetchData = async () => {
38
- const data = await DataJunctionAPI.node(name);
39
+ const data = await djClient.node(name);
39
40
  setNode(data);
40
41
  };
41
42
  fetchData().catch(console.error);
42
- }, [name]);
43
+ }, [djClient, name]);
43
44
 
44
45
  const TabsJson = [
45
46
  {
@@ -66,7 +67,7 @@ export function NodePage() {
66
67
  tabToDisplay = <NodeColumnTab node={node} />;
67
68
  break;
68
69
  case 2:
69
- tabToDisplay = <NodeLineage djNode={node} />;
70
+ tabToDisplay = <NodeLineage djNode={node} djClient={djClient} />;
70
71
  break;
71
72
  default:
72
73
  tabToDisplay = <NodeInfoTab node={node} />;
@@ -0,0 +1,5 @@
1
+ import { DataJunctionAPI } from '../services/DJService';
2
+ import * as React from 'react';
3
+
4
+ const DJClientContext = React.createContext({ DataJunctionAPI });
5
+ export default DJClientContext;
@@ -352,6 +352,8 @@ tbody th {
352
352
  padding: 0.44rem;
353
353
  border-radius: 0.375rem;
354
354
  cursor: crosshair;
355
+ word-wrap: break-word;
356
+ white-space: break-spaces;
355
357
  }
356
358
 
357
359
  /* Nodes */
@@ -379,8 +381,8 @@ tbody th {
379
381
  }
380
382
 
381
383
  .node_type__cube {
382
- background-color: #c2180750 !important;
383
- color: #c21807;
384
+ background-color: #dbafff !important;
385
+ color: #580076;
384
386
  }
385
387
 
386
388
  .status__valid {
@@ -498,8 +500,8 @@ pre {
498
500
  flex-grow: 0 !important;
499
501
  }
500
502
  .logo img {
501
- padding: 10px;
502
- margin-bottom: -1.2rem;
503
+ padding: 15px;
504
+ margin-bottom: 0.2rem;
503
505
  }
504
506
 
505
507
  .menu-lg-row > .menu-item {
package/tsconfig.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "removeComments": true,
22
22
  "sourceMap": true
23
23
  },
24
- "include": ["src", "internals/startingTemplate/**/*"],
24
+ "include": ["src/**/*.ts", "src/**/*.tsx", "internals/startingTemplate/**/*"],
25
25
  "ts-node": {
26
26
  "compilerOptions": {
27
27
  "esModuleInterop": true,
package/webpack.config.js CHANGED
@@ -1,6 +1,7 @@
1
+ const webpack = require('webpack');
1
2
  const path = require('path');
2
3
  const HtmlWebpackPlugin = require('html-webpack-plugin');
3
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4
+ // const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4
5
 
5
6
  var babelOptions = {
6
7
  presets: ['@babel/preset-react'],
@@ -10,17 +11,23 @@ module.exports = {
10
11
  cache: true,
11
12
  entry: {
12
13
  main: './src/index.tsx',
13
- vendor: ['events', 'fbemitter', 'flux', 'react', 'react-dom'],
14
+ vendor: ['events', 'react', 'react-dom'],
14
15
  },
15
16
  target: 'web',
16
17
  mode: 'development',
17
18
  output: {
18
19
  path: path.resolve(__dirname, './dist'),
19
20
  filename: 'static/[name].[fullhash].js',
21
+ library: 'datajunction-ui',
22
+ libraryTarget: 'umd',
23
+ globalObject: 'this',
24
+ umdNamedDefine: true,
20
25
  publicPath: '/',
21
26
  },
22
27
  devServer: {
23
- historyApiFallback: true,
28
+ historyApiFallback: {
29
+ disableDotRule: true,
30
+ },
24
31
  },
25
32
  resolve: {
26
33
  extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
@@ -31,6 +38,13 @@ module.exports = {
31
38
  fs: false,
32
39
  os: false,
33
40
  module: false,
41
+ http: false,
42
+ tls: false,
43
+ https: false,
44
+ url: false,
45
+ browser: false,
46
+ net: false,
47
+ process: false,
34
48
  },
35
49
  },
36
50
  module: {
@@ -84,6 +98,9 @@ module.exports = {
84
98
  new HtmlWebpackPlugin({
85
99
  template: path.resolve(__dirname, 'public', 'index.html'),
86
100
  }),
101
+ new webpack.DefinePlugin({
102
+ REACT_APP_DJ_URL: 'http://localhost:8000',
103
+ }),
87
104
  // new MiniCssExtractPlugin({
88
105
  // filename: './styles/index.css',
89
106
  // }),
package/dist/index.html DELETED
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="public/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <link rel="manifest" href="public/manifest.json" />
9
- <meta property="og:title" content="React Boilerplate Example App" />
10
- <meta property="og:description" content="" />
11
- <title>DataJunction App</title>
12
- <meta name="description" content="" />
13
- <script defer src="main.js"></script>
14
- <script defer src="vendor.js"></script>
15
- </head>
16
- <body>
17
- <noscript>You need to enable JavaScript to run this app.</noscript>
18
- <div id="root"></div>
19
-
20
- <!-- Inter Font -->
21
- <link
22
- href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap"
23
- rel="stylesheet"
24
- />
25
- </body>
26
- </html>