From 0c83a62dd21affb6d6161edad23720ba4322367d Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 7 Jan 2021 15:25:32 -0800 Subject: [PATCH] Removed Est_number from Job. Potential Breaking changes. IO-553 --- admin/src/components/jobs/jobs.create.jsx | 2 +- admin/src/components/jobs/jobs.edit.jsx | 1 - admin/src/components/jobs/jobs.list.jsx | 10 +- admin/src/components/jobs/jobs.show.jsx | 4 +- bodyshop_translations.babel | 21 -- .../accounting-payments-table.component.jsx | 16 +- ...accounting-receivables-table.component.jsx | 20 +- .../contract-jobs/contract-jobs.component.jsx | 12 +- .../csi-response-list-paginated.component.jsx | 14 +- .../global-search/global-search.component.jsx | 6 +- .../job-detail-cards.component.jsx | 8 +- .../job-search-select.component.jsx | 11 +- .../jobs-available-supplement.component.jsx | 9 +- .../jobs-detail-header.component.jsx | 6 +- .../jobs-find-modal.component.jsx | 2 +- .../jobs-find-modal.container.jsx | 4 - .../jobs-list-paginated.component.jsx | 15 +- .../jobs-list/jobs-list.component.jsx | 17 +- .../owner-detail-jobs.component.jsx | 2 +- .../payment-list-paginated.component.jsx | 13 +- .../print-center-item.component.jsx | 4 +- ...production-board-kanban-card.component.jsx | 6 +- .../production-board-kanban.utils.js | 4 - .../schedule-event.component.jsx | 2 +- .../scoreboard-jobs-list.component.jsx | 11 +- .../tech-job-clocked-in-list.component.jsx | 2 +- .../tech-lookup-jobs-drawer.component.jsx | 4 +- .../tech-lookup-jobs-list.component.jsx | 16 -- .../vehicle-detail-jobs.component.jsx | 2 +- client/src/graphql/accounting.queries.js | 4 +- client/src/graphql/appointments.queries.js | 4 +- client/src/graphql/available-jobs.queries.js | 1 - client/src/graphql/bodyshop.queries.js | 2 +- client/src/graphql/cccontracts.queries.js | 4 +- client/src/graphql/courtesy-car.queries.js | 2 +- client/src/graphql/csi.queries.js | 2 +- client/src/graphql/jobs.queries.js | 26 +- client/src/graphql/owners.queries.js | 1 - client/src/graphql/payments.queries.js | 1 - client/src/graphql/scoreboard.queries.js | 2 +- client/src/graphql/search.queries.js | 2 +- client/src/graphql/timetickets.queries.js | 4 +- client/src/graphql/vehicles.queries.js | 2 +- .../src/pages/jobs-all/jobs-all.container.jsx | 2 +- .../jobs-create/jobs-create.component.jsx | 4 +- .../jobs-create/jobs-create.container.jsx | 1 - .../jobs-detail.page.container.jsx | 25 +- .../jobs-intake.page.container.jsx | 2 +- .../parts-queue.page.component.jsx | 17 +- client/src/translations/en_us/common.json | 1 - client/src/translations/es/common.json | 1 - client/src/translations/fr/common.json | 1 - .../down.yaml | 263 +++++++++++++++++ .../up.yaml | 262 +++++++++++++++++ .../down.yaml | 264 ++++++++++++++++++ .../up.yaml | 263 +++++++++++++++++ .../down.yaml | 263 +++++++++++++++++ .../up.yaml | 262 +++++++++++++++++ .../down.yaml | 15 + .../up.yaml | 5 + .../1610061773237_run_sql_migration/down.yaml | 1 + .../1610061773237_run_sql_migration/up.yaml | 41 +++ hasura/migrations/metadata.yaml | 3 - server/graphql-client/queries.js | 2 +- 64 files changed, 1730 insertions(+), 269 deletions(-) create mode 100644 hasura/migrations/1610046845471_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1610046845471_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1610046883329_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1610046883329_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1610046900101_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1610046900101_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1610046982374_alter_table_public_jobs_drop_column_est_number/down.yaml create mode 100644 hasura/migrations/1610046982374_alter_table_public_jobs_drop_column_est_number/up.yaml create mode 100644 hasura/migrations/1610061773237_run_sql_migration/down.yaml create mode 100644 hasura/migrations/1610061773237_run_sql_migration/up.yaml diff --git a/admin/src/components/jobs/jobs.create.jsx b/admin/src/components/jobs/jobs.create.jsx index 7c133229b..9dd749348 100644 --- a/admin/src/components/jobs/jobs.create.jsx +++ b/admin/src/components/jobs/jobs.create.jsx @@ -5,7 +5,7 @@ const JobsCreate = (props) => ( - + diff --git a/admin/src/components/jobs/jobs.edit.jsx b/admin/src/components/jobs/jobs.edit.jsx index ae2ec888f..133e9a295 100644 --- a/admin/src/components/jobs/jobs.edit.jsx +++ b/admin/src/components/jobs/jobs.edit.jsx @@ -283,7 +283,6 @@ const JobsEdit = (props) => ( - diff --git a/admin/src/components/jobs/jobs.list.jsx b/admin/src/components/jobs/jobs.list.jsx index 3dd4b98d3..554afc958 100644 --- a/admin/src/components/jobs/jobs.list.jsx +++ b/admin/src/components/jobs/jobs.list.jsx @@ -1,16 +1,16 @@ +import { useQuery } from "@apollo/client"; +import CircularProgress from "@material-ui/core/CircularProgress"; import React from "react"; import { Datagrid, Filter, List, ReferenceField, - TextField, SelectInput, - TextInput, + TextField, + TextInput } from "react-admin"; -import { useQuery } from "@apollo/client"; import { QUERY_ALL_SHOPS } from "../../graphql/admin.shop.queries"; -import CircularProgress from "@material-ui/core/CircularProgress"; const JobsList = (props) => ( } {...props}> @@ -20,7 +20,7 @@ const JobsList = (props) => ( - + diff --git a/admin/src/components/jobs/jobs.show.jsx b/admin/src/components/jobs/jobs.show.jsx index 445db9d59..f57787c8d 100644 --- a/admin/src/components/jobs/jobs.show.jsx +++ b/admin/src/components/jobs/jobs.show.jsx @@ -7,7 +7,7 @@ import { Show, Tab, TabbedShowLayout, - TextField, + TextField } from "react-admin"; const JobsShow = (props) => ( @@ -221,7 +221,7 @@ const JobsShow = (props) => ( - + diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 1ef4de925..d0530a7a7 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -14062,27 +14062,6 @@ - - est_number - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - est_ph1 false diff --git a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx index c2a1f9702..ab5c565ee 100644 --- a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx +++ b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx @@ -2,12 +2,12 @@ import { Input, Table } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; +import { logImEXEvent } from "../../firebase/firebase.utils"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { DateTimeFormatter } from "../../utils/DateFormatter"; import { alphaSort } from "../../utils/sorters"; import PaymentExportButton from "../payment-export-button/payment-export-button.component"; import { PaymentsExportAllButton } from "../payments-export-all-button/payments-export-all-button.component"; -import { logImEXEvent } from "../../firebase/firebase.utils"; export default function AccountingPayablesTableComponent({ loading, @@ -37,19 +37,7 @@ export default function AccountingPayablesTableComponent({ {record.job.ro_number} ), }, - { - title: t("jobs.fields.est_number"), - dataIndex: "est_number", - key: "est_number", - sorter: (a, b) => a.job.est_number - b.job.est_number, - sortOrder: - state.sortedInfo.columnKey === "est_number" && state.sortedInfo.order, - render: (text, record) => ( - - {record.job.est_number} - - ), - }, + { title: t("jobs.fields.owner"), dataIndex: "owner", diff --git a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx index f11fa1550..2b6e440cf 100644 --- a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx +++ b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx @@ -1,11 +1,11 @@ -import { Input, Table, Button } from "antd"; +import { Button, Input, Table } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; +import { logImEXEvent } from "../../firebase/firebase.utils"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { alphaSort } from "../../utils/sorters"; import JobExportButton from "../jobs-close-export-button/jobs-close-export-button.component"; -import { logImEXEvent } from "../../firebase/firebase.utils"; import { JobsExportAllButton } from "../jobs-export-all-button/jobs-export-all-button.component"; export default function AccountingReceivablesTableComponent({ loading, jobs }) { @@ -34,17 +34,7 @@ export default function AccountingReceivablesTableComponent({ loading, jobs }) { {record.ro_number} ), }, - { - title: t("jobs.fields.est_number"), - dataIndex: "est_number", - key: "est_number", - sorter: (a, b) => a.est_number - b.est_number, - sortOrder: - state.sortedInfo.columnKey === "est_number" && state.sortedInfo.order, - render: (text, record) => ( - {record.est_number} - ), - }, + { title: t("jobs.fields.status"), dataIndex: "status", @@ -156,10 +146,6 @@ export default function AccountingReceivablesTableComponent({ loading, jobs }) { .toString() .toLowerCase() .includes(state.search.toLowerCase()) || - (v.est_number || "") - .toString() - .toLowerCase() - .includes(state.search.toLowerCase()) || (v.ownr_fn || "") .toLowerCase() .includes(state.search.toLowerCase()) || diff --git a/client/src/components/contract-jobs/contract-jobs.component.jsx b/client/src/components/contract-jobs/contract-jobs.component.jsx index 4520cf212..1d6e3b272 100644 --- a/client/src/components/contract-jobs/contract-jobs.component.jsx +++ b/client/src/components/contract-jobs/contract-jobs.component.jsx @@ -23,17 +23,13 @@ export default function ContractsJobsComponent({ dataIndex: "ro_number", key: "ro_number", width: "8%", - sorter: (a, b) => - alphaSort( - a.ro_number ? a.ro_number : "EST-" + a.est_number, - b.ro_number ? b.ro_number : "EST-" + b.est_number - ), + sorter: (a, b) => alphaSort(a.ro_number, b.ro_number), sortOrder: state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order, render: (text, record) => ( - {record.ro_number ? record.ro_number : "EST-" + record.est_number} + {record.ro_number ? record.ro_number : t("general.labels.na")} ), }, @@ -135,10 +131,6 @@ export default function ContractsJobsComponent({ ? data : data.filter( (j) => - (j.est_number || "") - .toString() - .toLowerCase() - .includes(state.search.toLowerCase()) || (j.ro_number || "") .toString() .toLowerCase() diff --git a/client/src/components/csi-response-list-paginated/csi-response-list-paginated.component.jsx b/client/src/components/csi-response-list-paginated/csi-response-list-paginated.component.jsx index e0694623e..46cbf8628 100644 --- a/client/src/components/csi-response-list-paginated/csi-response-list-paginated.component.jsx +++ b/client/src/components/csi-response-list-paginated/csi-response-list-paginated.component.jsx @@ -31,21 +31,9 @@ export default function CsiResponseListPaginated({ sorter: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number), sortOrder: sortcolumn === "ro_number" && sortorder, - render: (text, record) => ( - {record.job.ro_number} - ), - }, - { - title: t("jobs.fields.est_number"), - dataIndex: "est_number", - key: "est_number", - width: "8%", - sorter: (a, b) => a.job.est_number - b.job.est_number, - sortOrder: sortcolumn === "est_number" && sortorder, - render: (text, record) => ( - {record.job.est_number} + {record.job.ro_number || t("general.labels.na")} ), }, diff --git a/client/src/components/global-search/global-search.component.jsx b/client/src/components/global-search/global-search.component.jsx index a2bd42741..42410ab72 100644 --- a/client/src/components/global-search/global-search.component.jsx +++ b/client/src/components/global-search/global-search.component.jsx @@ -48,11 +48,7 @@ export default function GlobalSearch() {
- - {job.ro_number - ? `${job.ro_number || ""} / ${job.est_number || ""}` - : `${job.est_number || ""}`} - + {job.ro_number || t("general.labels.na")} {`${ diff --git a/client/src/components/job-detail-cards/job-detail-cards.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.component.jsx index eabd90f2f..5df23a76b 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.component.jsx @@ -1,6 +1,6 @@ import { PrinterFilled } from "@ant-design/icons"; import { useQuery } from "@apollo/react-hooks"; -import { Button, Col, Drawer, Grid, PageHeader, Row, Tag, Space } from "antd"; +import { Button, Col, Drawer, Grid, PageHeader, Row, Space, Tag } from "antd"; import queryString from "query-string"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -101,11 +101,7 @@ export function JobDetailCards({ setPrintCenterContext }) { ]} title={ - {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 - }`} + {data.jobs_by_pk.ro_number || t("general.labels.na")} } subTitle={data.jobs_by_pk.status} diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 6d513713c..728f82109 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -3,12 +3,12 @@ import { useLazyQuery } from "@apollo/react-hooks"; import { Empty, Select } from "antd"; import _ from "lodash"; import React, { forwardRef, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; import { SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE, - SEARCH_JOBS_FOR_AUTOCOMPLETE, + SEARCH_JOBS_FOR_AUTOCOMPLETE } from "../../graphql/jobs.queries"; import AlertComponent from "../alert/alert.component"; - const { Option } = Select; const JobSearchSelect = ( @@ -22,6 +22,7 @@ const JobSearchSelect = ( }, ref ) => { + const { t } = useTranslation(); const [callSearch, { loading, error, data }] = useLazyQuery( SEARCH_JOBS_FOR_AUTOCOMPLETE, { @@ -100,9 +101,9 @@ const JobSearchSelect = ( {theOptions ? theOptions.map((o) => (