WIP Whiteboard Changes
This commit is contained in:
@@ -12,10 +12,12 @@
|
|||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"firebase": "^7.5.0",
|
"firebase": "^7.5.0",
|
||||||
"graphql": "^14.5.8",
|
"graphql": "^14.5.8",
|
||||||
|
"i18next": "^19.0.2",
|
||||||
"node-sass": "^4.13.0",
|
"node-sass": "^4.13.0",
|
||||||
"react": "^16.12.0",
|
"react": "^16.12.0",
|
||||||
"react-apollo": "^3.1.3",
|
"react-apollo": "^3.1.3",
|
||||||
"react-dom": "^16.12.0",
|
"react-dom": "^16.12.0",
|
||||||
|
"react-i18next": "^11.2.7",
|
||||||
"react-number-format": "^4.3.1",
|
"react-number-format": "^4.3.1",
|
||||||
"react-router-dom": "^5.1.2",
|
"react-router-dom": "^5.1.2",
|
||||||
"react-scripts": "3.2.0",
|
"react-scripts": "3.2.0",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import ErrorBoundary from "../components/error-boundary/error-boundary.component
|
|||||||
import { auth } from "../firebase/firebase.utils";
|
import { auth } from "../firebase/firebase.utils";
|
||||||
import { UPSERT_USER } from "../graphql/user.queries";
|
import { UPSERT_USER } from "../graphql/user.queries";
|
||||||
import { GET_CURRENT_USER } from "../graphql/local.queries";
|
import { GET_CURRENT_USER } from "../graphql/local.queries";
|
||||||
import { QUERY_BODYSHOP } from "../graphql/bodyshop.queries";
|
// import { QUERY_BODYSHOP } from "../graphql/bodyshop.queries";
|
||||||
|
|
||||||
import PrivateRoute from "../utils/private-route";
|
import PrivateRoute from "../utils/private-route";
|
||||||
|
|
||||||
@@ -61,22 +61,22 @@ export default () => {
|
|||||||
console.log("User login upsert error.", error);
|
console.log("User login upsert error.", error);
|
||||||
});
|
});
|
||||||
|
|
||||||
apolloClient
|
// apolloClient
|
||||||
.query({
|
// .query({
|
||||||
query: QUERY_BODYSHOP,
|
// query: QUERY_BODYSHOP,
|
||||||
fetchPolicy: "network-only"
|
// fetchPolicy: "network-only"
|
||||||
})
|
// })
|
||||||
.then(r => {
|
// .then(r => {
|
||||||
const bodyShopData = r.data.bodyshops[0];
|
// const bodyShopData = r.data.bodyshops[0];
|
||||||
apolloClient.writeData({
|
// apolloClient.writeData({
|
||||||
data: {
|
// data: {
|
||||||
bodyShopData: { ...bodyShopData, __typename: "bodyShopData" }
|
// bodyShopData: { ...bodyShopData, __typename: "bodyShopData" }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
})
|
// })
|
||||||
.catch(error => {
|
// .catch(error => {
|
||||||
console.log("Error getting bodyshop data.", error);
|
// console.log("Error getting bodyshop data.", error);
|
||||||
});
|
// });
|
||||||
|
|
||||||
apolloClient.writeData({
|
apolloClient.writeData({
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ErrorBoundary extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.state.hasErrored === true) {
|
if (this.state.hasErrored === true) {
|
||||||
return <div>Uh oh, something went wrong. {this.state.error}</div>;
|
return <div>Uh oh, something went wrong.</div>;
|
||||||
} else {
|
} else {
|
||||||
return this.props.children;
|
return this.props.children;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,18 +25,17 @@ function searchResult(query) {
|
|||||||
function renderOption(item) {
|
function renderOption(item) {
|
||||||
return (
|
return (
|
||||||
<Option key={item.category} text={item.category}>
|
<Option key={item.category} text={item.category}>
|
||||||
<div className="global-search-item">
|
<div className='global-search-item'>
|
||||||
<span className="global-search-item-desc">
|
<span className='global-search-item-desc'>
|
||||||
Found {item.query} on
|
Found {item.query} on
|
||||||
<a
|
<a
|
||||||
href={`https://s.taobao.com/search?q=${item.query}`}
|
href={`https://s.taobao.com/search?q=${item.query}`}
|
||||||
target="_blank"
|
target='_blank'
|
||||||
rel="noopener noreferrer"
|
rel='noopener noreferrer'>
|
||||||
>
|
|
||||||
{item.category}
|
{item.category}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span className="global-search-item-count">{item.count} results</span>
|
<span className='global-search-item-count'>{item.count} results</span>
|
||||||
</div>
|
</div>
|
||||||
</Option>
|
</Option>
|
||||||
);
|
);
|
||||||
@@ -56,25 +55,26 @@ export default class GlobalSearch extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const { dataSource } = this.state;
|
const { dataSource } = this.state;
|
||||||
return (
|
return (
|
||||||
<div style={{ width: 300 }}>
|
<div />
|
||||||
<AutoComplete
|
// <div style={{ width: 300 }}>
|
||||||
size="large"
|
// <AutoComplete
|
||||||
style={{ width: "100%" }}
|
// size="large"
|
||||||
dataSource={dataSource.map(renderOption)}
|
// style={{ width: "100%" }}
|
||||||
onSelect={onSelect}
|
// dataSource={dataSource.map(renderOption)}
|
||||||
onSearch={this.handleSearch}
|
// onSelect={onSelect}
|
||||||
placeholder="input here"
|
// onSearch={this.handleSearch}
|
||||||
optionLabelProp="text"
|
// placeholder="input here"
|
||||||
>
|
// optionLabelProp="text"
|
||||||
<Input
|
// >
|
||||||
suffix={
|
// <Input
|
||||||
<Button style={{ marginRight: -12 }} size="large" type="primary">
|
// suffix={
|
||||||
<Icon type="search" />
|
// <Button style={{ marginRight: -12 }} size="large" type="primary">
|
||||||
</Button>
|
// <Icon type="search" />
|
||||||
}
|
// </Button>
|
||||||
/>
|
// }
|
||||||
</AutoComplete>
|
// />
|
||||||
</div>
|
// </AutoComplete>
|
||||||
|
// </div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ function JobTombstone({ job, ...otherProps }) {
|
|||||||
if (!job) {
|
if (!job) {
|
||||||
return (
|
return (
|
||||||
<AlertComponent
|
<AlertComponent
|
||||||
message="This job does not exist or you do not have access to it."
|
message='This job does not exist or you do not have access to it.'
|
||||||
type="error"
|
type='error'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -70,20 +70,19 @@ function JobTombstone({ job, ...otherProps }) {
|
|||||||
+" " + jobContext.owner?.first_name
|
+" " + jobContext.owner?.first_name
|
||||||
: "No owner"
|
: "No owner"
|
||||||
}
|
}
|
||||||
tags={<Tag color="blue">{jobContext?.status}</Tag>}
|
tags={<Tag color='blue'>{jobContext?.job_status?.name}</Tag>}
|
||||||
extra={[
|
extra={[
|
||||||
<Form.Item key="1">
|
<Form.Item key='1'>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type='primary' htmlType='submit'>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
]}
|
]}>
|
||||||
>
|
<Descriptions size='small' column={3}>
|
||||||
<Descriptions size="small" column={3}>
|
<Descriptions.Item label='Claim Total'>
|
||||||
<Descriptions.Item label="Claim Total">
|
|
||||||
$ {jobContext.claim_total?.toFixed(2)}
|
$ {jobContext.claim_total?.toFixed(2)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="Deductible">
|
<Descriptions.Item label='Deductible'>
|
||||||
$ {jobContext.deductible?.toFixed(2)}
|
$ {jobContext.deductible?.toFixed(2)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
@@ -91,51 +90,51 @@ function JobTombstone({ job, ...otherProps }) {
|
|||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Typography.Title level={4}>Information</Typography.Title>
|
<Typography.Title level={4}>Information</Typography.Title>
|
||||||
<Form.Item label="RO #">
|
<Form.Item label='RO #'>
|
||||||
{getFieldDecorator("ro_number", {
|
{getFieldDecorator("ro_number", {
|
||||||
initialValue: jobContext.ro_number
|
initialValue: jobContext.ro_number
|
||||||
})(<Input name="ro_number" readOnly onChange={handleChange} />)}
|
})(<Input name='ro_number' readOnly onChange={handleChange} />)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item label="Estimate #">
|
<Form.Item label='Estimate #'>
|
||||||
{getFieldDecorator("est_number", {
|
{getFieldDecorator("est_number", {
|
||||||
initialValue: jobContext.est_number
|
initialValue: jobContext.est_number
|
||||||
})(<Input name="est_number" readOnly onChange={handleChange} />)}
|
})(<Input name='est_number' readOnly onChange={handleChange} />)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Typography.Title level={4}>Insurance Information</Typography.Title>
|
<Typography.Title level={4}>Insurance Information</Typography.Title>
|
||||||
<Form.Item label="Insurance Company">
|
<Form.Item label='Insurance Company'>
|
||||||
{getFieldDecorator("est_co_nm", {
|
{getFieldDecorator("est_co_nm", {
|
||||||
initialValue: jobContext.est_co_nm
|
initialValue: jobContext.est_co_nm
|
||||||
})(<Input name="est_co_nm" onChange={handleChange} />)}
|
})(<Input name='est_co_nm' onChange={handleChange} />)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<Form.Item label="Estimator Last Name">
|
<Form.Item label='Estimator Last Name'>
|
||||||
{getFieldDecorator("est_ct_ln", {
|
{getFieldDecorator("est_ct_ln", {
|
||||||
initialValue: jobContext.est_ct_ln
|
initialValue: jobContext.est_ct_ln
|
||||||
})(<Input name="est_ct_ln" onChange={handleChange} />)}
|
})(<Input name='est_ct_ln' onChange={handleChange} />)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="Estimator First Name">
|
<Form.Item label='Estimator First Name'>
|
||||||
{getFieldDecorator("est_ct_fn", {
|
{getFieldDecorator("est_ct_fn", {
|
||||||
initialValue: jobContext.est_ct_fn
|
initialValue: jobContext.est_ct_fn
|
||||||
})(<Input name="est_ct_fn" onChange={handleChange} />)}
|
})(<Input name='est_ct_fn' onChange={handleChange} />)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<Form.Item label="Estimator Phone #">
|
<Form.Item label='Estimator Phone #'>
|
||||||
{getFieldDecorator("est_ph1", {
|
{getFieldDecorator("est_ph1", {
|
||||||
initialValue: jobContext.est_ph1
|
initialValue: jobContext.est_ph1
|
||||||
})(
|
})(
|
||||||
<FormItemPhone
|
<FormItemPhone
|
||||||
customInput={Input}
|
customInput={Input}
|
||||||
name="est_ph1"
|
name='est_ph1'
|
||||||
onValueChange={handleChange}
|
onValueChange={handleChange}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="Estimator Email">
|
<Form.Item label='Estimator Email'>
|
||||||
{getFieldDecorator("est_ea", {
|
{getFieldDecorator("est_ea", {
|
||||||
initialValue: jobContext.est_ea,
|
initialValue: jobContext.est_ea,
|
||||||
rules: [
|
rules: [
|
||||||
@@ -144,7 +143,7 @@ function JobTombstone({ job, ...otherProps }) {
|
|||||||
message: "This is not a valid email address."
|
message: "This is not a valid email address."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})(<Input name="est_ea" onChange={handleChange} />)}
|
})(<Input name='est_ea' onChange={handleChange} />)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ export default function JobsPage({ loading, jobs }) {
|
|||||||
sorter: (a, b) => alphaSort(a, b),
|
sorter: (a, b) => alphaSort(a, b),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
ellipsis: true
|
ellipsis: true,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.job_status?.name ?? "";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Customer",
|
title: "Customer",
|
||||||
@@ -75,9 +78,9 @@ export default function JobsPage({ loading, jobs }) {
|
|||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<span>
|
<span>
|
||||||
Action 一 {record.ro_number}
|
Action 一 {record.ro_number}
|
||||||
<Divider type="vertical" />
|
<Divider type='vertical' />
|
||||||
<Divider type="vertical" />
|
<Divider type='vertical' />
|
||||||
More actions <Icon type="down" />
|
More actions <Icon type='down' />
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -94,12 +97,12 @@ export default function JobsPage({ loading, jobs }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Input name="searchCriteria" onChange={handleChange} />
|
<Input name='searchCriteria' onChange={handleChange} />
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
pagination={{ position: "bottom" }}
|
pagination={{ position: "bottom" }}
|
||||||
columns={columns.map(item => ({ ...item }))}
|
columns={columns.map(item => ({ ...item }))}
|
||||||
rowKey="id"
|
rowKey='id'
|
||||||
dataSource={jobs}
|
dataSource={jobs}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,59 +1,75 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Skeleton, Switch, Card, Icon, Avatar } from "antd";
|
import { Link } from "react-router-dom";
|
||||||
|
import { Menu, Dropdown, Card, Icon, Avatar, Button } from "antd";
|
||||||
|
|
||||||
const { Meta } = Card;
|
export default function WhiteBoardCard({ metadata }) {
|
||||||
|
// const {
|
||||||
|
// onClick,
|
||||||
|
// className,
|
||||||
|
// name,
|
||||||
|
// cardStyle,
|
||||||
|
// body,
|
||||||
|
// dueOn,
|
||||||
|
// cardColor,
|
||||||
|
// subTitle,
|
||||||
|
// tagStyle,
|
||||||
|
// escalationText,
|
||||||
|
// tags,
|
||||||
|
// showDeleteButton,
|
||||||
|
// onDelete
|
||||||
|
// } = this.props;
|
||||||
|
const menu = (
|
||||||
|
<Menu>
|
||||||
|
<Menu.Item key='images'>
|
||||||
|
<Icon type='file-image' />
|
||||||
|
View Job Images
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key='printing'>
|
||||||
|
<Icon type='printer' />
|
||||||
|
Printing
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key='notes'>
|
||||||
|
<Icon type='edit' />
|
||||||
|
Job Notes
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key='postinvoices'>
|
||||||
|
<Icon type='shopping-cart' />
|
||||||
|
Post Invoices
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key='receiveparts'>
|
||||||
|
<Icon type='inbox' />
|
||||||
|
Receive Parts
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key='partstatus'>
|
||||||
|
<Icon type='tool' />
|
||||||
|
Parts Status
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
|
||||||
class WhiteBoardCard extends React.Component {
|
return (
|
||||||
state = {
|
<div>
|
||||||
loading: true
|
<Card
|
||||||
};
|
title={
|
||||||
|
(metadata.ro_number ?? metadata.est_number) +
|
||||||
onChange = checked => {
|
" | " +
|
||||||
this.setState({ loading: !checked });
|
(metadata.owner?.first_name ?? "") +
|
||||||
};
|
" " +
|
||||||
|
(metadata.owner?.last_name ?? "")
|
||||||
render() {
|
}
|
||||||
const { loading } = this.state;
|
style={{ width: 300, marginTop: 10 }}
|
||||||
// const {
|
actions={[
|
||||||
// onClick,
|
<Link to={`/manage/jobs/${metadata.id}`}>
|
||||||
// className,
|
<Icon type='eye' key='view' />
|
||||||
// name,
|
</Link>,
|
||||||
// cardStyle,
|
<Icon type='message' key='message' />,
|
||||||
// body,
|
<Dropdown overlay={menu} trigger={["click"]}>
|
||||||
// dueOn,
|
<Icon type='ellipsis' />
|
||||||
// cardColor,
|
</Dropdown>
|
||||||
// subTitle,
|
]}>
|
||||||
// tagStyle,
|
<Avatar alt='Job' />
|
||||||
// escalationText,
|
This is the card data.
|
||||||
// tags,
|
</Card>
|
||||||
// showDeleteButton,
|
</div>
|
||||||
// onDelete
|
);
|
||||||
// } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Card
|
|
||||||
style={{ width: 300, marginTop: 16 }}
|
|
||||||
actions={[
|
|
||||||
<Icon type="setting" key="setting" />,
|
|
||||||
<Icon type="edit" key="edit" />,
|
|
||||||
<Icon type="ellipsis" key="ellipsis" />,
|
|
||||||
<Switch checked={!loading} onChange={this.onChange} />
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Skeleton loading={loading} avatar active>
|
|
||||||
<Meta
|
|
||||||
avatar={
|
|
||||||
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
|
|
||||||
}
|
|
||||||
title="Card title"
|
|
||||||
description="This is the description"
|
|
||||||
/>
|
|
||||||
</Skeleton>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WhiteBoardCard;
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default function WhiteBoardKanBan({ data, eventBus }) {
|
|||||||
<Board
|
<Board
|
||||||
tagStyle={{ fontSize: "80%" }}
|
tagStyle={{ fontSize: "80%" }}
|
||||||
data={data}
|
data={data}
|
||||||
draggable
|
laneDraggable={false}
|
||||||
eventBusHandle={setEventBus}
|
eventBusHandle={setEventBus}
|
||||||
components={{ Card: WhiteBoardCard }}
|
components={{ Card: WhiteBoardCard }}
|
||||||
onCardClick={(cardId, metadata) =>
|
onCardClick={(cardId, metadata) =>
|
||||||
|
|||||||
@@ -13,39 +13,34 @@ export default function WhiteBoardKanBanContainer() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const static_data = {
|
|
||||||
lanes: [
|
|
||||||
{
|
|
||||||
id: "lane1",
|
|
||||||
title: "Planned Tasks",
|
|
||||||
label: "2/2",
|
|
||||||
cards: [
|
|
||||||
{
|
|
||||||
id: "Card1",
|
|
||||||
title: "Write Blog",
|
|
||||||
description: "Can AI make memes",
|
|
||||||
label: "30 mins"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "Card2",
|
|
||||||
title: "Pay Rent",
|
|
||||||
description: "Transfer via NEFT",
|
|
||||||
label: "5 mins",
|
|
||||||
metadata: { sha: "be312a1" }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "lane2",
|
|
||||||
title: "Completed",
|
|
||||||
label: "0/0",
|
|
||||||
cards: []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
if (loading) return <LoadingSpinner />;
|
if (loading) return <LoadingSpinner />;
|
||||||
if (error) return <Alert message={error.message} />;
|
if (error) return <Alert message={error.message} />;
|
||||||
let eventBus;
|
let eventBus;
|
||||||
return <WhiteBoardKanBan eventBus={eventBus} data={static_data} />;
|
|
||||||
|
let i = data.job_status.reduce((acc, value) => {
|
||||||
|
//Create a lane object for each row.
|
||||||
|
let newLane = {
|
||||||
|
id: value.name,
|
||||||
|
title: value.name,
|
||||||
|
label: "0",
|
||||||
|
cards: value.jobs.reduce((acc, value) => {
|
||||||
|
acc.push({
|
||||||
|
id: value.id,
|
||||||
|
title: value.ro_number,
|
||||||
|
description: value.est_number,
|
||||||
|
label: value.id,
|
||||||
|
metadata: value
|
||||||
|
});
|
||||||
|
return acc;
|
||||||
|
}, [])
|
||||||
|
};
|
||||||
|
acc.push(newLane);
|
||||||
|
return acc;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
let laneData = {
|
||||||
|
lanes: i
|
||||||
|
};
|
||||||
|
|
||||||
|
return <WhiteBoardKanBan eventBus={eventBus} data={laneData} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ export const GET_ALL_OPEN_JOBS = gql`
|
|||||||
id
|
id
|
||||||
est_number
|
est_number
|
||||||
ro_number
|
ro_number
|
||||||
status
|
job_status {
|
||||||
|
name
|
||||||
|
}
|
||||||
scheduled_completion
|
scheduled_completion
|
||||||
scheduled_delivery
|
scheduled_delivery
|
||||||
vehicle {
|
vehicle {
|
||||||
@@ -30,7 +32,9 @@ export const SUBSCRIPTION_ALL_OPEN_JOBS = gql`
|
|||||||
updated_at
|
updated_at
|
||||||
est_number
|
est_number
|
||||||
ro_number
|
ro_number
|
||||||
status
|
job_status {
|
||||||
|
name
|
||||||
|
}
|
||||||
scheduled_completion
|
scheduled_completion
|
||||||
scheduled_delivery
|
scheduled_delivery
|
||||||
vehicle {
|
vehicle {
|
||||||
@@ -73,23 +77,30 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
|
|||||||
|
|
||||||
export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
|
export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
|
||||||
subscription SUBSCRIPTION_JOBS_IN_PRODUCTION {
|
subscription SUBSCRIPTION_JOBS_IN_PRODUCTION {
|
||||||
jobs(limit: 1, order_by: {updated_at: desc }) {
|
job_status(
|
||||||
|
where: { isproductionstatus: { _eq: true } }
|
||||||
|
order_by: { order: asc }
|
||||||
|
) {
|
||||||
|
name
|
||||||
|
order
|
||||||
|
isproductionstatus
|
||||||
id
|
id
|
||||||
updated_at
|
jobs {
|
||||||
est_number
|
id
|
||||||
ro_number
|
actual_completion
|
||||||
status
|
actual_delivery
|
||||||
scheduled_completion
|
actual_in
|
||||||
scheduled_delivery
|
est_number
|
||||||
vehicle {
|
ro_number
|
||||||
v_model_yr
|
vehicle {
|
||||||
v_make_desc
|
v_model_yr
|
||||||
v_model_desc
|
v_model_desc
|
||||||
plate_no
|
v_make_desc
|
||||||
}
|
}
|
||||||
owner {
|
owner {
|
||||||
first_name
|
first_name
|
||||||
last_name
|
last_name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,7 +131,9 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
scheduled_completion
|
scheduled_completion
|
||||||
scheduled_in
|
scheduled_in
|
||||||
scheduled_delivery
|
scheduled_delivery
|
||||||
status
|
job_status {
|
||||||
|
name
|
||||||
|
}
|
||||||
updated_at
|
updated_at
|
||||||
claim_total
|
claim_total
|
||||||
deductible
|
deductible
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ export default function JobsPage() {
|
|||||||
fetchPolicy: "network-only"
|
fetchPolicy: "network-only"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = "new title"
|
||||||
|
}, []);
|
||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} />;
|
if (error) return <AlertComponent message={error.message} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Table, Button } from "antd";
|
|
||||||
|
|
||||||
const data = [
|
|
||||||
{
|
|
||||||
key: "1",
|
|
||||||
name: "John Brown",
|
|
||||||
age: 32,
|
|
||||||
address: "New York No. 1 Lake Park"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "2",
|
|
||||||
name: "Jim Green",
|
|
||||||
age: 42,
|
|
||||||
address: "London No. 1 Lake Park"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "3",
|
|
||||||
name: "Joe Black",
|
|
||||||
age: 32,
|
|
||||||
address: "Sidney No. 1 Lake Park"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "4",
|
|
||||||
name: "Jim Red",
|
|
||||||
age: 32,
|
|
||||||
address: "London No. 2 Lake Park"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export default class Test extends React.Component {
|
|
||||||
state = {
|
|
||||||
filteredInfo: null,
|
|
||||||
sortedInfo: null
|
|
||||||
};
|
|
||||||
|
|
||||||
handleChange = (pagination, filters, sorter) => {
|
|
||||||
console.log("Various parameters", pagination, filters, sorter);
|
|
||||||
this.setState({
|
|
||||||
filteredInfo: filters,
|
|
||||||
sortedInfo: sorter
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
clearFilters = () => {
|
|
||||||
this.setState({ filteredInfo: null });
|
|
||||||
};
|
|
||||||
|
|
||||||
clearAll = () => {
|
|
||||||
this.setState({
|
|
||||||
filteredInfo: null,
|
|
||||||
sortedInfo: null
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
setAgeSort = () => {
|
|
||||||
this.setState({
|
|
||||||
sortedInfo: {
|
|
||||||
order: "descend",
|
|
||||||
columnKey: "age"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
let { sortedInfo, filteredInfo } = this.state;
|
|
||||||
sortedInfo = sortedInfo || {};
|
|
||||||
filteredInfo = filteredInfo || {};
|
|
||||||
console.log("filteredInfo", filteredInfo);
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
title: "Name",
|
|
||||||
dataIndex: "name",
|
|
||||||
key: "name",
|
|
||||||
filters: [
|
|
||||||
{ text: "Joe", value: "Joe" },
|
|
||||||
{ text: "Jim", value: "Jim" }
|
|
||||||
],
|
|
||||||
filteredValue: filteredInfo.name || null,
|
|
||||||
onFilter: (value, record) => record.name.includes(value),
|
|
||||||
sorter: (a, b) => a.name.length - b.name.length,
|
|
||||||
sortOrder: sortedInfo.columnKey === "name" && sortedInfo.order,
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Age",
|
|
||||||
dataIndex: "age",
|
|
||||||
key: "age",
|
|
||||||
sorter: (a, b) => a.age - b.age,
|
|
||||||
sortOrder: sortedInfo.columnKey === "age" && sortedInfo.order,
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Address",
|
|
||||||
dataIndex: "address",
|
|
||||||
key: "address",
|
|
||||||
filters: [
|
|
||||||
{ text: "London", value: "London" },
|
|
||||||
{ text: "New York", value: "New York" }
|
|
||||||
],
|
|
||||||
filteredValue: filteredInfo.address || null,
|
|
||||||
onFilter: (value, record) => record.address.includes(value),
|
|
||||||
sorter: (a, b) => a.address.length - b.address.length,
|
|
||||||
sortOrder: sortedInfo.columnKey === "address" && sortedInfo.order,
|
|
||||||
ellipsis: true
|
|
||||||
}
|
|
||||||
];
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className="table-operations">
|
|
||||||
<Button onClick={this.setAgeSort}>Sort age</Button>
|
|
||||||
<Button onClick={this.clearFilters}>Clear filters</Button>
|
|
||||||
<Button onClick={this.clearAll}>Clear filters and sorters</Button>
|
|
||||||
</div>
|
|
||||||
<Table
|
|
||||||
columns={columns}
|
|
||||||
dataSource={data}
|
|
||||||
onChange={this.handleChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
6
client/src/translations/en/common.json
Normal file
6
client/src/translations/en/common.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"welcome": {
|
||||||
|
"title": "Welcome to {{framework}}",
|
||||||
|
"intro": "To get started, edit <1><0></0></1> and save to reload."
|
||||||
|
}
|
||||||
|
}
|
||||||
6
client/src/translations/es/common.json
Normal file
6
client/src/translations/es/common.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"welcome": {
|
||||||
|
"title": "Welcome to {{framework}}",
|
||||||
|
"intro": "To get started, edit <1><0></0></1> and save to reload."
|
||||||
|
}
|
||||||
|
}
|
||||||
6
client/src/translations/fr/common.json
Normal file
6
client/src/translations/fr/common.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"welcome": {
|
||||||
|
"title": "Welcome to {{framework}}",
|
||||||
|
"intro": "To get started, edit <1><0></0></1> and save to reload."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1010,7 +1010,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime "^0.13.2"
|
regenerator-runtime "^0.13.2"
|
||||||
|
|
||||||
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4":
|
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4":
|
||||||
version "7.7.7"
|
version "7.7.7"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf"
|
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf"
|
||||||
integrity sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==
|
integrity sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==
|
||||||
@@ -5873,6 +5873,13 @@ html-minifier@^3.5.20:
|
|||||||
relateurl "0.2.x"
|
relateurl "0.2.x"
|
||||||
uglify-js "3.4.x"
|
uglify-js "3.4.x"
|
||||||
|
|
||||||
|
html-parse-stringify2@2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz#dc5670b7292ca158b7bc916c9a6735ac8872834a"
|
||||||
|
integrity sha1-3FZwtyksoVi3vJFsmmc1rIhyg0o=
|
||||||
|
dependencies:
|
||||||
|
void-elements "^2.0.1"
|
||||||
|
|
||||||
html-webpack-plugin@4.0.0-beta.5:
|
html-webpack-plugin@4.0.0-beta.5:
|
||||||
version "4.0.0-beta.5"
|
version "4.0.0-beta.5"
|
||||||
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz#2c53083c1151bfec20479b1f8aaf0039e77b5513"
|
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz#2c53083c1151bfec20479b1f8aaf0039e77b5513"
|
||||||
@@ -5972,6 +5979,13 @@ https-browserify@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
|
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
|
||||||
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
|
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
|
||||||
|
|
||||||
|
i18next@^19.0.2:
|
||||||
|
version "19.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.0.2.tgz#d72502ef031403572703f2e9f013cae005265444"
|
||||||
|
integrity sha512-fBa43Ann2udP1CQAz3IQpOZ1dGAkmi3mMfzisOhH17igneSRbvZ7P2RNbL+L1iRYKMufBmVwnC7G3gqcyviZ9g==
|
||||||
|
dependencies:
|
||||||
|
"@babel/runtime" "^7.3.1"
|
||||||
|
|
||||||
iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
|
iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
|
||||||
version "0.4.24"
|
version "0.4.24"
|
||||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
||||||
@@ -8043,7 +8057,7 @@ node-notifier@^5.4.2:
|
|||||||
shellwords "^0.1.1"
|
shellwords "^0.1.1"
|
||||||
which "^1.3.0"
|
which "^1.3.0"
|
||||||
|
|
||||||
node-pre-gyp@*, node-pre-gyp@^0.14.0:
|
node-pre-gyp@^0.14.0:
|
||||||
version "0.14.0"
|
version "0.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
|
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
|
||||||
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
|
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
|
||||||
@@ -10224,7 +10238,7 @@ react-app-polyfill@^1.0.4:
|
|||||||
regenerator-runtime "^0.13.3"
|
regenerator-runtime "^0.13.3"
|
||||||
whatwg-fetch "^3.0.0"
|
whatwg-fetch "^3.0.0"
|
||||||
|
|
||||||
"react-click-outside@github:tj/react-click-outside":
|
react-click-outside@tj/react-click-outside:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://codeload.github.com/tj/react-click-outside/tar.gz/a833ddc5be47490307f9fcc6ed09d8c353108510"
|
resolved "https://codeload.github.com/tj/react-click-outside/tar.gz/a833ddc5be47490307f9fcc6ed09d8c353108510"
|
||||||
|
|
||||||
@@ -10274,6 +10288,14 @@ react-error-overlay@^6.0.3:
|
|||||||
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.4.tgz#0d165d6d27488e660bc08e57bdabaad741366f7a"
|
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.4.tgz#0d165d6d27488e660bc08e57bdabaad741366f7a"
|
||||||
integrity sha512-ueZzLmHltszTshDMwyfELDq8zOA803wQ1ZuzCccXa1m57k1PxSHfflPD5W9YIiTXLs0JTLzoj6o1LuM5N6zzNA==
|
integrity sha512-ueZzLmHltszTshDMwyfELDq8zOA803wQ1ZuzCccXa1m57k1PxSHfflPD5W9YIiTXLs0JTLzoj6o1LuM5N6zzNA==
|
||||||
|
|
||||||
|
react-i18next@^11.2.7:
|
||||||
|
version "11.2.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.2.7.tgz#d0dd61ae6127589e316c6293fc948fe413c63580"
|
||||||
|
integrity sha512-BBm6/ch6jgvpIBwyitNd0G7Z49+wNeyJ6x0rZFcXX6NPrla2GuDGH+oKSjmYRg8IqtL6aG9CwWb06YJCrXbk6w==
|
||||||
|
dependencies:
|
||||||
|
"@babel/runtime" "^7.3.1"
|
||||||
|
html-parse-stringify2 "2.0.1"
|
||||||
|
|
||||||
react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0:
|
react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0:
|
||||||
version "16.12.0"
|
version "16.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
|
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
|
||||||
@@ -11276,9 +11298,9 @@ slice-ansi@^2.1.0:
|
|||||||
astral-regex "^1.0.0"
|
astral-regex "^1.0.0"
|
||||||
is-fullwidth-code-point "^2.0.0"
|
is-fullwidth-code-point "^2.0.0"
|
||||||
|
|
||||||
"smooth-dnd@git+https://github.com/rcdexta/smooth-dnd.git":
|
"smooth-dnd@https://github.com/rcdexta/smooth-dnd":
|
||||||
version "0.6.3"
|
version "0.6.3"
|
||||||
resolved "git+https://github.com/rcdexta/smooth-dnd.git#f13924c67bf6ffe4613d97bb1ee83f11d364eb1e"
|
resolved "https://github.com/rcdexta/smooth-dnd#f13924c67bf6ffe4613d97bb1ee83f11d364eb1e"
|
||||||
|
|
||||||
snapdragon-node@^2.0.1:
|
snapdragon-node@^2.0.1:
|
||||||
version "2.1.1"
|
version "2.1.1"
|
||||||
@@ -12404,6 +12426,11 @@ vm-browserify@^1.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
|
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
|
||||||
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
|
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
|
||||||
|
|
||||||
|
void-elements@^2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"
|
||||||
|
integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=
|
||||||
|
|
||||||
w3c-hr-time@^1.0.1:
|
w3c-hr-time@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
|
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
|
||||||
|
|||||||
Reference in New Issue
Block a user