Skip to content

Commit

Permalink
Merge pull request #277 from Service-Soft/fix-unsaved-changes-guard-w…
Browse files Browse the repository at this point in the history
…ith-dialogs

fixed
  • Loading branch information
tim-fabian authored Jun 4, 2024
2 parents d1c7c30 + b9451d4 commit a233b61
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# The branch, tag or SHA to checkout. When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# runs npm i inside the root directory
- name: npm i root
run: |
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-material-entity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-material-entity",
"version": "18.0.0",
"version": "18.0.1",
"license": "MIT",
"keywords": [
"angular",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export class NgxMatEntityCreateDialogComponent<EntityType extends BaseEntityType
}
private async confirmCreate(): Promise<void> {
await this.entityService.create(this.data.entity);
this.unsavedChanges.emit(false);
this.dialogRef.close();
}

Expand Down Expand Up @@ -170,6 +171,7 @@ export class NgxMatEntityCreateDialogComponent<EntityType extends BaseEntityType
}
}
private confirmCancel(): void {
this.unsavedChanges.emit(false);
this.dialogRef.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class NgxMatEntityEditDialogComponent<EntityType extends BaseEntityType<E

private async confirmEdit(): Promise<void> {
await this.entityService.update(this.data.entity, this.entityPriorChanges);
this.unsavedChanges.emit(false);
this.dialogRef.close(1);
}

Expand Down Expand Up @@ -225,6 +226,7 @@ export class NgxMatEntityEditDialogComponent<EntityType extends BaseEntityType<E

private async confirmDelete(): Promise<void> {
await this.entityService.delete(this.entityPriorChanges);
this.unsavedChanges.emit(false);
this.dialogRef.close(2);
}

Expand Down Expand Up @@ -254,6 +256,7 @@ export class NgxMatEntityEditDialogComponent<EntityType extends BaseEntityType<E
}
private confirmCancel(): void {
EntityUtilities.resetChangesOnEntity(this.data.entity, this.entityPriorChanges);
this.unsavedChanges.emit(false);
this.dialogRef.close(0);
}

Expand Down

0 comments on commit a233b61

Please sign in to comment.