- Implemented ConfirmModalComponent and ConfirmDeleteModalComponent for confirmation dialogs. - Added modal service methods to open confirm and confirm delete modals. - Created corresponding HTML and SCSS files for both modal components. - Updated ReutilizablesTestPageComponent to utilize new modals. - Enhanced modal service tests to cover new functionality. - Refactored existing tests to accommodate changes in modal behavior and structure.
29 lines
769 B
TypeScript
29 lines
769 B
TypeScript
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
|
|
import {
|
|
ConfirmModalData,
|
|
MODAL_DATA,
|
|
ModalRef
|
|
} from '../../../core/services/modal.service';
|
|
import { ButtonComponent } from '../button/button.component';
|
|
|
|
@Component({
|
|
selector: 'app-confirm-modal',
|
|
imports: [ButtonComponent],
|
|
templateUrl: './confirm-modal.component.html',
|
|
styleUrl: './confirm-modal.component.scss',
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class ConfirmModalComponent {
|
|
protected readonly data = inject<ConfirmModalData>(MODAL_DATA);
|
|
private readonly modalRef = inject<ModalRef<boolean>>(ModalRef);
|
|
|
|
protected cancel(): void {
|
|
this.modalRef.close(false);
|
|
}
|
|
|
|
protected confirm(): void {
|
|
this.modalRef.close(true);
|
|
}
|
|
}
|