Minor fixes: Job detail card schedule, job list search, job list sorting.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Input, Table, Icon } from "antd";
|
||||
import { Input, Table, Icon, Button } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
@@ -8,6 +8,8 @@ import { withRouter } from "react-router-dom";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
|
||||
export default withRouter(function JobsList({
|
||||
searchTextState,
|
||||
refetch,
|
||||
loading,
|
||||
jobs,
|
||||
selectedJob,
|
||||
@@ -21,6 +23,7 @@ export default withRouter(function JobsList({
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const setSearchText = searchTextState[1];
|
||||
const columns = [
|
||||
{
|
||||
title: t("jobs.fields.ro_number"),
|
||||
@@ -29,7 +32,11 @@ export default withRouter(function JobsList({
|
||||
width: "8%",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||
sorter: (a, b) =>
|
||||
alphaSort(
|
||||
a.ro_number ? a.ro_number : "EST-" + a.est_number,
|
||||
b.ro_number ? b.ro_number : "EST-" + b.est_number
|
||||
),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||
|
||||
@@ -73,7 +80,7 @@ export default withRouter(function JobsList({
|
||||
<PhoneFormatter>{record.ownr_ph1}</PhoneFormatter>
|
||||
<Icon
|
||||
style={{ margin: 4 }}
|
||||
type="message"
|
||||
type='message'
|
||||
onClick={() => {
|
||||
alert("SMSing will happen here.");
|
||||
}}
|
||||
@@ -205,19 +212,24 @@ export default withRouter(function JobsList({
|
||||
loading={loading}
|
||||
title={() => {
|
||||
return (
|
||||
<Input.Search
|
||||
placeholder="Search..."
|
||||
onSearch={value => {
|
||||
console.log(value);
|
||||
}}
|
||||
enterButton
|
||||
/>
|
||||
<div style={{ display: "flex" }}>
|
||||
<Button onClick={() => refetch()}>
|
||||
<Icon type='sync' />
|
||||
</Button>
|
||||
<Input.Search
|
||||
placeholder='Search...'
|
||||
onChange={e => {
|
||||
setSearchText(e.target.value);
|
||||
}}
|
||||
enterButton
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
size="small"
|
||||
size='small'
|
||||
pagination={{ position: "top" }}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
rowKey="id"
|
||||
rowKey='id'
|
||||
dataSource={jobs}
|
||||
rowSelection={{ selectedRowKeys: [selectedJob] }}
|
||||
onChange={handleTableChange}
|
||||
|
||||
Reference in New Issue
Block a user