Skip to content

Commit

Permalink
Merge pull request #25 from udistrital/feature/Ajustes-generales
Browse files Browse the repository at this point in the history
feat: Se eliminan funciones y variables que ya no se usan, se corrige el nombre del script
  • Loading branch information
edwargl7 authored Dec 17, 2024
2 parents 2d4d551 + e9f7932 commit 357ae1a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ usuario_rol_mf is free software: you can redistribute it and/or modify it under

usuario_rol_mf is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with usuario_rol_mf. If not, see https://www.gnu.org/licenses/.
You should have received a copy of the GNU General Public License along with usuario_rol_mf. If not, see https://www.gnu.org/licenses/.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"build:test": "ng build --progress --configuration=development",
"build:single-spa:usuario_rol_mf": "ng build usuario_rol_mf --configuration production",
"serve:single-spa:usuario_rol_mf": "ng s --project usuario_rol_mf --disable-host-check --port 4202 --live-reload false"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HistoricoUsuariosMidService } from 'src/app/services/historico-usuarios
import { TercerosService } from 'src/app/services/terceros.service';
import { ModalService } from 'src/app/services/modal.service';
import { ActivatedRoute } from '@angular/router';
import { ImplicitAutenticationService } from 'src/app/services/implicit-autentication.service';
import { ImplicitAuthenticationService } from 'src/app/services/implicit-authentication.service';

export interface RolRegistro {
Nombre: string;
Expand Down Expand Up @@ -44,7 +44,7 @@ export class ActualizarUsuarioComponent {
private autenticacionService: AutenticacionService,
private route: ActivatedRoute,
private changeDetector: ChangeDetectorRef,
private authService: ImplicitAutenticationService,
private authService: ImplicitAuthenticationService,
private modalService: ModalService,
private router: Router,
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ <h2 style="color: var(--md-primary-700)">Gestión de Usuarios</h2>
>
El campo es obligatorio.
</mat-error>
<!-- <mat-error *ngIf="formUsuarios.get('correo')?.hasError('pattern')">
Por favor, introduce un correo electrónico o un documento válido.
</mat-error> -->
</mat-form-field>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { environment } from 'src/environments/environment';
import { ModalService } from 'src/app/services/modal.service';

import { Router } from '@angular/router';
import { ImplicitAutenticationService } from 'src/app/services/implicit-autentication.service';
import { ImplicitAuthenticationService } from 'src/app/services/implicit-authentication.service';
import { catchError, map, of, switchMap } from 'rxjs';


Expand Down Expand Up @@ -71,7 +71,7 @@ export class UsuariosComponent implements OnInit {
private historico_service: HistoricoUsuariosMidService,
private router: Router,
private changeDetector: ChangeDetectorRef,
private authService: ImplicitAutenticationService,
private authService: ImplicitAuthenticationService,
private modalService: ModalService
) {}

Expand Down Expand Up @@ -250,7 +250,6 @@ export class UsuariosComponent implements OnInit {
.then((result) => {
if (result.isConfirmed) {
this.loading = true;
console.log('Periodo: ', id_periodo);
this.historico_service
.delete('periodos-rol-usuarios/', id_periodo)
.subscribe({
Expand Down Expand Up @@ -285,41 +284,6 @@ export class UsuariosComponent implements OnInit {
this.router.navigate(['/gestion-usuarios/actualizar-usuario'], {
queryParams: { documento, id_periodo },
});
}

applyDocumentFilter() {
// Implementa la lógica para filtrar documentos aquí
console.log('Filtro de documento aplicado');
}

applyRoleFilter(event: MatSelectChange) {
const filterValue = event.value === 'all' ? '' : event.value;
this.dataSource.filter = JSON.stringify({
role: filterValue,
state: this.currentStateFilter,
});
}

applyStateFilter(event: MatSelectChange) {
const filterValue = event.value === 'all' ? '' : event.value.toString();
this.dataSource.filter = JSON.stringify({
role: this.currentRoleFilter,
state: filterValue,
});
}

get currentRoleFilter() {
const currentFilter = this.dataSource.filter
? JSON.parse(this.dataSource.filter)
: {};
return currentFilter.role || '';
}

get currentStateFilter() {
const currentFilter = this.dataSource.filter
? JSON.parse(this.dataSource.filter)
: {};
return currentFilter.state || '';
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ import { environment } from '../../environments/environment.development';
@Injectable({
providedIn: 'root',
})
export class ImplicitAutenticationService {
environment = environment.TOKEN;
export class ImplicitAuthenticationService {
rolesConsulta = environment.ROLES_CONSULTA;
rolesEdicion = environment.ROLES_CONSULTA_EDICION;
private userSubject = new BehaviorSubject({});
public user$ = this.userSubject.asObservable();
httpOptions: { headers: HttpHeaders; } | undefined;

constructor(private httpClient: HttpClient) {
this.init(this.environment);
this.init();
}

init(entorno: { AUTORIZATION_URL: string; CLIENTE_ID: string; RESPONSE_TYPE: string; SCOPE: string; REDIRECT_URL: string; SIGN_OUT_URL: string; SIGN_OUT_REDIRECT_URL: string; AUTENTICACION_MID: string; }): any {
this.environment = entorno;
init(): any {

const id_token = window.localStorage.getItem('id_token');

if (id_token) {
Expand Down

0 comments on commit 357ae1a

Please sign in to comment.