diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 1d18bd152..a63cff464 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -14310,6 +14310,27 @@ + + nofeatureaccess + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + noshop false @@ -28980,6 +29001,27 @@ + + courtesy_car_impound + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + courtesy_car_terms false @@ -32361,6 +32403,90 @@ + + production_by_last_name + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + production_by_repair_status + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + production_by_ro + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + production_by_target_date + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + purchases_by_cost_center_detail false diff --git a/client/src/components/chat-archive-button/chat-archive-button.component.jsx b/client/src/components/chat-archive-button/chat-archive-button.component.jsx index dcda38860..fdcff6b90 100644 --- a/client/src/components/chat-archive-button/chat-archive-button.component.jsx +++ b/client/src/components/chat-archive-button/chat-archive-button.component.jsx @@ -5,10 +5,6 @@ import { useTranslation } from "react-i18next"; import { TOGGLE_CONVERSATION_ARCHIVE } from "../../graphql/conversations.queries"; export default function ChatArchiveButton({ conversation }) { - console.log( - "🚀 ~ file: chat-archive-button.component.jsx ~ line 6 ~ conversation", - conversation - ); const [loading, setLoading] = useState(false); const { t } = useTranslation(); const [updateConversation] = useMutation(TOGGLE_CONVERSATION_ARCHIVE); diff --git a/client/src/components/feature-wrapper/feature-wrapper.component.jsx b/client/src/components/feature-wrapper/feature-wrapper.component.jsx new file mode 100644 index 000000000..af609ac1f --- /dev/null +++ b/client/src/components/feature-wrapper/feature-wrapper.component.jsx @@ -0,0 +1,50 @@ +import moment from "moment"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import AlertComponent from "../alert/alert.component"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); + +function FeatureWrapper({ + bodyshop, + featureName, + noauth, + children, + ...restProps +}) { + const { t } = useTranslation(); + + if (HasFeatureAccess({ featureName, bodyshop })) return children; + + return ( + noauth || ( + + ) + ); +} + +export function HasFeatureAccess({ featureName, bodyshop }) { + return ( + bodyshop.features.allAccess || + moment(bodyshop.features[featureName]).isAfter(moment()) + ); +} + +export default connect(mapStateToProps, null)(FeatureWrapper); + +/* +dashboard +production-board +scoreboard +csi +tech-console +mobile-imaging +*/ diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index 8ebc5d284..8ac3bdd02 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -16,6 +16,7 @@ import { Table, Tag, } from "antd"; +import axios from "axios"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -291,8 +292,8 @@ export function JobLinesComponent({ diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 04ab0b27d..42c0be5db 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -80,7 +80,7 @@ const JobSearchSelect = ( {theOptions ? theOptions.map((o) => (