diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index f6215e80d..f5be627cc 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -7120,6 +7120,27 @@ + + color + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + default_arrived false @@ -7456,6 +7477,27 @@ + + production_colors + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + production_statuses false diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index bcf6fc843..b49fdcb1e 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -128,3 +128,9 @@ .react-kanban-column { background-color: #ddd !important; } + +.production-list-table { + td.ant-table-column-sort { + background: unset; + } +} diff --git a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx index c3746bde6..3ced4e25e 100644 --- a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx +++ b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx @@ -6,7 +6,6 @@ import { InputNumber, Row, Select, - Space, Switch, } from "antd"; import React from "react"; diff --git a/client/src/components/production-list-table/production-list-table.component.jsx b/client/src/components/production-list-table/production-list-table.component.jsx index d69741496..f5ce08156 100644 --- a/client/src/components/production-list-table/production-list-table.component.jsx +++ b/client/src/components/production-list-table/production-list-table.component.jsx @@ -165,7 +165,6 @@ export function ProductionListTable({ // }; if (!!!columns) return
No columns found.
; - console.log(data); const totalHrs = data .reduce( @@ -218,8 +217,25 @@ export function ProductionListTable({ handleSelector=".prod-header-dropdown" > { + if (!bodyshop.md_ro_statuses.production_colors) return null; + + const color = bodyshop.md_ro_statuses.production_colors.find( + (x) => x.status === record.status + ); + + if (!color) return null; + + return { + style: { + backgroundColor: `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`, + }, + }; + }} components={{ header: { cell: ResizeableTitle, 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 28d8a4f1a..d735d7522 100644 --- a/client/src/components/shop-info/shop-info.rostatus.component.jsx +++ b/client/src/components/shop-info/shop-info.rostatus.component.jsx @@ -1,8 +1,12 @@ -import { Form, Select } from "antd"; +import { DeleteFilled } from "@ant-design/icons"; +import { Button, Form, Select, Space } from "antd"; import React, { useState } from "react"; +import { ChromePicker } from "react-color"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; +import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; + const SelectorDiv = styled.div` .ant-form-item .ant-select { width: 200px; @@ -257,6 +261,95 @@ export default function ShopInfoROStatusComponent({ form }) { + + + {(fields, { add, remove, move }) => { + return ( +
+ + {fields.map((field, index) => ( + + +
+ + + + { + remove(field.name); + }} + /> +
+ + + +
+
+ ))} +
+ + + +
+ ); + }} +
+
); } + +const ColorPicker = ({ value, onChange, style, ...restProps }) => { + const handleChange = (color) => { + console.log( + "🚀 ~ file: shop-info.rostatus.component.jsx ~ line 345 ~ color", + color + ); + if (onChange) onChange(color.rgb); + }; + return ( + + ); +}; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 740fee51d..7aae60089 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -450,6 +450,7 @@ "status": "Status Label", "statuses": { "active_statuses": "Active Statuses (Filtering for Active Jobs throughout system)", + "color": "Color", "default_arrived": "Default Arrived Status (Transition to Production)", "default_bo": "Default Backordered Status", "default_canceled": "Default Canceled Status", @@ -466,6 +467,7 @@ "open_statuses": "Open Statuses", "post_production_statuses": "Post-Production Statuses", "pre_production_statuses": "Pre-Production Statuses", + "production_colors": "Production Status Colors", "production_statuses": "Production Statuses" }, "target_touchtime": "Target Touch Time", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index e3de458b3..f47b7e44f 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -450,6 +450,7 @@ "status": "", "statuses": { "active_statuses": "", + "color": "", "default_arrived": "", "default_bo": "", "default_canceled": "", @@ -466,6 +467,7 @@ "open_statuses": "", "post_production_statuses": "", "pre_production_statuses": "", + "production_colors": "", "production_statuses": "" }, "target_touchtime": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index f46cba160..8172babb7 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -450,6 +450,7 @@ "status": "", "statuses": { "active_statuses": "", + "color": "", "default_arrived": "", "default_bo": "", "default_canceled": "", @@ -466,6 +467,7 @@ "open_statuses": "", "post_production_statuses": "", "pre_production_statuses": "", + "production_colors": "", "production_statuses": "" }, "target_touchtime": "",