Replaced electron-settings with store. Implemented job upsert logic.
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
import { List } from "antd";
|
||||
import React from "react";
|
||||
import { DeleteFilled } from "@ant-design/icons";
|
||||
import ipcTypes from "../../../ipc.types";
|
||||
const { ipcRenderer } = window;
|
||||
|
||||
export default function FilePathMolecule(item, index) {
|
||||
return <List.Item key={index}>{item}</List.Item>;
|
||||
const handleClick = () => {
|
||||
ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.removePath, item);
|
||||
};
|
||||
|
||||
return (
|
||||
<List.Item key={index} actions={[<DeleteFilled onClick={handleClick} />]}>
|
||||
{item}
|
||||
</List.Item>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { createStructuredSelector } from "reselect";
|
||||
import ipcTypes from "../ipc.types";
|
||||
|
||||
const { ipcRenderer } = window.require("electron");
|
||||
//const settings = window.require("electron-settings");
|
||||
|
||||
const mapStateToProps = createStructuredSelector({});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
Reference in New Issue
Block a user