From 3988386c798245a6cc972290da0707fde2bfca2a Mon Sep 17 00:00:00 2001 From: swtmply Date: Sat, 6 May 2023 02:56:02 +0800 Subject: [PATCH 1/7] IO-1722 replaced hex to rgba --- .../production-board-kanban-card.component.jsx | 18 +++++++++--------- .../shop-info/shop-info.rostatus.component.jsx | 2 +- .../shop-info.scheduling.component.jsx | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx index bab5b9851..17f590171 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx @@ -24,18 +24,15 @@ const cardColor = (ssbuckets, totalHrs) => { bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true) )[0]; - if (bucket.color) { - return bucket.color.hex; + if (bucket.color.rgb) { + return bucket.color.rgb; } - return ""; + return bucket.color; }; -function getContrastYIQ(hexColor) { - const r = parseInt(hexColor.substr(1, 2), 16); - const g = parseInt(hexColor.substr(3, 2), 16); - const b = parseInt(hexColor.substr(5, 2), 16); - const yiq = (r * 299 + g * 587 + b * 114) / 1000; +function getContrastYIQ(bgColor) { + const yiq = (bgColor.r * 299 + bgColor.g * 587 + bgColor.b * 114) / 1000; return yiq >= 128 ? "black" : "white"; } @@ -85,7 +82,10 @@ export default function ProductionBoardCard( className="react-kanban-card imex-kanban-card" size="small" style={{ - backgroundColor: cardSettings && cardSettings.cardcolor && bgColor, + backgroundColor: + cardSettings && + cardSettings.cardcolor && + `rgba(${bgColor.r},${bgColor.g},${bgColor.b},${bgColor.a})`, color: cardSettings && cardSettings.cardcolor && getContrastYIQ(bgColor), }} diff --git a/client/src/components/shop-info/shop-info.rostatus.component.jsx b/client/src/components/shop-info/shop-info.rostatus.component.jsx index 10dd0c926..29ad53ecd 100644 --- a/client/src/components/shop-info/shop-info.rostatus.component.jsx +++ b/client/src/components/shop-info/shop-info.rostatus.component.jsx @@ -396,7 +396,7 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) { ); } -const ColorPicker = ({ value, onChange, style, ...restProps }) => { +export const ColorPicker = ({ value, onChange, style, ...restProps }) => { const handleChange = (color) => { if (onChange) onChange(color.rgb); }; diff --git a/client/src/components/shop-info/shop-info.scheduling.component.jsx b/client/src/components/shop-info/shop-info.scheduling.component.jsx index 49145aed9..60bf3cbfd 100644 --- a/client/src/components/shop-info/shop-info.scheduling.component.jsx +++ b/client/src/components/shop-info/shop-info.scheduling.component.jsx @@ -15,6 +15,7 @@ import { useTranslation } from "react-i18next"; import ColorpickerFormItemComponent from "../form-items-formatted/colorpicker-form-item.component"; import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; +import { ColorPicker } from "./shop-info.rostatus.component"; export default function ShopInfoSchedulingComponent({ form }) { const { t } = useTranslation(); @@ -283,7 +284,7 @@ export default function ShopInfoSchedulingComponent({ form }) { key={`${index}color`} name={[field.name, "color"]} > - + From 12fa270a1a0f92bea9a81d5b11f4d518a98bb9aa Mon Sep 17 00:00:00 2001 From: swtmply Date: Sat, 6 May 2023 03:34:22 +0800 Subject: [PATCH 2/7] IO-1722 adjusted background colors --- ...ard-kanban-card-color-legend.component.jsx | 21 +++++++++++++------ ...production-board-kanban-card.component.jsx | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx index e9cc0f4e0..15b33ccc4 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx @@ -2,12 +2,21 @@ import { Col, List, Space, Typography } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; -const CardColorLegend = ({ bodyshop, cardSettings }) => { +const CardColorLegend = ({ bodyshop }) => { const { t } = useTranslation(); - const data = bodyshop.ssbuckets.map((size) => ({ - label: size.label, - color: size.color?.hex ?? "white", - })); + const data = bodyshop.ssbuckets.map((bucket) => { + let color = { r: 255, g: 255, b: 255 }; + + if (bucket.color.rgb) { + color = bucket.color.rgb; + } + color = bucket.color; // default to white + + return { + label: bucket.label, + color, + }; + }); return ( @@ -24,7 +33,7 @@ const CardColorLegend = ({ bodyshop, cardSettings }) => { style={{ width: "1.5rem", aspectRatio: "1/1", - backgroundColor: item.color, + backgroundColor: `rgba(${item.color.r},${item.color.g},${item.color.b},${item.color.a})`, }} >
{item.label}
diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx index 17f590171..7f59eadc4 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx @@ -28,7 +28,7 @@ const cardColor = (ssbuckets, totalHrs) => { return bucket.color.rgb; } - return bucket.color; + return bucket.color ?? { r: 255, g: 255, b: 255 }; // default to white }; function getContrastYIQ(bgColor) { From 3e00e7981d6339cae5099636e15bfde37a49c57f Mon Sep 17 00:00:00 2001 From: swtmply Date: Sat, 6 May 2023 03:34:55 +0800 Subject: [PATCH 3/7] IO-1722 added placement to popover --- .../production-board-kanban.card-settings.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx b/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx index bc7f83494..6a58af07b 100644 --- a/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx +++ b/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx @@ -173,7 +173,7 @@ export default function ProductionBoardKanbanCardSettings({ ); return ( - + From 56fef0f43c8610c68bb7ea4609b242a6f71a8f50 Mon Sep 17 00:00:00 2001 From: swtmply Date: Sat, 6 May 2023 04:55:21 +0800 Subject: [PATCH 4/7] IO-1722 Added reset button --- .../shop-info.scheduling.component.jsx | 60 +++++++++++++------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/client/src/components/shop-info/shop-info.scheduling.component.jsx b/client/src/components/shop-info/shop-info.scheduling.component.jsx index 60bf3cbfd..56bf72926 100644 --- a/client/src/components/shop-info/shop-info.scheduling.component.jsx +++ b/client/src/components/shop-info/shop-info.scheduling.component.jsx @@ -279,25 +279,49 @@ export default function ShopInfoSchedulingComponent({ form }) { - - - + + + {t("bodyshop.fields.ssbuckets.color")} + + + } + key={`${index}color`} + name={[field.name, "color"]} + > + + + + { + remove(field.name); + }} + /> + +
From 04509fa587d6f16d016eba8a0540698370b19cef Mon Sep 17 00:00:00 2001 From: swtmply Date: Sat, 6 May 2023 04:56:03 +0800 Subject: [PATCH 5/7] IO-1722 adjusted logic for card color --- ...tion-board-kanban-card-color-legend.component.jsx | 9 ++++++--- .../production-board-kanban-card.component.jsx | 12 +++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx index 15b33ccc4..d7b763939 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card-color-legend.component.jsx @@ -7,10 +7,13 @@ const CardColorLegend = ({ bodyshop }) => { const data = bodyshop.ssbuckets.map((bucket) => { let color = { r: 255, g: 255, b: 255 }; - if (bucket.color.rgb) { - color = bucket.color.rgb; + if (bucket.color) { + color = bucket.color; + + if (bucket.color.rgb) { + color = bucket.color.rgb; + } } - color = bucket.color; // default to white return { label: bucket.label, diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx index 7f59eadc4..dca5d3a70 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx @@ -24,11 +24,17 @@ const cardColor = (ssbuckets, totalHrs) => { bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true) )[0]; - if (bucket.color.rgb) { - return bucket.color.rgb; + let color = { r: 255, g: 255, b: 255 }; + + if (bucket && bucket.color) { + color = bucket.color; + + if (bucket.color.rgb) { + color = bucket.color.rgb; + } } - return bucket.color ?? { r: 255, g: 255, b: 255 }; // default to white + return color; }; function getContrastYIQ(bgColor) { From 2dabf3c811b55011f7ee1030abd822350ea80956 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 May 2023 14:03:05 -0700 Subject: [PATCH 6/7] IO-2261 Missing loader handler for owner_owing, correct payment --- .../payment-list-paginated.component.jsx | 2 +- server/opensearch/os-handler.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx index d1d806b29..06bebafd1 100644 --- a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx +++ b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx @@ -170,7 +170,7 @@ export function PaymentsListPaginated({ } setPaymentContext({ actions: { refetch: refetch }, - context: apolloResults ? record : apolloResults, + context: apolloResults ? apolloResults : record, }); }} > diff --git a/server/opensearch/os-handler.js b/server/opensearch/os-handler.js index 072ece57d..2bd05d5e5 100644 --- a/server/opensearch/os-handler.js +++ b/server/opensearch/os-handler.js @@ -70,6 +70,7 @@ async function OpenSearchUpdateHandler(req, res) { "clm_total", "comment", "ins_co_nm", + "owner_owing", "ownr_co_nm", "ownr_fn", "ownr_ln", From cf5ebb813088747ab3059ffa30be58506be19478 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 May 2023 14:24:00 -0700 Subject: [PATCH 7/7] IO-2261 Missing loader for owner_owing --- os-loader.js | 1 + 1 file changed, 1 insertion(+) diff --git a/os-loader.js b/os-loader.js index c09f1a98a..a7876187a 100644 --- a/os-loader.js +++ b/os-loader.js @@ -78,6 +78,7 @@ async function OpenSearchUpdateHandler(req, res) { clm_total comment ins_co_nm + owner_owing ownr_co_nm ownr_fn ownr_ln