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

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