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/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..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 @@ -2,12 +2,24 @@ 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) { + color = bucket.color; + + if (bucket.color.rgb) { + color = bucket.color.rgb; + } + } + + return { + label: bucket.label, + color, + }; + }); return ( @@ -24,7 +36,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 bab5b9851..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,18 +24,21 @@ const cardColor = (ssbuckets, totalHrs) => { bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true) )[0]; - if (bucket.color) { - return bucket.color.hex; + let color = { r: 255, g: 255, b: 255 }; + + if (bucket && bucket.color) { + color = bucket.color; + + if (bucket.color.rgb) { + color = bucket.color.rgb; + } } - return ""; + return 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 +88,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/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 ( - + 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..56bf72926 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(); @@ -278,25 +279,49 @@ export default function ShopInfoSchedulingComponent({ form }) { - - - + + + {t("bodyshop.fields.ssbuckets.color")} + + + } + key={`${index}color`} + name={[field.name, "color"]} + > + + + + { + remove(field.name); + }} + /> + + 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 diff --git a/server/opensearch/os-handler.js b/server/opensearch/os-handler.js index 0b27751de..1266e6a6c 100644 --- a/server/opensearch/os-handler.js +++ b/server/opensearch/os-handler.js @@ -74,6 +74,7 @@ async function OpenSearchUpdateHandler(req, res) { "clm_total", "comment", "ins_co_nm", + "owner_owing", "ownr_co_nm", "ownr_fn", "ownr_ln",