change & delete for command modal
This commit is contained in:
-1
@@ -42,7 +42,6 @@ export class CommandModalComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
attemptSave() {
|
||||
debugger;
|
||||
this.loading = true;
|
||||
this.dataSource.executeCommandByName(this.command, this.commandModel)
|
||||
.pipe(
|
||||
|
||||
+8
-1
@@ -20,13 +20,14 @@ export class CommandModalDirective {
|
||||
@Input() commandText: string;
|
||||
@Input() cancelText: string;
|
||||
@Input() animated: boolean;
|
||||
@Input() isConfirmModal: boolean;
|
||||
|
||||
@HostListener('click')
|
||||
wasClicked() {
|
||||
this.dataSource.resolveCommandModelByName({
|
||||
command: this.command,
|
||||
model: this.model
|
||||
}).subscribe(commandModel => {
|
||||
}).subscribe(commandModel => {
|
||||
const initialState = {
|
||||
dataSource: this.dataSource,
|
||||
command: this.command,
|
||||
@@ -37,6 +38,12 @@ export class CommandModalDirective {
|
||||
commandText: this.commandText || 'OK',
|
||||
cancelText: this.cancelText || 'Cancel'
|
||||
};
|
||||
if(this.isConfirmModal){
|
||||
this.modalService.show(CommandModalComponent, {
|
||||
animated: this.animated === undefined ? true : this.animated,
|
||||
initialState
|
||||
});
|
||||
}
|
||||
this.modalService.show(CommandModalComponent, {
|
||||
animated: this.animated === undefined ? true : this.animated,
|
||||
initialState
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" (click)="modalRef.hide()"
|
||||
[attr.disabled]="loading">{{ cancelText }}</button>
|
||||
<button type="button" class="btn btn-primary" (click)="attemptSave()" [attr.disabled]="loading">Creat</button>
|
||||
<button type="button" class="btn btn-primary" (click)="attemptSave()" [attr.disabled]="loading">Create</button>
|
||||
<br>
|
||||
|
||||
<div class="progress" style="width: 100%" *ngIf="loading">
|
||||
|
||||
-1
@@ -48,7 +48,6 @@ export class FormGroupCommandModalComponent implements OnInit {
|
||||
}
|
||||
|
||||
attemptSave() {
|
||||
|
||||
this.errorMessage = null;
|
||||
if (!this.modelForm.valid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user