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