Compare commits
5 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9f562faa4 | ||
|
|
b8b76cb96c | ||
|
|
fa958cbbfe | ||
|
|
2146672916 | ||
|
|
f96460f332 |
@@ -21,7 +21,7 @@ import dayjs from "../../utils/day";
|
|||||||
import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component";
|
import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component";
|
||||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
import ShareToTeamsButton from "../share-to-teams/share-to-teams.component.jsx";
|
import ShareToTeamsButton from "../share-to-teams/share-to-teams.component.jsx";
|
||||||
import { SiMicrosoftteams } from "react-icons/si";
|
import { PiMicrosoftTeamsLogo } from "react-icons/pi";
|
||||||
|
|
||||||
const cardColor = (ssbuckets, totalHrs) => {
|
const cardColor = (ssbuckets, totalHrs) => {
|
||||||
const bucket = ssbuckets.find((bucket) => bucket.gte <= totalHrs && (!bucket.lt || bucket.lt > totalHrs));
|
const bucket = ssbuckets.find((bucket) => bucket.gte <= totalHrs && (!bucket.lt || bucket.lt > totalHrs));
|
||||||
@@ -424,7 +424,7 @@ export default function ProductionBoardCard({ technician, card, bodyshop, cardSe
|
|||||||
noIcon={true}
|
noIcon={true}
|
||||||
linkText={
|
linkText={
|
||||||
<div className="share-to-teams-badge">
|
<div className="share-to-teams-badge">
|
||||||
<SiMicrosoftteams />
|
<PiMicrosoftTeamsLogo />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
urlOverride={`${window.location.origin}/manage/jobs/${card.id}`}
|
urlOverride={`${window.location.origin}/manage/jobs/${card.id}`}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { SiMicrosoftteams } from "react-icons/si";
|
import { PiMicrosoftTeamsLogo } from "react-icons/pi";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -90,7 +90,7 @@ const ShareToTeamsComponent = ({
|
|||||||
color: "#FFFFFF",
|
color: "#FFFFFF",
|
||||||
...buttonStyle
|
...buttonStyle
|
||||||
}}
|
}}
|
||||||
icon={<SiMicrosoftteams style={{ color: "#FFFFFF", ...buttonIconStyle }} />}
|
icon={<PiMicrosoftTeamsLogo style={{ color: "#FFFFFF", ...buttonIconStyle }} />}
|
||||||
onClick={handleShare}
|
onClick={handleShare}
|
||||||
title={linkText === null ? t("general.actions.sharetoteams") : linkText}
|
title={linkText === null ? t("general.actions.sharetoteams") : linkText}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import client from "../utils/GraphQLClient";
|
|||||||
import cleanAxios from "./CleanAxios";
|
import cleanAxios from "./CleanAxios";
|
||||||
import { TemplateList } from "./TemplateConstants";
|
import { TemplateList } from "./TemplateConstants";
|
||||||
import { generateTemplate } from "./graphQLmodifier";
|
import { generateTemplate } from "./graphQLmodifier";
|
||||||
import InstanceRenderManager from "./instanceRenderMgr";
|
|
||||||
|
|
||||||
const server = import.meta.env.VITE_APP_REPORTS_SERVER_URL;
|
const server = import.meta.env.VITE_APP_REPORTS_SERVER_URL;
|
||||||
|
|
||||||
@@ -39,7 +38,7 @@ export default async function RenderTemplate(
|
|||||||
jsreport.headers["Authorization"] = jsrAuth;
|
jsreport.headers["Authorization"] = jsrAuth;
|
||||||
|
|
||||||
//Query assets that match the template name. Must be in format <<templateName>>.query
|
//Query assets that match the template name. Must be in format <<templateName>>.query
|
||||||
let { contextData, useShopSpecificTemplate } = await fetchContextData(templateObject, jsrAuth);
|
let { contextData, useShopSpecificTemplate, shopSpecificFolder } = await fetchContextData(templateObject, jsrAuth);
|
||||||
|
|
||||||
const { ignoreCustomMargins } = Templates[templateObject.name];
|
const { ignoreCustomMargins } = Templates[templateObject.name];
|
||||||
|
|
||||||
@@ -74,14 +73,8 @@ export default async function RenderTemplate(
|
|||||||
...contextData,
|
...contextData,
|
||||||
...templateObject.variables,
|
...templateObject.variables,
|
||||||
...templateObject.context,
|
...templateObject.context,
|
||||||
headerpath: `/${InstanceRenderManager({
|
headerpath: shopSpecificFolder ? `/${bodyshop.imexshopid}/header.html` : `/GENERIC/header.html`,
|
||||||
imex: bodyshop.imexshopid,
|
footerpath: shopSpecificFolder ? `/${bodyshop.imexshopid}/footer.html` : `/GENERIC/footer.html`,
|
||||||
rome: bodyshop.imexshopid
|
|
||||||
})}/header.html`,
|
|
||||||
footerpath: `/${InstanceRenderManager({
|
|
||||||
imex: bodyshop.imexshopid,
|
|
||||||
rome: bodyshop.imexshopid
|
|
||||||
})}/footer.html`,
|
|
||||||
bodyshop: bodyshop,
|
bodyshop: bodyshop,
|
||||||
filters: templateObject?.filters,
|
filters: templateObject?.filters,
|
||||||
sorters: templateObject?.sorters,
|
sorters: templateObject?.sorters,
|
||||||
@@ -149,11 +142,12 @@ export async function RenderTemplates(templateObjects, bodyshop, renderAsHtml =
|
|||||||
templateObjects.forEach((template) => {
|
templateObjects.forEach((template) => {
|
||||||
proms.push(
|
proms.push(
|
||||||
(async () => {
|
(async () => {
|
||||||
let { contextData, useShopSpecificTemplate } = await fetchContextData(template, jsrAuth);
|
let { contextData, useShopSpecificTemplate, shopSpecificFolder } = await fetchContextData(template, jsrAuth);
|
||||||
unsortedTemplatesAndData.push({
|
unsortedTemplatesAndData.push({
|
||||||
templateObject: template,
|
templateObject: template,
|
||||||
contextData,
|
contextData,
|
||||||
useShopSpecificTemplate
|
useShopSpecificTemplate,
|
||||||
|
shopSpecificFolder
|
||||||
});
|
});
|
||||||
})()
|
})()
|
||||||
);
|
);
|
||||||
@@ -248,8 +242,8 @@ export async function RenderTemplates(templateObjects, bodyshop, renderAsHtml =
|
|||||||
|
|
||||||
// ...rootTemplate.templateObject.variables,
|
// ...rootTemplate.templateObject.variables,
|
||||||
// ...rootTemplate.templateObject.context,
|
// ...rootTemplate.templateObject.context,
|
||||||
headerpath: `/${bodyshop.imexshopid}/header.html`,
|
headerpath: rootTemplate.shopSpecificFolder ? `/${bodyshop.imexshopid}/header.html` : `/GENERIC/header.html`,
|
||||||
footerpath: `/${bodyshop.imexshopid}/footer.html`,
|
footerpath: rootTemplate.shopSpecificFolder ? `/${bodyshop.imexshopid}/footer.html` : `/GENERIC/footer.html`,
|
||||||
bodyshop: bodyshop,
|
bodyshop: bodyshop,
|
||||||
offset: bodyshop.timezone
|
offset: bodyshop.timezone
|
||||||
}
|
}
|
||||||
@@ -397,10 +391,10 @@ const fetchContextData = async (templateObject, jsrAuth) => {
|
|||||||
});
|
});
|
||||||
contextData = data;
|
contextData = data;
|
||||||
}
|
}
|
||||||
return { contextData, useShopSpecificTemplate };
|
return { contextData, useShopSpecificTemplate, shopSpecificFolder };
|
||||||
}
|
}
|
||||||
|
|
||||||
return await generateTemplate(templateQueryToExecute, templateObject, useShopSpecificTemplate);
|
return await generateTemplate(templateQueryToExecute, templateObject, useShopSpecificTemplate, shopSpecificFolder);
|
||||||
};
|
};
|
||||||
|
|
||||||
//export const displayTemplateInWindow = (html) => {
|
//export const displayTemplateInWindow = (html) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { gql } from "@apollo/client";
|
||||||
import { Kind, parse, print, visit } from "graphql";
|
import { Kind, parse, print, visit } from "graphql";
|
||||||
import client from "./GraphQLClient";
|
import client from "./GraphQLClient";
|
||||||
import { gql } from "@apollo/client";
|
|
||||||
|
|
||||||
/* eslint-disable no-loop-func */
|
/* eslint-disable no-loop-func */
|
||||||
|
|
||||||
@@ -114,9 +114,10 @@ export function printQuery(query) {
|
|||||||
* @param templateQueryToExecute
|
* @param templateQueryToExecute
|
||||||
* @param templateObject
|
* @param templateObject
|
||||||
* @param useShopSpecificTemplate
|
* @param useShopSpecificTemplate
|
||||||
* @returns {Promise<{contextData: {}, useShopSpecificTemplate}>}
|
* @param shopSpecificTemplate
|
||||||
|
* @returns {Promise<{contextData: {}, useShopSpecificTemplate, shopSpecificTemplate}>}
|
||||||
*/
|
*/
|
||||||
export async function generateTemplate(templateQueryToExecute, templateObject, useShopSpecificTemplate) {
|
export async function generateTemplate(templateQueryToExecute, templateObject, useShopSpecificTemplate, shopSpecificFolder) {
|
||||||
// Advanced Filtering and Sorting modifications start here
|
// Advanced Filtering and Sorting modifications start here
|
||||||
|
|
||||||
// Parse the query and apply the filters and sorters
|
// Parse the query and apply the filters and sorters
|
||||||
@@ -147,7 +148,7 @@ export async function generateTemplate(templateQueryToExecute, templateObject, u
|
|||||||
contextData = data;
|
contextData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { contextData, useShopSpecificTemplate };
|
return { contextData, useShopSpecificTemplate, shopSpecificFolder };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user