2021
client/package-lock.json
generated
2021
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -132,7 +132,6 @@
|
|||||||
"@babel/preset-react": "^7.23.3",
|
"@babel/preset-react": "^7.23.3",
|
||||||
"@emotion/babel-plugin": "^11.11.0",
|
"@emotion/babel-plugin": "^11.11.0",
|
||||||
"@emotion/react": "^11.11.3",
|
"@emotion/react": "^11.11.3",
|
||||||
"@sentry/webpack-plugin": "^2.10.2",
|
|
||||||
"@swc/core": "^1.3.104",
|
"@swc/core": "^1.3.104",
|
||||||
"@swc/plugin-styled-components": "^1.5.108",
|
"@swc/plugin-styled-components": "^1.5.108",
|
||||||
"@testing-library/cypress": "^10.0.1",
|
"@testing-library/cypress": "^10.0.1",
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const devTheme = {
|
|||||||
*/
|
*/
|
||||||
const prodTheme = {};
|
const prodTheme = {};
|
||||||
|
|
||||||
const currentTheme = process.env.NODE_ENV === "development" ? devTheme
|
const currentTheme = import.meta.env.DEV ? devTheme
|
||||||
: prodTheme;
|
: prodTheme;
|
||||||
|
|
||||||
const finaltheme = {
|
const finaltheme = {
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
|||||||
async function getCostingData() {
|
async function getCostingData() {
|
||||||
if (data && data.monthly_sales) {
|
if (data && data.monthly_sales) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
console.log('defaults:')
|
||||||
|
console.dir(axios.defaults);
|
||||||
const response = await axios.post("/job/costingmulti", {
|
const response = await axios.post("/job/costingmulti", {
|
||||||
jobids: data.monthly_sales.map((x) => x.id),
|
jobids: data.monthly_sales.map((x) => x.id),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { ConfigProvider } from "antd";
|
|||||||
// Dinero.globalLocale = "en-CA";
|
// Dinero.globalLocale = "en-CA";
|
||||||
Dinero.globalRoundingMode = "HALF_EVEN";
|
Dinero.globalRoundingMode = "HALF_EVEN";
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "development") {
|
if (import.meta.env.PROD) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
|
dsn: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
|
||||||
ignoreErrors: [
|
ignoreErrors: [
|
||||||
@@ -38,7 +38,7 @@ if (process.env.NODE_ENV !== "development") {
|
|||||||
// // If the entire session is not sampled, use the below sample rate to sample
|
// // If the entire session is not sampled, use the below sample rate to sample
|
||||||
// // sessions when an error occurs.
|
// // sessions when an error occurs.
|
||||||
// replaysOnErrorSampleRate: 1.0,
|
// replaysOnErrorSampleRate: 1.0,
|
||||||
environment: process.env.NODE_ENV,
|
environment: import.meta.env.MODE,
|
||||||
// tracesSampleRate: 0.2,
|
// tracesSampleRate: 0.2,
|
||||||
// We recommend adjusting this value in production, or using tracesSampler
|
// We recommend adjusting this value in production, or using tracesSampler
|
||||||
// for finer control
|
// for finer control
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export default function AboutPage() {
|
|||||||
<div style={{ textAlign: "center", margin: "1rem 0rem" }}>
|
<div style={{ textAlign: "center", margin: "1rem 0rem" }}>
|
||||||
<Typography.Title
|
<Typography.Title
|
||||||
level={2}
|
level={2}
|
||||||
>{`ImEX Online V.${process.env.NODE_ENV}-${import.meta.env.VITE_APP_GIT_SHA}`}</Typography.Title>
|
>{`ImEX Online V.${import.meta.env.MODE}-${import.meta.env.VITE_APP_GIT_SHA}`}</Typography.Title>
|
||||||
<Typography.Title level={4}>
|
<Typography.Title level={4}>
|
||||||
© 2019 - {new Date().getFullYear()} Snapt Software Inc. used under
|
© 2019 - {new Date().getFullYear()} Snapt Software Inc. used under
|
||||||
license to ImEX Systems Inc.
|
license to ImEX Systems Inc.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
|
export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
|
||||||
|
|
||||||
export const socket = SocketIO(
|
export const socket = SocketIO(
|
||||||
process.env.NODE_ENV === "production"
|
import.meta.env.PROD
|
||||||
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
|
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
|
||||||
: window.location.origin,
|
: window.location.origin,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
|
export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
|
||||||
|
|
||||||
export const socket = SocketIO(
|
export const socket = SocketIO(
|
||||||
process.env.NODE_ENV === "production"
|
import.meta.env.PROD
|
||||||
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
|
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
|
||||||
: window.location.origin,
|
: window.location.origin,
|
||||||
// "http://localhost:4000", // for dev testing,
|
// "http://localhost:4000", // for dev testing,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const middlewares = [
|
|||||||
createStateSyncMiddleware(reduxSyncConfig),
|
createStateSyncMiddleware(reduxSyncConfig),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "development") {
|
if (import.meta.env.DEV) {
|
||||||
middlewares.push(createLogger({ collapsed: true, diff: true }));
|
middlewares.push(createLogger({ collapsed: true, diff: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ export const store = configureStore({
|
|||||||
serializableCheck: false,
|
serializableCheck: false,
|
||||||
}).concat(middlewares),
|
}).concat(middlewares),
|
||||||
// middleware: middlewares,
|
// middleware: middlewares,
|
||||||
devTools: process.env.NODE_ENV !== 'production',
|
devTools: import.meta.env.DEV,
|
||||||
enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(sentryReduxEnhancer)
|
enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(sentryReduxEnhancer)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export function* setInstanceIdSaga({ payload: uid }) {
|
|||||||
|
|
||||||
yield put(setLocalFingerprint(result.visitorId));
|
yield put(setLocalFingerprint(result.visitorId));
|
||||||
yield delay(5 * 60 * 1000);
|
yield delay(5 * 60 * 1000);
|
||||||
if (process.env.NODE_ENV === "production") yield put(checkInstanceId(uid));
|
if (import.meta.env.PROD) yield put(checkInstanceId(uid));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("error", error);
|
console.log("error", error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const isLocalhost = Boolean(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export function register(config) {
|
export function register(config) {
|
||||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
if (import.meta.env.PROD && 'serviceWorker' in navigator) {
|
||||||
// The URL constructor is available in all browsers that support SW.
|
// The URL constructor is available in all browsers that support SW.
|
||||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||||
if (publicUrl.origin !== window.location.origin) {
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ i18n
|
|||||||
//lng: "en",
|
//lng: "en",
|
||||||
detection: {},
|
detection: {},
|
||||||
fallbackLng: "en-US",
|
fallbackLng: "en-US",
|
||||||
debug: process.env.NODE_ENV === "production" ? false : true,
|
debug: import.meta.env.PROD ? false : true,
|
||||||
|
|
||||||
//keySeparator: false, // we do not use keys in form messages.welcome
|
//keySeparator: false, // we do not use keys in form messages.welcome
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,26 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { auth } from "../firebase/firebase.utils";
|
import {auth} from "../firebase/firebase.utils";
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
axios.defaults.baseURL =
|
||||||
axios.defaults.baseURL =
|
import.meta.env.VITE_APP_AXIOS_BASE_API_URL ||
|
||||||
import.meta.env.VITE_APP_AXIOS_BASE_API_URL || "https://api.imex.online/";
|
(
|
||||||
}
|
import.meta.env.MODE === "production" ?
|
||||||
|
"https://api.imex.online/" :
|
||||||
|
"http://localhost:4000/"
|
||||||
|
);
|
||||||
|
|
||||||
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
||||||
async (config) => {
|
async (config) => {
|
||||||
if (!config.headers.Authorization) {
|
if (!config.headers.Authorization) {
|
||||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers.Authorization = `Bearer ${token}`;
|
config.headers.Authorization = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error) => Promise.reject(error)
|
(error) => Promise.reject(error)
|
||||||
);
|
);
|
||||||
|
|
||||||
const cleanAxios = axios.create();
|
const cleanAxios = axios.create();
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ const retryLink = new RetryLink({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const middlewares = [];
|
const middlewares = [];
|
||||||
if (process.env.NODE_ENV === "development") {
|
if (import.meta.env.DEV) {
|
||||||
middlewares.push(apolloLogger);
|
middlewares.push(apolloLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ const cache = new InMemoryCache({
|
|||||||
const client = new ApolloClient({
|
const client = new ApolloClient({
|
||||||
link: ApolloLink.from(middlewares),
|
link: ApolloLink.from(middlewares),
|
||||||
cache,
|
cache,
|
||||||
connectToDevTools: process.env.NODE_ENV !== "production",
|
connectToDevTools: import.meta.env.DEV,
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
watchQuery: {
|
watchQuery: {
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
|
|||||||
Reference in New Issue
Block a user