Skip to content

Code Reference — jbwui

High-level guide to the front-end code. All paths relative to st-integration/jbwui/src/.

FileResponsibility
index.jsCRA entry; renders <App/> in StrictMode
App.jsRouter (createBrowserRouter) + providers: AuthProvider, MUI ThemeProvider, CssBaseline
AuthContext.jsxGlobal auth/session provider: current user, Cognito session, group/role, dealer, onboarding state, sign-in/out, proactive token refresh (60 s loop, refresh <5 min to expiry), 30-min idle timeout, session-expired dialog. Persists token to localStorage
RouteGuard.jsxRedirects unauthenticated users to /
hooks/useIdleTimer.jsActivity-based idle timer with pause/resume
layouts/RootLayout.jsPublic shell (bare <Outlet/>)
layouts/HomeLayout.jsAuthenticated shell: TopBar + Sidebar + content outlet
layouts/OnboardingLayout.jsxWizard card shell for the onboarding steps
themes/theme.jsActive MUI theme (custom palette + typography variants). Other files in themes/ are unused factories
utils/encryption.jsAES encrypt/decrypt (crypto-js) for signin/reset URL payloads — ⚠ hardcoded key
FileScreen
SignIn.jsLogin; handles invited-user autofill (/signin/:id encrypted payload), routes by role post-login
Register.jsDealer/user self-registration (Register_old.js is a legacy copy)
VerifyUser.js / ResetPassword.js / ChangePassword.jsForgot-password initiate / reset with code / forced new-password
Overview.jsAdmin dashboard: DealerCards KPIs + LatestOnboardingCard + JbwAdminTools
DealerDetails.jsxDealer dashboard: DealerInfo, KPIs, TenantsList, AgreementsClaimsTabs, release-notes dialog
Onboarding.jsDealer list (ClientGrid) + onboard new dealer + per-dealer tenant sync
AgreementsSyncHome.jsxAgreement sync console: 3 tabs via AgreementSyncGrid, admin dealer search, sync trigger
UsersList.jsUser management (delegates to sections/users/userscard.jsx)
TransactionLogs.jsxSync/transmission logs
JBWarrantiesFrame.jsxJB&Associates claims iframe embed
ToDoHome.jsxEmail-notification/to-do inbox
onboarding/ClientName.jsxClientLocation.jsxClientPlatform.jsxClientCustom.jsx / ClientId.jsx (ServiceTitan) or ClientAccountId.jsx (Workiz) → CLientConnect.jsx4–5-step onboarding wizard; platform choice branches the path; final step calls createNewOnboarding

Components (components/, ~72 files) — by group

Section titled “Components (components/, ~72 files) — by group”

Chrome/navigation: Sidebar.jsx (role-based menu), TopBar.jsx (greeting, admin global dealer search, release notes, contact support, user menu, staging banner), UserProfileMenu.jsx, GlobalLoader.jsx (listens to api-loading events), SessionExpiredDialog.jsx.

Admin tools: JbwAdminTools.jsx (vertical-tab launcher) → DealerAdminTool.jsx, AddDealerTOJB360Tool.jsx, InvoiceAdminTools.jsx, ClaimManagmentAdminTool.jsx, DealerSummaryAdminTool.jsx, InvoiceSummary.jsx, ClaimsAdminTool.jsx.

Agreements & sync: AgreementsClaimsTabs.jsx (Agreements/Claims/Invoices tabs), AgreementList.jsx, AgreementsGrid.jsx, AgreementSyncGrid.jsx (the match/approve grid), AgreementDetails.jsx, AgreementInfo.jsx, AgreementEquipmentForm.jsx + Agm* equipment dialogs, AgreementSyncFileUpload.jsx, AgreementSyncDataDownload.jsx / AgreementSyncDownloadMenu.jsx, NewAgreementDialog.jsx, DuplicateAgreementCreateDialog.jsx, EquipmentsTable.jsx.

Claims: ClaimsList.jsx, ClaimsGrid.jsx, CreateClaimDialog.jsx, DuplicateClaimDialog.jsx, PotentialClaimsCreateDialog.jsx, DownloadClaimsTool.jsx, JBWClaimsIframDialog.jsx (postMessage bridge to jbandassociates.biz).

Invoices: InvoiceList.jsx, InvoiceDetailsDialog.jsx, InvoiceSummary.jsx.

Dealer/tenant: DealerSearch.jsx, AdminDealerSearch.jsx, DealerForm.jsx, ClientGrid.jsx, TenantsList.jsx, TenantGrid.jsx, TenantsDialog.jsx, TenantsMultiSelect.jsx, BusinessUnitSelect.jsx, STLocationSearch.jsx / STLocationSearchPopup.jsx, TblProductsSearch.jsx.

Auth dialogs: ChangePasswordDialog.jsx, ResetPasswordDialog.jsx, UserRegistrationDialog.jsx.

Logs: TransmissionDetailsList.jsx, TransmissionGrid.jsx, TransmissionDetails.jsx.

Primitives/misc: IconTextField.jsx, JbwSwitch.jsx, JbwAvatar.jsx, JBWDateLabel.jsx, JBWAlertDialog.jsx, JBWReleasaNotesDialog.jsx, ContactUsDialog.jsx, EmailNotificationBtn.jsx, CopyToClipboardButton.jsx, GradientCircularProgress.jsx, ClientProgressBar.jsx, RevenueChart.jsx, MultiSelectChipsComponent.jsx, gridNoRowOverLay.jsx.

Sections (sections/): dealerdetails/DealerCards.jsx, dealerdetails/DealerInfo.jsx, overview/latestOnboardingCard.jsx, overview/RevenueCard.jsx, users/userscard.jsx.

All in services/, all through the shared axios instance (services/configs/axiosConfig.js, baseURL = REACT_APP_AWS_GATEWAY_BASE_URL). Cognito config in services/configs/cognitoConfig.js; auth operations in services/jbwAuthServices.js.

ModuleEndpoints (relative to gateway)
agreementServices.jsGET agreements/dealer/{dealerId}; GET/POST/PATCH agreements/{id}/equipments; GET agreements/{id}/agreementdetails; POST agreements/{id}/duplicateagreement; PUT agreements/{id}/equipmentsync; GET agreements/dealer/{id}/invoicesearch; POST agreements/dealer/{id}/newinvoiceagreement; GET agreements/dealer/{id}/stequipments; PATCH agreements/{id}/updateinfo; GET agreements/jbw/{id}; GET agreements/{id}/getstinstalledequipment; GET /stlocations/search/tenant
agreementMatchDataService.jsGET agreementsync/{dealerId} (paged/tabbed); PUT agreementsync/{matchId}/location; PUT agreementsync/approve; GET agreementsync/{dealerId}/spcall (sync trigger); POST agreementsync/{dealerId}/fileupload; PATCH agreementsync/dismissagreement; PUT agreementsync/{matchId}/update
ClaimsServices.jsGET claims/{dealerId}; PATCH claims/reject/{id}; PATCH claims/claimidupdate/{id}; PATCH /claims/stupdate; GET claims/search; GET claims/{dealerId}/download; PUT claims/admtools; PUT claims/claimidupdate; POST claims/{dealerId}/createpotentialclaim
dealerServices.jsGET /dealer/{id}/verify, /onboard, /cardsdata, /transmissiondetails(+history), /gettenantinfo, /getworkizinfo; PATCH /dealer/{id}; POST newdealeronboard; GET /dealer/nononboardedlist, /latestonboardeddealers, /pendinglist, /dealer?key=&type=; PUT /dealer/{id}/admtools; dealer location lookups; POST dealer
dealerRegisterServices.jsPOST dealerregister/add; GET dealerregister(...); PUT dealerregister/userstatus; PATCH dealerregister/{id}/updatereleasenotestatus
dealeronboard.jsGET /dealeronboard; GET dealeronboard/search?key=
tenantServices.jsGET /tenant/{id}, /tenant/dealer/{dealerId}; PATCH /tenant/{id}; PUT /tenant/{id}/autoprocessagreement
InvoiceService.jsGET /invoices/invoicedetails/{id}; GET /invoices?...; GET /invoices/summarylist; PATCH /invoices?...
emailNotifcationService.jsGET/PATCH emailnotifications; POST /agreements/sendagreementemail
signupService.jsPOST /signup, /changepassword, /resetpassword
stlocationService.jsGET stlocations/search/{dealerid}
equipmentService.jsGET /equipment/types
TblProductsServices.jsGET tblproducts/search?key=
adminDashboardServices.jsGET admindashboard/cardsdata
customDataServices.jsGET /customdata
contactusService.jsPOST contactus
JWBServiceTitenService.jsPOST /jbwservicetitan (ST credential verify)
JBWServiceWorkizService.jsGET /workiz/accountverify
JBWAgreementsService.jsGET /jbwagreements/agreement/{jbwAgreementID}
jbwAuthServices.jsCognito (non-HTTP): signUp/confirm, authenticate, forgot/confirm password, new-password challenge, getSession/refreshSession, signOut