Fixed jobline insert trigger. RPS-15

This commit is contained in:
Patrick Fic
2020-10-26 12:42:33 -07:00
parent 3c98097a78
commit 87661783c1
7 changed files with 58 additions and 45 deletions

View File

@@ -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
REACT_APP_GRAPHQL_ENDPOINT=https://db.rps.imex.online/v1/graphql
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.rps.imex.online/v1/graphql

View File

@@ -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;

View File

@@ -0,0 +1 @@
[]

View File

@@ -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

View File

@@ -154,17 +154,19 @@ export default function JobLinesTableMolecule({ loading, job }) {
x: true,
y: "20rem",
}}
footer={() => (
<Table.Summary.Row>
<Table.Summary.Cell index={0}>Summary</Table.Summary.Cell>
<Table.Summary.Cell index={5}>
This is a summary content
</Table.Summary.Cell>
<Table.Summary.Cell index={6}>
This is a summary content
</Table.Summary.Cell>
</Table.Summary.Row>
)}
// summary={
// () => (
// <Table.Summary.Row>
// <Table.Summary.Cell index={0}>Summary</Table.Summary.Cell>
// <Table.Summary.Cell index={5}>
// This is a summary content
// </Table.Summary.Cell>
// <Table.Summary.Cell index={6}>
// This is a summary content
// </Table.Summary.Cell>
// </Table.Summary.Row>
// )
// }
/>
</div>
);

View File

@@ -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)

View File

@@ -21,3 +21,4 @@ ReactDOM.render(
</Provider>,
document.getElementById("root")
);
console.log("Connecting to endpoint: ", process.env.REACT_APP_GRAPHQL_ENDPOINT);