diff --git a/src/app/pages/catalog/catalog.component.css b/src/app/pages/catalog/catalog.component.css
index 0f74106a..013af3ed 100755
--- a/src/app/pages/catalog/catalog.component.css
+++ b/src/app/pages/catalog/catalog.component.css
@@ -28,10 +28,11 @@
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
+
.checkbox-container {
+ margin: 1em 12em 0 12em;
display: flex;
- align-items: center;
- margin-left: 0.625em; /* Adiciona algum espaço entre o campo de pesquisa e a checkbox */
+ justify-content:space-around;
}
diff --git a/src/app/pages/catalog/catalog.component.html b/src/app/pages/catalog/catalog.component.html
index f3f84980..5d3da92f 100755
--- a/src/app/pages/catalog/catalog.component.html
+++ b/src/app/pages/catalog/catalog.component.html
@@ -1,13 +1,17 @@
diff --git a/src/app/pages/catalog/catalog.component.ts b/src/app/pages/catalog/catalog.component.ts
index af675074..677e5efa 100755
--- a/src/app/pages/catalog/catalog.component.ts
+++ b/src/app/pages/catalog/catalog.component.ts
@@ -80,16 +80,16 @@ export class CatalogComponent implements OnInit {
if (this.isAuthenticated) {
this.videoService.getFavoriteVideos(this.userId).subscribe({
next: (data) => {
-
+
// Verifique se `videoList` existe e é um array
if (data && Array.isArray(data.videoList)) {
const favorite_videos_ids = data.videoList.map((item: any) => String(item.video_id)); // Converta IDs para string
-
+
this.favoriteVideos = this.unbTvVideos.filter(video => favorite_videos_ids.includes(String(video.id))); // Converta IDs para string
} else {
console.warn('A estrutura da resposta da API não está conforme o esperado:', data);
}
-
+
this.filterVideos(); // Atualize a filtragem após carregar os vídeos de "favoritos"
},
error: (error) => {
@@ -111,16 +111,16 @@ export class CatalogComponent implements OnInit {
if (this.isAuthenticated) {
this.videoService.getWatchLaterVideos(this.userId).subscribe({
next: (data) => {
-
+
// Verifique se `videoList` existe e é um array
if (data && Array.isArray(data.videoList)) {
const watchLaterVideoIds = data.videoList.map((item: any) => String(item.video_id)); // Converta IDs para string
-
+
this.watchLaterVideos = this.unbTvVideos.filter(video => watchLaterVideoIds.includes(String(video.id))); // Converta IDs para string
} else {
console.warn('A estrutura da resposta da API não está conforme o esperado:', data);
}
-
+
this.filterVideos(); // Atualize a filtragem após carregar os vídeos de "assistir mais tarde"
},
error: (error) => {
@@ -137,7 +137,7 @@ export class CatalogComponent implements OnInit {
this.filterVideos();
}
}
-
+
filterVideosByChannel(videos: IVideo[]): void {
videos.forEach((video) => {
@@ -156,7 +156,7 @@ export class CatalogComponent implements OnInit {
const matchesDescription = this.filterTitle ? video.description?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true;
const matchesKeywords = this.filterTitle ? video.keywords?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true;
const matchesCatalog = this.filterTitle ? video.catalog?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true;
-
+
return isWatchLater && isFavorite && (matchesTitle || matchesDescription || matchesKeywords || matchesCatalog);
});
}
diff --git a/src/app/pages/category-table/category-table.component.html b/src/app/pages/category-table/category-table.component.html
index 5cda73a6..5d6549b2 100644
--- a/src/app/pages/category-table/category-table.component.html
+++ b/src/app/pages/category-table/category-table.component.html
@@ -65,4 +65,4 @@
Dados - Categorias
-
\ No newline at end of file
+
diff --git a/src/app/pages/category-table/category-table.component.spec.ts b/src/app/pages/category-table/category-table.component.spec.ts
index 4b0455ad..74a09d09 100644
--- a/src/app/pages/category-table/category-table.component.spec.ts
+++ b/src/app/pages/category-table/category-table.component.spec.ts
@@ -72,13 +72,10 @@ describe('CategoryTableComponent', () => {
it('should call findAll on ngOnInit', () => {
spyOn(component, 'findAll');
component.ngOnInit();
+
expect(component.findAll).toHaveBeenCalled();
component.categories.forEach(category => {
- if (category === "Todas"){
- expect(component.selectedCategories[category]).toBeTrue()
- }else{
- expect(component.selectedCategories[category]).toBeFalse()
- }
+ expect(component.selectedCategories[category]).toBeTrue();
});
});
diff --git a/src/app/pages/category-table/category-table.component.ts b/src/app/pages/category-table/category-table.component.ts
index 55750dea..6f1baa09 100644
--- a/src/app/pages/category-table/category-table.component.ts
+++ b/src/app/pages/category-table/category-table.component.ts
@@ -32,6 +32,7 @@ export class CategoryTableComponent {
"Séries Especiais",
"UnBTV",
"Variedades"
+
];
filteredAggregatedVideos: any[] = [];
selectedCategories: { [key: string]: boolean } = {};
@@ -44,13 +45,15 @@ export class CategoryTableComponent {
private authService: AuthService,
private confirmationService: ConfirmationService
) {};
-
+
ngOnInit(): void{
this.categories.forEach(category => this.selectedCategories[category] = false);
- this.selectedCategories["Todas"] = true;
+ this.categories.forEach(category => {
+ this.selectedCategories[category] = true;
+ });
this.findAll();
}
-
+
findAll(): void {
this.videoService.findAll().subscribe({
next: (data) => {
@@ -107,7 +110,7 @@ export class CategoryTableComponent {
this.aggregatedVideos = Array.from(categoryMap.entries()).map(([category, data]) => ({
category,
- videoCount: data.count,
+ videoCount: data.count,
totalViews: data.views,
viewsPerVideo: data.count > 0 ? data.views/data.count : 0
}));
@@ -141,17 +144,28 @@ export class CategoryTableComponent {
this.sortAscending = true;
}
this.sortAggregatedVideos();
- }
+ }
filterCategories(): void {
const selectedCategories = Object.keys(this.selectedCategories).filter(category => this.selectedCategories[category]);
if (selectedCategories.includes("Todas")) {
- this.filteredAggregatedVideos = this.aggregatedVideos;
- }else if(selectedCategories.length === 0){
+ this.categories.forEach(category => {
+ this.selectedCategories[category] = true;
+ });
+ this.filteredAggregatedVideos = this.aggregatedVideos;
+ } else if (
+ !selectedCategories.includes("Todas") &&
+ this.selectedCategories["Todas"] === false &&
+ selectedCategories.length === 8
+ ) {
+ this.categories.forEach(category => {
+ this.selectedCategories[category] = false;
+ });
+ this.filteredAggregatedVideos = [];
+ } else if(selectedCategories.length === 0){
this.filteredAggregatedVideos = [];
- }
- else{
- this.filteredAggregatedVideos = this.aggregatedVideos.filter(video => selectedCategories.includes(video.category));
+ } else{
+ this.filteredAggregatedVideos = this.aggregatedVideos.filter(video => selectedCategories.includes(video.category));
}
this.sortAggregatedVideos();
}
@@ -182,7 +196,7 @@ export class CategoryTableComponent {
];
ws['!cols'] = columnWidths;
- XLSX.utils.book_append_sheet(wb, ws,'Sheet1');
+ XLSX.utils.book_append_sheet(wb, ws,'Sheet1');
XLSX.writeFile(wb, this.fileName);
}
-}
\ No newline at end of file
+}
diff --git a/src/app/pages/dashboard-category/dashboard-category.component.css b/src/app/pages/dashboard-category/dashboard-category.component.css
index e0c0c71f..536a9c7a 100644
--- a/src/app/pages/dashboard-category/dashboard-category.component.css
+++ b/src/app/pages/dashboard-category/dashboard-category.component.css
@@ -9,6 +9,10 @@
font-family: Helvetic, sans-serif;
}
+.containerCard, .containerLegenda, .containerGraficos {
+ font-size: 12px;
+}
+
.containerPrincipal {
display: flex;
min-height: 100vh;
diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.html b/src/app/pages/suggest-agenda/suggest-agenda.component.html
index 37eaed7e..4fbf0550 100755
--- a/src/app/pages/suggest-agenda/suggest-agenda.component.html
+++ b/src/app/pages/suggest-agenda/suggest-agenda.component.html
@@ -62,7 +62,7 @@