Merge pull request #3 from snaptsoft/dev-patrick

Push changes to dev.
This commit is contained in:
2020-01-24 12:56:43 -08:00
committed by GitHub
74 changed files with 4005 additions and 415 deletions

View File

@@ -5,4 +5,4 @@
1. Get a presigned URL by hitting our own express server with a unique key.
2. Use this presigned URL to upload an individual file.
3. Store the key + the bucket name to the documents record.
4. ???Figure out how to add thumbnails.
4.

View File

@@ -24,6 +24,27 @@
<folder_node>
<name>errors</name>
<children>
<concept_node>
<name>deletes3</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>getpresignurl</name>
<definition_loaded>false</definition_loaded>
@@ -66,6 +87,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>nodocuments</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>
@@ -97,6 +139,27 @@
<folder_node>
<name>successes</name>
<children>
<concept_node>
<name>delete</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>insert</name>
<definition_loaded>false</definition_loaded>
@@ -374,6 +437,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>convert</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>postInvoices</name>
<definition_loaded>false</definition_loaded>
@@ -442,6 +526,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>nodates</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>nojobselected</name>
<definition_loaded>false</definition_loaded>
@@ -573,6 +678,69 @@
<folder_node>
<name>fields</name>
<children>
<concept_node>
<name>actual_completion</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>actual_delivery</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>actual_in</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>
@@ -636,6 +804,132 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>date_closed</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>date_estimated</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>date_exported</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>date_invoiced</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>date_open</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>date_scheduled</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>deductible</name>
<definition_loaded>false</definition_loaded>
@@ -720,6 +1014,27 @@
</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>phone1</name>
<definition_loaded>false</definition_loaded>
@@ -741,6 +1056,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>phoneshort</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>ro_number</name>
<definition_loaded>false</definition_loaded>
@@ -762,6 +1098,69 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>scheduled_completion</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>scheduled_delivery</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>scheduled_in</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>status</name>
<definition_loaded>false</definition_loaded>
@@ -1066,27 +1465,6 @@
</concept_node>
</children>
</folder_node>
<concept_node>
<name>convert</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>
@@ -1823,6 +2201,37 @@
</concept_node>
</children>
</folder_node>
<folder_node>
<name>user</name>
<children>
<folder_node>
<name>actions</name>
<children>
<concept_node>
<name>signout</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>vehicles</name>
<children>

View File

