Replaced electron-settings with store. Implemented job upsert logic.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { SyncOutlined } from "@ant-design/icons";
|
||||
import { useQuery } from "@apollo/client";
|
||||
import { List, Space, Spin, Typography } from "antd";
|
||||
import { Button, List, Space, Spin, Typography } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import InfiniteScroll from "react-infinite-scroller";
|
||||
import { connect } from "react-redux";
|
||||
@@ -10,7 +11,6 @@ import { selectSelectedJobId } from "../../../redux/application/application.sele
|
||||
import ErrorResultAtom from "../../atoms/error-result/error-result.atom";
|
||||
import TimeAgoFormatter from "../../atoms/time-ago-formatter/time-ago-formatter.atom";
|
||||
import "./jobs-list.organism.styles.scss";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
selectedJobId: selectSelectedJobId,
|
||||
});
|
||||
@@ -22,7 +22,7 @@ const limit = 20;
|
||||
export function JobsTableOrganism({ selectedJobId, setSelectedJobId }) {
|
||||
const [state, setState] = useState({ hasMore: true });
|
||||
|
||||
const { loading, error, data, fetchMore } = useQuery(
|
||||
const { loading, error, data, refetch, fetchMore } = useQuery(
|
||||
QUERY_ALL_JOBS_PAGINATED,
|
||||
{
|
||||
variables: {
|
||||
@@ -76,6 +76,9 @@ export function JobsTableOrganism({ selectedJobId, setSelectedJobId }) {
|
||||
|
||||
return (
|
||||
<div className="jobs-list-container">
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<div className="jobs-list-infinite-container">
|
||||
<InfiniteScroll
|
||||
pageStart={0}
|
||||
|
||||
Reference in New Issue
Block a user