Minor bug fixing after smoke testing.

This commit is contained in:
Patrick Fic
2024-02-27 09:04:40 -08:00
parent 42aa42c892
commit 55ef205907
13 changed files with 149 additions and 142 deletions

View File

@@ -1,7 +1,7 @@
VITE_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
VITE_APP_GA_CODE=231099835
VITE_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDomain":"imex-dev.firebaseapp.com","databaseURL":"https://imex-dev.firebaseio.com","projectId":"imex-dev","storageBucket":"imex-dev.appspot.com","messagingSenderId":"759548147434","appId":"1:759548147434:web:e8239868a48ceb36700993","measurementId":"G-K5XRBVVB4S"}
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
VITE_APP_CLOUDINARY_API_KEY=957865933348715

View File

@@ -2,7 +2,7 @@ GENERATE_SOURCEMAP=true
VITE_APP_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.imex.online/v1/graphql
VITE_APP_GA_CODE=231103507
VITE_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDomain":"imex-prod.firebaseapp.com","databaseURL":"https://imex-prod.firebaseio.com","projectId":"imex-prod","storageBucket":"imex-prod.appspot.com","messagingSenderId":"253497221485","appId":"1:253497221485:web:3c81c483b94db84b227a64","measurementId":"G-NTWBKG2L0M"}
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
VITE_APP_CLOUDINARY_API_KEY=473322739956866

View File

