Skip to content

Commit d6cedbb

Browse files
Merge pull request #88 from bradenaa/testing
Handled some bugs
2 parents 1db248b + b433b5d commit d6cedbb

File tree

9 files changed

+59
-17
lines changed

9 files changed

+59
-17
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"css-loader": "^2.1.0",
7070
"electron": "^4.0.4",
7171
"electron-builder": "^20.39.0",
72+
"electron-devtools-installer": "^2.2.4",
7273
"eslint": "^5.10.0",
7374
"eslint-config-airbnb": "^17.1.0",
7475
"eslint-plugin-import": "^2.14.0",

src/client/components/NavigationComponents/ClusterInfoComponent.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,26 @@ import React from 'react';
88

99
const ClusterInfoComponent = (props) => {
1010
const { clusterInfo } = props;
11+
let halfOfServerEndpoint;
12+
let serverEndPointFrontHalf;
13+
let serverEndPointBackHalf;
14+
let subnetIds;
1115

12-
const halfOfServerEndpoint = Math.floor(clusterInfo.serverEndPoint.length / 2);
13-
const serverEndPointFrontHalf = clusterInfo.serverEndPoint.slice(0, halfOfServerEndpoint);
14-
const serverEndPointBackHalf = clusterInfo.serverEndPoint.slice(halfOfServerEndpoint);
16+
console.log(clusterInfo);
17+
console.log(Object.prototype.hasOwnProperty.call(clusterInfo, 'serverEndPoint'));
18+
if (Object.prototype.hasOwnProperty.call(clusterInfo, 'serverEndPoint')) {
19+
halfOfServerEndpoint = Math.floor(clusterInfo.serverEndPoint.length / 2);
20+
serverEndPointFrontHalf = clusterInfo.serverEndPoint.slice(0, halfOfServerEndpoint);
21+
serverEndPointBackHalf = clusterInfo.serverEndPoint.slice(halfOfServerEndpoint);
22+
}
23+
24+
if (Object.prototype.hasOwnProperty.call(clusterInfo, 'subnetIdsArray')) {
25+
subnetIds = clusterInfo.subnetIdsArray.map((subnet) => {
26+
return (
27+
<div key={subnet} className="cluster_info_subnets">{subnet}</div>
28+
);
29+
});
30+
}
1531

1632
return (
1733
<div className="cluster_info_container">
@@ -45,9 +61,7 @@ const ClusterInfoComponent = (props) => {
4561
</div>
4662
<div className="cluster_info_minor">
4763
<div className="cluster_info_key">SUBNET IDS: </div>
48-
<div className="cluster_info_subnets">{clusterInfo.subnetIdsArray[0]}</div>
49-
<div className="cluster_info_subnets">{clusterInfo.subnetIdsArray[1]}</div>
50-
<div className="cluster_info_subnets">{clusterInfo.subnetIdsArray[2]}</div>
64+
{subnetIds}
5165
</div>
5266
<div className="cluster_info_minor">
5367
<div className="cluster_info_key">SERVER END POINT: </div>

src/client/components/NavigationComponents/NavComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const NavComponent = (props) => {
5252
<button className="nav_component_cluster_button" type="button" onMouseEnter={getAndDisplayClusterData} onMouseLeave={hideClusterInfo}>CLUSTER DATA</button>
5353
{/* CLUSTER INFO DROPDOWN CONTAINER */}
5454
{showClusterInfo === true && (
55-
<ClusterInfoComponent clusterInfo={clusterInfo} />
55+
<ClusterInfoComponent clusterInfo={clusterInfo} />
5656
)}
5757
</div>
5858
</div>

src/client/containers/NavContainer.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ class NavContainer extends Component {
7777
//* --------------- COMPONENT METHODS --------------------------- *//
7878

7979
getAndDisplayClusterData(e) {
80-
const { clusterInfo, displayClusterInfo } = this.props;
81-
if (clusterInfo.clusterName === '') {
82-
ipcRenderer.send(events.GET_CLUSTER_DATA, 'request cluster data');
80+
const { clusterInfo, displayClusterInfo, creatingCluster } = this.props;
81+
if (!creatingCluster) {
82+
if (clusterInfo.clusterName === '') {
83+
ipcRenderer.send(events.GET_CLUSTER_DATA, 'request cluster data');
84+
}
85+
displayClusterInfo();
8386
}
84-
displayClusterInfo();
8587
}
8688

8789
handleMenuItemToShow(e) {
@@ -92,11 +94,12 @@ class NavContainer extends Component {
9294
}
9395

9496
handleNavBarClick(e) {
95-
const { hideCreateMenuDropdown } = this.props;
96-
hideCreateMenuDropdown();
97+
const { hideCreateMenuDropdown, creatingCluster } = this.props;
98+
if (!creatingCluster) {
99+
hideCreateMenuDropdown();
100+
}
97101
}
98102

99-
100103
// FOR DEBUGGING the main in production
101104
handleKubectlData(event, data) {
102105
console.log('Errors from stderr', data.stderr);

src/client/store/reducers/navbarReducers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default function navbarReducers(state = initialState, action) {
4848
case types.HIDE_CLUSTER_INFO:
4949
return { ...state, showClusterInfo: false };
5050
case types.UPDATE_CLUSTER_DATA:
51+
console.log(action.payload);
5152
return { ...state, clusterInfo: action.payload };
5253
default:
5354
return state;

src/main/.DS_Store

-6 KB
Binary file not shown.

src/main/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require('dotenv').config();
33

44
// --------- ELECTRON MODULES -----------
55
const { app, BrowserWindow, ipcMain, shell, Menu, crashReporter } = require('electron');
6+
const { default: installExtension, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');
67

78
crashReporter.start({
89
productName: 'kre8-awslaunched',
@@ -54,7 +55,9 @@ const createWindowAndSetEnvironmentVariables = () => {
5455
if (NODE_ENV === 'development') {
5556
process.env.APPLICATION_PATH = __dirname;
5657
awsEventCallbacks.setEnvVarsAndMkDirsInDev();
57-
BrowserWindow.addDevToolsExtension(REACT_DEV_TOOLS_PATH);
58+
installExtension(REACT_DEVELOPER_TOOLS)
59+
.then((name) => console.log(`Added Extension: ${name}`))
60+
.catch((err) => console.log('An error occurred: ', err));
5861
} else if (NODE_ENV === 'test') {
5962
process.env.APPLICATION_PATH = __dirname;
6063
awsEventCallbacks.setEnvVarsAndMkDirsInDev();

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = {
5555
// 'process.env.NODE_ENV': JSON.stringify('development'),
5656
// }),
5757
],
58-
devtool: 'cheap-source-map',
58+
devtool: 'eval-source-map',
5959
devServer: {
6060
contentBase: OUTPUT_DIR,
6161
historyApiFallback: true,

yarn.lock

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-4.1.0.tgz#33eff662a5c39c0c2061170cc003c5120743fff0"
88
integrity sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA==
99

10+
11+
version "0.0.6"
12+
resolved "https://registry.yarnpkg.com/7zip/-/7zip-0.0.6.tgz#9cafb171af82329490353b4816f03347aa150a30"
13+
integrity sha1-nK+xca+CMpSQNTtIFvAzR6oVCjA=
14+
1015
"@babel/cli@^7.2.3":
1116
version "7.4.3"
1217
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.4.3.tgz#353048551306ff42e5855b788b6ccd9477289774"
@@ -2270,6 +2275,11 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
22702275
shebang-command "^1.2.0"
22712276
which "^1.2.9"
22722277

2278+
2279+
version "0.0.2"
2280+
resolved "https://registry.yarnpkg.com/cross-unzip/-/cross-unzip-0.0.2.tgz#5183bc47a09559befcf98cc4657964999359372f"
2281+
integrity sha1-UYO8R6CVWb78+YzEZXlkmZNZNy8=
2282+
22732283
crypto-browserify@^3.11.0:
22742284
version "3.12.0"
22752285
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
@@ -2759,6 +2769,16 @@ electron-chromedriver@~3.0.0:
27592769
electron-download "^4.1.0"
27602770
extract-zip "^1.6.5"
27612771

2772+
electron-devtools-installer@^2.2.4:
2773+
version "2.2.4"
2774+
resolved "https://registry.yarnpkg.com/electron-devtools-installer/-/electron-devtools-installer-2.2.4.tgz#261a50337e37121d338b966f07922eb4939a8763"
2775+
integrity sha512-b5kcM3hmUqn64+RUcHjjr8ZMpHS2WJ5YO0pnG9+P/RTdx46of/JrEjuciHWux6pE+On6ynWhHJF53j/EDJN0PA==
2776+
dependencies:
2777+
"7zip" "0.0.6"
2778+
cross-unzip "0.0.2"
2779+
rimraf "^2.5.2"
2780+
semver "^5.3.0"
2781+
27622782
electron-download@^4.1.0:
27632783
version "4.1.1"
27642784
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8"
@@ -6600,7 +6620,7 @@ rgb2hex@^0.1.9:
66006620
resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.1.9.tgz#5d3e0e14b0177b568e6f0d5b43e34fbfdb670346"
66016621
integrity sha512-32iuQzhOjyT+cv9aAFRBJ19JgHwzQwbjUhH3Fj2sWW2EEGAW8fpFrDFP5ndoKDxJaLO06x1hE3kyuIFrUQtybQ==
66026622

6603-
rimraf@2, [email protected], rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:
6623+
rimraf@2, [email protected], rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:
66046624
version "2.6.3"
66056625
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
66066626
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==

0 commit comments

Comments
 (0)