Initial Vite Configuration & addition of prettierrc.
This commit is contained in:
@@ -17,7 +17,7 @@ dayjs.locale("en");
|
||||
|
||||
const config = {
|
||||
core: {
|
||||
authorizationKey: process.env.REACT_APP_SPLIT_API,
|
||||
authorizationKey: import.meta.env.VITE_APP_SPLIT_API,
|
||||
key: "anon",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ const devTheme = {
|
||||
*/
|
||||
const prodTheme = {};
|
||||
|
||||
const currentTheme = process.env.NODE_ENV === "development" ? devTheme
|
||||
const currentTheme = import.meta.env.DEV ? devTheme
|
||||
: prodTheme;
|
||||
|
||||
const finaltheme = {
|
||||
|
||||
@@ -14,4 +14,4 @@ function PrivateRoute({component: Component, isAuthorized, ...rest}) {
|
||||
return <Outlet/>;
|
||||
}
|
||||
|
||||
export default PrivateRoute;
|
||||
export default PrivateRoute;
|
||||
@@ -19,7 +19,7 @@ export function ChatAffixContainer({bodyshop, chatVisible}) {
|
||||
try {
|
||||
const r = await axios.post("/notifications/subscribe", {
|
||||
fcm_tokens: await getToken(messaging, {
|
||||
vapidKey: process.env.REACT_APP_FIREBASE_PUBLIC_VAPID_KEY,
|
||||
vapidKey: import.meta.env.VITE_APP_FIREBASE_PUBLIC_VAPID_KEY,
|
||||
}),
|
||||
type: "messaging",
|
||||
imexshopid: bodyshop.imexshopid,
|
||||
@@ -95,4 +95,4 @@ export function ChatAffixContainer({bodyshop, chatVisible}) {
|
||||
);
|
||||
}
|
||||
|
||||
export default ChatAffixContainer;
|
||||
export default ChatAffixContainer;
|
||||
|
||||
@@ -57,7 +57,7 @@ export const uploadToCloudinary = async (
|
||||
let tags = `${bodyshop.imexshopid},${
|
||||
tagsArray ? tagsArray.map((tag) => `${tag},`) : ""
|
||||
}`;
|
||||
// let eager = process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS;
|
||||
// let eager = import.meta.env.VITE_APP_CLOUDINARY_THUMB_TRANSFORMATIONS;
|
||||
|
||||
//Get the signed url.
|
||||
|
||||
@@ -96,21 +96,21 @@ export const uploadToCloudinary = async (
|
||||
|
||||
formData.append("upload_preset", upload_preset);
|
||||
|
||||
formData.append("api_key", process.env.REACT_APP_CLOUDINARY_API_KEY);
|
||||
formData.append("public_id", public_id);
|
||||
formData.append("tags", tags);
|
||||
formData.append("timestamp", timestamp);
|
||||
formData.append("signature", signature);
|
||||
formData.append("api_key", import.meta.env.VITE_APP_CLOUDINARY_API_KEY);
|
||||
formData.append("public_id", public_id);
|
||||
formData.append("tags", tags);
|
||||
formData.append("timestamp", timestamp);
|
||||
formData.append("signature", signature);
|
||||
|
||||
const cloudinaryUploadResponse = await cleanAxios.post(
|
||||
`${process.env.REACT_APP_CLOUDINARY_ENDPOINT_API}/${DetermineFileType(
|
||||
fileType
|
||||
)}/upload`,
|
||||
formData,
|
||||
{
|
||||
...options,
|
||||
}
|
||||
);
|
||||
const cloudinaryUploadResponse = await cleanAxios.post(
|
||||
`${import.meta.env.VITE_APP_CLOUDINARY_ENDPOINT_API}/${DetermineFileType(
|
||||
fileType
|
||||
)}/upload`,
|
||||
formData,
|
||||
{
|
||||
...options,
|
||||
}
|
||||
);
|
||||
|
||||
if (cloudinaryUploadResponse.status !== 200) {
|
||||
if (!!onError) {
|
||||
|
||||
@@ -109,7 +109,7 @@ export function JobsAvailableContainer({bodyshop, currentUser, insertAuditTrail,
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (process.env.REACT_APP_COUNTRY === "USA") {
|
||||
// if (process.env.VITE_APP_COUNTRY === "USA") {
|
||||
//Massage the CCC file set to remove duplicate UNQ_SEQ.
|
||||
InstanceRenderManager({executeFunction:true,rome: ResolveCCCLineIssues(estData.est_data, bodyshop) })
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ export const GenerateSrcUrl = (value) => {
|
||||
let extension = value.extension;
|
||||
if (extension && extension.toLowerCase().includes("heic")) extension = "jpg";
|
||||
|
||||
return `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
|
||||
return `${import.meta.env.VITE_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
|
||||
value.type
|
||||
)}/upload/${value.key}${extension ? `.${extension}` : ""}`;
|
||||
};
|
||||
@@ -18,9 +18,9 @@ export const GenerateThumbUrl = (value) => {
|
||||
)
|
||||
extension = "jpg";
|
||||
|
||||
return `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
|
||||
value.type
|
||||
)}/upload/${process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS}/${
|
||||
value.key
|
||||
}${extension ? `.${extension}` : ""}`;
|
||||
return `${import.meta.env.VITE_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
|
||||
value.type
|
||||
)}/upload/${import.meta.env.VITE_APP_CLOUDINARY_THUMB_TRANSFORMATIONS}/${
|
||||
value.key
|
||||
}${extension ? `.${extension}` : ""}`;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ import {getFirestore} from "firebase/firestore";
|
||||
import {getMessaging, getToken, onMessage} from "firebase/messaging";
|
||||
import {store} from "../redux/store";
|
||||
|
||||
const config = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
||||
const config = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
|
||||
initializeApp(config);
|
||||
|
||||
export const auth = getAuth();
|
||||
@@ -48,23 +48,23 @@ try {
|
||||
export {messaging};
|
||||
|
||||
export const requestForToken = () => {
|
||||
return getToken(messaging, {
|
||||
vapidKey: process.env.REACT_APP_FIREBASE_PUBLIC_VAPID_KEY,
|
||||
return getToken(messaging, {
|
||||
vapidKey: import.meta.env.VITE_APP_FIREBASE_PUBLIC_VAPID_KEY,
|
||||
})
|
||||
.then((currentToken) => {
|
||||
if (currentToken) {
|
||||
window.sessionStorage.setItem("fcmtoken", currentToken);
|
||||
// Perform any other necessary action with the token
|
||||
} else {
|
||||
// Show permission request UI
|
||||
console.log(
|
||||
"No registration token available. Request permission to generate one."
|
||||
);
|
||||
}
|
||||
})
|
||||
.then((currentToken) => {
|
||||
if (currentToken) {
|
||||
window.sessionStorage.setItem("fcmtoken", currentToken);
|
||||
// Perform any other necessary action with the token
|
||||
} else {
|
||||
// Show permission request UI
|
||||
console.log(
|
||||
"No registration token available. Request permission to generate one."
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("An error occurred while retrieving token. ", err);
|
||||
});
|
||||
.catch((err) => {
|
||||
console.log("An error occurred while retrieving token. ", err);
|
||||
});
|
||||
};
|
||||
|
||||
export const onMessageListener = () =>
|
||||
|
||||
@@ -28,7 +28,7 @@ import InstanceRenderManager from "./utils/instanceRenderMgr";
|
||||
// Dinero.globalLocale = "en-CA";
|
||||
Dinero.globalRoundingMode = "HALF_EVEN";
|
||||
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
if (import.meta.env.PROD) {
|
||||
Sentry.init({
|
||||
dsn: InstanceRenderManager({
|
||||
imex: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
|
||||
@@ -58,7 +58,7 @@ if (process.env.NODE_ENV !== "development") {
|
||||
],
|
||||
tracesSampleRate: 1.0,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
environment: process.env.NODE_ENV,
|
||||
environment: import.meta.env.MODE,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ const router = createBrowserRouter(
|
||||
);
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
if (import.meta.env.DEV ) {
|
||||
let styles = 'font-weight: bold; font-size: 50px;color: red; 6px 6px 0 rgb(226,91,14) , 9px 9px 0 rgb(245,221,8) , 12px 12px 0 rgb(5,148,68) '
|
||||
console.log('%c %s', styles, `VER: ${process.env.REACT_APP_INSTANCE}`)
|
||||
console.log('%c %s', styles, `VER: ${import.meta.env.VITE_APP_INSTANCE}`)
|
||||
}
|
||||
|
||||
function App() {
|
||||
@@ -9,8 +9,8 @@ export default function AboutPage() {
|
||||
imex: "ImEX Online",
|
||||
rome: "Rome Online",
|
||||
promanager: "ProManager",
|
||||
})}Rome Online V.${process.env.NODE_ENV}-${
|
||||
process.env.REACT_APP_GIT_SHA
|
||||
})}Rome Online V.${import.meta.env.MODE}-${
|
||||
import.meta.env.VITE_APP_GIT_SHA
|
||||
}`}</Typography.Title>
|
||||
<Typography.Title level={2}>Third Party Notices</Typography.Title>
|
||||
<a href="/3rdparty-app.txt">
|
||||
|
||||
@@ -24,17 +24,17 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
|
||||
|
||||
export const socket = SocketIO(
|
||||
process.env.NODE_ENV === "production"
|
||||
? process.env.REACT_APP_AXIOS_BASE_API_URL
|
||||
: window.location.origin,
|
||||
{
|
||||
path: "/ws",
|
||||
withCredentials: true,
|
||||
auth: async (callback) => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
callback({token});
|
||||
},
|
||||
}
|
||||
import.meta.env.PROD
|
||||
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
|
||||
: window.location.origin,
|
||||
{
|
||||
path: "/ws",
|
||||
withCredentials: true,
|
||||
auth: async (callback) => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
callback({ token });
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
export function DmsContainer({bodyshop, setBreadcrumbs, setSelectedHeader}) {
|
||||
|
||||
@@ -31,18 +31,18 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
|
||||
|
||||
export const socket = SocketIO(
|
||||
process.env.NODE_ENV === "production"
|
||||
? process.env.REACT_APP_AXIOS_BASE_API_URL
|
||||
: window.location.origin,
|
||||
// "http://localhost:4000", // for dev testing,
|
||||
{
|
||||
path: "/ws",
|
||||
withCredentials: true,
|
||||
auth: async (callback) => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
callback({token});
|
||||
},
|
||||
}
|
||||
import.meta.env.PROD
|
||||
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
|
||||
: window.location.origin,
|
||||
// "http://localhost:4000", // for dev testing,
|
||||
{
|
||||
path: "/ws",
|
||||
withCredentials: true,
|
||||
auth: async (callback) => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
callback({ token });
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
export function DmsContainer({bodyshop, setBreadcrumbs, setSelectedHeader}) {
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
import React, {useEffect} from "react";
|
||||
import {connect} from "react-redux";
|
||||
import {useNavigate} from "react-router-dom";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {selectCurrentUser} from "../../redux/user/user.selectors";
|
||||
import LandingPageStatic from "../../landing/index";
|
||||
import React, { useEffect } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import { selectCurrentUser } from '../../redux/user/user.selectors';
|
||||
import { Spin } from 'antd';
|
||||
//import LandingPageStatic from "../../landing/index";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
currentUser: selectCurrentUser,
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, null)(LandingPage);
|
||||
|
||||
export function LandingPage({currentUser}) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (currentUser.authorized) {
|
||||
navigate('/manage/jobs');
|
||||
}
|
||||
}, [currentUser, navigate]);
|
||||
|
||||
return <LandingPageStatic/>;
|
||||
export function LandingPage({ currentUser }) {
|
||||
const navigate = useNavigate();
|
||||
console.log('Main');
|
||||
useEffect(() => {
|
||||
navigate('/manage/jobs');
|
||||
}, [currentUser, navigate]);
|
||||
return <Spin />;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {FloatButton, Layout} from "antd";
|
||||
import preval from "preval.macro";
|
||||
// import preval from "preval.macro";
|
||||
import React, {lazy, Suspense, useEffect, useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
@@ -189,6 +189,7 @@ export function Manage({conflict, bodyshop}) {
|
||||
const [chatVisible] = useState(false);
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const widgetId = InstanceRenderManager({ imex:"IABVNO4scRKY11XBQkNr" ,rome: "mQdqARMzkZRUVugJ6TdS"}) ;
|
||||
window.noticeable.render("widget", widgetId);
|
||||
@@ -399,8 +400,8 @@ export function Manage({conflict, bodyshop}) {
|
||||
<div style={{display: "flex"}}>
|
||||
<div>
|
||||
{`${t("titles.app")} ${
|
||||
process.env.REACT_APP_GIT_SHA
|
||||
} - ${preval`module.exports = new Date().toLocaleString("en-US", {timeZone: "America/Los_Angeles"});`}`}
|
||||
import.meta.env.VITE_APP_GIT_SHA || 'Local Build'
|
||||
} - ${import.meta.env.VITE_APP_GIT_SHA_DATE}`}
|
||||
</div>
|
||||
<div id="noticeable-widget" style={{marginLeft: "1rem"}}/>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// const stripePromise = new Promise((resolve, reject) => {
|
||||
// resolve(
|
||||
// loadStripe(process.env.REACT_APP_STRIPE_PUBLIC_KEY, {
|
||||
// loadStripe(import.meta.env.VITE_APP_STRIPE_PUBLIC_KEY, {
|
||||
// stripeAccount: "acct_1Fa7lFIEahEZW8b4",
|
||||
// })
|
||||
// );
|
||||
|
||||
@@ -24,18 +24,18 @@ const middlewares = [
|
||||
createStateSyncMiddleware(reduxSyncConfig),
|
||||
];
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
middlewares.push(createLogger({collapsed: true, diff: true}));
|
||||
if (import.meta.env.DEV) {
|
||||
middlewares.push(createLogger({ collapsed: true, diff: true }));
|
||||
}
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: rootReducer,
|
||||
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
||||
serializableCheck: false,
|
||||
}).concat(middlewares),
|
||||
// middleware: middlewares,
|
||||
devTools: process.env.NODE_ENV !== 'production',
|
||||
enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(sentryReduxEnhancer)
|
||||
reducer: rootReducer,
|
||||
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
||||
serializableCheck: false,
|
||||
}).concat(middlewares),
|
||||
// middleware: middlewares,
|
||||
devTools: import.meta.env.DEV,
|
||||
enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(sentryReduxEnhancer)
|
||||
});
|
||||
|
||||
sagaMiddleWare.run(rootSaga);
|
||||
@@ -47,4 +47,4 @@ export default e;
|
||||
|
||||
if (window.Cypress) {
|
||||
window.store = store;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,12 +182,12 @@ export function* setInstanceIdSaga({payload: uid}) {
|
||||
fingerprint: result.visitorId,
|
||||
});
|
||||
|
||||
yield put(setLocalFingerprint(result.visitorId));
|
||||
yield delay(5 * 60 * 1000);
|
||||
if (process.env.NODE_ENV === "production") yield put(checkInstanceId(uid));
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
}
|
||||
yield put(setLocalFingerprint(result.visitorId));
|
||||
yield delay(5 * 60 * 1000);
|
||||
if (import.meta.env.PROD) yield put(checkInstanceId(uid));
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
}
|
||||
}
|
||||
|
||||
export function* onCheckInstanceId() {
|
||||
|
||||
@@ -19,15 +19,15 @@ const isLocalhost = Boolean(
|
||||
);
|
||||
|
||||
export function register(config) {
|
||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||
// from what our page is served on. This might happen if a CDN is used to
|
||||
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||
return;
|
||||
}
|
||||
if (import.meta.env.PROD && 'serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||
// from what our page is served on. This might happen if a CDN is used to
|
||||
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||
|
||||
@@ -13,14 +13,14 @@ const resources = {
|
||||
"es-MX": es_Translation,
|
||||
};
|
||||
i18n
|
||||
.use(initReactI18next)
|
||||
.use(LanguageDetector) // passes i18n down to react-i18next
|
||||
.init({
|
||||
resources,
|
||||
//lng: "en",
|
||||
detection: {},
|
||||
fallbackLng: "en-US",
|
||||
debug: process.env.NODE_ENV === "production" ? false : true,
|
||||
.use(initReactI18next)
|
||||
.use(LanguageDetector) // passes i18n down to react-i18next
|
||||
.init({
|
||||
resources,
|
||||
//lng: "en",
|
||||
detection: {},
|
||||
fallbackLng: "en-US",
|
||||
debug: import.meta.env.PROD ? false : true,
|
||||
|
||||
//keySeparator: false, // we do not use keys in form messages.welcome
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import axios from "axios";
|
||||
import {auth} from "../firebase/firebase.utils";
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
axios.defaults.baseURL =
|
||||
process.env.REACT_APP_AXIOS_BASE_API_URL || "https://api.imex.online/";
|
||||
}
|
||||
axios.defaults.baseURL =
|
||||
import.meta.env.VITE_APP_AXIOS_BASE_API_URL ||
|
||||
(
|
||||
import.meta.env.MODE === "production" ?
|
||||
"https://api.imex.online/" :
|
||||
"http://localhost:4000/"
|
||||
);
|
||||
|
||||
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
||||
async (config) => {
|
||||
|
||||
@@ -59,7 +59,7 @@ const range = [
|
||||
}
|
||||
];
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
if (import.meta.env.DEV) {
|
||||
range.push({
|
||||
label: 'Last Year',
|
||||
value: [
|
||||
|
||||
@@ -13,25 +13,25 @@ import {SentryLink} from "apollo-link-sentry";
|
||||
|
||||
//import { store } from "../redux/store";
|
||||
const httpLink = new HttpLink({
|
||||
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
|
||||
uri: import.meta.env.VITE_APP_GRAPHQL_ENDPOINT,
|
||||
});
|
||||
|
||||
const wsLink = new WebSocketLink({
|
||||
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT_WS,
|
||||
options: {
|
||||
lazy: true,
|
||||
reconnect: true,
|
||||
connectionParams: async () => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
if (token) {
|
||||
return {
|
||||
headers: {
|
||||
authorization: token ? `Bearer ${token}` : "",
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
uri: import.meta.env.VITE_APP_GRAPHQL_ENDPOINT_WS,
|
||||
options: {
|
||||
lazy: true,
|
||||
reconnect: true,
|
||||
connectionParams: async () => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
if (token) {
|
||||
return {
|
||||
headers: {
|
||||
authorization: token ? `Bearer ${token}` : "",
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const roundTripLink = new ApolloLink((operation, forward) => {
|
||||
@@ -144,8 +144,8 @@ const retryLink = new RetryLink({
|
||||
});
|
||||
|
||||
const middlewares = [];
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
middlewares.push(apolloLogger);
|
||||
if (import.meta.env.DEV) {
|
||||
middlewares.push(apolloLogger);
|
||||
}
|
||||
|
||||
middlewares.push(
|
||||
@@ -167,22 +167,22 @@ const cache = new InMemoryCache({
|
||||
});
|
||||
|
||||
const client = new ApolloClient({
|
||||
link: ApolloLink.from(middlewares),
|
||||
cache,
|
||||
connectToDevTools: process.env.NODE_ENV !== "production",
|
||||
defaultOptions: {
|
||||
watchQuery: {
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
errorPolicy: "ignore",
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: "network-only",
|
||||
errorPolicy: "all",
|
||||
},
|
||||
mutate: {
|
||||
errorPolicy: "all",
|
||||
},
|
||||
link: ApolloLink.from(middlewares),
|
||||
cache,
|
||||
connectToDevTools: import.meta.env.DEV,
|
||||
defaultOptions: {
|
||||
watchQuery: {
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
errorPolicy: "ignore",
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: "network-only",
|
||||
errorPolicy: "all",
|
||||
},
|
||||
mutate: {
|
||||
errorPolicy: "all",
|
||||
},
|
||||
},
|
||||
});
|
||||
export default client;
|
||||
|
||||
@@ -8,10 +8,9 @@ import {setEmailOptions} from "../redux/email/email.actions";
|
||||
import {store} from "../redux/store";
|
||||
import client from "../utils/GraphQLClient";
|
||||
import cleanAxios from "./CleanAxios";
|
||||
import {TemplateList} from "./TemplateConstants";
|
||||
import { TemplateList } from "./TemplateConstants";
|
||||
import {generateTemplate} from "./graphQLmodifier";
|
||||
|
||||
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
|
||||
const server = import.meta.env.VITE_APP_REPORTS_SERVER_URL;
|
||||
|
||||
jsreport.serverUrl = server;
|
||||
|
||||
@@ -480,4 +479,4 @@ function extend(o1, o2, o3) {
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
export default function InstanceRenderManager({ executeFunction, rome, promanager, imex, debug }) {
|
||||
let propToReturn = null;
|
||||
|
||||
switch (process.env.REACT_APP_INSTANCE) {
|
||||
switch (import.meta.env.VITE_APP_INSTANCE) {
|
||||
case 'IMEX':
|
||||
propToReturn = imex;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user