diff --git a/src/app/features/project/project-addons/components/configure-addon/configure-addon.component.ts b/src/app/features/project/project-addons/components/configure-addon/configure-addon.component.ts index 17bfd6e70..bda7efa20 100644 --- a/src/app/features/project/project-addons/components/configure-addon/configure-addon.component.ts +++ b/src/app/features/project/project-addons/components/configure-addon/configure-addon.component.ts @@ -180,7 +180,11 @@ export class ConfigureAddonComponent implements OnInit { } ngOnInit(): void { - this.handleCreateOperationInvocation(OperationNames.GET_ITEM_INFO, this.selectedStorageItemId()); + if (!this.isGoogleDrive()) { + this.handleCreateOperationInvocation(OperationNames.GET_ITEM_INFO, this.selectedStorageItemId()); + } else { + this.isEditMode.set(true); + } } handleDisconnectAccount(): void { @@ -206,8 +210,16 @@ export class ConfigureAddonComponent implements OnInit { toggleEditMode(): void { if (!this.isEditMode()) { this.resetConfigurationForm(); - this.handleCreateOperationInvocation(OperationNames.LIST_ROOT_ITEMS, this.selectedStorageItemId()); + if (!this.isGoogleDrive()) { + this.handleCreateOperationInvocation(OperationNames.LIST_ROOT_ITEMS, this.selectedStorageItemId()); + } else { + this.handleCreateOperationInvocation(OperationNames.GET_ITEM_INFO, this.selectedStorageItemId()); + } } else { + if (this.isGoogleDrive()) { + this.router.navigate([`${this.baseUrl()}/addons`]); + return; + } this.handleCreateOperationInvocation(OperationNames.GET_ITEM_INFO, this.addon()!.selectedStorageItemId); } diff --git a/src/app/features/project/project-addons/components/confirm-account-connection-modal/confirm-account-connection-modal.component.ts b/src/app/features/project/project-addons/components/confirm-account-connection-modal/confirm-account-connection-modal.component.ts index 4c98f9ddc..5c098c638 100644 --- a/src/app/features/project/project-addons/components/confirm-account-connection-modal/confirm-account-connection-modal.component.ts +++ b/src/app/features/project/project-addons/components/confirm-account-connection-modal/confirm-account-connection-modal.component.ts @@ -32,8 +32,15 @@ export class ConfirmAccountConnectionModalComponent { handleConnectAddonAccount(): void { const selectedAccount = this.dialogConfig.data.selectedAccount; + const isGoogleDrive = this.dialogConfig.data.isGoogleDrive; + if (!selectedAccount) return; + if (isGoogleDrive) { + this.dialogRef.close({ success: true }); + return; + } + const payload = this.operationInvocationService.createInitialOperationInvocationPayload( OperationNames.LIST_ROOT_ITEMS, selectedAccount diff --git a/src/app/features/project/project-addons/components/connect-configured-addon/connect-configured-addon.component.ts b/src/app/features/project/project-addons/components/connect-configured-addon/connect-configured-addon.component.ts index 2c11cabb6..1d9c77d8d 100644 --- a/src/app/features/project/project-addons/components/connect-configured-addon/connect-configured-addon.component.ts +++ b/src/app/features/project/project-addons/components/connect-configured-addon/connect-configured-addon.component.ts @@ -222,7 +222,10 @@ export class ConnectConfiguredAddonComponent { if (!this.selectedAccount()) return; - const dialogRef = this.addonDialogService.openConfirmAccountConnectionDialog(this.selectedAccount()); + const dialogRef = this.addonDialogService.openConfirmAccountConnectionDialog( + this.selectedAccount(), + this.isGoogleDrive() + ); dialogRef.subscribe((result) => { if (result?.success) { diff --git a/src/app/features/project/project-addons/services/addon-dialog.service.ts b/src/app/features/project/project-addons/services/addon-dialog.service.ts index e1ba2fe3d..dc324b48b 100644 --- a/src/app/features/project/project-addons/services/addon-dialog.service.ts +++ b/src/app/features/project/project-addons/services/addon-dialog.service.ts @@ -37,7 +37,10 @@ export class AddonDialogService { return dialogRef.onClose; } - openConfirmAccountConnectionDialog(selectedAccount: AuthorizedAccountModel): Observable<{ success: boolean }> { + openConfirmAccountConnectionDialog( + selectedAccount: AuthorizedAccountModel, + isGoogleDrive = false + ): Observable<{ success: boolean }> { const dialogRef = this.dialogService.open(ConfirmAccountConnectionModalComponent, { focusOnShow: false, header: this.translateService.instant('settings.addons.connectAddon.confirmAccount'), @@ -49,6 +52,7 @@ export class AddonDialogService { accountName: selectedAccount.displayName, }), selectedAccount, + isGoogleDrive, }, });