Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mapa-camas): permisos para ver registros #2434

Merged
merged 4 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class PermisosMapaCamasService {
public bloqueo = false;
public censo = false;
public descargarListado = false;

public registros = false;
constructor(
private auth: Auth,
) { }
Expand All @@ -41,5 +41,6 @@ export class PermisosMapaCamasService {
this.bloqueo = this.auth.check(`${this.ambito}:bloqueo`);
this.censo = this.auth.check(`${this.ambito}:censo`);
this.descargarListado = this.auth.check(`${this.ambito}:descargarListado`);
this.registros = this.auth.check('internacion:registros');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</plex-button>
</ng-container>

<ng-container *ngIf="(accionesEstado$ | async)?.length > 0">
<ng-container *ngIf="(accionesEstado$ | async)?.length > 0 && permisosMapaCamasService.registros">
<plex-button size="sm" type="success" (click)="onNuevoRegistrio()"> NUEVO REGISTRO </plex-button>
</ng-container>
<ng-container *ngIf="!cama.sala && hayMovimientosAt$ | async">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</app-egresar-paciente>
</ng-container>

<ng-container *ngIf="mostrar === 'registros'">
<ng-container *ngIf="mostrar === 'registros' && permisosMapaCamasService.registros">
<app-registros-huds-detalle (accion)="onAccion($event)"></app-registros-huds-detalle>
</ng-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export class InternacionDetalleComponent implements OnInit, OnDestroy {
{ key: 'egreso', label: 'EGRESO' }
];
}

const registro = this.items.findIndex(item => item.key === 'registros');
if (registro !== -1 && !this.permisosMapaCamasService.registros) {
this.items.splice(registro, 1);
}
});

this.resumenInternacion$ = this.mapaCamasService.resumenInternacion$;
Expand Down