Merge pull request #6 from snaptsoft/dev-patrick
Job Details + Importing
This commit is contained in:
@@ -9,4 +9,4 @@ To Start Hasura CLI:
|
||||
npx hasura console --admin-secret Dev-BodyShopAppBySnaptSoftware!
|
||||
|
||||
Migrating to Staging:
|
||||
npx hasura migrate apply --endpoint https://bodyshop-staging-db.herokuapp.com/ --admin-secret Staging-BodyShopAppBySnaptSoftware!
|
||||
npx hasura migrate apply --up 10 --endpoint https://bodyshop-staging-db.herokuapp.com/ --admin-secret Staging-BodyShopAppBySnaptSoftware!
|
||||
@@ -217,6 +217,27 @@
|
||||
<folder_node>
|
||||
<name>labels</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>actions</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>in</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -441,6 +462,121 @@
|
||||
</folder_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>joblines</name>
|
||||
<children>
|
||||
<folder_node>
|
||||
<name>fields</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>act_price</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>db_price</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>line_desc</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>part_type</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>unq_seq</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>jobs</name>
|
||||
<children>
|
||||
@@ -557,6 +693,48 @@
|
||||
<folder_node>
|
||||
<name>errors</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>creating</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>deleted</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>noaccess</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -814,6 +992,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>cieca_id</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>claim_total</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -2074,6 +2273,48 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>updated_at</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>uploaded_by</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>vehicle</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -2100,6 +2341,27 @@
|
||||
<folder_node>
|
||||
<name>labels</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>available_new_jobs</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<folder_node>
|
||||
<name>cards</name>
|
||||
<children>
|
||||
@@ -2357,6 +2619,27 @@
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<concept_node>
|
||||
<name>creating_new_job</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>documents</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -2488,6 +2771,27 @@
|
||||
<folder_node>
|
||||
<name>successes</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>all_deleted</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>converted</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -2509,6 +2813,48 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>created</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>deleted</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>save</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -3193,6 +3539,168 @@
|
||||
</folder_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>owners</name>
|
||||
<children>
|
||||
<folder_node>
|
||||
<name>fields</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>ownr_addr1</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>ownr_city</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>ownr_ea</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>ownr_fn</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>ownr_ln</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>ownr_ph1</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>labels</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>existing_owners</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>profile</name>
|
||||
<children>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@apollo/react-testing": "^3.1.3",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.2"
|
||||
}
|
||||
|
||||
@@ -126,6 +126,8 @@ class AppContainer extends Component {
|
||||
//Init local state.
|
||||
}
|
||||
|
||||
componentWillUnmount() {}
|
||||
|
||||
render() {
|
||||
const { client, loaded } = this.state;
|
||||
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import App from "./App.container";
|
||||
import { MockedProvider } from "@apollo/react-testing";
|
||||
const div = document.createElement("div");
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App />, div);
|
||||
it("renders without crashing", () => {
|
||||
ReactDOM.render(
|
||||
<MockedProvider>
|
||||
<App />
|
||||
</MockedProvider>,
|
||||
div
|
||||
);
|
||||
});
|
||||
|
||||
it("unmounts without crashing", () => {
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
||||
|
||||
11
client/src/components/alert/alert.component.test.js
Normal file
11
client/src/components/alert/alert.component.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import Alert from "./alert.component";
|
||||
import { MockedProvider } from "@apollo/react-testing";
|
||||
import { shallow } from "enzyme";
|
||||
|
||||
const div = document.createElement("div");
|
||||
|
||||
it("renders without crashing", () => {
|
||||
shallow(<Alert type="error" />);
|
||||
});
|
||||
@@ -1,46 +1,45 @@
|
||||
import React from "react";
|
||||
import "./header.styles.scss";
|
||||
import { useQuery } from "react-apollo";
|
||||
import {
|
||||
GET_LANDING_NAV_ITEMS,
|
||||
GET_NAV_ITEMS
|
||||
} from "../../graphql/metadata.queries";
|
||||
// //import {
|
||||
// GET_LANDING_NAV_ITEMS,
|
||||
// GET_NAV_ITEMS
|
||||
// } from "../../graphql/metadata.queries";
|
||||
import { GET_CURRENT_SELECTED_NAV_ITEM } from "../../graphql/local.queries";
|
||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
//import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||
//import AlertComponent from "../alert/alert.component";
|
||||
import HeaderComponent from "./header.component";
|
||||
|
||||
export default ({ landingHeader, signedIn }) => {
|
||||
const hookSelectedNavItem = useQuery(GET_CURRENT_SELECTED_NAV_ITEM);
|
||||
|
||||
let hookNavItems;
|
||||
if (landingHeader) {
|
||||
hookNavItems = useQuery(GET_LANDING_NAV_ITEMS, {
|
||||
fetchPolicy: "network-only"
|
||||
});
|
||||
} else {
|
||||
hookNavItems = useQuery(GET_NAV_ITEMS, {
|
||||
fetchPolicy: "network-only"
|
||||
});
|
||||
}
|
||||
// let hookNavItems;
|
||||
// if (landingHeader) {
|
||||
// hookNavItems = useQuery(GET_LANDING_NAV_ITEMS, {
|
||||
// fetchPolicy: "network-only"
|
||||
// });
|
||||
// } else {
|
||||
// hookNavItems = useQuery(GET_NAV_ITEMS, {
|
||||
// fetchPolicy: "network-only"
|
||||
// });
|
||||
// }
|
||||
|
||||
if (hookNavItems.loading || hookSelectedNavItem.loading)
|
||||
return <LoadingSpinner />;
|
||||
if (hookNavItems.error)
|
||||
return <AlertComponent message={hookNavItems.error.message} />;
|
||||
if (hookSelectedNavItem.error)
|
||||
return console.log(
|
||||
"Unable to load Selected Navigation Item.",
|
||||
hookSelectedNavItem.error
|
||||
);
|
||||
// if (hookNavItems.loading || hookSelectedNavItem.loading)
|
||||
// return <LoadingSpinner />;
|
||||
// if (hookNavItems.error)
|
||||
// return <AlertComponent message={hookNavItems.error.message} />;
|
||||
// if (hookSelectedNavItem.error)
|
||||
// return console.log(
|
||||
// "Unable to load Selected Navigation Item.",
|
||||
// hookSelectedNavItem.error
|
||||
// );
|
||||
|
||||
const { selectedNavItem } = hookSelectedNavItem.data;
|
||||
const navItems = JSON.parse(hookNavItems.data.masterdata_by_pk.value);
|
||||
// const navItems = JSON.parse(hookNavItems.data.masterdata_by_pk.value);
|
||||
|
||||
return (
|
||||
<HeaderComponent
|
||||
landingHeader={landingHeader}
|
||||
navItems={navItems}
|
||||
selectedNavItem={selectedNavItem}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -27,7 +27,6 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
TODO:
|
||||
{t("jobs.labels.cards.appraiser")}
|
||||
{data?.est_ea ? (
|
||||
<a href={`mailto:${data.est_ea}`}>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import React from "react";
|
||||
import { Form, Input, InputNumber } from "antd";
|
||||
import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context";
|
||||
|
||||
export default class EditableCell extends React.Component {
|
||||
getInput = () => {
|
||||
if (this.props.inputType === "number") {
|
||||
return <InputNumber />;
|
||||
}
|
||||
return <Input />;
|
||||
};
|
||||
|
||||
renderCell = ({ getFieldDecorator }) => {
|
||||
const {
|
||||
editing,
|
||||
dataIndex,
|
||||
title,
|
||||
inputType,
|
||||
record,
|
||||
index,
|
||||
children,
|
||||
...restProps
|
||||
} = this.props;
|
||||
return (
|
||||
<td {...restProps}>
|
||||
{editing ? (
|
||||
<Form.Item style={{ margin: 0 }}>
|
||||
{getFieldDecorator(dataIndex, {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: `Please Input ${title}!`
|
||||
}
|
||||
],
|
||||
initialValue: record[dataIndex]
|
||||
})(this.getInput())}
|
||||
</Form.Item>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
</td>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<JobDetailFormContext.Consumer>
|
||||
{this.renderCell}
|
||||
</JobDetailFormContext.Consumer>
|
||||
);
|
||||
}
|
||||
}
|
||||
124
client/src/components/job-detail-lines/job-lines.component.jsx
Normal file
124
client/src/components/job-detail-lines/job-lines.component.jsx
Normal file
@@ -0,0 +1,124 @@
|
||||
import { Table, Button } from "antd";
|
||||
import React, { useContext, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import EditableCell from "./job-lines-cell.component";
|
||||
|
||||
export default function JobLinesComponent({ job }) {
|
||||
//const form = useContext(JobDetailFormContext);
|
||||
//const { getFieldDecorator } = form;
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
filteredInfo: { text: "" }
|
||||
});
|
||||
const [editingKey, setEditingKey] = useState("");
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: t("joblines.fields.unq_seq"),
|
||||
dataIndex: "joblines.unq_seq",
|
||||
key: "joblines.unq_seq",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "unq_seq" && state.sortedInfo.order,
|
||||
//ellipsis: true,
|
||||
editable: true
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.line_desc"),
|
||||
dataIndex: "line_desc",
|
||||
key: "joblines.line_desc",
|
||||
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
editable: true
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.part_type"),
|
||||
dataIndex: "part_type",
|
||||
key: "joblines.part_type",
|
||||
sorter: (a, b) => alphaSort(a.part_type, b.part_type),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
editable: true
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.db_price"),
|
||||
dataIndex: "db_price",
|
||||
key: "joblines.db_price",
|
||||
sorter: (a, b) => a.db_price - b.db_price,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "db_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
render: (text, record) => (
|
||||
<CurrencyFormatter>{record.db_price}</CurrencyFormatter>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.act_price"),
|
||||
dataIndex: "act_price",
|
||||
key: "joblines.act_price",
|
||||
sorter: (a, b) => a.act_price - b.act_price,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{" "}
|
||||
<CurrencyFormatter>{record.act_price}</CurrencyFormatter>{" "}
|
||||
<Button
|
||||
onClick={() => {
|
||||
setEditingKey(record.id);
|
||||
}}>
|
||||
EDIT
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
];
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||
};
|
||||
|
||||
// const handleChange = event => {
|
||||
// const { value } = event.target;
|
||||
// setState({ ...state, filterinfo: { text: [value] } });
|
||||
// };
|
||||
return (
|
||||
<Table
|
||||
size='small'
|
||||
pagination={{ position: "bottom" }}
|
||||
columns={columns.map(col => {
|
||||
if (!col.editable) {
|
||||
return col;
|
||||
}
|
||||
return {
|
||||
...col,
|
||||
onCell: record => ({
|
||||
record,
|
||||
inputType: col.dataIndex === "age" ? "number" : "text",
|
||||
dataIndex: col.dataIndex,
|
||||
title: col.title,
|
||||
editing: editingKey === record.id
|
||||
})
|
||||
};
|
||||
})}
|
||||
components={{
|
||||
body: {
|
||||
cell: EditableCell
|
||||
}
|
||||
}}
|
||||
rowKey='id'
|
||||
dataSource={job.joblines}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import JobLinesComponent from "./job-lines.component";
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
|
||||
import { GET_JOB_LINES_BY_PK } from "../../graphql/jobs-lines.queries";
|
||||
|
||||
@@ -16,3 +16,4 @@ export default function JobLinesContainer({ jobId }) {
|
||||
<JobLinesComponent loading={loading} joblines={data ? data.joblines : null} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
import React, { useState } from "react";
|
||||
import { Table } from "antd";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
|
||||
export default function JobLinesComponent({ loading, joblines }) {
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
filteredInfo: { text: "" }
|
||||
});
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: "Line #",
|
||||
dataIndex: "line_ind",
|
||||
key: "line_ind",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: "Description",
|
||||
dataIndex: "line_desc",
|
||||
key: "line_desc",
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||
ellipsis: true
|
||||
}
|
||||
];
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||
};
|
||||
|
||||
// const handleChange = event => {
|
||||
// const { value } = event.target;
|
||||
// setState({ ...state, filterinfo: { text: [value] } });
|
||||
// };
|
||||
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={{ position: "bottom" }}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
rowKey='id'
|
||||
dataSource={joblines}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
import { Button, Icon, Input, notification, Table } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container";
|
||||
export default function JobsAvailableComponent({
|
||||
loading,
|
||||
data,
|
||||
refetch,
|
||||
deleteJob,
|
||||
deleteAllNewJobs,
|
||||
onModalOk,
|
||||
onModalCancel,
|
||||
modalVisible,
|
||||
setModalVisible,
|
||||
selectedOwner,
|
||||
setSelectedOwner,
|
||||
loadEstData,
|
||||
estData
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
filteredInfo: { text: "" }
|
||||
});
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: t("jobs.fields.cieca_id"),
|
||||
dataIndex: "cieca_id",
|
||||
key: "cieca_id",
|
||||
//width: "8%",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.owner"),
|
||||
dataIndex: "ownr_name",
|
||||
key: "ownr_name",
|
||||
ellipsis: true,
|
||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||
//width: "25%",
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "ownr_name" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.vehicle"),
|
||||
dataIndex: "vehicle_info",
|
||||
key: "vehicle_info",
|
||||
sorter: (a, b) => alphaSort(a.vehicle_info, b.vehicle_info),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "vehicle_info" && state.sortedInfo.order
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.clm_no"),
|
||||
dataIndex: "clm_no",
|
||||
key: "clm_no",
|
||||
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.clm_total"),
|
||||
dataIndex: "clm_amt",
|
||||
key: "clm_amt",
|
||||
sorter: (a, b) => a.clm_amt - b.clm_amt,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.uploaded_by"),
|
||||
dataIndex: "uploaded_by",
|
||||
key: "uploaded_by",
|
||||
sorter: (a, b) => alphaSort(a.uploaded_by, b.uploaded_by),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "uploaded_by" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.updated_at"),
|
||||
dataIndex: "updated_at",
|
||||
key: "updated_at",
|
||||
sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order,
|
||||
render: (text, record) => (
|
||||
<DateTimeFormatter>{record.updated_at}</DateTimeFormatter>
|
||||
)
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("general.labels.actions"),
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteJob({ variables: { id: record.id } }).then(r => {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.deleted")
|
||||
});
|
||||
refetch();
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Icon type="delete" />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
loadEstData({ variables: { id: record.id } });
|
||||
setModalVisible(true);
|
||||
}}
|
||||
>
|
||||
<Icon type="plus" />
|
||||
</Button>
|
||||
</span>
|
||||
)
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
}
|
||||
];
|
||||
|
||||
const owner =
|
||||
estData.data &&
|
||||
estData.data.available_jobs_by_pk &&
|
||||
estData.data.available_jobs_by_pk.est_data &&
|
||||
estData.data.available_jobs_by_pk.est_data.owner &&
|
||||
estData.data.available_jobs_by_pk.est_data.owner.data
|
||||
? estData.data.available_jobs_by_pk.est_data.owner.data
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<OwnerFindModalContainer
|
||||
loading={estData.loading}
|
||||
error={estData.error}
|
||||
owner={owner}
|
||||
selectedOwner={selectedOwner}
|
||||
setSelectedOwner={setSelectedOwner}
|
||||
visible={modalVisible}
|
||||
onOk={onModalOk}
|
||||
onCancel={onModalCancel}
|
||||
/>
|
||||
|
||||
<Table
|
||||
loading={loading}
|
||||
title={() => {
|
||||
return (
|
||||
<div>
|
||||
<Input.Search
|
||||
placeholder="Search..."
|
||||
onSearch={value => {
|
||||
console.log(value);
|
||||
}}
|
||||
enterButton
|
||||
/>
|
||||
<Button
|
||||
onClick={() => {
|
||||
refetch();
|
||||
}}
|
||||
>
|
||||
<Icon type="sync" />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteAllNewJobs()
|
||||
.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
|
||||
});
|
||||
});
|
||||
}}
|
||||
>
|
||||
Delete All
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
size="small"
|
||||
pagination={{ position: "top" }}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
rowKey="id"
|
||||
dataSource={data && data.available_jobs}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import { notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useMutation, useQuery } from "react-apollo";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import { DELETE_ALL_AVAILABLE_NEW_JOBS, QUERY_AVAILABLE_NEW_JOBS } from "../../graphql/available-jobs.queries";
|
||||
import { INSERT_NEW_JOB } from "../../graphql/jobs.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||
import JobsAvailableComponent from "./jobs-available-new.component";
|
||||
|
||||
export default withRouter(function JobsAvailableContainer({
|
||||
deleteJob,
|
||||
estDataLazyLoad,
|
||||
history
|
||||
}) {
|
||||
const { loading, error, data, refetch } = useQuery(QUERY_AVAILABLE_NEW_JOBS, {
|
||||
fetchPolicy: "network-only"
|
||||
});
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [selectedOwner, setSelectedOwner] = useState(null);
|
||||
const [insertLoading, setInsertLoading] = useState(false);
|
||||
const [deleteAllNewJobs] = useMutation(DELETE_ALL_AVAILABLE_NEW_JOBS);
|
||||
const [insertNewJob] = useMutation(INSERT_NEW_JOB);
|
||||
const [loadEstData, estData] = estDataLazyLoad;
|
||||
|
||||
const onModalOk = () => {
|
||||
setModalVisible(false);
|
||||
console.log("selectedOwner", selectedOwner);
|
||||
setInsertLoading(true);
|
||||
console.log(
|
||||
"logitest",
|
||||
estData.data &&
|
||||
estData.data.available_jobs_by_pk &&
|
||||
estData.data.available_jobs_by_pk.est_data
|
||||
);
|
||||
|
||||
if (
|
||||
!(
|
||||
estData.data &&
|
||||
estData.data.available_jobs_by_pk &&
|
||||
estData.data.available_jobs_by_pk.est_data
|
||||
)
|
||||
) {
|
||||
//We don't have the right data. Error!
|
||||
setInsertLoading(false);
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.creating", { error: "No job data present." })
|
||||
});
|
||||
} else {
|
||||
insertNewJob({
|
||||
variables: {
|
||||
job: selectedOwner
|
||||
? Object.assign(
|
||||
{},
|
||||
estData.data.available_jobs_by_pk.est_data,
|
||||
{ owner: null },
|
||||
{ ownerid: selectedOwner }
|
||||
)
|
||||
: estData.data.available_jobs_by_pk.est_data
|
||||
}
|
||||
})
|
||||
.then(r => {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.created"),
|
||||
onClick: () => {
|
||||
console.log("r", r);
|
||||
history.push(
|
||||
`/manage/jobs/${r.data.insert_jobs.returning[0].id}`
|
||||
);
|
||||
}
|
||||
});
|
||||
//Job has been inserted. Clean up the available jobs record.
|
||||
deleteJob({
|
||||
variables: { id: estData.data.available_jobs_by_pk.id }
|
||||
}).then(r => {
|
||||
refetch();
|
||||
setInsertLoading(false);
|
||||
});
|
||||
})
|
||||
.catch(r => {
|
||||
//error while inserting
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.creating", { error: r.message })
|
||||
});
|
||||
refetch();
|
||||
setInsertLoading(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const onModalCancel = () => {
|
||||
setModalVisible(false);
|
||||
setSelectedOwner(null);
|
||||
};
|
||||
|
||||
if (error) return <AlertComponent type="error" message={error.message} />;
|
||||
return (
|
||||
<LoadingSpinner
|
||||
loading={insertLoading}
|
||||
message={t("jobs.labels.creating_new_job")}
|
||||
>
|
||||
<JobsAvailableComponent
|
||||
loading={loading}
|
||||
data={data}
|
||||
refetch={refetch}
|
||||
deleteJob={deleteJob}
|
||||
deleteAllNewJobs={deleteAllNewJobs}
|
||||
insertNewJob={insertNewJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
onModalCancel={onModalCancel}
|
||||
onModalOk={onModalOk}
|
||||
modalVisible={modalVisible}
|
||||
setModalVisible={setModalVisible}
|
||||
selectedOwner={selectedOwner}
|
||||
setSelectedOwner={setSelectedOwner}
|
||||
loadEstData={loadEstData}
|
||||
estData={estData}
|
||||
/>
|
||||
</LoadingSpinner>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,193 @@
|
||||
import { Input, Table, Button, Icon, notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
export default function JobsAvailableSupplementComponent({
|
||||
loading,
|
||||
data,
|
||||
refetch,
|
||||
deleteJob,
|
||||
deleteAllNewJobs,
|
||||
estDataLazyLoad
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
filteredInfo: { text: "" }
|
||||
});
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: t("jobs.fields.cieca_id"),
|
||||
dataIndex: "cieca_id",
|
||||
key: "cieca_id",
|
||||
//width: "8%",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.ro_number"),
|
||||
dataIndex: "job_id",
|
||||
key: "job_id",
|
||||
//width: "8%",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order,
|
||||
render: (text, record) => <div>{record.job && record.job.ro_number}</div>
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.owner"),
|
||||
dataIndex: "ownr_name",
|
||||
key: "ownr_name",
|
||||
ellipsis: true,
|
||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||
//width: "25%",
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "ownr_name" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.vehicle"),
|
||||
dataIndex: "vehicle_info",
|
||||
key: "vehicle_info",
|
||||
sorter: (a, b) => alphaSort(a.vehicle_info, b.vehicle_info),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "vehicle_info" && state.sortedInfo.order
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.clm_no"),
|
||||
dataIndex: "clm_no",
|
||||
key: "clm_no",
|
||||
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.clm_total"),
|
||||
dataIndex: "clm_amt",
|
||||
key: "clm_amt",
|
||||
sorter: (a, b) => a.clm_amt - b.clm_amt,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.uploaded_by"),
|
||||
dataIndex: "uploaded_by",
|
||||
key: "uploaded_by",
|
||||
sorter: (a, b) => alphaSort(a.uploaded_by, b.uploaded_by),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "uploaded_by" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("jobs.fields.updated_at"),
|
||||
dataIndex: "updated_at",
|
||||
key: "updated_at",
|
||||
sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order,
|
||||
render: (text, record) => (
|
||||
<DateTimeFormatter>{record.updated_at}</DateTimeFormatter>
|
||||
)
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("general.labels.actions"),
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteJob({ variables: { id: record.id } }).then(r => {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.deleted")
|
||||
});
|
||||
refetch();
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Icon type="delete" />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
alert("Add");
|
||||
}}
|
||||
>
|
||||
<Icon type="plus" />
|
||||
</Button>
|
||||
</span>
|
||||
)
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
title={() => {
|
||||
return (
|
||||
<div>
|
||||
<Input.Search
|
||||
placeholder="Search..."
|
||||
onSearch={value => {
|
||||
console.log(value);
|
||||
}}
|
||||
enterButton
|
||||
/>
|
||||
<Button
|
||||
onClick={() => {
|
||||
refetch();
|
||||
}}
|
||||
>
|
||||
<Icon type="sync" />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteAllNewJobs()
|
||||
.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
|
||||
});
|
||||
});
|
||||
}}
|
||||
>
|
||||
Delete All
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
size="small"
|
||||
pagination={{ position: "top" }}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
rowKey="id"
|
||||
dataSource={data && data.available_jobs}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import React from "react";
|
||||
import { useMutation, useQuery } from "react-apollo";
|
||||
import { DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS, QUERY_AVAILABLE_SUPPLEMENT_JOBS } from "../../graphql/available-jobs.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import JobsAvailableSupplementComponent from "./jobs-available-supplement.component";
|
||||
|
||||
export default function JobsAvailableSupplementContainer({
|
||||
deleteJob,
|
||||
estDataLazyLoad
|
||||
}) {
|
||||
const { loading, error, data, refetch } = useQuery(
|
||||
QUERY_AVAILABLE_SUPPLEMENT_JOBS,
|
||||
{
|
||||
fetchPolicy: "network-only"
|
||||
}
|
||||
);
|
||||
const [deleteAllNewJobs] = useMutation(DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS);
|
||||
|
||||
if (error) return <AlertComponent type="error" message={error.message} />;
|
||||
return (
|
||||
<JobsAvailableSupplementComponent
|
||||
loading={loading}
|
||||
data={data}
|
||||
refetch={refetch}
|
||||
deleteJob={deleteJob}
|
||||
deleteAllNewJobs={deleteAllNewJobs}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
import { Avatar, Button, Checkbox, Descriptions, notification, PageHeader, Tag } from "antd";
|
||||
import {
|
||||
Avatar,
|
||||
Button,
|
||||
Checkbox,
|
||||
Descriptions,
|
||||
notification,
|
||||
PageHeader,
|
||||
Tag
|
||||
} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Moment from "react-moment";
|
||||
@@ -16,7 +24,7 @@ export default function JobsDetailHeader({
|
||||
|
||||
const tombstoneTitle = (
|
||||
<div>
|
||||
<Avatar size='large' alt='Vehicle Image' src={CarImage} />
|
||||
<Avatar size="large" alt="Vehicle Image" src={CarImage} />
|
||||
{`${t("jobs.fields.ro_number")} ${
|
||||
job.ro_number ? job.ro_number : t("general.labels.na")
|
||||
}`}
|
||||
@@ -25,26 +33,34 @@ export default function JobsDetailHeader({
|
||||
|
||||
const tombstoneSubtitle = (
|
||||
<div>
|
||||
{job.owner
|
||||
? (job.owner.first_name || "") + " " + (job.owner.last_name || "")
|
||||
: t("jobs.errors.noowner")}
|
||||
<Tag color="red">
|
||||
{job.owner ? (
|
||||
<Link to={`/manage/owners/${job.owner.id}`}>
|
||||
{`${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || ""}`}
|
||||
</Link>
|
||||
) : (
|
||||
t("jobs.errors.noowner")
|
||||
)}
|
||||
</Tag>
|
||||
|
||||
{job.vehicle ? (
|
||||
<Link to={`/manage/vehicles/${job.vehicle.id}`}>
|
||||
{job.vehicle.v_model_yr || t("general.labels.na")}{" "}
|
||||
{job.vehicle.v_make_desc || t("general.labels.na")}{" "}
|
||||
{job.vehicle.v_model_desc || t("general.labels.na")} |{" "}
|
||||
{job.vehicle.plate_no || t("general.labels.na")} |{" "}
|
||||
{job.vehicle.v_vin || t("general.labels.na")}
|
||||
</Link>
|
||||
) : null}
|
||||
<Tag color="green">
|
||||
{job.vehicle ? (
|
||||
<Link to={`/manage/vehicles/${job.vehicle.id}`}>
|
||||
{job.vehicle.v_model_yr || t("general.labels.na")}{" "}
|
||||
{job.vehicle.v_make_desc || t("general.labels.na")}{" "}
|
||||
{job.vehicle.v_model_desc || t("general.labels.na")} |{" "}
|
||||
{job.vehicle.plate_no || t("general.labels.na")} |{" "}
|
||||
{job.vehicle.v_vin || t("general.labels.na")}
|
||||
</Link>
|
||||
) : null}
|
||||
</Tag>
|
||||
</div>
|
||||
);
|
||||
|
||||
const menuExtra = [
|
||||
<Button
|
||||
key='convert'
|
||||
type='dashed'
|
||||
key="convert"
|
||||
type="dashed"
|
||||
disabled={job.converted}
|
||||
onClick={() => {
|
||||
mutationConvertJob({
|
||||
@@ -56,10 +72,11 @@ export default function JobsDetailHeader({
|
||||
message: t("jobs.successes.converted")
|
||||
});
|
||||
});
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.convert")}
|
||||
</Button>,
|
||||
<Button type='primary' key='submit' htmlType='submit'>
|
||||
<Button type="primary" key="submit" htmlType="submit">
|
||||
{t("general.labels.save")}
|
||||
</Button>
|
||||
];
|
||||
@@ -72,14 +89,15 @@ export default function JobsDetailHeader({
|
||||
title={tombstoneTitle}
|
||||
subTitle={tombstoneSubtitle}
|
||||
tags={
|
||||
<span key='job-status'>
|
||||
<span key="job-status">
|
||||
{job.job_status ? (
|
||||
<Tag color='blue'>{job.job_status.name}</Tag>
|
||||
<Tag color="blue">{job.job_status.name}</Tag>
|
||||
) : null}
|
||||
</span>
|
||||
}
|
||||
extra={menuExtra}>
|
||||
<Descriptions size='small' column={5}>
|
||||
extra={menuExtra}
|
||||
>
|
||||
<Descriptions size="small" column={5}>
|
||||
<Descriptions.Item label={t("jobs.fields.repairtotal")}>
|
||||
<CurrencyFormatter>{job.claim_total}</CurrencyFormatter>
|
||||
</Descriptions.Item>
|
||||
@@ -94,7 +112,7 @@ export default function JobsDetailHeader({
|
||||
|
||||
<Descriptions.Item label={t("jobs.fields.scheduled_completion")}>
|
||||
{job.scheduled_completion ? (
|
||||
<Moment format='MM/DD/YYYY'>{job.scheduled_completion}</Moment>
|
||||
<Moment format="MM/DD/YYYY">{job.scheduled_completion}</Moment>
|
||||
) : null}
|
||||
</Descriptions.Item>
|
||||
|
||||
|
||||
@@ -2,6 +2,16 @@ import React from "react";
|
||||
import { Spin } from "antd";
|
||||
import "./loading-spinner.styles.scss";
|
||||
|
||||
export default function LoadingSpinner() {
|
||||
return <Spin className="loading-spinner" size="large" delay="500" />;
|
||||
export default function LoadingSpinner({ loading = true, message, ...props }) {
|
||||
return (
|
||||
<Spin
|
||||
spinning={loading}
|
||||
className="loading-spinner"
|
||||
size="large"
|
||||
//delay="500"
|
||||
tip={message ? message : null}
|
||||
>
|
||||
{props.children}
|
||||
</Spin>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
import { Checkbox, Divider, Table } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||
|
||||
export default function OwnerFindModalComponent({
|
||||
selectedOwner,
|
||||
setSelectedOwner,
|
||||
ownersListLoading,
|
||||
ownersList
|
||||
}) {
|
||||
//setSelectedOwner is used to set the record id of the owner to use for adding the job.
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: t("owners.fields.ownr_ln"),
|
||||
dataIndex: "ownr_ln",
|
||||
key: "ownr_ln"
|
||||
//width: "8%",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// // filteredValue: state.filteredInfo.text || null,
|
||||
// sorter: (a, b) => alphaSort(a, b),
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("owners.fields.ownr_fn"),
|
||||
dataIndex: "ownr_fn",
|
||||
key: "ownr_fn"
|
||||
// ellipsis: true,
|
||||
// sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||
// //width: "25%",
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "ownr_name" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("owners.fields.ownr_addr1"),
|
||||
dataIndex: "ownr_addr1",
|
||||
key: "ownr_addr1"
|
||||
// sorter: (a, b) => alphaSort(a.vehicle_info, b.vehicle_info),
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "vehicle_info" && state.sortedInfo.order
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("owners.fields.ownr_city"),
|
||||
dataIndex: "ownr_city",
|
||||
key: "ownr_city"
|
||||
// sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("owners.fields.ownr_ea"),
|
||||
dataIndex: "ownr_ea",
|
||||
key: "ownr_ea"
|
||||
// sorter: (a, b) => a.clm_amt - b.clm_amt,
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("owners.fields.ownr_ph1"),
|
||||
dataIndex: "ownr_ph1",
|
||||
key: "ownr_ph1",
|
||||
render: (text, record) => (
|
||||
<PhoneFormatter>{record.ownr_ph1}</PhoneFormatter>
|
||||
)
|
||||
// sorter: (a, b) => alphaSort(a.uploaded_by, b.uploaded_by),
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "uploaded_by" && state.sortedInfo.order
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
}
|
||||
];
|
||||
|
||||
const handleOnRowClick = record => {
|
||||
if (record) {
|
||||
if (record.id) {
|
||||
setSelectedOwner(record.id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
setSelectedOwner(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
title={() => t("owners.labels.existing_owners")}
|
||||
size="small"
|
||||
pagination={{ position: "bottom" }}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
rowKey="id"
|
||||
loading={ownersListLoading}
|
||||
dataSource={ownersList}
|
||||
rowSelection={{
|
||||
onSelect: props => {
|
||||
setSelectedOwner(props.id);
|
||||
},
|
||||
type: "radio",
|
||||
selectedRowKeys: [selectedOwner]
|
||||
}}
|
||||
onRow={(record, rowIndex) => {
|
||||
return {
|
||||
onClick: event => {
|
||||
handleOnRowClick(record);
|
||||
}
|
||||
};
|
||||
}}
|
||||
/>
|
||||
<Divider />
|
||||
<Checkbox
|
||||
checked={selectedOwner ? false : true}
|
||||
onClick={() => setSelectedOwner(null)}
|
||||
>
|
||||
Create a new Owner record for this job.
|
||||
</Checkbox>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { Modal } from "antd";
|
||||
import React from "react";
|
||||
import { useQuery } from "react-apollo";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { QUERY_SEARCH_OWNER_BY_IDX } from "../../graphql/owners.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||
import OwnerFindModalComponent from "./owner-find-modal.component";
|
||||
|
||||
export default function OwnerFindModalContainer({
|
||||
loading,
|
||||
error,
|
||||
owner,
|
||||
selectedOwner,
|
||||
setSelectedOwner,
|
||||
...modalProps
|
||||
}) {
|
||||
//use owner object to run query and find what possible owners there are.
|
||||
const { t } = useTranslation();
|
||||
|
||||
const ownersList = useQuery(QUERY_SEARCH_OWNER_BY_IDX, {
|
||||
variables: {
|
||||
search: owner
|
||||
? `${owner.ownr_fn} ${owner.ownr_ln} ${owner.ownr_addr1} ${owner.ownr_city} ${owner.ownr_zip} ${owner.ownr_ea} ${owner.ownr_ph1} ${owner.ownr_ph2}`
|
||||
: null
|
||||
},
|
||||
skip: !owner,
|
||||
fetchPolicy: "network-only"
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t("owners.labels.existing_owners")}
|
||||
width={"80%"}
|
||||
{...modalProps}
|
||||
>
|
||||
{loading ? <LoadingSpinner /> : null}
|
||||
{error ? <AlertComponent message={error.message} type="error" /> : null}
|
||||
{owner ? (
|
||||
<OwnerFindModalComponent
|
||||
selectedOwner={selectedOwner}
|
||||
setSelectedOwner={setSelectedOwner}
|
||||
ownersListLoading={ownersList.loading}
|
||||
ownersList={
|
||||
ownersList.data && ownersList.data.search_owners
|
||||
? ownersList.data.search_owners
|
||||
: null
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import { onError } from "apollo-link-error";
|
||||
//import { Observable } from "apollo-link";
|
||||
import { Observable } from "apollo-link";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
|
||||
|
||||
const errorLink = onError(
|
||||
({ graphQLErrors, networkError, operation, forward }) => {
|
||||
let access_token = window.localStorage.getItem("token");
|
||||
// console.log("graphQLErrors", graphQLErrors);
|
||||
// console.log("networkError", networkError);
|
||||
// console.log("operation", operation);
|
||||
@@ -26,59 +26,68 @@ const errorLink = onError(
|
||||
//User access token has expired
|
||||
//props.history.push("/network-error");
|
||||
console.log("We need a new token!");
|
||||
if (access_token && access_token !== "undefined") {
|
||||
// Let's refresh token through async request
|
||||
// Let's refresh token through async request
|
||||
|
||||
auth.currentUser.getIdToken(true).then(token => {
|
||||
if (token) {
|
||||
window.localStorage.setItem("token", token);
|
||||
operation.setContext(({ headers = {} }) => ({
|
||||
headers: {
|
||||
...headers,
|
||||
authorization: token ? `Bearer ${token}` : ""
|
||||
}
|
||||
}));
|
||||
return forward(operation);
|
||||
}
|
||||
});
|
||||
auth.currentUser.getIdToken(true).then(token => {
|
||||
if (token) {
|
||||
console.log("Got the new token.", token);
|
||||
window.localStorage.setItem("token", token);
|
||||
operation.setContext(({ headers = {} }) => ({
|
||||
headers: {
|
||||
...headers,
|
||||
authorization: token ? `Bearer ${token}` : ""
|
||||
}
|
||||
}));
|
||||
|
||||
// return new Observable(observer => {
|
||||
// auth.currentUser
|
||||
// .getIdToken(true)
|
||||
// .then(function(idToken) {
|
||||
// if (!idToken) {
|
||||
// window.localStorage.removeItem("token");
|
||||
// return console.log("Refresh token has expired");
|
||||
// }
|
||||
// console.log("Got a new token", idToken);
|
||||
// window.localStorage.setItem("token", idToken);
|
||||
return new Observable(observer => {
|
||||
const subscriber = {
|
||||
next: observer.next.bind(observer),
|
||||
error: observer.error.bind(observer),
|
||||
complete: observer.complete.bind(observer)
|
||||
};
|
||||
console.log("About to resend the request.");
|
||||
// Retry last failed request
|
||||
forward(operation).subscribe(subscriber);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// // reset the headers
|
||||
// operation.setContext(({ headers = {} }) => ({
|
||||
// headers: {
|
||||
// // Re-add old headers
|
||||
// ...headers,
|
||||
// // Switch out old access token for new one
|
||||
// authorization: idToken ? `Bearer ${idToken}` : ""
|
||||
// }
|
||||
// }));
|
||||
// return new Observable(observer => {
|
||||
// auth.currentUser
|
||||
// .getIdToken(true)
|
||||
// .then(function(idToken) {
|
||||
// if (!idToken) {
|
||||
// window.localStorage.removeItem("token");
|
||||
// return console.log("Refresh token has expired");
|
||||
// }
|
||||
// console.log("Got a new token", idToken);
|
||||
// window.localStorage.setItem("token", idToken);
|
||||
|
||||
// const subscriber = {
|
||||
// next: observer.next.bind(observer),
|
||||
// error: observer.error.bind(observer),
|
||||
// complete: observer.complete.bind(observer)
|
||||
// };
|
||||
// console.log("About to resend the request.");
|
||||
// // Retry last failed request
|
||||
// forward(operation).subscribe(subscriber);
|
||||
// })
|
||||
// .catch(error => {
|
||||
// // No refresh or client token available, we force user to login
|
||||
// console.log("Hit an error.");
|
||||
// observer.error(error);
|
||||
// });
|
||||
// });
|
||||
}
|
||||
// // reset the headers
|
||||
// operation.setContext(({ headers = {} }) => ({
|
||||
// headers: {
|
||||
// // Re-add old headers
|
||||
// ...headers,
|
||||
// // Switch out old access token for new one
|
||||
// authorization: idToken ? `Bearer ${idToken}` : ""
|
||||
// }
|
||||
// }));
|
||||
|
||||
// const subscriber = {
|
||||
// next: observer.next.bind(observer),
|
||||
// error: observer.error.bind(observer),
|
||||
// complete: observer.complete.bind(observer)
|
||||
// };
|
||||
// console.log("About to resend the request.");
|
||||
// // Retry last failed request
|
||||
// forward(operation).subscribe(subscriber);
|
||||
// })
|
||||
// .catch(error => {
|
||||
// // No refresh or client token available, we force user to login
|
||||
// console.log("Hit an error.");
|
||||
// observer.error(error);
|
||||
// });
|
||||
// });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
81
client/src/graphql/available-jobs.queries.js
Normal file
81
client/src/graphql/available-jobs.queries.js
Normal file
@@ -0,0 +1,81 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const QUERY_AVAILABLE_NEW_JOBS = gql`
|
||||
query QUERY_AVAILABLE_NEW_JOBS {
|
||||
available_jobs(
|
||||
where: { issupplement: { _eq: false } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
vehicle_info
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_AVAILABLE_SUPPLEMENT_JOBS = gql`
|
||||
query QUERY_AVAILABLE_SUPPLEMENT_JOBS {
|
||||
available_jobs(
|
||||
where: { issupplement: { _eq: true } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
vehicle_info
|
||||
job {
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_AVAILABLE_JOB = gql`
|
||||
mutation DELETE_AVAILABLE_JOB($id: uuid) {
|
||||
delete_available_jobs(where: { id: { _eq: $id } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_ALL_AVAILABLE_NEW_JOBS = gql`
|
||||
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
|
||||
delete_available_jobs(where: { issupplement: { _eq: false } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS = gql`
|
||||
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
|
||||
delete_available_jobs(where: { issupplement: { _eq: true } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK = gql`
|
||||
query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) {
|
||||
available_jobs_by_pk(id: $id) {
|
||||
id
|
||||
est_data
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -152,6 +152,30 @@ export const GET_JOB_BY_PK = gql`
|
||||
towing_payable
|
||||
storage_payable
|
||||
adjustment_bottom_line
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner{
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
|
||||
joblines{
|
||||
id
|
||||
unq_seq
|
||||
line_ind
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -250,3 +274,13 @@ export const CONVERT_JOB_TO_RO = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_JOB = gql`
|
||||
mutation INSERT_JOB($job: [jobs_insert_input!]!) {
|
||||
insert_jobs(objects: $job) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
20
client/src/graphql/owners.queries.js
Normal file
20
client/src/graphql/owners.queries.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const QUERY_SEARCH_OWNER_BY_IDX = gql`
|
||||
query QUERY_SEARCH_OWNER_BY_IDX($search: String!) {
|
||||
search_owners(args: { search: $search }) {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_st
|
||||
ownr_zip
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -1,9 +1,23 @@
|
||||
import React from 'react'
|
||||
import React from "react";
|
||||
import JobsAvailableContainer from "../../components/jobs-available-new/jobs-available-new.container";
|
||||
import JobsAvailableSupplementContainer from "../../components/jobs-available-supplement/jobs-available-supplement.container";
|
||||
|
||||
export default function JobsAvailablePageComponent() {
|
||||
return (
|
||||
<div>
|
||||
JobsAvailablePageComponent
|
||||
</div>
|
||||
)
|
||||
export default function JobsAvailablePageComponent({
|
||||
deleteJob,
|
||||
estDataLazyLoad
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
Available New Jobs
|
||||
<JobsAvailableContainer
|
||||
deleteJob={deleteJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
Available Supplements (//TODO: LOGIC HAS NOT YET BEEN COPIED FROM OTHER COMPONENT)
|
||||
<JobsAvailableSupplementContainer
|
||||
deleteJob={deleteJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,26 @@
|
||||
import React from 'react'
|
||||
import JobsAvailablePageComponent from './jobs-available.page.component'
|
||||
import React from "react";
|
||||
import { useMutation, useLazyQuery } from "react-apollo";
|
||||
import {
|
||||
DELETE_AVAILABLE_JOB,
|
||||
QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK
|
||||
} from "../../graphql/available-jobs.queries";
|
||||
import JobsAvailablePageComponent from "./jobs-available.page.component";
|
||||
|
||||
export default function JobsAvailablePageContainer() {
|
||||
return (
|
||||
<div>
|
||||
<JobsAvailablePageComponent />
|
||||
</div>
|
||||
)
|
||||
const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB);
|
||||
|
||||
const estDataLazyLoad = useLazyQuery(
|
||||
QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK,
|
||||
{
|
||||
fetchPolicy: "network-only"
|
||||
}
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
<JobsAvailablePageComponent
|
||||
deleteJob={deleteJob}
|
||||
estDataLazyLoad={estDataLazyLoad}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
FaRegStickyNote,
|
||||
FaShieldAlt
|
||||
} from "react-icons/fa";
|
||||
import JobLinesContainer from "../../components/job-lines/job-lines.container.component";
|
||||
import JobsLines from '../../components/job-detail-lines/job-lines.component'
|
||||
import JobsDetailClaims from "../../components/jobs-detail-claims/jobs-detail-claims.component";
|
||||
import JobsDetailFinancials from "../../components/jobs-detail-financial/jobs-detail-financial.component";
|
||||
import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-header.component";
|
||||
@@ -94,7 +94,7 @@ export default function JobsDetailPage({
|
||||
}
|
||||
key="repairdata"
|
||||
>
|
||||
<JobLinesContainer jobId={job.id} />
|
||||
<JobsLines job={job} />
|
||||
</Tabs.TabPane>
|
||||
|
||||
<Tabs.TabPane
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { configure } from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
configure({ adapter: new Adapter() });
|
||||
configure({ adapter: new Adapter() });
|
||||
@@ -20,6 +20,7 @@
|
||||
"reset": "Reset to original."
|
||||
},
|
||||
"labels": {
|
||||
"actions": "Actions",
|
||||
"in": "In",
|
||||
"loading": "Loading...",
|
||||
"na": "N/A",
|
||||
@@ -36,6 +37,15 @@
|
||||
"unsavedchanges": "You have unsaved changes."
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"fields": {
|
||||
"act_price": "Actual Price",
|
||||
"db_price": "Database Price",
|
||||
"line_desc": "Line Description",
|
||||
"part_type": "Part Type",
|
||||
"unq_seq": "Seq #"
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"actions": {
|
||||
"addDocuments": "Add Job Documents",
|
||||
@@ -45,6 +55,8 @@
|
||||
"printCenter": "Print Center"
|
||||
},
|
||||
"errors": {
|
||||
"creating": "Error encountered while creating job. {{error}}",
|
||||
"deleted": "Error deleting job.",
|
||||
"noaccess": "This job does not exist or you do not have access to it.",
|
||||
"nodates": "No dates specified for this job.",
|
||||
"nojobselected": "No job is selected.",
|
||||
@@ -59,6 +71,7 @@
|
||||
"actual_delivery": "Actual Delivery",
|
||||
"actual_in": "Actual In",
|
||||
"adjustment_bottom_line": "Adjustments",
|
||||
"cieca_id": "CIECA ID",
|
||||
"claim_total": "Claim Total",
|
||||
"clm_no": "Claim #",
|
||||
"clm_total": "Claim Total",
|
||||
@@ -119,9 +132,12 @@
|
||||
"storage_payable": "Storage/PVRT",
|
||||
"towing_payable": "Towing Payable",
|
||||
"unitnumber": "Unit #",
|
||||
"updated_at": "Updated At",
|
||||
"uploaded_by": "Uploaded By",
|
||||
"vehicle": "Vehicle"
|
||||
},
|
||||
"labels": {
|
||||
"available_new_jobs": "",
|
||||
"cards": {
|
||||
"appraiser": "Appraiser",
|
||||
"customer": "Customer Information",
|
||||
@@ -136,6 +152,7 @@
|
||||
"totals": "Totals",
|
||||
"vehicle": "Vehicle"
|
||||
},
|
||||
"creating_new_job": "Creating new job...",
|
||||
"documents": "Documents",
|
||||
"lines": "Estimate Lines",
|
||||
"notes": "Notes",
|
||||
@@ -144,7 +161,10 @@
|
||||
"vehicle_info": "Vehicle"
|
||||
},
|
||||
"successes": {
|
||||
"all_deleted": "{{count}} jobs deleted successfully.",
|
||||
"converted": "Job converted successfully.",
|
||||
"created": "Job created successfully. Click to view.",
|
||||
"deleted": "Job deleted successfully.",
|
||||
"save": "Record Saved",
|
||||
"savetitle": "Record saved successfully."
|
||||
}
|
||||
@@ -197,6 +217,19 @@
|
||||
"updated": "Note updated successfully."
|
||||
}
|
||||
},
|
||||
"owners": {
|
||||
"fields": {
|
||||
"ownr_addr1": "Address",
|
||||
"ownr_city": "City",
|
||||
"ownr_ea": "Email",
|
||||
"ownr_fn": "First Name",
|
||||
"ownr_ln": "Last Name",
|
||||
"ownr_ph1": "Phone 1"
|
||||
},
|
||||
"labels": {
|
||||
"existing_owners": "Existing Owners"
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
"errors": {
|
||||
"state": "Error reading page state. Please refresh."
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"reset": "Restablecer a original."
|
||||
},
|
||||
"labels": {
|
||||
"actions": "Comportamiento",
|
||||
"in": "en",
|
||||
"loading": "Cargando...",
|
||||
"na": "N / A",
|
||||
@@ -36,6 +37,15 @@
|
||||
"unsavedchanges": "Usted tiene cambios no guardados."
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"fields": {
|
||||
"act_price": "Precio actual",
|
||||
"db_price": "Precio de base de datos",
|
||||
"line_desc": "Descripción de línea",
|
||||
"part_type": "Tipo de parte",
|
||||
"unq_seq": "Seq #"
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"actions": {
|
||||
"addDocuments": "Agregar documentos de trabajo",
|
||||
@@ -45,6 +55,8 @@
|
||||
"printCenter": "Centro de impresión"
|
||||
},
|
||||
"errors": {
|
||||
"creating": "",
|
||||
"deleted": "Error al eliminar el trabajo.",
|
||||
"noaccess": "Este trabajo no existe o no tiene acceso a él.",
|
||||
"nodates": "No hay fechas especificadas para este trabajo.",
|
||||
"nojobselected": "No hay trabajo seleccionado.",
|
||||
@@ -59,6 +71,7 @@
|
||||
"actual_delivery": "Entrega real",
|
||||
"actual_in": "Real en",
|
||||
"adjustment_bottom_line": "Ajustes",
|
||||
"cieca_id": "CIECA ID",
|
||||
"claim_total": "Reclamar total",
|
||||
"clm_no": "Reclamación #",
|
||||
"clm_total": "Reclamar total",
|
||||
@@ -119,9 +132,12 @@
|
||||
"storage_payable": "Almacenamiento / PVRT",
|
||||
"towing_payable": "Remolque a pagar",
|
||||
"unitnumber": "Unidad #",
|
||||
"updated_at": "Actualizado en",
|
||||
"uploaded_by": "Subido por",
|
||||
"vehicle": "Vehículo"
|
||||
},
|
||||
"labels": {
|
||||
"available_new_jobs": "",
|
||||
"cards": {
|
||||
"appraiser": "Tasador",
|
||||
"customer": "Información al cliente",
|
||||
@@ -136,6 +152,7 @@
|
||||
"totals": "Totales",
|
||||
"vehicle": "Vehículo"
|
||||
},
|
||||
"creating_new_job": "Creando nuevo trabajo ...",
|
||||
"documents": "documentos",
|
||||
"lines": "Líneas estimadas",
|
||||
"notes": "Notas",
|
||||
@@ -144,7 +161,10 @@
|
||||
"vehicle_info": "Vehículo"
|
||||
},
|
||||
"successes": {
|
||||
"all_deleted": "{{count}} trabajos eliminados con éxito.",
|
||||
"converted": "Trabajo convertido con éxito.",
|
||||
"created": "Trabajo creado con éxito. Click para ver.",
|
||||
"deleted": "Trabajo eliminado con éxito.",
|
||||
"save": "Registro guardado",
|
||||
"savetitle": "Registro guardado con éxito."
|
||||
}
|
||||
@@ -197,6 +217,19 @@
|
||||
"updated": "Nota actualizada con éxito."
|
||||
}
|
||||
},
|
||||
"owners": {
|
||||
"fields": {
|
||||
"ownr_addr1": "Dirección",
|
||||
"ownr_city": "ciudad",
|
||||
"ownr_ea": "Email",
|
||||
"ownr_fn": "Nombre de pila",
|
||||
"ownr_ln": "Apellido",
|
||||
"ownr_ph1": ""
|
||||
},
|
||||
"labels": {
|
||||
"existing_owners": "Propietarios existentes"
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
"errors": {
|
||||
"state": "Error al leer el estado de la página. Porfavor refresca."
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"reset": "Rétablir l'original."
|
||||
},
|
||||
"labels": {
|
||||
"actions": "actes",
|
||||
"in": "dans",
|
||||
"loading": "Chargement...",
|
||||
"na": "N / A",
|
||||
@@ -36,6 +37,15 @@
|
||||
"unsavedchanges": "Vous avez des changements non enregistrés."
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"fields": {
|
||||
"act_price": "Prix actuel",
|
||||
"db_price": "Prix de la base de données",
|
||||
"line_desc": "Description de la ligne",
|
||||
"part_type": "Type de pièce",
|
||||
"unq_seq": "Seq #"
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"actions": {
|
||||
"addDocuments": "Ajouter des documents de travail",
|
||||
@@ -45,6 +55,8 @@
|
||||
"printCenter": "Centre d'impression"
|
||||
},
|
||||
"errors": {
|
||||
"creating": "",
|
||||
"deleted": "Erreur lors de la suppression du travail.",
|
||||
"noaccess": "Ce travail n'existe pas ou vous n'y avez pas accès.",
|
||||
"nodates": "Aucune date spécifiée pour ce travail.",
|
||||
"nojobselected": "Aucun travail n'est sélectionné.",
|
||||
@@ -59,6 +71,7 @@
|
||||
"actual_delivery": "Livraison réelle",
|
||||
"actual_in": "En réel",
|
||||
"adjustment_bottom_line": "Ajustements",
|
||||
"cieca_id": "CIECA ID",
|
||||
"claim_total": "Total réclamation",
|
||||
"clm_no": "Prétendre #",
|
||||
"clm_total": "Total réclamation",
|
||||
@@ -119,9 +132,12 @@
|
||||
"storage_payable": "Stockage / PVRT",
|
||||
"towing_payable": "Remorquage à payer",
|
||||
"unitnumber": "Unité #",
|
||||
"updated_at": "Mis à jour à",
|
||||
"uploaded_by": "Telechargé par",
|
||||
"vehicle": "Véhicule"
|
||||
},
|
||||
"labels": {
|
||||
"available_new_jobs": "",
|
||||
"cards": {
|
||||
"appraiser": "Expert",
|
||||
"customer": "Informations client",
|
||||
@@ -136,6 +152,7 @@
|
||||
"totals": "Totaux",
|
||||
"vehicle": "Véhicule"
|
||||
},
|
||||
"creating_new_job": "Création d'un nouvel emploi ...",
|
||||
"documents": "Les documents",
|
||||
"lines": "Estimer les lignes",
|
||||
"notes": "Remarques",
|
||||
@@ -144,7 +161,10 @@
|
||||
"vehicle_info": "Véhicule"
|
||||
},
|
||||
"successes": {
|
||||
"all_deleted": "{{count}} travaux supprimés avec succès.",
|
||||
"converted": "Travail converti avec succès.",
|
||||
"created": "Le travail a été créé avec succès. Clique pour voir.",
|
||||
"deleted": "Le travail a bien été supprimé.",
|
||||
"save": "Enregistrement enregistré",
|
||||
"savetitle": "Enregistrement enregistré avec succès."
|
||||
}
|
||||
@@ -197,6 +217,19 @@
|
||||
"updated": "Remarque mise à jour avec succès."
|
||||
}
|
||||
},
|
||||
"owners": {
|
||||
"fields": {
|
||||
"ownr_addr1": "Adresse",
|
||||
"ownr_city": "Ville",
|
||||
"ownr_ea": "Email",
|
||||
"ownr_fn": "Prénom",
|
||||
"ownr_ln": "Nom de famille",
|
||||
"ownr_ph1": ""
|
||||
},
|
||||
"labels": {
|
||||
"existing_owners": "Propriétaires existants"
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
"errors": {
|
||||
"state": "Erreur lors de la lecture de l'état de la page. Rafraichissez, s'il vous plait."
|
||||
|
||||
10
client/src/utils/DateFormatter.jsx
Normal file
10
client/src/utils/DateFormatter.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import Moment from "react-moment";
|
||||
|
||||
export function DateFormatter(props) {
|
||||
return <Moment format="MM/DD/YYYY">{props.children || ""}</Moment>;
|
||||
}
|
||||
|
||||
export function DateTimeFormatter(props) {
|
||||
return <Moment format="MM/DD/YYYY @ HH:mm">{props.children || ""}</Moment>;
|
||||
}
|
||||
@@ -79,6 +79,15 @@
|
||||
"@apollo/react-hooks" "^3.1.3"
|
||||
tslib "^1.10.0"
|
||||
|
||||
"@apollo/react-testing@^3.1.3":
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@apollo/react-testing/-/react-testing-3.1.3.tgz#d8dd318f58fb6a404976bfa3f8a79e976a5c6562"
|
||||
integrity sha512-58R7gROl4TZMHm5kS76Nof9FfZhD703AU3SmJTA2f7naiMqC9Qd8pZ4oNCBafcab0SYN//UtWvLcluK5O7V/9g==
|
||||
dependencies:
|
||||
"@apollo/react-common" "^3.1.3"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
tslib "^1.10.0"
|
||||
|
||||
"@babel/code-frame@7.5.5", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5":
|
||||
version "7.5.5"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d"
|
||||
@@ -11051,6 +11060,8 @@ rxjs@^6.4.0, rxjs@^6.5.3:
|
||||
version "6.5.4"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c"
|
||||
integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: DROP TABLE "public"."available_jobs"
|
||||
type: run_sql
|
||||
@@ -0,0 +1,25 @@
|
||||
- args:
|
||||
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: "CREATE TABLE \"public\".\"available_jobs\"(\"id\" uuid NOT NULL DEFAULT
|
||||
gen_random_uuid(), \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\"
|
||||
timestamptz NOT NULL DEFAULT now(), \"uploaded_by\" text NOT NULL, \"cieca_id\"
|
||||
text NOT NULL, \"bodyshopid\" uuid NOT NULL, \"est_data\" jsonb NOT NULL, \"issupplement\"
|
||||
boolean NOT NULL DEFAULT false, \"jobid\" uuid, \"supplement_number\" integer,
|
||||
\"ownr_name\" text, \"vehicle_info\" text, \"clm_amt\" numeric, \"clm_no\" text,
|
||||
\"source_system\" text, PRIMARY KEY (\"id\") , FOREIGN KEY (\"bodyshopid\")
|
||||
REFERENCES \"public\".\"bodyshops\"(\"id\") ON UPDATE cascade ON DELETE cascade,
|
||||
FOREIGN KEY (\"jobid\") REFERENCES \"public\".\"jobs\"(\"id\") ON UPDATE restrict
|
||||
ON DELETE cascade);\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
|
||||
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
|
||||
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_available_jobs_updated_at\"\nBEFORE
|
||||
UPDATE ON \"public\".\"available_jobs\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
|
||||
ON TRIGGER \"set_public_available_jobs_updated_at\" ON \"public\".\"available_jobs\"
|
||||
\nIS 'trigger to set value of column \"updated_at\" to current timestamp on
|
||||
row update';\n"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: add_existing_table_or_view
|
||||
@@ -0,0 +1,24 @@
|
||||
- args:
|
||||
relationship: bodyshop
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: drop_relationship
|
||||
- args:
|
||||
relationship: job
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: drop_relationship
|
||||
- args:
|
||||
relationship: available_jobs
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_relationship
|
||||
- args:
|
||||
relationship: available_jobs
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_relationship
|
||||
@@ -0,0 +1,40 @@
|
||||
- args:
|
||||
name: bodyshop
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
using:
|
||||
foreign_key_constraint_on: bodyshopid
|
||||
type: create_object_relationship
|
||||
- args:
|
||||
name: job
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
using:
|
||||
foreign_key_constraint_on: jobid
|
||||
type: create_object_relationship
|
||||
- args:
|
||||
name: available_jobs
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: bodyshopid
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: create_array_relationship
|
||||
- args:
|
||||
name: available_jobs
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: jobid
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: create_array_relationship
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
permission:
|
||||
allow_upsert: true
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- uploaded_by
|
||||
- cieca_id
|
||||
- bodyshopid
|
||||
- est_data
|
||||
- issupplement
|
||||
- jobid
|
||||
- supplement_number
|
||||
- ownr_name
|
||||
- vehicle_info
|
||||
- clm_amt
|
||||
- clm_no
|
||||
- source_system
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
@@ -0,0 +1,34 @@
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- issupplement
|
||||
- supplement_number
|
||||
- est_data
|
||||
- clm_amt
|
||||
- cieca_id
|
||||
- clm_no
|
||||
- ownr_name
|
||||
- source_system
|
||||
- uploaded_by
|
||||
- vehicle_info
|
||||
- created_at
|
||||
- updated_at
|
||||
- bodyshopid
|
||||
- id
|
||||
- jobid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
limit: null
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
@@ -0,0 +1,21 @@
|
||||
- args:
|
||||
permission:
|
||||
columns: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: drop_delete_permission
|
||||
@@ -0,0 +1,16 @@
|
||||
- args:
|
||||
permission:
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: available_jobs
|
||||
schema: public
|
||||
type: create_delete_permission
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."first_name" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_fn" to "first_name";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."first_name" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "first_name" to "ownr_fn";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."last_name" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_ln" to "last_name";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."last_name" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "last_name" to "ownr_ln";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."address1" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_addr1" to "address1";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."address1" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "address1" to "ownr_addr1";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."address2" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_addr2" to "address2";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."address2" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "address2" to "ownr_addr2";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."city" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_city" to "city";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."city" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "city" to "ownr_city";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."state" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_st" to "state";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."state" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "state" to "ownr_st";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."zip" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_zip" to "zip";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."zip" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "zip" to "ownr_zip";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."country" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_ctry" to "country";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."country" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "country" to "ownr_ctry";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."email" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_ea" to "email";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."email" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "email" to "ownr_ea";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."phone" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "ownr_ph1" to "phone";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."owners"."phone" IS E''
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."owners" rename column "phone" to "ownr_ph1";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_ph2";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_ph2" text NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,43 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,41 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,42 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,42 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- allow_text_message
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- created_at
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- shopid
|
||||
- ownr_st
|
||||
- updated_at
|
||||
- ownr_zip
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
1
hasura/migrations/1580321100336_owner_gin_idx/down.yaml
Normal file
1
hasura/migrations/1580321100336_owner_gin_idx/down.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
6
hasura/migrations/1580321100336_owner_gin_idx/up.yaml
Normal file
6
hasura/migrations/1580321100336_owner_gin_idx/up.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "\r\nCREATE INDEX owner_gin_idx ON owners\r\nUSING GIN ((ownr_fn || ' '
|
||||
|| ownr_ln || ' ' || ownr_addr1 || ' ' || ownr_city || ' ' || ownr_zip ||
|
||||
' ' || ownr_ea || ' ' || ownr_ph1 || ' ' || ownr_ph2 ) gin_trgm_ops);\r\n"
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,14 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "CREATE FUNCTION search_owners(search text)\r\nRETURNS SETOF owners AS $$\r\n
|
||||
\ SELECT *\r\n FROM owners\r\n WHERE\r\n search <% (ownr_fn ||
|
||||
' ' || ownr_ln || ' ' || ownr_addr1 || ' ' || ownr_city || ' ' || ownr_zip
|
||||
\ || ' ' || ownr_ea || ' ' || ownr_ph1 || ' ' || ownr_ph2)\r\n ORDER BY\r\n
|
||||
\ similarity(search, (ownr_fn || ' ' || ownr_ln || ' ' || ownr_addr1 ||
|
||||
' ' || ownr_city || ' ' || ownr_zip || ' ' || ownr_ea || ' ' || ownr_ph1 ||
|
||||
' ' || ownr_ph2)) DESC\r\n LIMIT 20;\r\n$$ LANGUAGE sql STABLE;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_owners
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_co_nm";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_co_nm" text NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,45 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
- ownr_co_nm
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,42 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,43 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,45 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_title";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_title" text NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,45 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
- ownr_co_nm
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,46 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
- ownr_co_nm
|
||||
- ownr_title
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,43 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_title
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,45 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,46 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_title
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "ALTER TABLE jobs ALTER COLUMN theft_ind DROP DEFAULT;\r\nALTER TABLE jobs
|
||||
ALTER theft_ind TYPE bool USING CASE WHEN true THEN FALSE ELSE TRUE END;\r\nALTER
|
||||
TABLE jobs ALTER COLUMN theft_ind SET DEFAULT FALSE;"
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "ALTER TABLE jobs ALTER COLUMN tlos_ind DROP DEFAULT;\r\nALTER TABLE jobs
|
||||
ALTER tlos_ind TYPE bool USING CASE WHEN true THEN FALSE ELSE TRUE END;\r\nALTER
|
||||
TABLE jobs ALTER COLUMN tlos_ind SET DEFAULT FALSE;"
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."jobs" DROP COLUMN "parts_tax_rate";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."jobs" ADD COLUMN "parts_tax_rate" numeric NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."jobs"."parts_tax_rate" IS E'null'
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: alter table "public"."jobs" rename column "tax_pstthr" to "parts_tax_rate";
|
||||
type: run_sql
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user