Moved delete dialog so formula manger can use it

This commit is contained in:
2018-07-17 20:43:26 -04:00
parent dc54530028
commit ce8ac6637a
4 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import {NewCategoryComponent} from '../newCategory/newCategory.component';
import {AppComponent} from '../../app.component';
import {DomSanitizer} from '@angular/platform-browser';
import {NewProductComponent} from '../newProduct/newProduct.component';
import {DeleteComponent} from '../delete/delete.component';
import {DeleteComponent} from '../../delete/delete.component';
@Component({
selector: 'store',

View File

@ -1,13 +0,0 @@
<mat-dialog-content>
<h3 mat-dialog-title>Delete {{data.name}}</h3>
<p>You are about to delete {{data.name}}. This cannot be undone.
<br>
<br> please enter
<span style="background-color: #ffff00">{{data.name}}</span> bellow to confirm your action.</p>
<mat-form-field class="w-100">
<input matInput placeholder="Confirm" [(ngModel)]="confirm">
</mat-form-field>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-raised-button color="primary" (click)="delete()" [disabled]="confirm.toLowerCase() != data.name.toLowerCase()">Delete</button>
</mat-dialog-actions>

View File

@ -1,16 +0,0 @@
import {Component, Inject} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';
@Component({
selector: 'delete',
templateUrl: 'delete.component.html'
})
export class DeleteComponent {
confirm = '';
constructor(private dialogRef: MatDialogRef<DeleteComponent>, @Inject(MAT_DIALOG_DATA) public data) {}
delete() {
this.data.ref.delete().then(() => this.dialogRef.close());
}
}