Skip to content

Commit

Permalink
Ajuste issues manutenibilidade e confiabilidade sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielRoger07 committed Aug 30, 2024
1 parent 90b6bd9 commit 4aa83c1
Show file tree
Hide file tree
Showing 26 changed files with 521 additions and 359 deletions.
2 changes: 2 additions & 0 deletions src/app/components/video-comment/video-comment.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<div
(click)="toggleComments()"
class="text-blue-brand w-2 min-w-fit cursor-pointer"
(keydown)="dummyKeyDown($event)"
>
Recolher comentarios
</div>
Expand Down Expand Up @@ -36,6 +37,7 @@
*ngIf="!showComments"
(click)="toggleComments()"
class="text-blue-brand w-2 min-w-fit cursor-pointer"
(keydown)="dummyKeyDown($event)"
>
{{ comments.length }} Comentários
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/video-comment/video-comment.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,8 @@ export class VideoCommentComponent implements OnInit {
this.showComments = !this.showComments;
}

dummyKeyDown(event: KeyboardEvent): void {
// Não faz nada
}
}

2 changes: 1 addition & 1 deletion src/app/pages/active-account/active-account.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<input pInputText class="w-64 h-8 border rounded-lg border-gray-300 pl-4 md:w-96 md:h-10" type="text" formControlName="code" name="code" placeholder="Código" required>
</div>
<button class="w-20 h-8 bg-blue-brand rounded-lg justify-center mb-4 text-white md:h-10 md:w-32" type="submit">Ativar</button>
<div class="flex justify-start items-center text-blue-brand underline pl-4" (click)="resendCode()">
<div class="flex justify-start items-center text-blue-brand underline pl-4" (click)="resendCode()" (keydown)="dummyKeyDown($event)">
Reenviar Código
</div>
</form>
Expand Down
4 changes: 4 additions & 0 deletions src/app/pages/active-account/active-account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ export class ActiveAccountComponent implements OnInit {
navigator(rota: string): void {
this.router.navigate([rota]);
}

dummyKeyDown(event: KeyboardEvent): void {
// Não faz nada
}
}
56 changes: 28 additions & 28 deletions src/app/pages/catalog/catalog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<div class="flex flex-col gap-2">
<h4 class="text-start font-bold text-[13px] text-blue-brand">Jornalismo</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.journalism.falaJovem)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.journalism.falaJovem)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Fala, jovem'" src="../../../assets/imgs/catalog-thumbs/1.Fala-Jovem.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.journalism.informeUnB)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.journalism.informeUnB)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Informe UnB'" src="../../../assets/imgs/catalog-thumbs/2.Informe-UnB.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.journalism.zapping)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.journalism.zapping)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Zapping'" src="../../../assets/imgs/catalog-thumbs/3.Zapping.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
Expand All @@ -36,32 +36,32 @@ <h4 class="text-start font-bold text-[13px] text-blue-brand">Jornalismo</h4>
<h4 class="text-start font-bold text-[13px] text-blue-brand">Entrevista</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.interviews.brasilEmQuestao)">
(click)="onProgramClick(catalog.interviews.brasilEmQuestao)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Brasil em Questão'"
src="../../../assets/imgs/catalog-thumbs/4.Brasil-em-Questao.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.interviews.dialogos)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.interviews.dialogos)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Diálogos'" src="../../../assets/imgs/catalog-thumbs/5.Diálogos.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.interviews.tirandoDeLetra)">
(click)="onProgramClick(catalog.interviews.tirandoDeLetra)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Tirando de letra'"
src="../../../assets/imgs/catalog-thumbs/6.Tirando-de-Letra.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.interviews.entrevistas)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.interviews.entrevistas)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'UnBTV Entrevista'"
src="../../../assets/imgs/catalog-thumbs/7.UnBTV-Entrevista.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.interviews.vastoMundo)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.interviews.vastoMundo)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Vasto Mundo'" src="../../../assets/imgs/catalog-thumbs/8.Vasto-Mundo.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.interviews.vozesDiplomaticas)">
(click)="onProgramClick(catalog.interviews.vozesDiplomaticas)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Vozes Diplomáticas'"
src="../../../assets/imgs/catalog-thumbs/9.Vozes-Diplomaticas.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
Expand All @@ -75,35 +75,35 @@ <h4 class="text-start font-bold text-[13px] text-blue-brand">
</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.researchAndScience.expliqueSuaTese)">
(click)="onProgramClick(catalog.researchAndScience.expliqueSuaTese)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Explique sua Tese'"
src="../../../assets/imgs/catalog-thumbs/10.Explique-sua-Tese.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.researchAndScience.fazendoCiencia)">
(click)="onProgramClick(catalog.researchAndScience.fazendoCiencia)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Fazendo Ciência Formando Cientistas'"
src="../../../assets/imgs/catalog-thumbs/11.Fazendo-Ciencia-Formando-Cientistas.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.researchAndScience.radarDaExtencao)">
(click)="onProgramClick(catalog.researchAndScience.radarDaExtencao)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Radar da Extensão'"
src="../../../assets/imgs/catalog-thumbs/12.Radar-da-Extensao.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.researchAndScience.seLigaNoPAS)">
(click)="onProgramClick(catalog.researchAndScience.seLigaNoPAS)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Se Liga no PAS'" src="../../../assets/imgs/catalog-thumbs/13.Se-Liga-no-PAS.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.researchAndScience.unbTvCiencia)">
(click)="onProgramClick(catalog.researchAndScience.unbTvCiencia)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'UnBTV Ciência'" src="../../../assets/imgs/catalog-thumbs/14.UnBTV-Ciencia.png"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.researchAndScience.universidadeParaQue)">
(click)="onProgramClick(catalog.researchAndScience.universidadeParaQue)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Universidade Para Quê?'"
src="../../../assets/imgs/catalog-thumbs/15.Universidade-Para-Que.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
Expand All @@ -116,19 +116,19 @@ <h4 class="text-start font-bold text-[13px] text-blue-brand">
Arte e Cultura
</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.emCantos)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.emCantos)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Em Cantos'" src="../../../assets/imgs/catalog-thumbs/16.Emcantos.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.casaDoSom)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.casaDoSom)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Casa do Som'" src="../../../assets/imgs/catalog-thumbs/17.Casa-do-Som.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.esbocos)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.esbocos)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Esboços'" src="../../../assets/imgs/catalog-thumbs/18.Esbocos.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.exclusiva)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.artAndCulture.exclusiva)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Exclusiva'" src="../../../assets/imgs/catalog-thumbs/19.Exclusiva.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
Expand All @@ -141,36 +141,36 @@ <h4 class="text-start font-bold text-[13px] text-blue-brand">
</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.specialSeries.florestaDeGente)">
(click)="onProgramClick(catalog.specialSeries.florestaDeGente)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Floresta de Gente'"
src="../../../assets/imgs/catalog-thumbs/20.Floresta-de-Gente.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.specialSeries.guiaDoCalouro)">
(click)="onProgramClick(catalog.specialSeries.guiaDoCalouro)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Guia do Calouro'" src="../../../assets/imgs/catalog-thumbs/21.Guia-do-Calouro.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.specialSeries.memoriasPauloFreire)">
(click)="onProgramClick(catalog.specialSeries.memoriasPauloFreire)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Memorias de Paulo Freire'"
src="../../../assets/imgs/catalog-thumbs/22.Memorias-de-Paulo-Freire.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.specialSeries.desafiosDasEleicoes)">
(click)="onProgramClick(catalog.specialSeries.desafiosDasEleicoes)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Os desafios das eleicoes 2022'"
src="../../../assets/imgs/catalog-thumbs/23.Os-desafios-das-eleicoes2022.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.specialSeries.vidaDeEstudante)">
(click)="onProgramClick(catalog.specialSeries.vidaDeEstudante)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Podcast Vida de Estudante'"
src="../../../assets/imgs/catalog-thumbs/24.Podcast-Vida-de-Estudante.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.specialSeries.arquiteturaICC)">
(click)="onProgramClick(catalog.specialSeries.arquiteturaICC)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Serie Arquitetura'"
src="../../../assets/imgs/catalog-thumbs/25.Serie-Arquitetura.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
Expand All @@ -183,12 +183,12 @@ <h4 class="text-start font-bold text-[13px] text-blue-brand">
Documentais
</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.documentaries.miniDoc)">
<div class="w-full h-full max-w-[150px] max-h-[84px]" (click)="onProgramClick(catalog.documentaries.miniDoc)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Mini Doc'" src="../../../assets/imgs/catalog-thumbs/26.Mini-Doc.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.documentaries.documentaries)">
(click)="onProgramClick(catalog.documentaries.documentaries)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Documentários'" src="../../../assets/imgs/catalog-thumbs/27.Documentarios.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
</div>
Expand All @@ -199,7 +199,7 @@ <h4 class="text-start font-bold text-[13px] text-blue-brand">
<h4 class="text-start font-bold text-[13px] text-blue-brand">Variedades</h4>
<div class="w-full flex flex-wrap justify-between gap-y-6 md:gap-x-2">
<div class="w-full h-full max-w-[150px] max-h-[84px]"
(click)="onProgramClick(catalog.varieties.pitadasDoCerrado)">
(click)="onProgramClick(catalog.varieties.pitadasDoCerrado)" (keydown)="dummyKeyDown($event)">
<img alt="capa do programa 'Pitadas do Cerrado'"
src="../../../assets/imgs/catalog-thumbs/28.Pitadas-do-Cerrado.jpg"
class="object-cover rounded-md cursor-pointer thumbnail" />
Expand Down
4 changes: 4 additions & 0 deletions src/app/pages/catalog/catalog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,8 @@ export class CatalogComponent implements OnInit {
this.videoService.setVideosCatalog(videos);
this.router.navigate(['/videos']);
}

