Skip to content

Commit a80a590

Browse files
committed
feat: moving folders to maintain the standard
1 parent 81fd6c4 commit a80a590

35 files changed

Lines changed: 1301 additions & 65 deletions

src/app/app.routes.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,28 @@ export const routes: Routes = [
1919
{
2020
path: 'catalog/products/new',
2121
loadComponent: () =>
22-
import('./features/catalog/product-create/product-create').then((m) => m.ProductCreateComponent),
22+
import('./features/catalog/products/product-create/product-create').then(
23+
(m) => m.ProductCreateComponent,
24+
),
2325
},
2426
{
2527
path: 'catalog/products/:id/edit',
2628
loadComponent: () =>
27-
import('./features/catalog/product-workspace/product-workspace').then(
29+
import('./features/catalog/products/product-workspace/product-workspace').then(
2830
(m) => m.ProductWorkspaceComponent,
2931
),
3032
},
3133
{
3234
path: 'catalog/products/:id/view',
3335
loadComponent: () =>
34-
import('./features/catalog/product-workspace/product-workspace').then(
36+
import('./features/catalog/products/product-workspace/product-workspace').then(
3537
(m) => m.ProductWorkspaceComponent,
3638
),
3739
},
3840
{
3941
path: 'catalog/products/:id',
4042
loadComponent: () =>
41-
import('./features/catalog/product-workspace/product-workspace').then(
43+
import('./features/catalog/products/product-workspace/product-workspace').then(
4244
(m) => m.ProductWorkspaceComponent,
4345
),
4446
},

src/app/core/services/category-service.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,16 @@ export class CategoryService {
3030
getById(id: string) {
3131
return this.http.get<CategoryResponse>(`${this.api}/${this.flag}/${id}`);
3232
}
33+
34+
create(data: FormData) {
35+
return this.http.post<CategoryResponse>(`${this.api}/${this.flag}`, data);
36+
}
37+
38+
update(id: string, data: FormData) {
39+
return this.http.post<CategoryResponse>(`${this.api}/${this.flag}/${id}`, data);
40+
}
41+
42+
delete(id: string) {
43+
return this.http.delete<void>(`${this.api}/${this.flag}/${id}`);
44+
}
3345
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Categories component styles */
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!-- Page Header -->
2+
<app-page-header
3+
title="Categorias de Produtos"
4+
subtitle="Gerenciamento da hierarquia, slugs e ordem de exibição das categorias do catálogo."
5+
[breadcrumbs]="[
6+
{ label: 'Catálogo', route: '/catalog/products' },
7+
{ label: 'Categorias' }
8+
]"
9+
>
10+
<div actions class="flex items-center gap-2">
11+
<app-button variant="primary" size="sm" iconStart="plus" (btnClick)="newCategory()">
12+
Nova Categoria
13+
</app-button>
14+
</div>
15+
</app-page-header>
16+
17+
<!-- Filter Toolbar -->
18+
<app-toolbar>
19+
<div start class="flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3 w-full">
20+
<app-search-input
21+
[value]="searchQuery()"
22+
(valueChange)="onSearchChange($event)"
23+
placeholder="Filtrar por nome, slug ou descrição..."
24+
/>
25+
26+
<app-select
27+
[value]="selectedStatus()"
28+
(valueChange)="onStatusChange($event)"
29+
[options]="[]"
30+
placeholder="Todos os Status"
31+
/>
32+
</div>
33+
34+
<div end class="flex items-center gap-2">
35+
<app-button variant="ghost" size="sm" iconStart="refresh-cw" (btnClick)="resetFilters()">
36+
Limpar
37+
</app-button>
38+
</div>
39+
</app-toolbar>
40+
41+
<!-- Table + Integrated Pagination Container -->
42+
<div class="w-full">
43+
<app-data-table
44+
[columns]="columns"
45+
[data]="paginatedCategories()"
46+
[actions]="actions"
47+
[loading]="loading()"
48+
[roundedBottom]="false"
49+
/>
50+
51+
<app-pagination
52+
[currentPage]="currentPage()"
53+
[pageSize]="pageSize()"
54+
[totalItems]="filteredCategories().length"
55+
[pageSizeOptions]="[5, 10, 25, 50]"
56+
(pageChange)="onPageChange($event)"
57+
(pageSizeChange)="onPageSizeChange($event)"
58+
/>
59+
</div>
60+
61+
<!-- Delete Confirmation Dialog -->
62+
<app-confirm-dialog
63+
[isOpen]="deleteDialogOpen()"
64+
title="Excluir Categoria do Catálogo"
65+
[message]="'Tem certeza de que deseja remover a categoria ' + (selectedCategoryForDelete()?.name || '') + '?'"
66+
type="danger"
67+
confirmText="Excluir Categoria"
68+
cancelText="Cancelar"
69+
(confirmAction)="executeDelete()"
70+
(cancelAction)="deleteDialogOpen.set(false)"
71+
/>
72+
73+
<!-- Category Create / Edit / View Drawer Form -->
74+
<app-category-form
75+
[isOpen]="isFormOpen()"
76+
[mode]="formMode()"
77+
[category]="selectedCategory()"
78+
[categoriesList]="allCategories()"
79+
(closeForm)="closeForm()"
80+
(categorySaved)="onCategorySaved()"
81+
/>

0 commit comments

Comments
 (0)