Further UI Updates

This commit is contained in:
Patrick Fic
2021-03-29 17:08:52 -07:00
parent 17264ff7d6
commit 6c34b8839c
78 changed files with 1250 additions and 1024 deletions

View File

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

View File

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