dummyKeyDown(event: KeyboardEvent): void {
// Não faz nada
}
}
6 changes: 3 additions & 3 deletions src/app/pages/category-table/category-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ <h1>Dados - Categorias</h1>
<thead>
<tr>
<th>Categoria</th>
<th (click)="setSortColumn('videoCount')" [class.selected]="selectedColumn === 'videoCount'" class="ordenavel">
<th (click)="setSortColumn('videoCount')" [class.selected]="selectedColumn === 'videoCount'" class="ordenavel" (keydown)="dummyKeyDown($event)">
N° Vídeos
<span class="setinha" [ngClass]="{'up': selectedColumn === 'videoCount' && !sortAscending, 'down': selectedColumn === 'videoCount' && sortAscending}"></span>
</th>
<th (click)="setSortColumn('totalViews')" [class.selected]="selectedColumn === 'totalViews'" class="ordenavel">
<th (click)="setSortColumn('totalViews')" [class.selected]="selectedColumn === 'totalViews'" class="ordenavel" (keydown)="dummyKeyDown($event)">
N° Visualizações
<span class="setinha" [ngClass]="{'up': selectedColumn === 'totalViews' && !sortAscending, 'down': selectedColumn === 'totalViews' && sortAscending}"></span>
</th>
<th (click)="setSortColumn('viewsPerVideo')" [class.selected]="selectedColumn === 'viewsPerVideo'" class="ordenavel">
<th (click)="setSortColumn('viewsPerVideo')" [class.selected]="selectedColumn === 'viewsPerVideo'" class="ordenavel" (keydown)="dummyKeyDown($event)">
Visualizações/Vídeo
<span class="setinha" [ngClass]="{'up': selectedColumn === 'viewsPerVideo' && !sortAscending, 'down': selectedColumn === 'viewsPerVideo' && sortAscending}"></span>
</th>
Expand Down
Loading

0 comments on commit 4aa83c1

Please sign in to comment.