@@ -1,7 +1,7 @@
VITE_APP_GRAPHQL_ENDPOINT=https://db.test.bodyshop.app/v1/graphql
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.test.bodyshop.app/v1/graphql
VITE_APP_GA_CODE=231099835
VITE_APP_FIREBASE_CONFIG={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"}
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
VITE_APP_CLOUDINARY_API_KEY=473322739956866

View File

@@ -11,24 +11,28 @@ let isDarkMode = false;
* @type {{components: {Menu: {itemDividerBorderColor: string}}}}
*/
const defaultTheme = {
components: {
Table: {
rowHoverBg: '#e7f3ff',
rowSelectedBg: '#e6f7ff',
headerSortHoverBg: 'transparent',
},
Menu: {
darkItemHoverBg: '#1677ff',
itemHoverBg: '#1677ff',
horizontalItemHoverBg: '#1677ff',
}
components: {
Table: {
rowHoverBg: '#e7f3ff',
rowSelectedBg: '#e6f7ff',
headerSortHoverBg: 'transparent',
},
token: {
colorPrimary: InstanceRenderMgr({
imex: "#1677ff",
rome:"#326ade"}) ,
colorInfo: "#326ade"
}
Menu: {
darkItemHoverBg: '#1890ff',
itemHoverBg: '#1890ff',
horizontalItemHoverBg: '#1890ff',
},
},
token: {
colorPrimary: InstanceRenderMgr({ //TODO:AIO Add in ProMan colors.
imex: '#1890ff',
rome: '#326ade',
}),
colorInfo: InstanceRenderMgr({
imex: '#1890ff',
rome: '#326ade',
}),
},
};
/**

View File

@@ -112,7 +112,7 @@ function Header({
promanager: HasFeatureAccess({ featureName: 'bills', bodyshop }),
})
) {
accountingChildren.push([
accountingChildren.push(
{
key: 'bills',
icon: <Icon component={FaFileInvoiceDollar} />,
@@ -128,8 +128,8 @@ function Header({
context: {},
});
},
},
]);
}
);
}
if (Simple_Inventory.treatment === 'on') {
@@ -378,7 +378,7 @@ function Header({
...(InstanceRenderManager({
imex: true,
rome: true,
promanager: false// HasFeatureAccess({ featureName: 'courtesycars', bodyshop }),
promanager: false, // HasFeatureAccess({ featureName: 'courtesycars', bodyshop }),
})
? [
{
@@ -587,9 +587,9 @@ function Header({
label: (
<Tooltip
title={`A more modern ${InstanceRenderManager({
imex: t("titles.imexonline"),
rome: t("titles.romeonline"),
promanager: t("titles.promanager")
imex: t('titles.imexonline'),
rome: t('titles.romeonline'),
promanager: t('titles.promanager'),
})} is ready for you to try! You can switch back at any time.`}
>
<InfoCircleOutlined />

View File

@@ -37,7 +37,7 @@ export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
const rdxStore = store.getState();
if (rdxStore.user.bodyshop.last_name_first && !forceFirstLast)
if (rdxStore.user?.bodyshop?.last_name_first && !forceFirstLast)
return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${
ownerObject?.ownr_co_nm || ""
}`.trim();

View File

@@ -29,9 +29,9 @@ export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoComponent);
export function ShopInfoComponent({bodyshop, form, saveLoading}) {
const {treatments: {CriticalPartsScanning, EnhancedPayroll}} = useSplitTreatments({
const {treatments: {CriticalPartsScanning, Enhanced_Payroll}} = useSplitTreatments({
attributes: {},
names: ["CriticalPartsScanning","EnhancedPayroll"],
names: ["CriticalPartsScanning","Enhanced_Payroll"],
splitKey: bodyshop.imexshopid,
});
@@ -95,14 +95,13 @@ export function ShopInfoComponent({bodyshop, form, saveLoading}) {
},
]
: []),
...EnhancedPayroll.treatment === "on" ? [
...Enhanced_Payroll.treatment === "on" ? [
{
key: 'task-presets',
label: t("bodyshop.labels.task-presets"),
children: <ShopInfoTaskPresets form={form}/>
}]: []
];
return (
<Card
extra={

View File

@@ -53,7 +53,7 @@ export function SignInComponent({
return (
<div className="login-container">
<div className="login-logo-container">
<img src={InstanceRenderManager({imex:ImEXOnlineLogo, rome:RomeLogo})} width={200} alt={InstanceRenderManager({imex:t("titles.imexonline"), rome: t("titles.romeonline"), promanager:t("titles.promanager")})}/>
<img src={InstanceRenderManager({imex:ImEXOnlineLogo, rome:RomeLogo, promanager:'https://www.web-est.com/img/web_est_logo_software.gif'})} width={200} alt={InstanceRenderManager({imex:t("titles.imexonline"), rome: t("titles.romeonline"), promanager:t("titles.promanager")})}/>
<Typography.Title>{
InstanceRenderManager({imex: t("titles.imexonline"), rome: t("titles.romeonline"), promanager:t("titles.promanager")})
}</Typography.Title>

View File

@@ -360,6 +360,8 @@ export function TimeTicketList({
dataSource={timetickets}
onChange={handleTableChange}
summary={() => {
if(Enhanced_Payroll.treatment === "on") return null;
if(Enhanced_Payroll.treatment === "off")
return (
<Table.Summary.Row>
<Table.Summary.Cell>

View File

@@ -143,14 +143,13 @@ const JobRelatedTicketsTable = ({
}, Dinero());
return {
id: `${item.jobKey}${costCenter}`,
costCenter,
item,
actHrs: actHrs.toFixed(1),
prodHrs: prodHrs.toFixed(1),
clockHrs,
...InstanceRenderManager({rome: {pay}})
id: `${item.jobKey}${costCenter}`,
costCenter,
item,
actHrs: actHrs.toFixed(1),
prodHrs: prodHrs.toFixed(1),
clockHrs,
...InstanceRenderManager({ imex: {}, rome: { pay } }),
};
});
})
@@ -210,7 +209,7 @@ const JobRelatedTicketsTable = ({
state.sortedInfo.columnKey === "clockHrs" && state.sortedInfo.order,
render: (text, record) => record.clockHrs.toFixed(2),
},
...InstanceRenderManager({rome:{
...InstanceRenderManager({ imex: [], rome:[{
title: "Pay",
dataIndex: "Pay",
key: "Pay",
@@ -218,7 +217,7 @@ const JobRelatedTicketsTable = ({
sortOrder:
state.sortedInfo.columnKey === "clockHrs" && state.sortedInfo.order,
render: (text, record) => record.pay.toFormat("$0.00"),
}})
}]})
,
{
title: t("general.labels.actions"),

View File

@@ -12,6 +12,7 @@ import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/applic
import {selectBodyshop} from "../../redux/user/user.selectors";
import ContractCreatePageComponent from "./contract-create.page.component";
import InstanceRenderManager from '../../utils/instanceRenderMgr';
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -122,6 +123,7 @@ export function ContractCreatePageContainer({
}, [t, setBreadcrumbs, setSelectedHeader]);
return (
<FeatureWrapperComponent featureName='courtesycars'>
<RbacWrapper action="contracts:create">
<Form
form={form}
@@ -137,6 +139,7 @@ export function ContractCreatePageContainer({
/>
</Form>
</RbacWrapper>
</FeatureWrapperComponent>
);
}

View File

@@ -107,31 +107,31 @@ export function JobsDetailPage({
// The union and spread is required to keep values coming in from the estimating system that aren't displayed.
parts_tax_rates: _.union(
Object.keys(job.parts_tax_rates),
Object.keys(values.parts_tax_rates)
Object.keys(values.parts_tax_rates || {})
).reduce((acc, val) => {
acc[val] = {
...job.parts_tax_rates[val],
...values.parts_tax_rates[val],
...values.parts_tax_rates?.[val], //TODO:AIO Verify that these still save for Rome Online with this null coalescing.
};
return acc;
}, {}),
materials: _.union(
Object.keys(job.materials),
Object.keys(values.materials)
Object.keys(values.materials|| {})
).reduce((acc, val) => {
acc[val] = {
...job.materials[val],
...values.materials[val],
...values.materials?.[val],
};
return acc;
}, {}),
cieca_pfl: _.union(
Object.keys(job.cieca_pfl),
Object.keys(values.cieca_pfl)
Object.keys(values.cieca_pfl|| {})
).reduce((acc, val) => {
acc[val] = {
...job.cieca_pfl[val],
...values.cieca_pfl[val],
...values.cieca_pfl?.[val],
};
return acc;
}, {}),

View File

@@ -11,7 +11,7 @@
// opt-in, read https://cra.link/PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
@@ -21,117 +21,117 @@ const isLocalhost = Boolean(
export function register(config) {
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);
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;
}
//TODO:AIO Resolve this for all 3 host names.
window.addEventListener('load', () => {
const swUrl = `service-worker.js`;
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://cra.link/PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://cra.link/PWA'
);
});
}
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://cra.link/PWA.'
);
navigator.serviceWorker
.register(swUrl)
.then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://cra.link/PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch((error) => {
console.error('Error during service worker registration:', error);
});
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch((error) => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: {'Service-Worker': 'script'},
})
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then((registration) => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log('No internet connection found. App is running in offline mode.');
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' },
})
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then((registration) => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log('No internet connection found. App is running in offline mode.');
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then((registration) => {
registration.unregister();
})
.catch((error) => {
console.error(error.message);
});
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then((registration) => {
registration.unregister();
})
.catch((error) => {
console.error(error.message);
});
}
}