Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -49,6 +52,7 @@ export class AddonDialogService {
accountName: selectedAccount.displayName,
}),
selectedAccount,
isGoogleDrive,
},
});

Expand Down
Loading