Further UI Updates
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
SyncOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Input, notification, Space, Table } from "antd";
|
||||
import { Button, Card, Input, notification, Space, Table } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
@@ -176,58 +176,54 @@ export default function JobsAvailableComponent({
|
||||
: [];
|
||||
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
title={() => {
|
||||
return (
|
||||
<div className="imex-table-header">
|
||||
<Space>
|
||||
<strong>{t("jobs.labels.availablejobs")}</strong>
|
||||
<Button
|
||||
onClick={() => {
|
||||
<Card
|
||||
title={t("jobs.labels.availablejobs")}
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Button
|
||||
onClick={() => {
|
||||
refetch();
|
||||
}}
|
||||
>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteAllAvailableJobs()
|
||||
.then((r) => {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.all_deleted", {
|
||||
count: r.data.delete_available_jobs.affected_rows,
|
||||
}),
|
||||
});
|
||||
refetch();
|
||||
}}
|
||||
>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteAllAvailableJobs()
|
||||
.then((r) => {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.all_deleted", {
|
||||
count: r.data.delete_available_jobs.affected_rows,
|
||||
}),
|
||||
});
|
||||
refetch();
|
||||
})
|
||||
.catch((r) => {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.deleted") + " " + r.message,
|
||||
});
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("general.actions.deleteall")}
|
||||
</Button>
|
||||
</Space>
|
||||
<div className="imex-table-header__search">
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
setSearchText(e.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
size="small"
|
||||
pagination={{ position: "top" }}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={availableJobs}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
})
|
||||
.catch((r) => {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.deleted") + " " + r.message,
|
||||
});
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("general.actions.deleteall")}
|
||||
</Button>
|
||||
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
setSearchText(e.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<Table
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={availableJobs}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
useMutation,
|
||||
useQuery,
|
||||
} from "@apollo/client";
|
||||
import { notification } from "antd";
|
||||
import { Col, notification, Row } from "antd";
|
||||
import Axios from "axios";
|
||||
import Dinero from "dinero.js";
|
||||
import _ from "lodash";
|
||||
@@ -354,14 +354,20 @@ export function JobsAvailableContainer({ bodyshop, currentUser }) {
|
||||
onCancel={onJobModalCancel}
|
||||
modalSearchState={modalSearchState}
|
||||
/>
|
||||
<JobsAvailableTableComponent
|
||||
loading={loading}
|
||||
data={data}
|
||||
refetch={refetch}
|
||||
addJobAsNew={addJobAsNew}
|
||||
addJobAsSupp={addJobAsSupp}
|
||||
/>
|
||||
<JobsAvailableScan refetch={refetch} />
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<JobsAvailableTableComponent
|
||||
loading={loading}
|
||||
data={data}
|
||||
refetch={refetch}
|
||||
addJobAsNew={addJobAsNew}
|
||||
addJobAsSupp={addJobAsSupp}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<JobsAvailableScan refetch={refetch} />
|
||||
</Col>
|
||||
</Row>
|
||||
</LoadingSpinner>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user