Skip to content

Commit

Permalink
fix(GDU): quita event emit de onChange (#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
plammel authored Jul 29, 2020
1 parent ec5cb7a commit 0001fd6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@
</plex-accordion>
<div *ngIf="item.type" [hidden]="isHidden">

<plex-bool [(ngModel)]="state" *ngIf="item.type === 'boolean'" [label]="item.title" type="slide"
(change)="selectChange()"> </plex-bool>
<plex-bool [(ngModel)]="state" *ngIf="item.type === 'boolean'" [label]="item.title" type="slide"></plex-bool>

<div *ngIf="item.type !== 'boolean'">
<h5>
{{item.title}}
<plex-bool *ngIf="!item.avoidAll" [(ngModel)]="all" label="Seleccionar todos" type="slide"
(change)="change.emit()"> </plex-bool>
<plex-bool *ngIf="!item.avoidAll" [(ngModel)]="all" label="Seleccionar todos" type="slide"> </plex-bool>
</h5>
<plex-select [multiple]="true" [readonly]="all" [(ngModel)]="seleccionados" *ngIf="!loading"
(getData)="loadData(item.type, $event)" placeholder="Seleccione los elementos con permisos"
(change)="selectChange()" name="plexSelect" idField="id"></plex-select>
(getData)="loadData(item.type, $event)" placeholder="Seleccione los elementos con permisos" name="plexSelect"
idField="id"></plex-select>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export class ArbolPermisosItemComponent implements OnInit, OnChanges, AfterViewI
@Input() parentPermission: String = '';
@Input() userPermissions: String[] = [];

@Output() change = new EventEmitter();

@ViewChild('panel', { static: false }) accordions: PlexPanelComponent;
@ViewChildren(ArbolPermisosItemComponent) childsComponents: QueryList<ArbolPermisosItemComponent>;

Expand Down Expand Up @@ -65,7 +63,6 @@ export class ArbolPermisosItemComponent implements OnInit, OnChanges, AfterViewI
}
}
}
this.change.emit();
}

removeInnerPermissions() {
Expand Down Expand Up @@ -132,10 +129,6 @@ export class ArbolPermisosItemComponent implements OnInit, OnChanges, AfterViewI
}
}

selectChange() {
this.change.emit();
}

loadData(type, event) {
// [TODO] Agregar parametros de busqueda en el JSON de permisos. Ej: { turneable: 1 }
// [TODO] Filtrar otras tipos de datos
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div *ngFor="let permiso of permisos">
<arbol-permisos-item [item]="permiso" [userPermissions]="userPermissions" (change)="onChange()">
<arbol-permisos-item [item]="permiso" [userPermissions]="userPermissions" >
</arbol-permisos-item>
</div>
2 changes: 1 addition & 1 deletion src/app/apps/gestor-usuarios/views/usuarios-edit.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<plex-icon name="content-paste"></plex-icon>
</plex-button>
</plex-title>
<arbol-permisos [permisos]="arbolPermisos" [userPermissions]="permisos$ | async" (change)="onChange()">
<arbol-permisos [permisos]="arbolPermisos" [userPermissions]="permisos$ | async" >
</arbol-permisos>
</plex-layout-sidebar>
</plex-layout>
6 changes: 1 addition & 5 deletions src/app/apps/gestor-usuarios/views/usuarios-edit.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,9 @@ export class UsuariosEditComponent implements OnInit, OnDestroy {
this.habilitados[perfil.id] = enabled;
}

onChange() {
this.permisos = this.arbol.getPermisos();
}

grabar() {
const body = {
permisos: this.permisos,
permisos: this.arbol.getPermisos(),
id: this.organizacionId,
nombre: this.orgName,
perfiles: this.perfiles.filter(p => this.habilitados[p.id]).map(p => {
Expand Down

0 comments on commit 0001fd6

Please sign in to comment.