deshabilitar funciones de modificación para la categoría nula
This commit is contained in:
		
							parent
							
								
									42f1b2eeff
								
							
						
					
					
						commit
						1d75fb6960
					
				| 
						 | 
				
			
			@ -25,11 +25,16 @@
 | 
			
		|||
      </dl>
 | 
			
		||||
 | 
			
		||||
      <button type="submit" (click)="previousState()" class="btn btn-ds btn-info" data-cy="entityDetailsBackButton">
 | 
			
		||||
        <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.back">Back</span>
 | 
			
		||||
         <span jhiTranslate="entity.action.back">Back</span>
 | 
			
		||||
      </button>
 | 
			
		||||
 | 
			
		||||
      <button type="button" [routerLink]="['/categoria', categoria.id, 'edit']" class="btn btn-ds btn-ds-primary btn-primary">
 | 
			
		||||
        <fa-icon icon="pencil-alt"></fa-icon> <span jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
      <button
 | 
			
		||||
        *ngIf="categoria.id != 0"
 | 
			
		||||
        type="button"
 | 
			
		||||
        [routerLink]="['/categoria', categoria.id, 'edit']"
 | 
			
		||||
        class="btn btn-ds btn-ds-primary btn-primary"
 | 
			
		||||
      >
 | 
			
		||||
         <span jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,9 +40,9 @@
 | 
			
		|||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
        <tr *ngFor="let categoria of categorias | filter: 'nombre':searchString; trackBy: trackId" data-cy="entityTable">
 | 
			
		||||
          <td>{{ categoria.nombre }}</td>
 | 
			
		||||
          <td jhiTranslate="{{ 'dataSurveyApp.EstadoCategoria.' + categoria.estado }}">{{ categoria.estado }}</td>
 | 
			
		||||
          <td class="text-right">
 | 
			
		||||
          <td *ngIf="categoria.id != 0">{{ categoria.nombre }}</td>
 | 
			
		||||
          <td *ngIf="categoria.id != 0" jhiTranslate="{{ 'dataSurveyApp.EstadoCategoria.' + categoria.estado }}">{{ categoria.estado }}</td>
 | 
			
		||||
          <td *ngIf="categoria.id != 0" class="text-right">
 | 
			
		||||
            <div class="btn-group">
 | 
			
		||||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
| 
						 | 
				
			
			@ -50,13 +50,11 @@
 | 
			
		|||
                class="btn-sm ds-btn ds-btn--primary"
 | 
			
		||||
                data-cy="entityEditButton"
 | 
			
		||||
              >
 | 
			
		||||
                <fa-icon icon="pencil-alt"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
              </button>
 | 
			
		||||
 | 
			
		||||
              <button type="submit" (click)="delete(categoria)" class="btn-sm ds-btn ds-btn--danger" data-cy="entityDeleteButton">
 | 
			
		||||
                <fa-icon icon="times"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
 | 
			
		||||
              <button type="submit" (click)="toggleStatus(categoria)" class="btn-sm ds-btn ds-btn--toggle" data-cy="entityDeleteButton">
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
 | 
			
		||||
              </button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </td>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,6 +53,7 @@
 | 
			
		|||
        </button>
 | 
			
		||||
 | 
			
		||||
        <button
 | 
			
		||||
          *ngIf="this.id != 0"
 | 
			
		||||
          type="submit"
 | 
			
		||||
          id="save-entity"
 | 
			
		||||
          data-cy="entityCreateSaveButton"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,7 @@ export class CategoriaUpdateComponent implements OnInit {
 | 
			
		|||
    estado: [null, [Validators.required]],
 | 
			
		||||
  });
 | 
			
		||||
  public duplicateName: boolean;
 | 
			
		||||
  id: number | undefined;
 | 
			
		||||
 | 
			
		||||
  constructor(protected categoriaService: CategoriaService, protected activatedRoute: ActivatedRoute, protected fb: FormBuilder) {
 | 
			
		||||
    this.duplicateName = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -88,6 +89,7 @@ export class CategoriaUpdateComponent implements OnInit {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  protected updateForm(categoria: ICategoria): void {
 | 
			
		||||
    this.id = categoria.id;
 | 
			
		||||
    this.editForm.patchValue({
 | 
			
		||||
      id: categoria.id,
 | 
			
		||||
      nombre: categoria.nombre,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue