@paro.io/expert-shared-components 1.14.78 → 1.14.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import type { TaxAxisShellProps } from './types';
2
- export declare const TaxAxisShell: ({ taxAxisApi, userContext, initialSessionId, initialProfile, onSessionChange, documentUploadUrl, uploadBucketName, sessionDefaults, qboAuthorizeUrl, qboRedirectUri, expertId, qboConnected, qboCompanyName, }: TaxAxisShellProps) => JSX.Element;
2
+ export declare const TaxAxisShell: ({ taxAxisApi, userContext, initialSessionId, initialProfile, onSessionChange, documentUploadUrl, uploadBucketName, sessionDefaults, qboAuthorizeUrl, qboRedirectUri, onQboDisconnect, expertId, qboConnected, qboCompanyName, }: TaxAxisShellProps) => JSX.Element;
3
3
  export default TaxAxisShell;
@@ -148,7 +148,7 @@ function ShellContainer({ children, fullWidth = false, }) {
148
148
  return (react_1.default.createElement("div", { className: 'min-h-screen bg-tax-axis-navy text-white font-tax-axis-body' },
149
149
  react_1.default.createElement("div", { className: 'max-w-[960px] mx-auto px-5 py-7' }, children)));
150
150
  }
151
- const TaxAxisShell = ({ taxAxisApi, userContext = 'expert', initialSessionId, initialProfile, onSessionChange, documentUploadUrl, uploadBucketName, sessionDefaults, qboAuthorizeUrl, qboRedirectUri, expertId, qboConnected, qboCompanyName, }) => {
151
+ const TaxAxisShell = ({ taxAxisApi, userContext = 'expert', initialSessionId, initialProfile, onSessionChange, documentUploadUrl, uploadBucketName, sessionDefaults, qboAuthorizeUrl, qboRedirectUri, onQboDisconnect, expertId, qboConnected, qboCompanyName, }) => {
152
152
  const [step, setStep] = (0, react_1.useState)('SESSION_SETUP');
153
153
  const [profile, setProfile] = (0, react_1.useState)(initialProfile ? Object.assign({}, initialProfile) : null);
154
154
  const [sessionId, setSessionId] = (0, react_1.useState)(initialSessionId || null);
@@ -559,10 +559,12 @@ const TaxAxisShell = ({ taxAxisApi, userContext = 'expert', initialSessionId, in
559
559
  }), onContinue: handleAnalyzeDocuments, onBack: () => isProspectFlow ? setStep('PROSPECT_REPORT') : setStep('SESSION_SETUP'), qboConnected: qboConnectedState, qboCompanyName: qboCompanyNameState, qboAuthorizeUrl: qboAuthorizeUrl, qboRedirectUri: qboRedirectUri, qboClientConfirmed: qboConnectedState, onImportQboReport: taxAxisApi.importQboReport ? handleImportQboReport : undefined, onQboConnected: (companyName) => {
560
560
  setQboConnectedState(true);
561
561
  setQboCompanyNameState(companyName);
562
- }, onQboDisconnected: () => {
562
+ }, onQboDisconnected: () => __awaiter(void 0, void 0, void 0, function* () {
563
+ if (onQboDisconnect)
564
+ yield onQboDisconnect();
563
565
  setQboConnectedState(false);
564
566
  setQboCompanyNameState(null);
565
- } })));
567
+ }) })));
566
568
  case 'PROCESSING':
567
569
  return (react_1.default.createElement(ShellContainer, null,
568
570
  react_1.default.createElement(TaxAxisProcessing_1.TaxAxisProcessing, { profile: profile, userContext: userContext, reportReady: reportReady, onComplete: () => setStep('DASHBOARD') })));
@@ -16,6 +16,7 @@ export type TaxAxisShellProps = {
16
16
  qboAuthorizeUrl?: string;
17
17
  qboGetClientsUrl?: string;
18
18
  qboRedirectUri?: string;
19
+ onQboDisconnect?: () => Promise<void>;
19
20
  expertId?: string;
20
21
  qboConnected?: boolean;
21
22
  qboCompanyName?: string | null;
@@ -14,6 +14,6 @@ export declare function useQboFlow({ qboConnected, qboCompanyName, qboAuthorizeU
14
14
  handleCompanySelected: (company: QboCompany) => void;
15
15
  handleReportsConfirmed: (reportIds: string[]) => Promise<void>;
16
16
  handleMappingConfirm: () => Promise<void>;
17
- handleDisconnect: () => void;
17
+ handleDisconnect: () => Promise<void>;
18
18
  closeModal: () => void;
19
19
  };
@@ -166,14 +166,16 @@ function useQboFlow({ qboConnected, qboCompanyName, qboAuthorizeUrl, qboRedirect
166
166
  const handleMappingConfirm = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
167
167
  yield handleReportsConfirmed(selectedReports);
168
168
  }), [handleReportsConfirmed, selectedReports]);
169
- const handleDisconnect = (0, react_1.useCallback)(() => {
169
+ const handleDisconnect = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
170
+ if (!window.confirm("Are you sure you want to disconnect QuickBooks? This will stop data imports for this account."))
171
+ return;
170
172
  setSelectedCompany(null);
171
173
  setSelectedReports([]);
172
174
  setImportStepIndex(0);
173
175
  setModalStep("closed");
174
176
  if (onQboDisconnected)
175
- onQboDisconnected();
176
- }, [onQboDisconnected]);
177
+ yield onQboDisconnected();
178
+ }), [onQboDisconnected]);
177
179
  const closeModal = (0, react_1.useCallback)(() => {
178
180
  setModalStep("closed");
179
181
  setError(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.14.78",
3
+ "version": "1.14.79",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {