Files
shopit-front/src/app/shared/components/confirm-modal/confirm-modal.component.ts
ncoronel 446d1b8970 feat(modal): add confirm and confirm delete modals with tests
- 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.
2026-07-02 11:45:47 -03:00

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);
}
}