Skip to content

Commit

Permalink
adjust code for promptservice.open()
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator committed Jul 27, 2023
1 parent c22eb3e commit ff99371
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ export class AssignmentDetailComponent extends BaseMeetingComponent implements O
*/
public async onDeleteAssignmentButton(): Promise<void> {
const title = this.translate.instant(`Are you sure you want to delete this election?`);
if (await this.promptService.open(title, this.assignment.getTitle())) {
const content = this.assignment.getTitle();
if (await this.promptService.open(title, content)) {
this.assignmentRepo
.delete(this.assignment)
.then(() => this.router.navigate([this.activeMeetingId, `assignments`]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ export class ChatGroupDetailComponent extends BaseMeetingComponent implements On

public async clearChatGroup(chatGroup: ViewChatGroup): Promise<void> {
const title = this.translate.instant(`Are you sure you want to clear all messages in this chat?`);
if (await this.promptService.open(title, chatGroup.name)) {
const content = chatGroup.name;
if (await this.promptService.open(title, content)) {
await this.repo.clear(chatGroup).catch(this.raiseError);
this.triggerUpdateView();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ export class ProjectorDetailComponent extends BaseMeetingComponent implements On
*/
public async onDeleteProjectorButton(): Promise<void> {
const title = this.translate.instant(`Are you sure you want to delete this projector?`);
if (this.projector && (await this.promptService.open(title, this.projector.name))) {
const content = this.projector.name;
if (this.projector && (await this.promptService.open(title, content))) {
this.repo.delete(this.projector);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export class ProjectorListEntryComponent {
*/
public async onDeleteButton(): Promise<void> {
const title = this.translate.instant(`Are you sure you want to delete this projector?`);
if (await this.promptService.open(title, this.projector.name)) {
const content = this.projector.name;
if (await this.promptService.open(title, content)) {
this.repo.delete(this.projector);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export class OrganizationTagListComponent extends BaseListViewComponent<ViewOrga
}

public async deleteOrganizationTags(...orgaTags: ViewOrganizationTag[]): Promise<void> {
const dialogTitle =
const title =
orgaTags.length === 1
? this.translate.instant(`Are you sure you want to delete this tag?`)
: this.translate.instant(`Are you sure you want to delete all selected tags?`);
const dialogSubtitle = orgaTags.length === 1 ? orgaTags[0].name : ``;
if (await this.promptService.open(dialogTitle, dialogSubtitle)) {
const content = orgaTags.length === 1 ? orgaTags[0].name : ``;
if (await this.promptService.open(title, content)) {
await this.repo.delete(...orgaTags);
}
}
Expand Down

0 comments on commit ff99371

Please sign in to comment.