From e1e5dda7108a0a50779186f0d857e930d9e2397c Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 26 May 2022 12:09:36 -0700 Subject: [PATCH] IO-1891 Add owner Note. --- bodyshop_translations.babel | 21 ++++++++++ .../owner-detail-form.component.jsx | 6 +-- .../owner-find-modal.component.jsx | 8 ++++ .../production-list-columns.add.component.jsx | 23 +++++++---- client/src/graphql/owners.queries.js | 2 + client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + hasura/metadata/tables.yaml | 41 ++++++++++--------- .../down.sql | 4 ++ .../up.sql | 2 + 11 files changed, 80 insertions(+), 30 deletions(-) create mode 100644 hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/down.sql create mode 100644 hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/up.sql diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 1421c9116..5f5bb62e5 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -32076,6 +32076,27 @@ + + note + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ownr_addr1 false diff --git a/client/src/components/owner-detail-form/owner-detail-form.component.jsx b/client/src/components/owner-detail-form/owner-detail-form.component.jsx index a41b050e9..f5fe04d5d 100644 --- a/client/src/components/owner-detail-form/owner-detail-form.component.jsx +++ b/client/src/components/owner-detail-form/owner-detail-form.component.jsx @@ -14,7 +14,6 @@ export default function OwnerDetailFormComponent({ form, loading }) { return (
- @@ -29,7 +28,6 @@ export default function OwnerDetailFormComponent({ form, loading }) { - @@ -50,7 +48,6 @@ export default function OwnerDetailFormComponent({ form, loading }) { - + + +
); } diff --git a/client/src/components/owner-find-modal/owner-find-modal.component.jsx b/client/src/components/owner-find-modal/owner-find-modal.component.jsx index eb2a6e068..177b4326e 100644 --- a/client/src/components/owner-find-modal/owner-find-modal.component.jsx +++ b/client/src/components/owner-find-modal/owner-find-modal.component.jsx @@ -59,6 +59,14 @@ export default function OwnerFindModalComponent({ {record.ownr_ph2} ), }, + { + title: t("owners.fields.note"), + dataIndex: "note", + key: "note", + render: (text, record) => ( + {record.note} + ), + }, ]; const handleOnRowClick = (record) => { diff --git a/client/src/components/production-list-columns/production-list-columns.add.component.jsx b/client/src/components/production-list-columns/production-list-columns.add.component.jsx index fb3575f5d..82f884673 100644 --- a/client/src/components/production-list-columns/production-list-columns.add.component.jsx +++ b/client/src/components/production-list-columns/production-list-columns.add.component.jsx @@ -42,17 +42,24 @@ export function ProductionColumnsComponent({ }; const columnKeys = columns.map((i) => i.key); - + const cols = dataSource({ + technician, + state: tableState, + activeStatuses: bodyshop.md_ro_statuses.active_statuses, + }); const menu = ( - - {dataSource({ - technician, - state: tableState, - activeStatuses: bodyshop.md_ro_statuses.active_statuses, - }) + + {cols .filter((i) => !columnKeys.includes(i.key)) .map((item) => ( - {item.title} + + {item.title} + ))} ); diff --git a/client/src/graphql/owners.queries.js b/client/src/graphql/owners.queries.js index 8268d20e8..8ff0736d2 100644 --- a/client/src/graphql/owners.queries.js +++ b/client/src/graphql/owners.queries.js @@ -15,6 +15,7 @@ export const QUERY_SEARCH_OWNER_BY_IDX = gql` ownr_st ownr_zip id + note } } `; @@ -65,6 +66,7 @@ export const QUERY_OWNER_BY_ID = gql` ownr_title ownr_zip preferred_contact + note jobs { id ro_number diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index c48d4b09a..c684228ce 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1893,6 +1893,7 @@ "address": "Address", "allow_text_message": "Permission to Text?", "name": "Name", + "note": "Owner Note", "ownr_addr1": "Address", "ownr_addr2": "Address 2", "ownr_city": "City", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index d29f4c642..af04f5bb1 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1893,6 +1893,7 @@ "address": "Dirección", "allow_text_message": "Permiso de texto?", "name": "Nombre", + "note": "", "ownr_addr1": "Dirección", "ownr_addr2": "Dirección 2", "ownr_city": "ciudad", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index cd2e4daa7..fbd28bd87 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1893,6 +1893,7 @@ "address": "Adresse", "allow_text_message": "Autorisation de texte?", "name": "Prénom", + "note": "", "ownr_addr1": "Adresse", "ownr_addr2": "Adresse 2 ", "ownr_city": "Ville", diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index c2f4970b8..18224906e 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -3823,32 +3823,36 @@ - active: _eq: true columns: - - id + - accountingid + - allow_text_message - created_at - - updated_at - - ownr_fn - - ownr_ln + - id + - note - ownr_addr1 - ownr_addr2 - ownr_city - - ownr_st - - ownr_zip + - ownr_co_nm - ownr_ctry - ownr_ea + - ownr_fn + - ownr_ln - ownr_ph1 - - preferred_contact - - allow_text_message - - shopid - ownr_ph2 - - ownr_co_nm + - ownr_st - ownr_title - - accountingid + - ownr_zip + - preferred_contact + - shopid + - updated_at select_permissions: - role: user permission: columns: - - allow_text_message - accountingid + - allow_text_message + - created_at + - id + - note - ownr_addr1 - ownr_addr2 - ownr_city @@ -3863,10 +3867,8 @@ - ownr_title - ownr_zip - preferred_contact - - created_at - - updated_at - - id - shopid + - updated_at filter: bodyshop: associations: @@ -3881,8 +3883,11 @@ - role: user permission: columns: - - allow_text_message - accountingid + - allow_text_message + - created_at + - id + - note - ownr_addr1 - ownr_addr2 - ownr_city @@ -3897,10 +3902,8 @@ - ownr_title - ownr_zip - preferred_contact - - created_at - - updated_at - - id - shopid + - updated_at filter: bodyshop: associations: diff --git a/hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/down.sql b/hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/down.sql new file mode 100644 index 000000000..b8e72fc50 --- /dev/null +++ b/hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."owners" add column "note" text +-- null; diff --git a/hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/up.sql b/hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/up.sql new file mode 100644 index 000000000..6d6856e51 --- /dev/null +++ b/hasura/migrations/1653589931102_alter_table_public_owners_add_column_note/up.sql @@ -0,0 +1,2 @@ +alter table "public"."owners" add column "note" text + null;