Merge pull request #45 from Quantum-P3/fix/mensajes-alerta
Fix/mensajes alerta
This commit is contained in:
		
						commit
						5eafb8a5d0
					
				| 
						 | 
				
			
			@ -22,7 +22,7 @@ export interface Alert {
 | 
			
		|||
  providedIn: 'root',
 | 
			
		||||
})
 | 
			
		||||
export class AlertService {
 | 
			
		||||
  timeout = 5000;
 | 
			
		||||
  timeout = 3000;
 | 
			
		||||
  toast = false;
 | 
			
		||||
  position = 'top right';
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -65,7 +65,7 @@ export class AlertService {
 | 
			
		|||
    alert.timeout = alert.timeout ?? this.timeout;
 | 
			
		||||
    alert.toast = alert.toast ?? this.toast;
 | 
			
		||||
    alert.position = alert.position ?? this.position;
 | 
			
		||||
    alert.close = (alertsArray: Alert[]) => this.closeAlert(alert.id!, alertsArray);
 | 
			
		||||
    //alert.close = (alertsArray: Alert[]) => this.closeAlert(alert.id!, alertsArray);
 | 
			
		||||
 | 
			
		||||
    (extAlerts ?? this.alerts).push(alert);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,5 @@
 | 
			
		|||
<form class="ds-form" *ngIf="categoria" name="deleteForm" (ngSubmit)="confirmDelete(categoria!)">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <h4 class="modal-title" data-cy="categoriaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
 | 
			
		||||
 | 
			
		||||
    <button type="button" class="ds-btn close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-header"></div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,9 +15,15 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </h2>
 | 
			
		||||
 | 
			
		||||
  <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
  <!--  <div class="alert alert-success" *ngIf="success" jhiTranslate="dataSurveyApp.categoria.delete.error">
 | 
			
		||||
 | 
			
		||||
  <jhi-alert></jhi-alert>
 | 
			
		||||
  </div>-->
 | 
			
		||||
 | 
			
		||||
  <div>
 | 
			
		||||
    <jhi-alert class="alert-success"></jhi-alert>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="alert alert-success" *ngIf="success" jhiTranslate="dataSurveyApp.categoria.delete.success"></div>
 | 
			
		||||
 | 
			
		||||
  <div class="alert alert-warning" id="no-result" *ngIf="categorias?.length === 0">
 | 
			
		||||
    <span jhiTranslate="dataSurveyApp.categoria.home.notFound">No categorias found</span>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,7 @@ export class CategoriaComponent implements OnInit {
 | 
			
		|||
  categorias?: ICategoria[];
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
  public searchString: string;
 | 
			
		||||
  success = false;
 | 
			
		||||
 | 
			
		||||
  constructor(protected categoriaService: CategoriaService, protected modalService: NgbModal) {
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
| 
						 | 
				
			
			@ -48,6 +49,7 @@ export class CategoriaComponent implements OnInit {
 | 
			
		|||
    // unsubscribe not needed because closed completes on modal close
 | 
			
		||||
    modalRef.closed.subscribe(reason => {
 | 
			
		||||
      if (reason === 'deleted') {
 | 
			
		||||
        this.success = true;
 | 
			
		||||
        this.loadAll();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,11 +8,13 @@
 | 
			
		|||
        "createOrEditLabel": "Datos de categoría",
 | 
			
		||||
        "notFound": "Ninguna categoría encontrada"
 | 
			
		||||
      },
 | 
			
		||||
      "created": "Una nueva categoría ha sido creada con el identificador {{ param }}",
 | 
			
		||||
      "updated": "Los datos de la categoría {{ nombre }} han sido actualizados",
 | 
			
		||||
      "created": "Su categoría fue creada de manera exitosa",
 | 
			
		||||
      "updated": "Los datos de la categoría han sido guardados de manera exitosa",
 | 
			
		||||
      "deleted": "La categoría  {{ nombre }} ha sido deshabilitada",
 | 
			
		||||
      "delete": {
 | 
			
		||||
        "question": "¿Seguro que quiere cambiar el estado de \"{{ nombre }}\"?"
 | 
			
		||||
        "question": "¿Seguro que quiere cambiar el estado de \"{{ nombre }}\"?",
 | 
			
		||||
        "success": "Su categoría ha sido modificada de manera exitosa ",
 | 
			
		||||
        "error": "Ocurrió un error al cambiar el estado de su categoría, por favor intentar de nuevo"
 | 
			
		||||
      },
 | 
			
		||||
      "detail": {
 | 
			
		||||
        "title": "Categoría"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue