diff --git a/.env.production b/.env.production index 313cb63..79ed23a 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ REACT_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyCXg148Ma82Qa7dK-2EL4sE0tJhKVnh1rY", "authDomain": "rps-prod-b53c8.firebaseapp.com", "databaseURL": "https://rps-prod-b53c8.firebaseio.com", "projectId": "rps-prod-b53c8", "storageBucket": "rps-prod-b53c8.appspot.com", "messagingSenderId": "361220226954", "appId": "1:361220226954:web:bf3a38d196e4fd8c921273", "measurementId": "G-W3BHH420EC"} -REACT_APP_GRAPHQL_ENDPOINT=https://rps.bodyshop.app/v1/graphql -REACT_APP_GRAPHQL_ENDPOINT_WS=wss://rps.bodyshop.app/v1/graphql \ No newline at end of file +REACT_APP_GRAPHQL_ENDPOINT=https://db.rps.imex.online/v1/graphql +REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.rps.imex.online/v1/graphql \ No newline at end of file diff --git a/electron/file-watcher/file-watcher.js b/electron/file-watcher/file-watcher.js index 4b3d96b..ba2522b 100644 --- a/electron/file-watcher/file-watcher.js +++ b/electron/file-watcher/file-watcher.js @@ -94,14 +94,16 @@ function onWatcherReady() { } async function StopWatcher() { - await watcher.close(); - log.info("Watcher stopped."); - const b = BrowserWindow.getAllWindows()[0]; - b.webContents.send(ipcTypes.default.fileWatcher.toRenderer.stopSuccess); - NewNotification({ - title: "RPS Watcher Stopped", - body: "Estimates will not be automatically uploaded.", - }); + if (watcher) { + await watcher.close(); + log.info("Watcher stopped."); + const b = BrowserWindow.getAllWindows()[0]; + b.webContents.send(ipcTypes.default.fileWatcher.toRenderer.stopSuccess); + NewNotification({ + title: "RPS Watcher Stopped", + body: "Estimates will not be automatically uploaded.", + }); + } } exports.StartWatcher = StartWatcher; diff --git a/hasura/migrations/1603740763642_run_sql_migration/down.yaml b/hasura/migrations/1603740763642_run_sql_migration/down.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/hasura/migrations/1603740763642_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1603740763642_run_sql_migration/up.yaml b/hasura/migrations/1603740763642_run_sql_migration/up.yaml new file mode 100644 index 0000000..731c40e --- /dev/null +++ b/hasura/migrations/1603740763642_run_sql_migration/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: true + read_only: false + sql: "create trigger calculate_updated_job_line_insert\r\nbefore\r\ninsert\r\n + \ on\r\n public.joblines for each row execute function calculate_job_line();" + type: run_sql diff --git a/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx b/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx index 1bfc583..6aabfe4 100644 --- a/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx +++ b/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx @@ -154,17 +154,19 @@ export default function JobLinesTableMolecule({ loading, job }) { x: true, y: "20rem", }} - footer={() => ( - - Summary - - This is a summary content - - - This is a summary content - - - )} + // summary={ + // () => ( + // + // Summary + // + // This is a summary content + // + // + // This is a summary content + // + // + // ) + // } /> ); diff --git a/src/components/organisms/jobs-list-search/jobs-list-search.organism.jsx b/src/components/organisms/jobs-list-search/jobs-list-search.organism.jsx index 5a9e5b6..118b090 100644 --- a/src/components/organisms/jobs-list-search/jobs-list-search.organism.jsx +++ b/src/components/organisms/jobs-list-search/jobs-list-search.organism.jsx @@ -35,36 +35,37 @@ export default function JobsTableOrganism() { ); const handleInfiniteOnLoad = (page) => { - if (fetchMore) + if (fetchMore) { ipcRenderer.send(ipcTypes.default.app.toMain.track, { event: "FETCH_MORE_JOBS", }); - fetchMore({ - variables: { - offset: limit * page, - }, - updateQuery: (prev, { fetchMoreResult }) => { - if (!fetchMoreResult) { - console.log("No more results. Fetch More was empty."); - setState({ ...state, hasMore: false }); - return prev; - } + fetchMore({ + variables: { + offset: limit * page, + }, + updateQuery: (prev, { fetchMoreResult }) => { + if (!fetchMoreResult) { + console.log("No more results. Fetch More was empty."); + setState({ ...state, hasMore: false }); + return prev; + } - const newCache = Object.assign({}, prev, { - jobs: [...prev.search_jobs, ...fetchMoreResult.search_jobs], - }); + const newCache = Object.assign({}, prev, { + jobs: [...prev.search_jobs, ...fetchMoreResult.search_jobs], + }); - if ( - newCache.jobs.length >= data && - data.search_jobs_aggregate.aggregate.count - ) { - console.log("No more results."); - setState({ ...state, hasMore: false }); - } + if ( + newCache.jobs.length >= data && + data.search_jobs_aggregate.aggregate.count + ) { + console.log("No more results."); + setState({ ...state, hasMore: false }); + } - return newCache; - }, - }); + return newCache; + }, + }); + } }; if (error) diff --git a/src/index.js b/src/index.js index e6db681..313dcef 100644 --- a/src/index.js +++ b/src/index.js @@ -21,3 +21,4 @@ ReactDOM.render( , document.getElementById("root") ); +console.log("Connecting to endpoint: ", process.env.REACT_APP_GRAPHQL_ENDPOINT);