|
|
|
|
@@ -111,7 +111,8 @@
|
|
|
|
|
'/auth/google',
|
|
|
|
|
'google-auth',
|
|
|
|
|
'width=500,height=600,scrollbars=yes,resizable=yes,left=' +
|
|
|
|
|
Math.round(window.screen.width / 2 - 250) + ',top=' +
|
|
|
|
|
Math.round(window.screen.width / 2 - 250) +
|
|
|
|
|
',top=' +
|
|
|
|
|
Math.round(window.screen.height / 2 - 300)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@@ -190,7 +191,6 @@
|
|
|
|
|
cleanUp();
|
|
|
|
|
}
|
|
|
|
|
}, 60 * 1000); // Reduced from 3min to 1min
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error connecting to Google:', error);
|
|
|
|
|
authData.error = 'Failed to connect to Google';
|
|
|
|
|
@@ -332,7 +332,7 @@
|
|
|
|
|
const response = await fetch('/private/api/google/sheets/recent', {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
'Authorization': `Bearer ${localStorage.getItem('google_refresh_token')}`
|
|
|
|
|
Authorization: `Bearer ${localStorage.getItem('google_refresh_token')}`
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -363,7 +363,7 @@
|
|
|
|
|
const response = await fetch(`/private/api/google/sheets/${sheet.id}/data`, {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
'Authorization': `Bearer ${localStorage.getItem('google_refresh_token')}`
|
|
|
|
|
Authorization: `Bearer ${localStorage.getItem('google_refresh_token')}`
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -427,15 +427,13 @@
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="max-w-4xl mx-auto p-6">
|
|
|
|
|
<!-- Header -->
|
|
|
|
|
<StepNavigator {currentStep} {totalSteps} />
|
|
|
|
|
<!-- Header -->
|
|
|
|
|
<StepNavigator {currentStep} {totalSteps} />
|
|
|
|
|
|
|
|
|
|
<!-- Step Content -->
|
|
|
|
|
<div class="rounded-lg border border-gray-300 bg-white p-6 mb-4">
|
|
|
|
|
<!-- Step Content -->
|
|
|
|
|
<div class="mb-4 rounded border border-gray-300 bg-white p-6">
|
|
|
|
|
{#if currentStep === 0}
|
|
|
|
|
<GoogleAuthStep
|
|
|
|
|
bind:errors
|
|
|
|
|
onSuccess={(token) => {
|
|
|
|
|
authData.error = null;
|
|
|
|
|
authData.token = token;
|
|
|
|
|
@@ -450,20 +448,19 @@
|
|
|
|
|
{:else if currentStep === 1}
|
|
|
|
|
<EventDetailsStep bind:eventData />
|
|
|
|
|
{:else if currentStep === 2}
|
|
|
|
|
<GoogleSheetsStep bind:sheetsData bind:errors {loadRecentSheets} {selectSheet} {toggleSheetList} />
|
|
|
|
|
<GoogleSheetsStep
|
|
|
|
|
bind:sheetsData
|
|
|
|
|
{loadRecentSheets}
|
|
|
|
|
{selectSheet}
|
|
|
|
|
{toggleSheetList}
|
|
|
|
|
/>
|
|
|
|
|
{:else if currentStep === 3}
|
|
|
|
|
<EmailSettingsStep bind:emailData bind:errors />
|
|
|
|
|
<EmailSettingsStep bind:emailData />
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{#if errors.submit}
|
|
|
|
|
<div class="mt-4 p-3 bg-red-50 border border-red-200 rounded">
|
|
|
|
|
<p class="text-sm text-red-600">{errors.submit}</p>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Navigation -->
|
|
|
|
|
<StepNavigation
|
|
|
|
|
<!-- Navigation -->
|
|
|
|
|
<StepNavigation
|
|
|
|
|
{currentStep}
|
|
|
|
|
{totalSteps}
|
|
|
|
|
{canProceed}
|
|
|
|
|
@@ -471,5 +468,4 @@
|
|
|
|
|
{prevStep}
|
|
|
|
|
{nextStep}
|
|
|
|
|
{createEvent}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
/>
|
|
|
|
|
|