diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts index 2b8ba1b..f806d1f 100644 --- a/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-settings/telegram-settings.component.ts @@ -4,6 +4,7 @@ import { Observer, Observable } from 'rxjs'; import { TelegramInfoDialogComponent } from '../telegram-info-dialog/telegram-info-dialog.component'; import { MatDialog } from '@angular/material/dialog'; import { TelegramDialogComponent } from '../telegram-dialog/telegram-dialog.component'; +import { YesNoDialogComponent } from 'src/app/shared/yes-no-dialog/yes-no-dialog.component'; @Component({ selector: 'app-telegram-settings', @@ -32,11 +33,23 @@ export class TelegramSettingsComponent implements OnInit { } onDelete(telegramId) { - this.telegramService - .deleteTelegram(telegramId, this.hoodId) - .subscribe(() => { - this.reload(); - }); + const dialogRef = this.dialog.open(YesNoDialogComponent, { + data: { + title: 'Warning', + content: + 'This will also delete the list of subscribers of the telegram bot.', + }, + }); + + dialogRef.afterClosed().subscribe((response) => { + if (response) { + this.telegramService + .deleteTelegram(telegramId, this.hoodId) + .subscribe(() => { + this.reload(); + }); + } + }); } onCreate() { diff --git a/kibicara-frontend/src/app/shared/shared.module.ts b/kibicara-frontend/src/app/shared/shared.module.ts index b1c4786..5ea0155 100644 --- a/kibicara-frontend/src/app/shared/shared.module.ts +++ b/kibicara-frontend/src/app/shared/shared.module.ts @@ -6,9 +6,10 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { CommonModule } from '@angular/common'; import { Ng2SearchPipeModule } from 'ng2-search-filter'; +import { YesNoDialogComponent } from './yes-no-dialog/yes-no-dialog.component'; @NgModule({ - declarations: [ToolbarComponent, NotFoundComponent], + declarations: [ToolbarComponent, NotFoundComponent, YesNoDialogComponent], imports: [ MaterialModule, ReactiveFormsModule, diff --git a/kibicara-frontend/src/app/shared/yes-no-dialog/yes-no-dialog.component.html b/kibicara-frontend/src/app/shared/yes-no-dialog/yes-no-dialog.component.html new file mode 100644 index 0000000..0cec175 --- /dev/null +++ b/kibicara-frontend/src/app/shared/yes-no-dialog/yes-no-dialog.component.html @@ -0,0 +1,8 @@ +