Fixed refresh all. Fixed Updating Methods. Removed Jira Widget.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Button, List } from "antd";
|
||||
import { WarningOutlined } from "@ant-design/icons";
|
||||
import { List } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -6,7 +7,6 @@ import { setSelectedJobId } from "../../../redux/application/application.actions
|
||||
import { selectSelectedJobId } from "../../../redux/application/application.selectors";
|
||||
import TimeAgoFormatter from "../../atoms/time-ago-formatter/time-ago-formatter.atom";
|
||||
import "./jobs-list-item.styles.scss";
|
||||
import { WarningOutlined } from "@ant-design/icons";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
selectedJobId: selectSelectedJobId,
|
||||
@@ -19,6 +19,7 @@ export function JobsListItemMolecule({
|
||||
selectedJobId,
|
||||
setSelectedJobId,
|
||||
item,
|
||||
refetch,
|
||||
}) {
|
||||
const handleSelect = (jobId) => {
|
||||
setSelectedJobId(jobId);
|
||||
@@ -29,9 +30,11 @@ export function JobsListItemMolecule({
|
||||
<List.Item
|
||||
className="jobs-list-item-refresh"
|
||||
key="refreshItem"
|
||||
onClick={() => console.log("Refresh")}
|
||||
onClick={() => {
|
||||
refetch();
|
||||
}}
|
||||
>
|
||||
<div style={{ flex: 1 }}>Refresh</div>
|
||||
<div className="jobs-list-item-refresh-content">Refresh All</div>
|
||||
</List.Item>
|
||||
);
|
||||
return (
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
padding: 0.1rem !important;
|
||||
margin: 0;
|
||||
border-bottom: 0.8rem solid #f0f0f0 !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&-content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background-color: #e6f7ff;
|
||||
|
||||
@@ -36,6 +36,9 @@ export function ReportingDatesMolecule({ queryReportingData }) {
|
||||
<DatePicker.RangePicker
|
||||
ranges={{
|
||||
Today: [moment(), moment()],
|
||||
"Last 7 days": [moment().subtract(7, "days"), moment()],
|
||||
"Next 7 days": [moment(), moment().add(7, "days")],
|
||||
"Next 14 days": [moment(), moment().add(14, "days")],
|
||||
"Last Month": [
|
||||
moment().startOf("month").subtract(1, "month"),
|
||||
moment().startOf("month").subtract(1, "month").endOf("month"),
|
||||
@@ -48,7 +51,6 @@ export function ReportingDatesMolecule({ queryReportingData }) {
|
||||
moment().startOf("month").add(1, "month"),
|
||||
moment().startOf("month").add(1, "month").endOf("month"),
|
||||
],
|
||||
"Last 7 days": [moment().subtract(7, "days"), moment()],
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function ShopSettingsFormMolecule({ form, saveLoading }) {
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Alert whne Parts Price Difference Less Than"
|
||||
label="Alert when Parts Price Difference Less Than"
|
||||
name="ppd_diff_alert"
|
||||
rules={[
|
||||
{
|
||||
|
||||
@@ -32,32 +32,33 @@ export default function JobsTableOrganism() {
|
||||
);
|
||||
|
||||
const handleInfiniteOnLoad = (page) => {
|
||||
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 &&
|
||||
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.jobs, ...fetchMoreResult.jobs],
|
||||
});
|
||||
const newCache = Object.assign({}, prev, {
|
||||
jobs: [...prev.jobs, ...fetchMoreResult.jobs],
|
||||
});
|
||||
|
||||
if (
|
||||
newCache.jobs.length >= data &&
|
||||
data.jobs_aggregate.aggregate.count
|
||||
) {
|
||||
console.log("No more results.");
|
||||
setState({ ...state, hasMore: false });
|
||||
}
|
||||
if (
|
||||
newCache.jobs.length >= data &&
|
||||
data.jobs_aggregate.aggregate.count
|
||||
) {
|
||||
console.log("No more results.");
|
||||
setState({ ...state, hasMore: false });
|
||||
}
|
||||
|
||||
return newCache;
|
||||
},
|
||||
});
|
||||
return newCache;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
if (error)
|
||||
@@ -81,7 +82,9 @@ export default function JobsTableOrganism() {
|
||||
<List
|
||||
bordered
|
||||
dataSource={data ? [{ isRefresh: true }, ...data.jobs] : []}
|
||||
renderItem={(item) => <JobsListItemMolecule item={item} />}
|
||||
renderItem={(item) => (
|
||||
<JobsListItemMolecule item={item} refetch={refetch} />
|
||||
)}
|
||||
>
|
||||
{loading && state.hasMore && (
|
||||
<div>
|
||||
@@ -92,9 +95,11 @@ export default function JobsTableOrganism() {
|
||||
</Dropdown>
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
{`${data ? data.jobs.length : 0} jobs loaded. ${
|
||||
data ? data.jobs_aggregate.aggregate.count : 0
|
||||
} total jobs.`}
|
||||
<div>
|
||||
{`${data ? data.jobs.length : 0} jobs loaded. ${
|
||||
data ? data.jobs_aggregate.aggregate.count : 0
|
||||
} total jobs.`}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user