@@ -30,6 +30,7 @@ export default () => {
useEffect(() => {
//Run the auth code only on the first render.
const unsubscribeFromAuth = auth.onAuthStateChanged(async user => {
console.log("Auth State Changed.")
if (user) {
let token;
token = await user.getIdToken();

View File

@@ -1,12 +1,13 @@
import React from "react";
import { Link } from "react-router-dom";
import { Dropdown, Menu, Icon, Avatar, Row, Col } from "antd";
import { useTranslation } from "react-i18next";
import i18next from "i18next";
import { useQuery } from "@apollo/react-hooks";
import { GET_CURRENT_USER } from "../../graphql/local.queries";
import { Avatar, Col, Dropdown, Icon, Menu, Row } from "antd";
import i18next from "i18next";
import React from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import UserImage from "../../assets/User.svg";
import { GET_CURRENT_USER } from "../../graphql/local.queries";
import AlertComponent from "../alert/alert.component";
import SignOut from "../sign-out/sign-out.component";
export default function CurrentUserDropdown() {
const { t } = useTranslation();
@@ -23,6 +24,9 @@ export default function CurrentUserDropdown() {
};
const menu = (
<Menu mode='vertical' onClick={handleMenuClick}>
<Menu.Item>
<SignOut />
</Menu.Item>
<Menu.Item>
<Link to='/manage/profile'> {t("menus.currentuser.profile")}</Link>
</Menu.Item>
@@ -59,7 +63,7 @@ export default function CurrentUserDropdown() {
</Col>
<Col span={16}>
<Link to='/manage/profile'>
{currentUser?.displayName ?? t("general.labels.unknown")}
{currentUser?.displayName || t("general.labels.unknown")}
</Link>
</Col>
</Row>

View File

@@ -1,13 +1,12 @@
import { useApolloClient } from "@apollo/react-hooks";
import { Col, Icon, Menu, Row } from "antd";
import React from "react";
import { Link } from "react-router-dom";
import { useApolloClient } from "@apollo/react-hooks";
import { Menu, Icon, Row, Col } from "antd";
import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component";
import GlobalSearch from "../global-search/global-search.component";
import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component";
import "./header.styles.scss";
import SignOut from "../sign-out/sign-out.component";
import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component";
import GlobalSearch from "../global-search/global-search.component";
import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component";
export default ({ landingHeader, navItems, selectedNavItem }) => {
const apolloClient = useApolloClient();
@@ -38,9 +37,7 @@ export default ({ landingHeader, navItems, selectedNavItem }) => {
))}
{!landingHeader ? (
<Menu.Item>
<SignOut />
</Menu.Item>
null
) : (
<Menu.Item>
<ManageSignInButton />

View File

@@ -1,26 +1,24 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { useQuery } from "@apollo/react-hooks";
import AlertComponent from "../alert/alert.component";
import { Button, Icon, PageHeader, Tag } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { QUERY_JOB_CARD_DETAILS } from "../../graphql/jobs.queries";
import { PageHeader, Button, Descriptions, Tag, Icon } from "antd";
import AlertComponent from "../alert/alert.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container";
//import JobDetailCardsHeaderComponent from "./job-detail-cards.header.component";
import JobDetailCardsCustomerComponent from "./job-detail-cards.customer.component";
import JobDetailCardsVehicleComponent from "./job-detail-cards.vehicle.component";
import JobDetailCardsInsuranceComponent from "./job-detail-cards.insurance.component";
import JobDetailCardsDatesComponent from "./job-detail-cards.dates.component";
import JobDetailCardsPartsComponent from "./job-detail-cards.parts.component";
import JobDetailCardsNotesComponent from "./job-detail-cards.notes.component";
import JobDetailCardsDamageComponent from "./job-detail-cards.damage.component";
import JobDetailCardsTotalsComponent from "./job-detail-cards.totals.component";
import JobDetailCardsDatesComponent from "./job-detail-cards.dates.component";
import JobDetailCardsDocumentsComponent from "./job-detail-cards.documents.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import JobDetailCardsInsuranceComponent from "./job-detail-cards.insurance.component";
import JobDetailCardsNotesComponent from "./job-detail-cards.notes.component";
import JobDetailCardsPartsComponent from "./job-detail-cards.parts.component";
import "./job-detail-cards.styles.scss";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container";
import JobDetailCardsTotalsComponent from "./job-detail-cards.totals.component";
export default function JobDetailCards({ selectedJob }) {
const { loading, error, data, refetch } = useQuery(QUERY_JOB_CARD_DETAILS, {
@@ -56,11 +54,17 @@ export default function JobDetailCards({ selectedJob }) {
</span>
}
title={
loading
? t("general.labels.loading")
: data.jobs_by_pk.ro_number
? `${t("jobs.fields.ro_number")} ${data.jobs_by_pk.ro_number}`
: `${t("jobs.fields.est_number")} ${data.jobs_by_pk.est_number}`
loading ? (
t("general.labels.loading")
) : (
<Link to={`/manage/jobs/${data.jobs_by_pk.id}`}>
{data.jobs_by_pk.ro_number
? `${t("jobs.fields.ro_number")} ${data.jobs_by_pk.ro_number}`
: `${t("jobs.fields.est_number")} ${
data.jobs_by_pk.est_number
}`}{" "}
</Link>
)
}
extra={[
<Link
@@ -89,33 +93,38 @@ export default function JobDetailCards({ selectedJob }) {
{t("jobs.actions.postInvoices")}
</Button>
]}>
{loading ? (
<LoadingSkeleton />
) : (
<Descriptions size='small' column={3}>
<Descriptions.Item label='Created'>Lili Qu</Descriptions.Item>
<Descriptions.Item label='Association'>421421</Descriptions.Item>
<Descriptions.Item label='Creation Time'>
2017-01-10
</Descriptions.Item>
<Descriptions.Item label='Effective Time'>
2017-10-10
</Descriptions.Item>
<Descriptions.Item label='Remarks'>
Gonghu Road, Xihu District, Hangzhou, Zhejiang, China
</Descriptions.Item>
</Descriptions>
)}
{
// loading ? (
// <LoadingSkeleton />
// ) : (
// <Descriptions size='small' column={3}>
// <Descriptions.Item label='Created'>Lili Qu</Descriptions.Item>
// <Descriptions.Item label='Association'>421421</Descriptions.Item>
// <Descriptions.Item label='Creation Time'>
// 2017-01-10
// </Descriptions.Item>
// <Descriptions.Item label='Effective Time'>
// 2017-10-10
// </Descriptions.Item>
// <Descriptions.Item label='Remarks'>
// Gonghu Road, Xihu District, Hangzhou, Zhejiang, China
// </Descriptions.Item>
// </Descriptions>
// )
}
<section className='job-cards'>
<JobDetailCardsCustomerComponent
loading={loading}
data={data ? data.jobs_by_pk : null}
/>
<JobDetailCardsVehicleComponent
loading={loading}
data={data ? data.jobs_by_pk : null}
/>
{
// <JobDetailCardsVehicleComponent
// loading={loading}
// data={data ? data.jobs_by_pk : null}
// />
}
<JobDetailCardsInsuranceComponent
loading={loading}
data={data ? data.jobs_by_pk : null}

View File

@@ -1,7 +1,8 @@
import React from "react";
import { useTranslation } from "react-i18next";
import CardTemplate from "./job-detail-cards.template.component";
import { Link } from "react-router-dom";
import PhoneFormatter from "../../utils/PhoneFormatter";
import CardTemplate from "./job-detail-cards.template.component";
export default function JobDetailCardsCustomerComponent({ loading, data }) {
const { t } = useTranslation();
@@ -10,21 +11,34 @@ export default function JobDetailCardsCustomerComponent({ loading, data }) {
<CardTemplate
loading={loading}
title={t("jobs.labels.cards.customer")}
extraLink={data?.owner ? `/manage/owners/${data?.owner?.id}` : null}>
extraLink={data && data.owner ? `/manage/owners/${data.owner.id}` : null}>
{data ? (
<span>
<div>{`${data?.ownr_fn ??
""} ${data.ownr_ln ?? ""}`}</div>
<div>{`${data.ownr_fn || ""} ${data.ownr_ln || ""}`}</div>
<div>
<PhoneFormatter>{`${data?.ownr_ph1 ?? ""}`}</PhoneFormatter>
{t("jobs.fields.phoneshort")}:
<PhoneFormatter>{`${data.ownr_ph1 ||
t("general.labels.na")}`}</PhoneFormatter>
</div>
{data?.ownr_ea ? (
<a href={`mailto:${data.ownr_ea}`}>
<div>{`${data?.ownr_ea ?? ""}`}</div>
</a>
) : null}
<div>{`${data?.owner?.preferred_contact ?? ""}`}</div>
<div>
{t("jobs.fields.ownr_ea")}:
{data.ownr_ea ? (
<a href={`mailto:${data.ownr_ea}`}>
<span>{`${data.ownr_ea || ""}`}</span>
</a>
) : (
t("general.labels.na")
)}
</div>
<div>{`${(data.owner && data.owner.preferred_contact) || ""}`}</div>
{data.vehicle ? (
<Link to={`/manage/vehicles/${data.vehicle.id}`}>
{`${data.vehicle.v_model_yr || ""} ${data.vehicle.v_make_desc ||
""} ${data.vehicle.v_model_desc || ""}`}
</Link>
) : (
<span>{t("jobs.errors.novehicle")}</span>
)}
</span>
) : null}
</CardTemplate>

View File

@@ -11,13 +11,112 @@ export default function JobDetailCardsDatesComponent({ loading, data }) {
<CardTemplate loading={loading} title={t("jobs.labels.cards.dates")}>
{data ? (
<Timeline>
<Timeline.Item>
Actual In <Moment format='MM/DD/YYYY'>{data?.actual_in}</Moment>
</Timeline.Item>
<Timeline.Item>
Scheduled Completion
<Moment format='MM/DD/YYYY'>{data?.scheduled_completion}</Moment>
</Timeline.Item>
{!(
data.actual_in ||
data.scheduled_completion ||
data.scheduled_in ||
data.actual_completion ||
data.scheduled_delivery ||
data.actual_delivery ||
data.date_estimated ||
data.date_open ||
data.date_scheduled ||
data.date_invoiced ||
data.date_closed ||
data.date_exported
) ? (
<div>{t("jobs.errors.nodates")}</div>
) : null}
{data.actual_in ? (
<Timeline.Item>
{t("jobs.fields.actual_in")}
<Moment format='MM/DD/YYYY'>{data.actual_in || ""}</Moment>
</Timeline.Item>
) : null}
{data.scheduled_completion ? (
<Timeline.Item>
{t("jobs.fields.scheduled_completion")}
<Moment format='MM/DD/YYYY'>
{data.scheduled_completion || ""}
</Moment>
</Timeline.Item>
) : null}
{data.scheduled_in ? (
<Timeline.Item>
{t("jobs.fields.scheduled_in")}
<Moment format='MM/DD/YYYY'>{data.scheduled_in || ""}</Moment>
</Timeline.Item>
) : null}
{data.actual_completion ? (
<Timeline.Item>
{t("jobs.fields.actual_completion")}
<Moment format='MM/DD/YYYY'>
{data.actual_completion || ""}
</Moment>
</Timeline.Item>
) : null}
{data.scheduled_delivery ? (
<Timeline.Item>
{t("jobs.fields.scheduled_delivery")}
<Moment format='MM/DD/YYYY'>
{data.scheduled_delivery || ""}
</Moment>
</Timeline.Item>
) : null}
{data.actual_delivery ? (
<Timeline.Item>
{t("jobs.fields.actual_delivery")}
<Moment format='MM/DD/YYYY'>{data.actual_delivery || ""}</Moment>
</Timeline.Item>
) : null}
{data.date_estimated ? (
<Timeline.Item>
{t("jobs.fields.date_estimated")}
<Moment format='MM/DD/YYYY'>{data.date_estimated || ""}</Moment>
</Timeline.Item>
) : null}
{data.date_open ? (
<Timeline.Item>
{t("jobs.fields.date_open")}
<Moment format='MM/DD/YYYY'>{data.date_open || ""}</Moment>
</Timeline.Item>
) : null}
{data.date_scheduled ? (
<Timeline.Item>
{t("jobs.fields.date_scheduled")}
<Moment format='MM/DD/YYYY'>{data.date_scheduled || ""}</Moment>
</Timeline.Item>
) : null}
{data.date_invoiced ? (
<Timeline.Item>
{t("jobs.fields.date_invoiced")}
<Moment format='MM/DD/YYYY'>{data.date_invoiced || ""}</Moment>
</Timeline.Item>
) : null}
{data.date_closed ? (
<Timeline.Item>
{t("jobs.fields.date_closed")}
<Moment format='MM/DD/YYYY'>{data.date_closed || ""}</Moment>
</Timeline.Item>
) : null}
{data.date_exported ? (
<Timeline.Item>
{t("jobs.fields.date_exported")}
<Moment format='MM/DD/YYYY'>{data.date_exported || ""}</Moment>
</Timeline.Item>
) : null}
</Timeline>
) : null}
</CardTemplate>

View File

@@ -1,17 +1,35 @@
import { Carousel } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import "./job-detail-cards.styles.scss";
import CardTemplate from "./job-detail-cards.template.component";
export default function JobDetailCardsDocumentsComponent({ loading, data }) {
const { t } = useTranslation();
if (!data)
return (
<CardTemplate loading={loading} title={t("jobs.labels.cards.documents")}>
null
</CardTemplate>
);
return (
<CardTemplate loading={loading} title={t("jobs.labels.cards.documents")}>
{data ? (
<span>
Documents stuff here.
</span>
) : null}
<CardTemplate
loading={loading}
title={t("jobs.labels.cards.documents")}
extraLink={`/manage/jobs/${data.id}#documents`}>
{data.documents.count > 0 ? (
<Carousel autoplay>
{data.documents.map(item => (
<div key={item.id}>
<img src={item.thumb_url} alt={item.name} />
</div>
))}
</Carousel>
) : (
<div>{t("documents.errors.nodocuments")}</div>
)}
</CardTemplate>
);
}

View File

@@ -0,0 +1,11 @@
.ant-carousel .slick-slide {
text-align: center;
height: 160px;
line-height: 160px;
background: #364d79;
overflow: hidden;
}
.ant-carousel .slick-slide h3 {
color: #fff;
}

View File

@@ -10,16 +10,16 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
<CardTemplate loading={loading} title={t("jobs.labels.cards.insurance")}>
{data ? (
<span>
<div>{data?.ins_co_nm ?? t("general.labels.unknown")}</div>
<div>{data?.clm_no ?? t("general.labels.unknown")}</div>
<div>{data?.ins_co_nm || t("general.labels.unknown")}</div>
<div>{data?.clm_no || t("general.labels.unknown")}</div>
<div>
{t("jobs.labels.cards.filehandler")}
{data?.ins_ea ? (
<a href={`mailto:${data.ins_ea}`}>
<div>{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}</div>
<div>{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}</div>
</a>
) : (
<div>{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}</div>
<div>{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}</div>
)}
{data?.ins_ph1 ? (
<PhoneFormatter>{data?.ins_ph1}</PhoneFormatter>
@@ -31,10 +31,10 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
{t("jobs.labels.cards.appraiser")}
{data?.est_ea ? (
<a href={`mailto:${data.est_ea}`}>
<div>{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}</div>
<div>{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}</div>
</a>
) : (
<div>{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}</div>
<div>{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}</div>
)}
</div>
@@ -42,10 +42,10 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
{t("jobs.labels.cards.estimator")}
{data?.est_ea ? (
<a href={`mailto:${data.est_ea}`}>
<div>{`${data?.est_ct_fn ?? ""} ${data?.est_ct_ln ?? ""}`}</div>
<div>{`${data?.est_ct_fn || ""} ${data?.est_ct_ln || ""}`}</div>
</a>
) : (
<div>{`${data?.est_ct_fn ?? ""} ${data?.est_ct_ln ?? ""}`}</div>
<div>{`${data?.est_ct_fn || ""} ${data?.est_ct_ln || ""}`}</div>
)}
{data?.est_ph1 ? (
<PhoneFormatter>{data?.est_ph1}</PhoneFormatter>

View File

@@ -13,9 +13,9 @@ export default function JobDetailCardsVehicleComponent({ loading, data }) {
>
{data ? (
<span>
{data.vehicle?.v_model_yr ?? t("general.labels.na")}{" "}
{data.vehicle?.v_make_desc ?? t("general.labels.na")}{" "}
{data.vehicle?.v_model_desc ?? t("general.labels.na")}
{data.vehicle?.v_model_yr || t("general.labels.na")}{" "}
{data.vehicle?.v_make_desc || t("general.labels.na")}{" "}
{data.vehicle?.v_model_desc || t("general.labels.na")}
</span>
) : null}
</CardTemplate>

View File

@@ -91,9 +91,9 @@ function JobTombstone({ job, ...otherProps }) {
title={tombstoneTitle}
subTitle={
jobContext.owner
? (jobContext.owner?.first_name ?? "") +
? (jobContext.owner?.first_name || "") +
" " +
(jobContext.owner?.last_name ?? "")
(jobContext.owner?.last_name || "")
: t("jobs.errors.noowner")
}
tags={
@@ -124,7 +124,7 @@ function JobTombstone({ job, ...otherProps }) {
});
});
}}>
{t("jobs.labels.convert")}
{t("jobs.actions.convert")}
</Button>,
<Button type='primary' key='submit' htmlType='submit'>
{t("general.labels.save")}
@@ -133,10 +133,10 @@ function JobTombstone({ job, ...otherProps }) {
<Descriptions size='small' column={5}>
<Descriptions.Item label={t("jobs.fields.vehicle")}>
<Link to={`/manage/vehicles/${jobContext.vehicle?.id}`}>
{jobContext.vehicle?.v_model_yr ?? t("general.labels.na")}{" "}
{jobContext.vehicle?.v_make_desc ?? t("general.labels.na")}{" "}
{jobContext.vehicle?.v_model_desc ?? t("general.labels.na")} |{" "}
{jobContext.vehicle?.plate_no ?? t("general.labels.na")}
{jobContext.vehicle?.v_model_yr || t("general.labels.na")}{" "}
{jobContext.vehicle?.v_make_desc || t("general.labels.na")}{" "}
{jobContext.vehicle?.v_model_desc || t("general.labels.na")} |{" "}
{jobContext.vehicle?.plate_no || t("general.labels.na")}
</Link>
</Descriptions.Item>

View File

@@ -0,0 +1,249 @@
import { Icon, Modal, notification, Upload } from "antd";
import axios from "axios";
import React, { useState } from "react";
import { useMutation } from "react-apollo";
import { useTranslation } from "react-i18next";
import Resizer from "react-image-file-resizer";
import {
INSERT_NEW_DOCUMENT,
DELETE_DOCUMENT
} from "../../graphql/documents.queries";
import "./jobs-documents.styles.scss";
import { generateCdnThumb } from "../../utils/DocHelpers";
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) {
const { t } = useTranslation();
const [insertNewDocument] = useMutation(INSERT_NEW_DOCUMENT);
const [deleteDocument] = useMutation(DELETE_DOCUMENT);
const [state, setState] = useState({
previewVisible: false,
previewImage: ""
});
const [fileList, setFileList] = useState(
data.reduce((acc, value) => {
acc.push({
uid: value.id,
url: value.thumb_url,
name: value.name,
status: "done",
full_url: value.url,
key: value.key
});
return acc;
}, [])
);
const uploadToS3 = (
fileName,
fileType,
file,
onError,
onSuccess,
onProgress
) => {
axios
.post("/sign_s3", {
fileName,
fileType
})
.then(response => {
var returnData = response.data.data.returnData;
var signedRequest = returnData.signedRequest;
var url = returnData.url;
setState({ ...state, url: url });
// Put the fileType in the headers for the upload
var options = {
headers: {
"Content-Type": fileType
},
onUploadProgress: e => {
onProgress({ percent: (e.loaded / e.total) * 100 });
}
};
axios
.put(signedRequest, file, options)
.then(response => {
console.log("response from axios", response);
insertNewDocument({
variables: {
docInput: [
{
jobid: jobId,
uploaded_by: currentUser.email,
url,
thumb_url: generateCdnThumb(fileName),
key: fileName
}
]
}
}).then(r => {
onSuccess({
uid: r.data.insert_documents.returning[0].id,
url: r.data.insert_documents.returning[0].thumb_url,
name: r.data.insert_documents.returning[0].name,
status: "done",
full_url: r.data.insert_documents.returning[0].url,
key: r.data.insert_documents.returning[0].key
});
notification["success"]({
message: t("documents.successes.insert")
});
});
setState({ ...state, success: true });
})
.catch(error => {
console.log("Error uploading to S3", error);
onError(error);
notification["error"]({
message: t("documents.errors.insert") + JSON.stringify(error)
});
});
})
.catch(error => {
console.log("Outside Error here.", error);
notification["error"]({
message: t("documents.errors.getpresignurl") + JSON.stringify(error)
});
});
};
const handleUpload = ev => {
const { onError, onSuccess, onProgress } = ev;
//If PDF, upload directly.
//If JPEG, resize and upload.
let key = `${shopId}/${jobId}/${ev.file.name}`;
if (ev.file.type === "application/pdf") {
console.log("It's a PDF.");
uploadToS3(key, ev.file.type, ev.file, onError, onSuccess, onProgress);
} else {
Resizer.imageFileResizer(
ev.file,
3000,
3000,
"JPEG",
75,
0,
uri => {
let file = new File([uri], ev.file.name, {});
file.uid = ev.file.uid;
uploadToS3(key, file.type, file, onError, onSuccess, onProgress);
},
"blob"
);
}
};
const handleCancel = () => setState({ ...state, previewVisible: false });
const handlePreview = async file => {
if (!file.full_url && !file.url) {
file.preview = await getBase64(file.originFileObj);
}
setState({
...state,
previewImage: file.full_url || file.url,
previewVisible: true
});
};
const handleChange = props => {
const { event, fileList, file } = props;
//Required to ensure that the state accurately reflects new data and that images can be deleted in feeded.
if (!event) {
//SPread the new file in where the old one was.
const newFileList = fileList.map(i =>
i.uid === file.uid ? Object.assign({}, i, file.response) : i
);
setFileList(newFileList);
} else {
setFileList(fileList);
}
};
const { previewVisible, previewImage } = state;
const handleRemove = file => {
console.log("file", file);
//Remove the file on S3
axios
.post("/delete_s3", { fileName: file.key })
.then(response => {
//Delete the record in our database.
if (response.status === 200) {
deleteDocument({ variables: { id: file.uid } }).then(r => {
notification["success"]({
message: t("documents.successes.delete")
});
});
} else {
notification["error"]({
message:
1 +
t("documents.errors.deletes3") +
JSON.stringify(response.message)
});
}
})
.catch(error => {
notification["error"]({
message: "2" + t("documents.errors.deletes3") + JSON.stringify(error)
});
});
};
return (
<div className='clearfix'>
<button
onClick={() => {
const imageRequest = JSON.stringify({
bucket: process.env.REACT_APP_S3_BUCKET,
key:
"52b7357c-0edd-4c95-85c3-dfdbcdfad9ac/c8ca5761-681a-4bb3-ab76-34c447357be3/Invoice_353284489.pdf",
edits: { format: "jpeg" }
});
const CloudFrontUrl = "https://d18fc493a0fm4o.cloudfront.net";
const url = `${CloudFrontUrl}/${btoa(imageRequest)}`;
console.log("url", url);
}}>
Test PDF
</button>
<Upload.Dragger
customRequest={handleUpload}
accept='.pdf,.jpg,.jpeg'
listType='picture-card'
fileList={fileList}
multiple={true}
onPreview={handlePreview}
onRemove={handleRemove}
onChange={handleChange}>
<p className='ant-upload-drag-icon'>
<Icon type='inbox' />
</p>
<p className='ant-upload-text'>
Click or drag file to this area to upload
</p>
<p className='ant-upload-hint'>
Support for a single or bulk upload. Strictly prohibit from uploading
company data or other band files
</p>
</Upload.Dragger>
<Modal visible={previewVisible} footer={null} onCancel={handleCancel}>
<img alt='example' style={{ width: "100%" }} src={previewImage} />
</Modal>
</div>
);
}
export default JobsDocumentsComponent;

View File

@@ -4,7 +4,8 @@ import { QUERY_SHOP_ID } from "../../graphql/bodyshop.queries";
import { GET_DOCUMENTS_BY_JOB } from "../../graphql/documents.queries";
import AlertComponent from "../alert/alert.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import JobDocuments from "./jobs-documents.page";
import JobDocuments from "./jobs-documents.component";
import { GET_CURRENT_USER } from "../../graphql/local.queries";
export default function JobsDocumentsContainer({ jobId }) {
const { loading, error, data } = useQuery(GET_DOCUMENTS_BY_JOB, {
@@ -16,15 +17,22 @@ export default function JobsDocumentsContainer({ jobId }) {
fetchPolicy: "network-only"
});
if (loading || shopData.loading) return <LoadingSpinner />;
if (error) return <AlertComponent type='error' message={error.message} />;
if (shopData.error)
return <AlertComponent type='error' message={shopData.error.message} />;
const user = useQuery(GET_CURRENT_USER);
if (loading || shopData.loading || user.loading) return <LoadingSpinner />;
if (error || shopData.error || user.error)
return (
<AlertComponent
type='error'
message={error.message || shopData.error.message || user.error.message}
/>
);
return (
<JobDocuments
data={data.documents}
jobId={jobId}
currentUser={user.data.currentUser}
shopId={
shopData.data?.bodyshops[0]?.id
? shopData.data?.bodyshops[0]?.id

View File

@@ -1,204 +0,0 @@
import { Button, Icon, Modal, notification, Upload } from "antd";
import axios from "axios";
import React, { useState } from "react";
import { useMutation } from "react-apollo";
import { useTranslation } from "react-i18next";
import Resizer from "react-image-file-resizer";
import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries";
import "./jobs-documents.styles.scss";
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
function JobsDocumentsComponent({ shopId, jobId, loading, data }) {
const { t } = useTranslation();
const [insertNewDocument] = useMutation(INSERT_NEW_DOCUMENT);
const [state, setState] = useState({
previewVisible: false,
previewImage: ""
});
const [fileList, setFileList] = useState(
data.reduce((acc, value) => {
acc.push({
uid: value.id,
url: value.url,
name: value.name,
status: "done",
thumUrl:
"https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
});
return acc;
}, [])
);
const handleUpload = ev => {
const { onError, onSuccess, onProgress } = ev;
Resizer.imageFileResizer(
ev.file,
3000,
3000,
"JPEG",
75,
0,
uri => {
let file = new File([uri], ev.file.name, {});
file.uid = ev.file.uid;
// Split the filename to get the name and type
let fileName = file.name;
let fileType = file.type;
let key = `${shopId}/${jobId}/${fileName}`;
//URL is using the proxy set in pacakges.json.
axios
.post("/sign_s3", {
fileName: key,
fileType
})
.then(response => {
var returnData = response.data.data.returnData;
var signedRequest = returnData.signedRequest;
var url = returnData.url;
setState({ ...state, url: url });
// Put the fileType in the headers for the upload
var options = {
headers: {
"Content-Type": fileType
},
onUploadProgress: e => {
onProgress({ percent: (e.loaded / e.total) * 100 });
}
};
axios
.put(signedRequest, file, options)
.then(response => {
onSuccess(response.body);
insertNewDocument({
variables: {
docInput: [
{
jobid: jobId,
uploaded_by: "patrick@bodyshop.app",
url,
thumb_url: url
}
]
}
}).then(r => {
console.log(r);
notification["success"]({
message: t("documents.successes.insert")
});
});
setState({ ...state, success: true });
})
.catch(error => {
console.log("Error uploading to S3", error);
onError(error);
notification["error"]({
message: t("documents.errors.insert") + JSON.stringify(error)
});
});
})
.catch(error => {
console.log("Outside Error here.", error);
notification["error"]({
message:
t("documents.errors.getpresignurl") + JSON.stringify(error)
});
});
},
"blob"
);
};
const handleCancel = () => setState({ ...state, previewVisible: false });
const handlePreview = async file => {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
setState({
...state,
previewImage: file.url || file.preview,
previewVisible: true
});
};
const handleChange = props => {
const { fileList } = props;
console.log("New fileList", fileList);
setFileList(fileList);
};
const { previewVisible, previewImage } = state;
// const uploadButton = (
// <div>
// <Icon type='plus' />
// <div className='ant-upload-text'>{t("documents.labels.upload")}</div>
// </div>
// );
console.log(
"process.env.REACT_APP_S3_BUCKET",
process.env.REACT_APP_S3_BUCKET
);
const imageRequest = JSON.stringify({
bucket: process.env.REACT_APP_S3_BUCKET,
key:
"52b7357c-0edd-4c95-85c3-dfdbcdfad9ac/f11e92a4-8a7d-4ec0-86ac-2f46b631e438/thumb-1920-459857.jpg",
edits: {
resize: {
height: 100,
width: 100
}
}
});
const CloudFrontUrl = "https://d18fc493a0fm4o.cloudfront.net";
const url = `${CloudFrontUrl}/${btoa(imageRequest)}`;
return (
<div className='clearfix'>
<Button
onClick={() => {
console.log("btn click");
console.log("data", data);
}}>
Test Request
</Button>
<img src={url} alt='test' />
<Upload.Dragger
customRequest={handleUpload}
accept='.pdf,.jpg,.jpeg'
listType='picture-card'
fileList={fileList}
multiple={true}
onPreview={handlePreview}
onChange={handleChange}>
<p className='ant-upload-drag-icon'>
<Icon type='inbox' />
</p>
<p className='ant-upload-text'>
Click or drag file to this area to upload
</p>
<p className='ant-upload-hint'>
Support for a single or bulk upload. Strictly prohibit from uploading
company data or other band files
</p>
</Upload.Dragger>
<Modal visible={previewVisible} footer={null} onCancel={handleCancel}>
<img alt='example' style={{ width: "100%" }} src={previewImage} />
</Modal>
</div>
);
}
export default JobsDocumentsComponent;

View File

@@ -34,7 +34,7 @@ export default withRouter(function JobsList({
render: (text, record) => (
<span>
<Link to={"/manage/jobs/" + record.id}>
{record.ro_number ? record.ro_number : t("general.labels.na")}
{record.ro_number ? record.ro_number : "EST-" + record.est_number}
</Link>
</span>
)
@@ -91,7 +91,7 @@ export default withRouter(function JobsList({
sortOrder:
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
render: (text, record) => {
return record.job_status?.name ?? t("general.labels.na");
return record.job_status?.name || t("general.labels.na");
}
},
@@ -202,7 +202,9 @@ export default withRouter(function JobsList({
return (
<Input.Search
placeholder='Search...'
onSearch={value => console.log(value)}
onSearch={value => {
console.log(value);
}}
enterButton
/>
);

View File

@@ -1,12 +1,9 @@
import React, { Component } from "react";
//import { Redirect } from "react-router-dom";
import React from "react";
import { useTranslation } from "react-i18next";
import firebase from "../../firebase/firebase.utils";
export default class SignOut extends Component {
state = {
redirect: false
};
signOut = async () => {
export default function SignoutComponent() {
const signOut = async () => {
try {
await firebase.auth().signOut();
// this.setState({
@@ -17,17 +14,7 @@ export default class SignOut extends Component {
}
};
renderRedirect = () => {
if (this.state.redirect) {
//return <Redirect to="/signin" />;
}
};
render() {
return (
<div>
{this.renderRedirect()}
<div onClick={this.signOut}>Sign Out</div>
</div>
);
}
const { t } = useTranslation();
return <div onClick={signOut}>{t("user.actions.signout")}</div>;
}

View File

@@ -63,11 +63,11 @@ export default function WhiteBoardCard({ metadata }) {
<div>
<Card
title={
(metadata.ro_number ?? metadata.est_number) +
(metadata.ro_number || metadata.est_number) +
" | " +
(metadata.owner?.first_name ?? "") +
(metadata.owner?.first_name || "") +
" " +
(metadata.owner?.last_name ?? "")
(metadata.owner?.last_name || "")
}
style={{ width: 300, marginTop: 10 }}
bodyStyle={{ padding: 10 }}
@@ -87,15 +87,15 @@ export default function WhiteBoardCard({ metadata }) {
<Col span={18}>
<Row>
<WrappedSpan>
{metadata.vehicle?.v_model_yr ?? t("general.labels.na")}{" "}
{metadata.vehicle?.v_make_desc ?? t("general.labels.na")}{" "}
{metadata.vehicle?.v_model_desc ?? t("general.labels.na")}
{metadata.vehicle?.v_model_yr || t("general.labels.na")}{" "}
{metadata.vehicle?.v_make_desc || t("general.labels.na")}{" "}
{metadata.vehicle?.v_model_desc || t("general.labels.na")}
</WrappedSpan>
</Row>
{metadata.vehicle?.v_vin ? (
<Row>
<WrappedSpan>
VIN: {metadata.vehicle?.v_vin ?? t("general.labels.na")}
VIN: {metadata.vehicle?.v_vin || t("general.labels.na")}
</WrappedSpan>
</Row>
) : null}

View File

@@ -1,14 +1,14 @@
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);
console.log("forward", forward);
// console.log("graphQLErrors", graphQLErrors);
// console.log("networkError", networkError);
// console.log("operation", operation);
// console.log("forward", forward);
let expired = false;
@@ -28,42 +28,56 @@ const errorLink = onError(
console.log("We need a new token!");
if (access_token && access_token !== "undefined") {
// Let's refresh token through async request
return new Observable(observer => {
auth.currentUser
.getIdToken(true)
.then(function(idToken) {
if (!idToken) {
window.localStorage.removeItem("token");
return console.log("Refresh token has expired");
auth.currentUser.getIdToken(true).then(token => {
if (token) {
window.localStorage.setItem("token", token);
operation.setContext(({ headers = {} }) => ({
headers: {
...headers,
authorization: token ? `Bearer ${token}` : ""
}
console.log("Got a new token", idToken);
window.localStorage.setItem("token", idToken);
// 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);
});
}));
return forward(operation);
}
});
// 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);
// // 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);
// });
// });
}
}
}

View File

@@ -7,6 +7,7 @@ export const GET_DOCUMENTS_BY_JOB = gql`
url
thumb_url
name
key
}
}
`;
@@ -14,6 +15,20 @@ export const GET_DOCUMENTS_BY_JOB = gql`
export const INSERT_NEW_DOCUMENT = gql`
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
insert_documents(objects: $docInput) {
returning {
id
url
thumb_url
name
key
}
}
}
`;
export const DELETE_DOCUMENT = gql`
mutation DELETE_DOCUMENT($id: uuid) {
delete_documents(where: { id: { _eq: $id } }) {
returning {
id
}

View File

@@ -246,6 +246,10 @@ export const QUERY_JOB_CARD_DETAILS = gql`
updated_at
claim_total
ded_amt
documents(limit: 3, order_by: { created_at: desc }) {
id
thumb_url
}
vehicle {
id
plate_no

View File

@@ -10,7 +10,6 @@ import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"
function JobsDetailPage({ jobId, hash, data, match, history }) {
const { t } = useTranslation();
console.log("hash", hash);
return (
<div>
<Row>

View File

@@ -20,7 +20,6 @@ export default function JobsPage({ match, location }) {
const { hash } = location;
const [selectedJob, setSelectedJob] = useState(hash ? hash.substr(1) : null);
console.log("Jobs Page Render.");
if (error) return <AlertComponent message={error.message} type='error' />;
return (

View File

@@ -2,13 +2,16 @@
"translation": {
"documents": {
"errors": {
"deletes3": "Error deleting document from storage. ",
"getpresignurl": "Error obtaining presigned URL for document. ",
"insert": "Unable to upload file."
"insert": "Unable to upload file.",
"nodocuments": "There are no documents."
},
"labels": {
"upload": "Upload"
},
"successes": {
"delete": "Document deleted successfully.",
"insert": "Uploaded document successfully. "
}
},
@@ -31,11 +34,13 @@
"actions": {
"addDocuments": "Add Job Documents",
"addNote": "Add Note",
"convert": "Convert",
"postInvoices": "Post Invoices",
"printCenter": "Print Center"
},
"errors": {
"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.",
"noowner": "No owner associated.",
"novehicle": "No vehicle associated.",
@@ -44,15 +49,29 @@
"validationtitle": "Validation Error"
},
"fields": {
"actual_completion": "Actual Completion",
"actual_delivery": "Actual Delivery",
"actual_in": "Actual In",
"claim_total": "Claim Total",
"clm_no": "Claim #",
"clm_total": "Claim Total",
"date_closed": "Closed",
"date_estimated": "Date Estimated",
"date_exported": "Exported",
"date_invoiced": "Invoiced",
"date_open": "Open",
"date_scheduled": "Scheduled",
"deductible": "Deductible",
"est_number": "Estimate Number",
"owner": "Owner",
"owner_owing": "Cust. Owes",
"ownr_ea": "Email",
"phone1": "Phone 1",
"phoneshort": "PH",
"ro_number": "RO #",
"scheduled_completion": "Scheduled Completion",
"scheduled_delivery": "Scheduled Delivery",
"scheduled_in": "Scheduled In",
"status": "Job Status",
"vehicle": "Vehicle"
},
@@ -62,7 +81,7 @@
"customer": "Customer Information",
"damage": "Area of Damage",
"dates": "Dates",
"documents": "Documents",
"documents": "Recent Documents",
"estimator": "Estimator",
"filehandler": "File Handler",
"insurance": "Insurance Details",
@@ -71,7 +90,6 @@
"totals": "Totals",
"vehicle": "Vehicle"
},
"convert": "Convert",
"documents": "Documents",
"lines": "Estimate Lines",
"notes": "Notes",
@@ -130,6 +148,11 @@
"jobsdocuments": "Job Documents {{ro_number}} | $t(titles.app)",
"profile": "My Profile | $t(titles.app)"
},
"user": {
"actions": {
"signout": "Sign Out"
}
},
"vehicles": {
"fields": {
"plate_no": "License Plate"

View File

@@ -2,13 +2,16 @@
"translation": {
"documents": {
"errors": {
"deletes3": "Error al eliminar el documento del almacenamiento.",
"getpresignurl": "Error al obtener la URL prescrita para el documento.",
"insert": "Incapaz de cargar el archivo."
"insert": "Incapaz de cargar el archivo.",
"nodocuments": "No hay documentos"
},
"labels": {
"upload": "Subir"
},
"successes": {
"delete": "Documento eliminado con éxito.",
"insert": "Documento cargado con éxito."
}
},
@@ -31,11 +34,13 @@
"actions": {
"addDocuments": "Agregar documentos de trabajo",
"addNote": "Añadir la nota",
"convert": "Convertir",
"postInvoices": "Contabilizar facturas",
"printCenter": "Centro de impresión"
},
"errors": {
"noaccess": "Este trabajo no existe o no tiene acceso a él.",
"nodates": "No hay fechas especificadas para este trabajo.",
"nojobselected": "No hay trabajo seleccionado.",
"noowner": "Ningún propietario asociado.",
"novehicle": "No hay vehículo asociado.",
@@ -44,15 +49,29 @@
"validationtitle": "Error de validacion"
},
"fields": {
"actual_completion": "Realización real",
"actual_delivery": "Entrega real",
"actual_in": "Real en",
"claim_total": "Reclamar total",
"clm_no": "Reclamación #",
"clm_total": "Reclamar total",
"date_closed": "Cerrado",
"date_estimated": "Fecha estimada",
"date_exported": "Exportado",
"date_invoiced": "Facturado",
"date_open": "Abierto",
"date_scheduled": "Programado",
"deductible": "Deducible",
"est_number": "Numero Estimado",
"owner": "Propietario",
"owner_owing": "Cust. Debe",
"ownr_ea": "Email",
"phone1": "Teléfono 1",
"phoneshort": "PH",
"ro_number": "RO #",
"scheduled_completion": "Finalización programada",
"scheduled_delivery": "Entrega programada",
"scheduled_in": "Programado en",
"status": "Estado del trabajo",
"vehicle": "Vehículo"
},
@@ -62,7 +81,7 @@
"customer": "Información al cliente",
"damage": "Área de Daño",
"dates": "fechas",
"documents": "documentos",
"documents": "Documentos recientes",
"estimator": "Estimador",
"filehandler": "File Handler",
"insurance": "detalles del seguro",
@@ -71,7 +90,6 @@
"totals": "Totales",
"vehicle": "Vehículo"
},
"convert": "Convertir",
"documents": "documentos",
"lines": "Líneas estimadas",
"notes": "Notas",
@@ -130,6 +148,11 @@
"jobsdocuments": "Documentos de trabajo {{ro_number}} | $ t (títulos.app)",
"profile": "Mi perfil | $t(titles.app)"
},
"user": {
"actions": {
"signout": "desconectar"
}
},
"vehicles": {
"fields": {
"plate_no": "Placa"

View File

@@ -2,13 +2,16 @@
"translation": {
"documents": {
"errors": {
"deletes3": "Erreur lors de la suppression du document du stockage.",
"getpresignurl": "Erreur lors de l'obtention de l'URL présignée pour le document.",
"insert": "Incapable de télécharger le fichier."
"insert": "Incapable de télécharger le fichier.",
"nodocuments": "Il n'y a pas de documents."
},
"labels": {
"upload": "Télécharger"
},
"successes": {
"delete": "Le document a bien été supprimé.",
"insert": "Document téléchargé avec succès."
}
},
@@ -31,11 +34,13 @@
"actions": {
"addDocuments": "Ajouter des documents de travail",
"addNote": "Ajouter une note",
"convert": "Convertir",
"postInvoices": "Poster des factures",
"printCenter": "Centre d'impression"
},
"errors": {
"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é.",
"noowner": "Aucun propriétaire associé.",
"novehicle": "Aucun véhicule associé.",
@@ -44,15 +49,29 @@
"validationtitle": "Erreur de validation"
},
"fields": {
"actual_completion": "Achèvement réel",
"actual_delivery": "Livraison réelle",
"actual_in": "En réel",
"claim_total": "Total réclamation",
"clm_no": "Prétendre #",
"clm_total": "Total réclamation",
"date_closed": "Fermé",
"date_estimated": "Date estimée",
"date_exported": "Exportés",
"date_invoiced": "Facturé",
"date_open": "Ouvrir",
"date_scheduled": "Prévu",
"deductible": "Déductible",
"est_number": "Numéro d'estimation",
"owner": "Propriétaire",
"owner_owing": "Cust. Owes",
"ownr_ea": "Email",
"phone1": "Téléphone 1",
"phoneshort": "PH",
"ro_number": "RO #",
"scheduled_completion": "Achèvement planifié",
"scheduled_delivery": "Livraison programmée",
"scheduled_in": "Planifié dans",
"status": "Statut de l'emploi",
"vehicle": "Véhicule"
},
@@ -62,7 +81,7 @@
"customer": "Informations client",
"damage": "Zone de dommages",
"dates": "Rendez-vous",
"documents": "Les documents",
"documents": "Documents récents",
"estimator": "Estimateur",
"filehandler": "Gestionnaire de fichiers",
"insurance": "Détails de l'assurance",
@@ -71,7 +90,6 @@
"totals": "Totaux",
"vehicle": "Véhicule"
},
"convert": "Convertir",
"documents": "Les documents",
"lines": "Estimer les lignes",
"notes": "Remarques",
@@ -130,6 +148,11 @@
"jobsdocuments": "Documents de travail {{ro_number}} | $ t (titres.app)",
"profile": "Mon profil | $t(titles.app)"
},
"user": {
"actions": {
"signout": "Déconnexion"
}
},
"vehicles": {
"fields": {
"plate_no": "Plaque d'immatriculation"

View File

@@ -0,0 +1,13 @@
export const generateCdnThumb = key => {
const imageRequest = JSON.stringify({
bucket: process.env.REACT_APP_S3_BUCKET,
key: key,
edits: {
resize: {
height: 100,
width: 100
}
}
});
return `${process.env.REACT_APP_S3_CDN}/${btoa(imageRequest)}`;
};

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."documents" DROP COLUMN "key";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."documents" ADD COLUMN "key" text NOT NULL DEFAULT '0';
type: run_sql

View File

@@ -0,0 +1,36 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- name
- thumb_url
- uploaded_by
- url
- created_at
- updated_at
- id
- jobid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: documents
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- created_at
- id
- jobid
- key
- name
- thumb_url
- updated_at
- uploaded_by
- url
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: documents
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,34 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- name
- thumb_url
- uploaded_by
- url
- created_at
- updated_at
- id
- jobid
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: documents
schema: public
type: create_select_permission

View File

@@ -0,0 +1,35 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- created_at
- id
- jobid
- key
- name
- thumb_url
- updated_at
- uploaded_by
- url
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: documents
schema: public
type: create_select_permission

View File

@@ -0,0 +1,36 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_update_permission
- args:
permission:
columns:
- name
- thumb_url
- uploaded_by
- url
- created_at
- updated_at
- id
- jobid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: documents
schema: public
type: create_update_permission

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_update_permission
- args:
permission:
columns:
- created_at
- id
- jobid
- key
- name
- thumb_url
- updated_at
- uploaded_by
- url
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: documents
schema: public
type: create_update_permission

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,4 @@
- args:
cascade: true
sql: "CREATE EXTENSION pg_trgm;\r\n"
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,7 @@
- args:
cascade: true
sql: "CREATE INDEX jobs_gin_idx ON jobs\r\nUSING GIN ((est_number || ' ' || ro_number
\ || ' ' || clm_no || ' ' || ownr_ln || ' ' || ownr_fn || ' ' || ownr_ph1
\r\n|| ' ' || ownr_ea \r\n|| ' ' || insd_ln \r\n|| ' ' || insd_fn \r\n|| ' '
|| insd_ea \r\n|| ' ' || insd_ph1 ) gin_trgm_ops);"
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,16 @@
- args:
cascade: true
sql: "CREATE FUNCTION search_jobs(search text)\r\nRETURNS SETOF jobs AS $$\r\n
\ SELECT *\r\n FROM jobs\r\n WHERE\r\n search <% (est_number ||
' ' || ro_number || ' ' || clm_no || ' ' || ownr_ln || ' ' || ownr_fn ||
' ' || ownr_ph1 \r\n|| ' ' || ownr_ea \r\n|| ' ' || insd_ln \r\n|| ' ' || insd_fn
\r\n|| ' ' || insd_ea \r\n|| ' ' || insd_ph1 )\r\n ORDER BY\r\n similarity(search,
(est_number || ' ' || ro_number || ' ' || clm_no || ' ' || ownr_ln || '
' || ownr_fn || ' ' || ownr_ph1 \r\n|| ' ' || ownr_ea \r\n|| ' ' || insd_ln
\r\n|| ' ' || insd_fn \r\n|| ' ' || insd_ea \r\n|| ' ' || insd_ph1 )) DESC\r\n
\ LIMIT 50;\r\n$$ LANGUAGE sql STABLE;"
type: run_sql
- args:
name: search_jobs
schema: public
type: track_function

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,4 @@
- args:
cascade: true
sql: 'drop index jobs_gin_idx '
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,4 @@
- args:
cascade: true
sql: drop function search_jobs
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,7 @@
- args:
cascade: true
sql: CREATE INDEX jobs_search_idx ON jobs USING gin (est_number gin_trgm_ops,
ro_number gin_trgm_ops, clm_no gin_trgm_ops, ownr_ln gin_trgm_ops, ownr_fn gin_trgm_ops,
ownr_ph1 gin_trgm_ops, ownr_ea gin_trgm_ops, insd_ln gin_trgm_ops, insd_fn gin_trgm_ops,
insd_ea gin_trgm_ops, insd_ph1 gin_trgm_ops);
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,4 @@
- args:
cascade: true
sql: 'drop INDEX jobs_search_idx '
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "search_idx_col";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "search_idx_col" tsvector NULL;
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,15 @@
- args:
cascade: true
sql: "CREATE FUNCTION search_jobs(search text)\r\nRETURNS SETOF jobs AS $$\r\n
\ SELECT *\r\n FROM jobs\r\n WHERE\r\n ownr_fn ilike ('%' || search
|| '%')\r\n OR ownr_ln ilike ('%' || search || '%')\r\n OR ro_number
ilike ('%' || search || '%')\r\n OR est_number ilike ('%' || search ||
'%')\r\n OR clm_no ilike ('%' || search || '%')\r\n OR ownr_ph1 ilike
('%' || search || '%')\r\n OR ownr_ea ilike ('%' || search || '%')\r\n
\ OR insd_ln ilike ('%' || search || '%')\r\n OR insd_fn ilike ('%'
|| search || '%')\r\n$$ LANGUAGE sql STABLE;\r\n"
type: run_sql
- args:
name: search_jobs
schema: public
type: track_function

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "search_idx_col" tsvector
type: run_sql
- args:
sql: ALTER TABLE "public"."jobs" ALTER COLUMN "search_idx_col" DROP NOT NULL
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "search_idx_col" CASCADE
type: run_sql

View File

@@ -0,0 +1,212 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,211 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,210 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,209 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,212 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,211 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "est_number" text
type: run_sql
- args:
sql: ALTER TABLE "public"."jobs" ALTER COLUMN "est_number" DROP NOT NULL
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "est_number" CASCADE
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "est_number";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "est_number" bigserial NOT NULL;
type: run_sql

View File

@@ -0,0 +1,211 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,212 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,209 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,210 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- converted
- inproduction
- asgn_date
- invoice_date
- loss_date
- pay_date
- est_number
- area_of_damage
- claim_total
- clm_total
- ded_amt
- deductible
- federal_tax_rate
- local_tax_rate
- owner_owing
- pay_amt
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- state_tax_rate
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- asgn_no
- asgn_type
- cat_no
- ciecaid
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_zip
- cust_pr
- ded_status
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- labor_rate_desc
- labor_rate_id
- loss_cat
- loss_desc
- loss_type
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_chknm
- payee_nms
- pay_type
- policy_no
- regie_number
- ro_number
- theft_ind
- tlos_ind
- actual_completion
- actual_delivery
- actual_in
- created_at
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- scheduled_completion
- scheduled_delivery
- scheduled_in
- updated_at
- id
- ownerid
- shopid
- statusid
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,211 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- area_of_damage
- asgn_date
- asgn_no
- asgn_type
- cat_no
- ciecaid
- claim_total
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_total
- clm_zip
- converted
- created_at
- cust_pr
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- ded_amt
- ded_status
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- loss_cat
- loss_date
- loss_desc
- loss_type
- owner_owing
- ownerid
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_amt
- pay_chknm
- pay_date
- pay_type
- payee_nms
- policy_no
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- theft_ind
- tlos_ind
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,212 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- converted
- inproduction
- asgn_date
- invoice_date
- loss_date
- pay_date
- est_number
- area_of_damage
- claim_total
- clm_total
- ded_amt
- deductible
- federal_tax_rate
- local_tax_rate
- owner_owing
- pay_amt
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- state_tax_rate
- agt_addr1
- agt_addr2
- agt_city
- agt_co_id
- agt_co_nm
- agt_ct_fn
- agt_ct_ln
- agt_ct_ph
- agt_ct_phx
- agt_ctry
- agt_ea
- agt_fax
- agt_faxx
- agt_lic_no
- agt_ph1
- agt_ph1x
- agt_ph2
- agt_ph2x
- agt_st
- agt_zip
- asgn_no
- asgn_type
- cat_no
- ciecaid
- clm_addr1
- clm_addr2
- clm_city
- clm_ct_fn
- clm_ct_ln
- clm_ct_ph
- clm_ct_phx
- clm_ctry
- clm_ea
- clm_fax
- clm_faxx
- clm_no
- clm_ofc_id
- clm_ofc_nm
- clm_ph1
- clm_ph1x
- clm_ph2
- clm_ph2x
- clm_st
- clm_title
- clm_zip
- cust_pr
- ded_status
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_ph1
- est_st
- est_zip
- ins_addr1
- ins_addr2
- ins_city
- ins_co_id
- ins_co_nm
- ins_ct_fn
- ins_ct_ln
- ins_ct_ph
- ins_ct_phx
- ins_ctry
- insd_addr1
- insd_addr2
- insd_city
- insd_co_nm
- insd_ctry
- insd_ea
- insd_fax
- insd_faxx
- insd_fn
- insd_ln
- insd_ph1
- insd_ph1x
- insd_ph2
- insd_ph2x
- insd_st
- insd_title
- insd_zip
- ins_ea
- ins_fax
- ins_faxx
- ins_memo
- ins_ph1
- ins_ph1x
- ins_ph2
- ins_ph2x
- ins_st
- ins_title
- ins_zip
- labor_rate_desc
- labor_rate_id
- loss_cat
- loss_desc
- loss_type
- ownr_addr1
- ownr_addr2
- ownr_city
- ownr_co_nm
- ownr_ctry
- ownr_ea
- ownr_fax
- ownr_faxx
- ownr_fn
- ownr_ln
- ownr_ph1
- ownr_ph1x
- ownr_ph2
- ownr_ph2x
- ownr_st
- ownr_title
- ownr_zip
- pay_chknm
- payee_nms
- pay_type
- policy_no
- regie_number
- ro_number
- theft_ind
- tlos_ind
- actual_completion
- actual_delivery
- actual_in
- created_at
- date_closed
- date_estimated
- date_exported
- date_invoiced
- date_open
- date_scheduled
- scheduled_completion
- scheduled_delivery
- scheduled_in
- updated_at
- id
- ownerid
- shopid
- statusid
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -71,3 +71,25 @@ exports.get_s3 = (req, res) => {
res.json({ success: true, data: { returnData } });
});
};
exports.delete_s3 = (req, res) => {
const s3 = new aws.S3(); // Create a new instance of S3
const fileName = req.body.fileName;
//const fileType = req.body.fileType;
// Set up the payload of what we are sending to the S3 api
console.log("fileName", req.body);
const s3Params = {
Bucket: S3_BUCKET,
Key: fileName
};
s3.deleteObject(s3Params, function(err, data) {
if (err) {
res.json({ success: false, message: err.message });
}
// error
else {
res.json({ success: true, data });
} // deleted
});
};

View File

@@ -21,10 +21,11 @@ app.use(cors());
var s3upload = require("./s3upload");
app.post("/sign_s3", s3upload.sign_s3);
app.get("/sign_s3", s3upload.get_s3);
app.post("/delete_s3", s3upload.delete_s3);
app.get("/test", function(req, res) {
res.json({ success: true });
});
// app.get("/test", function(req, res) {
// res.json({ success: true });
// });
if (process.env.NODE_ENV === "production") {
app.use(express.static(path.join(__dirname, "client/build")));