-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
setInventoryInResDotLocals now selects more relations; simplified getInventoryDetails; fixed server-side deleteInventory; added seperate delete-confirmation-component; inventories are now deleteable; delete-inventory with working redirect; mat-typography in edit-stocks slider annotation; stocks are now deleteable; delete-stock with working redirect; openedOn now works (fixes #47); deleted old confirm-dialog html file in edit-thing folder; things are now deleteable; delete-thing with working redirect; changed boolena === false to (exclamation mark)boolean; moved the delete-confirmation dialog component away from edit-thing component into its own component which is used for all deletion activities; formatted authService; less logging; implemented deleteInventory in inventoryService; implemented deleteStock in stockService; formatted thingService
- Loading branch information
1 parent
1338fc4
commit 96a59f2
Showing
15 changed files
with
292 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/app/components/delete-confirmation-dialog/delete-confirmation-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<h1 mat-dialog-title *ngIf="!!data.inventory">Really delete {{data.inventory.name}}?</h1> | ||
<h1 mat-dialog-title *ngIf="!!data.thing">Really delete {{data.thing.name}}?</h1> | ||
<h1 mat-dialog-title *ngIf="!!data.stock">Really delete #{{data.stock.number}}?</h1> | ||
<div mat-dialog-content class="mat-typography"> | ||
<span *ngIf="!!data.inventory"> | ||
This will delete all things and categories of this inventory. <br> | ||
All stocks of all of its things will get deleted as well. <br> | ||
</span> | ||
<span *ngIf="!!data.thing"> | ||
All of its stocks will get deleted as well. <br> | ||
Categories will not be affected. <br> | ||
</span> | ||
<span *ngIf="!!data.stock"> | ||
It has {{data.stock.percentLeft}}% left. | ||
</span> | ||
<br> | ||
This action cannot be undone. | ||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-raised-button [mat-dialog-close]="false" color="primary">No</button> | ||
<button mat-stroked-button [mat-dialog-close]="true" color="warn">Yes</button> | ||
</div> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/components/delete-confirmation-dialog/delete-confirmation-dialog.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DeleteConfirmationDialogComponent } from './delete-confirmation-dialog.component'; | ||
|
||
describe('DeleteConfirmationDialogComponent', () => { | ||
let component: DeleteConfirmationDialogComponent; | ||
let fixture: ComponentFixture<DeleteConfirmationDialogComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DeleteConfirmationDialogComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DeleteConfirmationDialogComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
src/app/components/delete-confirmation-dialog/delete-confirmation-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Component, OnInit, Inject, Input } from "@angular/core"; | ||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material"; | ||
|
||
@Component({ | ||
selector: "app-delete-confirmation-dialog", | ||
templateUrl: "./delete-confirmation-dialog.component.html", | ||
styleUrls: ["./delete-confirmation-dialog.component.scss"] | ||
}) | ||
export class DeleteConfirmationDialogComponent<DialogData> implements OnInit { | ||
constructor( | ||
public dialogRef: MatDialogRef<DeleteConfirmationDialogComponent<DialogData>>, | ||
@Inject(MAT_DIALOG_DATA) public data: DialogData | ||
) {} | ||
|
||
ngOnInit(): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.