Merged in release/2023-05-05 (pull request #767)

Release/2023 05 05
This commit is contained in:
Patrick Fic
2023-05-05 22:03:21 +00:00
8 changed files with 81 additions and 36 deletions

View File

@@ -170,7 +170,7 @@ export function PaymentsListPaginated({
}
setPaymentContext({
actions: { refetch: refetch },
context: apolloResults ? record : apolloResults,
context: apolloResults ? apolloResults : record,
});
}}
>

View File

@@ -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 (
<Col>
@@ -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})`,
}}
></div>
<div>{item.label}</div>

View File

@@ -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),
}}

View File

@@ -173,7 +173,7 @@ export default function ProductionBoardKanbanCardSettings({
</div>
);
return (
<Popover content={overlay} visible={visible}>
<Popover content={overlay} visible={visible} placement="topRight">
<Button loading={loading} onClick={() => setVisible(true)}>
{t("production.labels.cardsettings")}
</Button>

View File

@@ -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);
};

View File

@@ -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 }) {
<InputNumber />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.ssbuckets.color")}
key={`${index}color`}
name={[field.name, "color"]}
>
<ColorpickerFormItemComponent />
</Form.Item>
<Space direction="horizontal">
<Form.Item
label={
<Space>
{t("bodyshop.fields.ssbuckets.color")}
<Button
size="small"
onClick={() => {
form.setFieldValue([
"ssbuckets",
field.name,
"color",
]);
<Space wrap>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
<FormListMoveArrows
move={move}
index={index}
total={fields.length}
/>
form.setFields([
{
name: ["ssbuckets", field.name, "color"],
touched: true,
},
]);
}}
>
Reset
</Button>
</Space>
}
key={`${index}color`}
name={[field.name, "color"]}
>
<ColorPicker />
</Form.Item>
<Space wrap>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
<FormListMoveArrows
move={move}
index={index}
total={fields.length}
/>
</Space>
</Space>
</LayoutFormRow>
</Form.Item>

View File

@@ -78,6 +78,7 @@ async function OpenSearchUpdateHandler(req, res) {
clm_total
comment
ins_co_nm
owner_owing
ownr_co_nm
ownr_fn
ownr_ln

View File

@@ -74,6 +74,7 @@ async function OpenSearchUpdateHandler(req, res) {
"clm_total",
"comment",
"ins_co_nm",
"owner_owing",
"ownr_co_nm",
"ownr_fn",
"ownr_ln",