From 4fdc241b9c19d5114ec544b7a11f6fdc570cb4b3 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 Jan 2024 10:56:30 -0800 Subject: [PATCH 1/3] IO-2522 Load Level Report App Side --- .../shop-employee-teams.form.component.jsx | 16 ++++++++-- client/src/graphql/employee_teams.queries.js | 29 +++++++++++-------- client/src/translations/en_us/common.json | 2 ++ client/src/translations/es/common.json | 2 ++ client/src/translations/fr/common.json | 2 ++ client/src/utils/TemplateConstants.js | 13 +++++++++ 6 files changed, 50 insertions(+), 14 deletions(-) diff --git a/client/src/components/shop-teams/shop-employee-teams.form.component.jsx b/client/src/components/shop-teams/shop-employee-teams.form.component.jsx index d811eb794..928b4286b 100644 --- a/client/src/components/shop-teams/shop-employee-teams.form.component.jsx +++ b/client/src/components/shop-teams/shop-employee-teams.form.component.jsx @@ -2,11 +2,11 @@ import { DeleteFilled } from "@ant-design/icons"; import { useMutation, useQuery } from "@apollo/client"; import { Button, - Space, Card, Form, Input, InputNumber, + Space, Switch, notification, } from "antd"; @@ -157,6 +157,18 @@ export function ShopEmployeeTeamsFormComponent({ bodyshop }) { > + + + {(fields, { add, remove, move }) => { @@ -199,7 +211,7 @@ export function ShopEmployeeTeamsFormComponent({ bodyshop }) { }, ]} > - + { }, group: "customers", }, + load_level: { + title: i18n.t("reportcenter.templates.load_level"), + subject: i18n.t("reportcenter.templates.load_level"), + key: "load_level", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_open"), + }, + group: "jobs", + enhanced_payroll: true, + }, } : {}), ...(!type || type === "courtesycarcontract" From c0dab92d0ef6d0f2f7b51129d556edd2aae9d2c1 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 Jan 2024 12:01:47 -0800 Subject: [PATCH 2/3] IO-2522 Load Level Table Change --- hasura/metadata/tables.yaml | 33 ++++++++++--------- .../down.sql | 4 +++ .../up.sql | 2 ++ .../down.sql | 3 ++ .../up.sql | 1 + .../down.sql | 4 +++ .../up.sql | 2 ++ 7 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/down.sql create mode 100644 hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/up.sql create mode 100644 hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/down.sql create mode 100644 hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/up.sql create mode 100644 hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/down.sql create mode 100644 hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 216ac8c48..9867b3f8e 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -2023,24 +2023,24 @@ - active: _eq: true columns: - - labor_rates - - percentage - created_at - - updated_at - employeeid - id + - labor_rates + - percentage - teamid + - updated_at select_permissions: - role: user permission: columns: - - labor_rates - - percentage - created_at - - updated_at - employeeid - id + - labor_rates + - percentage - teamid + - updated_at filter: employee_team: bodyshop: @@ -2055,13 +2055,13 @@ - role: user permission: columns: - - labor_rates - - percentage - created_at - - updated_at - employeeid - id + - labor_rates + - percentage - teamid + - updated_at filter: employee_team: bodyshop: @@ -2123,21 +2123,23 @@ _eq: true columns: - active - - name - - created_at - - updated_at - bodyshopid + - created_at - id + - max_load + - name + - updated_at select_permissions: - role: user permission: columns: - active - - name - - created_at - - updated_at - bodyshopid + - created_at - id + - max_load + - name + - updated_at filter: bodyshop: associations: @@ -2153,6 +2155,7 @@ columns: - active - bodyshopid + - max_load - name - updated_at filter: diff --git a/hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/down.sql b/hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/down.sql new file mode 100644 index 000000000..8df675f00 --- /dev/null +++ b/hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/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"."employee_team_members" add column "max_load" numeric +-- not null default '10000'; diff --git a/hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/up.sql b/hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/up.sql new file mode 100644 index 000000000..7b49a8dcd --- /dev/null +++ b/hasura/migrations/1704401074280_alter_table_public_employee_team_members_add_column_max_load/up.sql @@ -0,0 +1,2 @@ +alter table "public"."employee_team_members" add column "max_load" numeric + not null default '10000'; diff --git a/hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/down.sql b/hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/down.sql new file mode 100644 index 000000000..a869e6890 --- /dev/null +++ b/hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/down.sql @@ -0,0 +1,3 @@ +alter table "public"."employee_team_members" alter column "max_load" set default '10000'::numeric; +alter table "public"."employee_team_members" alter column "max_load" drop not null; +alter table "public"."employee_team_members" add column "max_load" numeric; diff --git a/hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/up.sql b/hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/up.sql new file mode 100644 index 000000000..18bf59cf3 --- /dev/null +++ b/hasura/migrations/1704403786392_alter_table_public_employee_team_members_drop_column_max_load/up.sql @@ -0,0 +1 @@ +alter table "public"."employee_team_members" drop column "max_load" cascade; diff --git a/hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/down.sql b/hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/down.sql new file mode 100644 index 000000000..58a0f9b6d --- /dev/null +++ b/hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/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"."employee_teams" add column "max_load" numeric +-- not null default '10000'; diff --git a/hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/up.sql b/hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/up.sql new file mode 100644 index 000000000..c55ba33d0 --- /dev/null +++ b/hasura/migrations/1704403846373_alter_table_public_employee_teams_add_column_max_load/up.sql @@ -0,0 +1,2 @@ +alter table "public"."employee_teams" add column "max_load" numeric + not null default '10000'; From fe3698980d5c81651288ed3aad1807366e5e7fa2 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 Jan 2024 13:09:15 -0800 Subject: [PATCH 3/3] IO-2514 Only Unique items in Menu --- .../production-list-columns.data.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/client/src/components/production-list-columns/production-list-columns.data.js b/client/src/components/production-list-columns/production-list-columns.data.js index d43433540..8e584aa2e 100644 --- a/client/src/components/production-list-columns/production-list-columns.data.js +++ b/client/src/components/production-list-columns/production-list-columns.data.js @@ -6,6 +6,7 @@ import { Link } from "react-router-dom"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { TimeFormatter } from "../../utils/DateFormatter"; import PhoneFormatter from "../../utils/PhoneFormatter"; +import { onlyUnique } from "../../utils/arrayHelper"; import { alphaSort, dateSort, statusSort } from "../../utils/sorters"; import JobAltTransportChange from "../job-at-change/job-at-change.component"; import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component"; @@ -548,12 +549,17 @@ const r = ({ technician, state, activeStatuses, data, bodyshop }) => { sortOrder: state.sortedInfo.columnKey === "estimator" && state.sortedInfo.order, filters: - data?.map((s) => { - return { - text: `${s.est_ct_fn || ""} ${s.est_ct_ln || ""}`.trim(), - value: [`${s.est_ct_fn || ""} ${s.est_ct_ln || ""}`.trim()], - }; - }) || [], + (data && + data + .map((j) => `${j.est_ct_fn || ""} ${j.est_ct_ln || ""}`.trim()) + .filter(onlyUnique) + .map((s) => { + return { + text: s || "N/A", + value: [s], + }; + })) || + [], onFilter: (value, record) => value.includes( `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim()