From 67cae24b6c87a8c7edc1f77241639da24c125435 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 15 Oct 2020 09:57:23 -0700 Subject: [PATCH] Formatting fixes. --- electron/file-watcher/file-watcher-ipc.js | 2 ++ electron/file-watcher/file-watcher.js | 2 -- electron/main.js | 5 +++++ hasura/debug.log | 1 + package.json | 18 ++++++------------ .../filepaths-list/filepaths-list.organism.jsx | 3 ++- .../jobs-detail/jobs-detail.organism.jsx | 3 ++- .../jobs-detail.organism.styles.scss | 5 +++++ .../jobs-list.organism.jsx} | 4 ++-- .../jobs-list.organism.styles.scss} | 6 +++++- src/components/pages/jobs/jobs.page.jsx | 12 ++++++------ src/components/pages/routes/routes.page.jsx | 4 ++-- src/components/pages/sign-in/sign-in.page.jsx | 15 ++++++++++++--- src/graphql/jobs.queries.js | 2 +- src/redux/user/user.reducer.js | 7 +++++-- src/redux/user/user.selectors.js | 7 ++++++- 16 files changed, 62 insertions(+), 34 deletions(-) create mode 100644 src/components/organisms/jobs-detail/jobs-detail.organism.styles.scss rename src/components/organisms/{jobs-table/jobs-table.organism.jsx => jobs-list/jobs-list.organism.jsx} (98%) rename src/components/organisms/{jobs-table/jobs-table.organism.styles.scss => jobs-list/jobs-list.organism.styles.scss} (86%) diff --git a/electron/file-watcher/file-watcher-ipc.js b/electron/file-watcher/file-watcher-ipc.js index 16442b6..6a24b05 100644 --- a/electron/file-watcher/file-watcher-ipc.js +++ b/electron/file-watcher/file-watcher-ipc.js @@ -23,6 +23,7 @@ ipcMain.on(ipcTypes.default.fileWatcher.toMain.start, async (event, arg) => { ipcTypes.default.fileWatcher.toRenderer.filepathsList, filePaths ); + event.sender.send(ipcTypes.default.fileWatcher.toRenderer.startSuccess); }); ipcMain.on(ipcTypes.default.fileWatcher.toMain.stop, async (event, arg) => { @@ -41,6 +42,7 @@ ipcMain.on(ipcTypes.default.fileWatcher.toMain.addPath, async (event, arg) => { ); const newFilePaths = await settings.get("filePaths"); + console.log("newFilePaths", newFilePaths) event.sender.send( ipcTypes.default.fileWatcher.toRenderer.filepathsList, diff --git a/electron/file-watcher/file-watcher.js b/electron/file-watcher/file-watcher.js index 2f0698b..52bbeca 100644 --- a/electron/file-watcher/file-watcher.js +++ b/electron/file-watcher/file-watcher.js @@ -62,8 +62,6 @@ function StartWatcher() { function onWatcherReady() { console.log("Ready!"); - const b = BrowserWindow.getFocusedWindow(); - b.webContents.send(ipcTypes.default.fileWatcher.toRenderer.startSuccess); } async function StopWatcher() { diff --git a/electron/main.js b/electron/main.js index f22192e..e9e219e 100644 --- a/electron/main.js +++ b/electron/main.js @@ -6,6 +6,11 @@ const { default: ipcTypes } = require("../src/ipc.types"); require("./ipc-main-handler"); +settings.configure({ + defaults: { + foo: "bar", + }, +}); // Conditionally include the dev tools installer to load React Dev Tools let installExtension, REACT_DEVELOPER_TOOLS; if (isDev) { diff --git a/hasura/debug.log b/hasura/debug.log index 6f29fd0..ab51e52 100644 --- a/hasura/debug.log +++ b/hasura/debug.log @@ -1 +1,2 @@ [1014/195617.530:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) +[1015/081931.328:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) diff --git a/package.json b/package.json index 1dd9ddb..56b223c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,9 @@ { "name": "imexrps", + "productName": "ImEX RPS", + "author": "Patrick Fic ", + "description": "ImEX RPS", "version": "0.0.1", - "private": true, "main": "electron/main.js", "homepage": "./", "dependencies": { @@ -77,16 +79,11 @@ }, "config": { "forge": { - "packagerConfig": { - "icon": "src/icons/mac/icon.icns", - "name": "ImEX RPS" - }, + "packagerConfig": {}, "makers": [ { "name": "@electron-forge/maker-squirrel", - "config": { - "name": "ImeXRPS" - } + "config": {} }, { "name": "@electron-forge/maker-zip", @@ -96,10 +93,7 @@ }, { "name": "@electron-forge/maker-deb", - "config": { - "name": "ImEX RPS", - "icon": "src/icons/mac/icon.icns" - } + "config": {} }, { "name": "@electron-forge/maker-rpm", diff --git a/src/components/organisms/filepaths-list/filepaths-list.organism.jsx b/src/components/organisms/filepaths-list/filepaths-list.organism.jsx index 4745876..382d977 100644 --- a/src/components/organisms/filepaths-list/filepaths-list.organism.jsx +++ b/src/components/organisms/filepaths-list/filepaths-list.organism.jsx @@ -21,10 +21,11 @@ export function FilePathsList({ watchedPaths }) { ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.filepathsGet); }, []); + console.log("watchedPaths", watchedPaths); return (
File Paths - +
); diff --git a/src/components/organisms/jobs-detail/jobs-detail.organism.jsx b/src/components/organisms/jobs-detail/jobs-detail.organism.jsx index 8e8fbc1..b4b5d14 100644 --- a/src/components/organisms/jobs-detail/jobs-detail.organism.jsx +++ b/src/components/organisms/jobs-detail/jobs-detail.organism.jsx @@ -8,6 +8,7 @@ import { selectSelectedJobId } from "../../../redux/application/application.sele import ErrorResultAtom from "../../atoms/error-result/error-result.atom"; import JobsDetailDescriptionMolecule from "../../molecules/jobs-detail-description/jobs-detail-description.molecule"; import JobsLinesTableMolecule from "../../molecules/jobs-lines-table/jobs-lines-table.molecule"; +import "./jobs-detail.organism.styles.scss"; const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser @@ -32,7 +33,7 @@ export function JobsDetailOrganism({ selectedJobId }) { /> ); return ( -
+
+
({}); export function JobsPage() { return ( -
- - - +
+ + + - + diff --git a/src/components/pages/routes/routes.page.jsx b/src/components/pages/routes/routes.page.jsx index 86f9183..9277028 100644 --- a/src/components/pages/routes/routes.page.jsx +++ b/src/components/pages/routes/routes.page.jsx @@ -12,12 +12,12 @@ const mapDispatchToProps = (dispatch) => ({}); export function RoutesPage() { return ( - + - + diff --git a/src/components/pages/sign-in/sign-in.page.jsx b/src/components/pages/sign-in/sign-in.page.jsx index b8451d9..40952f2 100644 --- a/src/components/pages/sign-in/sign-in.page.jsx +++ b/src/components/pages/sign-in/sign-in.page.jsx @@ -6,11 +6,15 @@ import { Link } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import ImEXOnlineLogo from "../../../assets/logo192.png"; import { emailSignInStart } from "../../../redux/user/user.actions"; -import { selectSignInError } from "../../../redux/user/user.selectors"; +import { + selectLoginLoading, + selectSignInError, +} from "../../../redux/user/user.selectors"; import "./sign-in.page.styles.scss"; const mapStateToProps = createStructuredSelector({ signInError: selectSignInError, + loginLoading: selectLoginLoading, }); const mapDispatchToProps = (dispatch) => ({ @@ -18,7 +22,7 @@ const mapDispatchToProps = (dispatch) => ({ dispatch(emailSignInStart({ email, password })), }); -export function SignInPage({ emailSignInStart, signInError }) { +export function SignInPage({ emailSignInStart, signInError, loginLoading }) { const handleFinish = (values) => { const { email, password } = values; emailSignInStart(email, password); @@ -45,7 +49,12 @@ export function SignInPage({ emailSignInStart, signInError }) { {signInError ? ( ) : null} - diff --git a/src/graphql/jobs.queries.js b/src/graphql/jobs.queries.js index 5f3975e..3792762 100644 --- a/src/graphql/jobs.queries.js +++ b/src/graphql/jobs.queries.js @@ -54,7 +54,7 @@ export const QUERY_ALL_JOBS_PAGINATED = gql` `; export const QUERY_JOB_BY_PK = gql` - query QUERY_ALL_JOBS_PAGINATED($jobId: uuid!) { + query QUERY_JOB_BY_PK($jobId: uuid!) { jobs_by_pk(id: $jobId) { ownr_fn ownr_ln diff --git a/src/redux/user/user.reducer.js b/src/redux/user/user.reducer.js index 39d7fe2..0f62651 100644 --- a/src/redux/user/user.reducer.js +++ b/src/redux/user/user.reducer.js @@ -14,7 +14,7 @@ const INITIAL_STATE = { error: null, success: false, }, - authLevel: 0, + loginLoading: false, }; const userReducer = (state = INITIAL_STATE, action) => { @@ -47,6 +47,7 @@ const userReducer = (state = INITIAL_STATE, action) => { return { ...state, currentUser: action.payload, + loingLoading: false, error: null, }; case UserActionTypes.SIGN_OUT_SUCCESS: @@ -81,8 +82,10 @@ const userReducer = (state = INITIAL_STATE, action) => { return { ...state, error: action.payload, + loginLoading: false, }; - + case UserActionTypes.EMAIL_SIGN_IN_START: + return { ...state, loginLoading: true }; default: return state; } diff --git a/src/redux/user/user.selectors.js b/src/redux/user/user.selectors.js index f3e616a..79180d8 100644 --- a/src/redux/user/user.selectors.js +++ b/src/redux/user/user.selectors.js @@ -20,4 +20,9 @@ export const selectPasswordReset = createSelector( export const selectBodyshop = createSelector( [selectUser], (user) => user.bodyshop -); \ No newline at end of file +); + +export const selectLoginLoading = createSelector( + [selectUser], + (user) => user.loginLoading +);