Merged in feature/IO-3069-Job-Drawer-Documents-Upsell (pull request #2032)
IO-3069 Job Drawer Documents Upsell correction Approved-by: Dave Richer
This commit is contained in:
@@ -122,7 +122,7 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
|||||||
</Col>
|
</Col>
|
||||||
{!bodyshop.uselocalmediaserver && (
|
{!bodyshop.uselocalmediaserver && (
|
||||||
<Col {...span}>
|
<Col {...span}>
|
||||||
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} />
|
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} bodyshop={bodyshop} />
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
<Col {...span}>
|
<Col {...span}>
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import { Carousel } from "antd";
|
import { Carousel } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
import { GenerateThumbUrl } from "../jobs-documents-gallery/job-documents.utility";
|
import { GenerateThumbUrl } from "../jobs-documents-gallery/job-documents.utility";
|
||||||
import CardTemplate from "./job-detail-cards.template.component";
|
|
||||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
|
import CardTemplate from "./job-detail-cards.template.component";
|
||||||
|
|
||||||
export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
export default function JobDetailCardsDocumentsComponent({ loading, data, bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const hasMediaAccess = HasFeatureAccess({ bodyshop, featureName: "media" });
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return (
|
return (
|
||||||
@@ -21,17 +23,19 @@ export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
|||||||
title={t("jobs.labels.cards.documents")}
|
title={t("jobs.labels.cards.documents")}
|
||||||
extraLink={`/manage/jobs/${data.id}?tab=documents`}
|
extraLink={`/manage/jobs/${data.id}?tab=documents`}
|
||||||
>
|
>
|
||||||
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
|
{!hasMediaAccess && (
|
||||||
{data.documents.length > 0 ? (
|
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
|
||||||
<Carousel autoplay>
|
{data.documents.length > 0 ? (
|
||||||
{data.documents.map((item) => (
|
<Carousel autoplay>
|
||||||
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
|
{data.documents.map((item) => (
|
||||||
))}
|
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
|
||||||
</Carousel>
|
))}
|
||||||
) : (
|
</Carousel>
|
||||||
<div>{t("documents.errors.nodocuments")}</div>
|
) : (
|
||||||
)}
|
<div>{t("documents.errors.nodocuments")}</div>
|
||||||
</UpsellComponent>
|
)}
|
||||||
|
</UpsellComponent>
|
||||||
|
)}
|
||||||
</CardTemplate>
|
</CardTemplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user