From d7e195ff7f2116d377f9dbd53a8a50f9c351592c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 29 Jan 2020 12:00:50 -0800 Subject: [PATCH] Added find owner modal and basic searching logic. --- bodyshop_translations.babel | 162 ++++++++++++++++++ .../jobs-available-new.component.jsx | 38 ++-- .../jobs-available-new.container.jsx | 27 ++- .../owner-find-modal.component.jsx | 124 +++++++++++++- .../owner-find-modal.container.jsx | 44 ++++- client/src/graphql/owners.queries.js | 20 +++ client/src/translations/en_us/common.json | 13 ++ client/src/translations/es/common.json | 13 ++ client/src/translations/fr/common.json | 13 ++ .../1580321100336_owner_gin_idx/down.yaml | 1 + .../1580321100336_owner_gin_idx/up.yaml | 6 + .../down.yaml | 1 + .../up.yaml | 14 ++ .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 44 +++++ .../up.yaml | 45 +++++ .../down.yaml | 42 +++++ .../up.yaml | 43 +++++ .../down.yaml | 44 +++++ .../up.yaml | 45 +++++ 21 files changed, 711 insertions(+), 34 deletions(-) create mode 100644 client/src/graphql/owners.queries.js create mode 100644 hasura/migrations/1580321100336_owner_gin_idx/down.yaml create mode 100644 hasura/migrations/1580321100336_owner_gin_idx/up.yaml create mode 100644 hasura/migrations/1580321202242_owner_search_function/down.yaml create mode 100644 hasura/migrations/1580321202242_owner_search_function/up.yaml create mode 100644 hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/down.yaml create mode 100644 hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/up.yaml create mode 100644 hasura/migrations/1580322221407_update_permission_user_public_table_owners/down.yaml create mode 100644 hasura/migrations/1580322221407_update_permission_user_public_table_owners/up.yaml create mode 100644 hasura/migrations/1580322225907_update_permission_user_public_table_owners/down.yaml create mode 100644 hasura/migrations/1580322225907_update_permission_user_public_table_owners/up.yaml create mode 100644 hasura/migrations/1580322230561_update_permission_user_public_table_owners/down.yaml create mode 100644 hasura/migrations/1580322230561_update_permission_user_public_table_owners/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 5ac9537b9..162ad5ab9 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -3361,6 +3361,168 @@ + + owners + + + fields + + + ownr_addr1 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_city + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_ea + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_fn + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_ln + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_ph1 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + labels + + + existing_owners + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + profile diff --git a/client/src/components/jobs-available-new/jobs-available-new.component.jsx b/client/src/components/jobs-available-new/jobs-available-new.component.jsx index b34e6c5fa..3638188d4 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.component.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.component.jsx @@ -1,8 +1,8 @@ -import { Input, Table, Button, Icon, notification, Modal } from "antd"; +import { Button, Icon, Input, notification, Table } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -import { alphaSort } from "../../utils/sorters"; import { DateTimeFormatter } from "../../utils/DateFormatter"; +import { alphaSort } from "../../utils/sorters"; import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container"; export default function JobsAvailableComponent({ loading, @@ -10,9 +10,12 @@ export default function JobsAvailableComponent({ refetch, deleteJob, deleteAllNewJobs, - insertNewJob, - setJobId, - estDataLazyLoad + estDataLazyLoad, + onModalOk, + onModalCancel, + modalVisible, + setModalVisible, + selectedOwner, setSelectedOwner }) { const { t } = useTranslation(); const [loadEstData, estData] = estDataLazyLoad; @@ -22,7 +25,7 @@ export default function JobsAvailableComponent({ filteredInfo: { text: "" } }); - const [modalVisible, setModalVisible] = useState(false); + const handleTableChange = (pagination, filters, sorter) => { setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); @@ -121,8 +124,6 @@ export default function JobsAvailableComponent({