IO-3235 FeatureAccess on VisualBoard for SmartSchedule Option of Color Cards

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2025-05-20 15:25:29 -07:00
parent 6005eaee6a
commit 831802f5af

View File

@@ -1,7 +1,15 @@
import { Card, Col, Form, Radio, Row } from "antd"; import { Card, Col, Form, Radio, Row } from "antd";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../../redux/user/user.selectors";
import { HasFeatureAccess } from "../../feature-wrapper/feature-wrapper.component";
const LayoutSettings = ({ t }) => ( const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
});
const LayoutSettings = ({ t, bodyshop }) => (
<Card title={t("production.settings.layout")} style={{ maxWidth: "100%", overflowX: "auto" }}> <Card title={t("production.settings.layout")} style={{ maxWidth: "100%", overflowX: "auto" }}>
<Row gutter={[16, 16]}> <Row gutter={[16, 16]}>
{[ {[
@@ -30,6 +38,8 @@ const LayoutSettings = ({ t }) => (
{ value: false, label: t("production.labels.wide") } { value: false, label: t("production.labels.wide") }
] ]
}, },
...(HasFeatureAccess({ bodyshop, featureName: "smartscheduling" })
? [
{ {
name: "cardcolor", name: "cardcolor",
label: t("production.labels.cardcolor"), label: t("production.labels.cardcolor"),
@@ -37,7 +47,9 @@ const LayoutSettings = ({ t }) => (
{ value: true, label: t("production.labels.on") }, { value: true, label: t("production.labels.on") },
{ value: false, label: t("production.labels.off") } { value: false, label: t("production.labels.off") }
] ]
}, }
]
: []),
{ {
name: "kiosk", name: "kiosk",
label: t("production.labels.kiosk_mode"), label: t("production.labels.kiosk_mode"),
@@ -67,4 +79,4 @@ LayoutSettings.propTypes = {
t: PropTypes.func.isRequired t: PropTypes.func.isRequired
}; };
export default LayoutSettings; export default connect(mapStateToProps)(LayoutSettings);