Skip to content

Commit c60fc6e

Browse files
committed
added redux devTools, working on adding react devTools
1 parent 09a8717 commit c60fc6e

85 files changed

Lines changed: 17346 additions & 113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/context/ApplicationContext.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const ApplicationContextProvider: React.FC<AppContextProps> = React.memo(props =
4040
*/
4141
// v10: Invoked by connectToDB, passing in app (card title)
4242
const fetchServicesNames = useCallback((application: string) => {
43+
44+
console.log({application});
4345
// console.log('Hi, inside ApplicationConext - fetchServicesNames callback. Sending servicesRequest to ipcMain.');
4446
// console.log('app when fetch services name: ', application);
4547
ipcRenderer.send('servicesRequest');
@@ -68,6 +70,7 @@ const ApplicationContextProvider: React.FC<AppContextProps> = React.memo(props =
6870
ipcRenderer.removeAllListeners('databaseConnected');
6971
ipcRenderer.send('connect', username, index, URI, databaseType);
7072
ipcRenderer.on('databaseConnected', (event: Electron.Event, data: any) => {
73+
console.log({data});
7174
if(data === true) {
7275
fetchServicesNames(application);
7376
} else {

app/context/DashboardContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const DashboardContextProvider = React.memo((props: any) => {
6161
JSON.stringify([name, database, URI, description, typeOfService])
6262
);
6363
setApplications(result);
64-
// console.log('the current application that was added is : ', result);
64+
console.log('the current application that was added is : ', result);
6565
}, []);
6666

6767
const addAwsApp = useCallback((awsFields: AwsFields) => {

electron/Main.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import { app, BrowserWindow, ipcMain } from 'electron';
1+
import { app, BrowserWindow, ipcMain, session } from 'electron';
22
import './routes/dashboard';
33
import { clearGuestSettings } from './routes/dashboard';
44
import './routes/data';
55
import './routes/cloudbased';
66
import path from 'path';
7+
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer'
78

89
// Declare variable to be used as the application window
910
let win: Electron.BrowserWindow;
1011

1112
app.commandLine.appendSwitch('remote-debugging-port', '9222');
1213

14+
// Path to reactDevTools
15+
const reactDevToolsPath = path.join(__dirname, '../node_modules/react-devtools');
16+
1317
/**
1418
* @desc createWindow sets up the environment of the window (dimensions, port, initial settings)
1519
*/
@@ -56,9 +60,32 @@ const createWindow = () => {
5660
});
5761
};
5862

63+
const addDevTools = async () => {
64+
// await installExtension(REACT_DEVELOPER_TOOLS, { loadExtensionOptions: { allowFileAccess: true }})
65+
// .then((name) => console.log(`Added Extension: ${name}`))
66+
// .catch((err) => console.log('An error occurred: ', err));
67+
68+
await installExtension(REDUX_DEVTOOLS)
69+
.then((name) => console.log(`Added Extension: ${name}`))
70+
.catch((err) => console.log('An error occurred: ', err));
71+
};
72+
73+
app.whenReady().then(async () => {
74+
await addDevTools();
75+
76+
await session.defaultSession.loadExtension(reactDevToolsPath);
77+
// devtools extensions
78+
});
5979
// Invoke the createWindow function when Electron application loads
6080
app.on('ready', createWindow);
6181

82+
// Loads reactDevTools extension
83+
// app.whenReady().then(async () => {
84+
// console.log(reactDevToolsPath);
85+
// await session.defaultSession.loadExtension(reactDevToolsPath);
86+
// console.log({reactDevToolsPath})
87+
// });
88+
6289
// Quits application when all windows are closed
6390
app.on('window-all-closed', () => {
6491
app.quit();

electron/routes/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ipcMain.on('servicesRequest', async (message: Electron.IpcMainEvent) => {
8484
// console.log('Hi, inside data.ts line 97 - servicesRequest. Fetching services...');
8585

8686
// Mongo Database
87-
// console.log('data.ts line 100 CurrentDataBase TYPE:', currentDatabaseType);
87+
console.log('data.ts line 100 CurrentDataBase TYPE:', currentDatabaseType);
8888
if (currentDatabaseType === 'MongoDB' ) {
8989
// Get all documents from the services collection
9090
//>>>>>

examples/microservices/sample.env

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)