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

Correção de vários bugs #49

Open
wants to merge 6 commits into
base: docker-codigo-fonte
Choose a base branch
from
Open
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 @@ -136,6 +136,8 @@ public async Task<IApplicationResult<DadosPaginadosViewModel<PactoTrabalhoViewMo
parameters.Add("@offset", (request.Page - 1) * request.PageSize, DbType.Int32, ParameterDirection.Input);
parameters.Add("@pageSize", request.PageSize, DbType.Int32, ParameterDirection.Input);

parameters.Add("@unidadeId", request.UnidadeId, DbType.Int64, ParameterDirection.Input);

if (!request.IsGestor)
query = query.Replace("#CONTROLE#", PactoTrabalhoRawSqls.ControleAcesso);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static string ObterItensPorUnidade
return @"
SELECT i.itemCatalogoId
,i.titulo
,i.titulo + IIF(i.complexidade IS NULL OR i.complexidade = '', '', ' - ' + i.complexidade) + ' (pres.:' + cast(i.tempoPresencial as varchar(5)) + 'h / rem.:' + cast(i.tempoRemoto as varchar(5)) + 'h)' as tituloCompleto
,i.titulo + IIF(i.complexidade IS NULL OR i.complexidade = '', '', ' - ' + i.complexidade) + ' (pres.:' + cast(i.tempoPresencial as varchar(5)) + 'h / rem.:' + cast(coalesce(i.tempoRemoto,0) as varchar(5)) + 'h)' as tituloCompleto
,i.complexidade
,i.calculoTempoId formaCalculoTempoItemCatalogoId
,cd.descricao formaCalculoTempoItemCatalogo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ FROM [ProgramaGestao].[PactoTrabalho] pt
#CONTROLE#
WHERE (@pessoaId IS NULL OR pt.pessoaId = @pessoaId)
AND (@situacaoId IS NULL OR pt.situacaoId = @situacaoId)
AND (@formaExecucaoId IS NULL OR pt.formaExecucaoId = @formaExecucaoId)
AND (@dataInicio IS NULL OR pt.dataFim >= @dataInicio)
AND (@dataFim IS NULL OR pt.dataInicio <= @dataFim)
AND (@unidadeId IS NULL OR pt.unidadeId = @unidadeId)
) contador
";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td class="text-right">{{item.tempoRealizado}}</td>
<td class="text-center">
<div *ngIf="item.nota === 0 || item.nota" title="{{item.justificativa}}">{{ item.nota }}</div>
<secure-input *ngIf="item.situacaoId === 503" [perfis]="[PerfilEnum.Diretor, PerfilEnum.CoordenadorGeral, PerfilEnum.ChefeUnidade]" [unidade]="unidade">
<secure-input *ngIf="item.situacaoId === 503" [perfis]="[PerfilEnum.Diretor, PerfilEnum.CoordenadorGeral, PerfilEnum.ChefeUnidade]" [unidade]="unidade" [servidor]="servidor">
<a href="javascript:void(0)" *ngIf="usuarioPodeAvaliar" (click)="avaliar(item.pactoTrabalhoAtividadeId)">Avaliar</a>
</secure-input>
<a href="javascript:void(0)" *ngIf="!usuarioPodeAvaliar && item.nota" (click)="avaliar(item.pactoTrabalhoAtividadeId)">Ver avaliação</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class PactoListaAtividadeAndamentoComponent implements OnInit {

@Input() dadosPacto: BehaviorSubject<IPactoTrabalho>;
servidor = new BehaviorSubject<number>(null);
unidade = new BehaviorSubject<number>(null);

@Input() readOnly: Boolean;
@Input() isReadOnly = new BehaviorSubject<Boolean>(true);
Expand Down Expand Up @@ -138,6 +139,7 @@ export class PactoListaAtividadeAndamentoComponent implements OnInit {
this.teletrabalhoParcial = this.dadosPacto.value.formaExecucaoId === 102;

this.servidor.next(this.dadosPacto.value.pessoaId);
this.unidade.next(this.dadosPacto.value.unidadeId);
this.isReadOnly.next(this.readOnly || this.dadosPacto.value.situacaoId !== 405);
this.pactoTrabalhoDataService.ObterAtividades(this.dadosPacto.value.pactoTrabalhoId).subscribe(
resultado => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1 class="content-title">
</div>
<div class="br-divider mt-4"></div>
<div class="actions justify-content-start">
<secure-input [perfis]="[PerfilEnum.Diretor, PerfilEnum.CoordenadorGeral, PerfilEnum.ChefeUnidade, PerfilEnum.Servidor]" [unidade]="unidade" [servidor]="servidor">
<secure-input [perfis]="[PerfilEnum.Diretor, PerfilEnum.CoordenadorGeral, PerfilEnum.ChefeUnidade]" [unidade]="unidade" [servidor]="servidor">
<button class="br-button is-primary" type="button" *ngIf="dadosPacto.value?.situacaoId === 401 && saldoHoras >= 0" (click)="aceitar()">Enviar para aceite</button>
<button class="br-button is-primary bg-success border-0 mr-2" type="button" *ngIf="dadosPacto.value?.situacaoId === 402 && usuarioPodeAceitar" (click)="aceitar()">Aceitar</button>
<button class="br-button is-primary mr-0 bg-danger border-0" type="button" *ngIf="dadosPacto.value?.situacaoId === 402 && usuarioPodeAceitar" (click)="rejeitar()">Rejeitar</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Location } from '@angular/common';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { HttpClient, HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http';
import { Injectable, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Observable, of } from 'rxjs';
Expand All @@ -13,6 +13,14 @@ import { ConfigurationService } from './configuration.service';
import { DataService } from './data.service';
import { StorageService } from './storage.service';


export class HttpUrlEncodingCodec implements HttpParameterCodec {
encodeKey(k: string): string { return encodeURIComponent(k); }
encodeValue(v: string): string { return encodeURIComponent(v); }
decodeKey(k: string): string { return decodeURIComponent(k); }
decodeValue(v: string) { return decodeURIComponent(v); }
}

/*
* Serviço que faz o controle de autenticação das aplicações
*/
Expand Down Expand Up @@ -114,7 +122,7 @@ export class SecurityService implements OnInit {

const headers = new HttpHeaders({ 'Content-Type': 'application/x-www-form-urlencoded' });

let params = new HttpParams()
let params = new HttpParams({ encoder: new HttpUrlEncodingCodec() })
.set('grant_type', 'password')
.set('client_id', clientId)
.set('scope', scope)
Expand Down