365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

365 intranet problema com o next das imagens - #367

Merged
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens
Apr 30, 2026
Merged

365 intranet problema com o next das imagens#367
GRHInvDev merged 3 commits into
mainfrom
365-intranet---problema-com-o-next-das-imagens

Conversation

@rbxyz

@rbxyzrbxyz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added filial (branch) management admin page for organizational structure administration.
    • Form response data can now be exported to CSV spreadsheet format with customizable field selection and date filtering.
    • Profile completion now includes filial selection for certain enterprise types.
  • Chores

    • Updated app version to 1.19.0.
    • Upgraded Prisma dependencies to v6.19.3.
    • Added react-window dependency for optimized list rendering.

rbxyzand others added 3 commits April 23, 2026 15:16
Implement full CRUD management for company branches with a dedicated admin page:
- New /admin/filiais page for creating, editing, and deleting branches
- Filial list with search/filter capabilities
- User assignment to branches (1-to-1 relationship)
- Virtual list of users per branch
- Edit branch assignment from user management page
- Backend endpoints: list, getById, create, update, delete branches
- User endpoints: listAllUsers, updateUserFilial
Features:
- Branch details expandable view with assigned users
- Modal forms for create/edit operations
- Delete confirmation with user count validation
- Toast notifications for all operations
- Proper access control (sudo-only for management)
- Release notes updated to 1.18.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Added new rules for managing branches (filiais) in the admin panel.
- Updated user role configurations to include permissions for managing branches.
- Enhanced the admin home page to include a route for branch management.
- Improved the user management card to display and manage branch permissions.
- Updated various components to handle branch-related data and interactions.
- Refactored code for better clarity and maintainability.
Release notes updated to version 1.19.0.
@rbxyzrbxyz self-assigned this Apr 30, 2026
@vercel

vercelBot commented Apr 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: elo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@coderabbitai

coderabbitaiBot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2066f906-cb35-47ec-9c3b-62aacb75dcfc

📥 Commits

Reviewing files that changed from the base of the PR and between abb0f88 and 8b83e8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • CLAUDE.md
  • package.json
  • prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql
  • prisma/migrations/20260430120000_add_filial/migration.sql
  • prisma/schema.prisma
  • scripts/prisma-link-client.mjs
  • scripts/sql/insert-filial-cachoeirinha.sql
  • scripts/sql/insert-filial-lages.sql
  • src/app/(authenticated)/admin/filiais/page.tsx
  • src/app/(authenticated)/admin/food/_components/orders-tab.tsx
  • src/app/(authenticated)/admin/page.tsx
  • src/app/(authenticated)/admin/quality/enums/page.tsx
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/app/(authenticated)/admin/users/page.tsx
  • src/app/(authenticated)/cars/details/page.tsx
  • src/app/(authenticated)/dashboard/page.tsx
  • src/app/(authenticated)/forms/[id]/edit/page.tsx
  • src/app/(authenticated)/forms/hall-entrada/page.tsx
  • src/app/api/chat/route.ts
  • src/components/admin/products/order-details-modal.tsx
  • src/components/admin/suggestion/kpi-management-modal.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/components/admin/vehicles/vehicle-metrics.tsx
  • src/components/chat/ChatRoom.tsx
  • src/components/dashboard/videos-carousel.tsx
  • src/components/dashboard/weather-widget.tsx
  • src/components/forms/create-manual-response-dialog.tsx
  • src/components/forms/field-type-selector.tsx
  • src/components/forms/form-builder-with-save.tsx
  • src/components/forms/form-response.tsx
  • src/components/forms/form-responses-export-dialog.tsx
  • src/components/forms/form-spreadsheet-export-settings.tsx
  • src/components/forms/form-visibility-settings.tsx
  • src/components/forms/responses-list.tsx
  • src/components/shop/my-orders-list.tsx
  • src/components/ui/complete-profile-modal.tsx
  • src/components/ui/image-carousel.tsx
  • src/const/admin-routes.ts
  • src/const/app-release-notes.ts
  • src/hooks/use-access-control.tsx
  • src/lib/access-control-server.ts
  • src/lib/form-csv-export.ts
  • src/server/api/root.ts
  • src/server/api/routers/filiais.ts
  • src/server/api/routers/form-response.ts
  • src/server/api/routers/forms.ts
  • src/server/api/routers/kpi.ts
  • src/server/api/routers/purchase-registration.ts
  • src/server/api/routers/suggestions.ts
  • src/server/api/routers/user.ts
  • src/types/enterprise.ts
  • src/types/role-config.ts
  • src/types/suggestion-ai-enhancement.ts

📝 Walkthrough

Walkthrough

This PR introduces filial (branch location) management with database schema extensions, spreadsheet export capabilities for form responses, admin UI for filial administration, and systematically removes TypeScript type assertions in favor of direct property access and proper typing.

Changes

Cohort / File(s)Summary
Version & Dependencies
package.json, CLAUDE.md
Version bump to 1.19.0; adds prisma-link-client.mjs post-generation script; upgrades Prisma packages to 6.19.3; adds react-window and @types/pg dependencies; updates agent instructions for Browser execution gating.
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20260424120000_form_spreadsheet_export/migration.sql, prisma/migrations/20260430120000_add_filial/migration.sql
Adds Filial model with unique code and user relations; extends User with nullable filialId; adds spreadsheetExportEnabled boolean flag to Form model; creates corresponding database columns and foreign key constraints.
Filial Data Initialization
scripts/prisma-link-client.mjs, scripts/sql/insert-filial-*.sql
Creates symlink management script for Prisma client; inserts two predefined filial records (Cachoeirinha, Lages) with duplicate-prevention checks.
Filial Management (Admin UI & API)
src/app/(authenticated)/admin/filiais/page.tsx, src/server/api/routers/filiais.ts
New admin page with full CRUD for filials (list, create, edit, delete, fetch with users); includes search, virtualized lists, and modals; router with permission checks, code uniqueness enforcement, and user-linked deletion prevention.
Form Response Export
src/components/forms/form-responses-export-dialog.tsx, src/components/forms/form-spreadsheet-export-settings.tsx, src/lib/form-csv-export.ts, src/server/api/routers/form-response.ts
New export dialog component with field selection and date range filtering; new form settings component for export toggle; CSV formatting/escaping utilities; new TRPC mutation fetching up to 8,000 responses and generating CSV with dynamic field columns.
Form Visibility & Builder Refactoring
src/components/forms/form-visibility-settings.tsx, src/components/forms/form-builder-with-save.tsx, src/app/(authenticated)/forms/[id]/edit/page.tsx
Extracts visibility controls into dedicated component; adds spreadsheet export settings component; passes spreadsheetExportEnabled through form builder and edit page; refactors form creation/update to use new components.
Response List & Display
src/components/forms/responses-list.tsx
Adds conditional export dialog rendering; computes canExportSpreadsheet from owner check and feature flag; refactors formatResponseValue to handle bigint, symbol, function types explicitly without broad casting.
User Management (Profile & Admin)
src/components/ui/complete-profile-modal.tsx, src/app/(authenticated)/admin/users/page.tsx, src/server/api/routers/user.ts
Extended CompleteProfileModal with filial selection (required for filial enterprises); admin users page loads filials and provides "Alterar Filial" modal; added listAllUsers and updateUserFilial procedures with permission enforcement; extended RolesConfig with can_manage_filial flag.
Dashboard & Profile Completion
src/app/(authenticated)/dashboard/page.tsx
Gates profile completion on filialId when enterprise is a filial type; passes filialId to CompleteProfileModal; updates footer link from Allpines to EzLab.
Admin Routing & Access Control
src/const/admin-routes.ts, src/lib/access-control-server.ts, src/hooks/use-access-control.tsx, src/app/(authenticated)/admin/page.tsx
Adds /admin/filiais route with icon; introduces can_manage_filial permission flag to routing/access functions; updates admin home to include filiais under "Operações e infraestrutura".
Type Extraction & System Types
src/types/enterprise.ts, src/types/role-config.ts, src/components/dashboard/videos-carousel.tsx, src/components/dashboard/weather-widget.tsx
New Enterprise union type from hardcoded values; extends RolesConfig with can_manage_filial; switches weather/videos components to use local enterprise type instead of Prisma import; updates location logic to use string literals.
Prisma Type Assertion Removal (Routers)
src/server/api/routers/form-response.ts, src/server/api/routers/forms.ts, src/server/api/routers/user.ts, src/server/api/routers/purchase-registration.ts, src/server/api/routers/suggestions.ts, src/server/api/routers/kpi.ts
Removes Prisma.* type casts in favor of direct object assignment; updates query mode filters to use string literals; extends form, user routers with spreadsheet export and filial fields.
Component Type Refactoring
src/app/(authenticated)/admin/food/_components/orders-tab.tsx, src/app/(authenticated)/admin/quality/enums/page.tsx, src/app/(authenticated)/admin/suggestions/page.tsx, src/app/(authenticated)/forms/hall-entrada/page.tsx, src/app/(authenticated)/cars/details/page.tsx, src/components/admin/products/order-details-modal.tsx, src/components/admin/suggestion/kpi-management-modal.tsx, src/components/admin/suggestion/suggestions-kanban-board.tsx, src/components/admin/vehicles/vehicle-metrics.tsx, src/components/chat/ChatRoom.tsx, src/components/forms/create-manual-response-dialog.tsx, src/components/forms/field-type-selector.tsx, src/components/forms/form-response.tsx, src/components/shop/my-orders-list.tsx, src/components/ui/image-carousel.tsx, src/types/suggestion-ai-enhancement.ts
Systematically removes explicit type assertions (as Type) in favor of direct property access, explicit generic parameters, or direct return values; refactors Date construction and array type annotations; removes intermediate unknown casts.
Minor Changes
src/app/api/chat/route.ts, src/server/api/root.ts, src/const/app-release-notes.ts
Replaces type assertion with Reflect.get for message extraction; wires filiaisRouter into root API; updates release notes for versions 1.18.0 and 1.19.0.

Sequence Diagrams

sequenceDiagram
actor User as Admin User
participant FiliaisUI as Filiais Admin Page
participant API as tRPC Router<br/>(filiais)
participant DB as Database<br/>(filiais table)
User->>FiliaisUI: Load filiais page
FiliaisUI->>API: list() - fetch all filials
API->>DB: SELECT * FROM filiais
DB-->>API: filial records
API-->>FiliaisUI: filial list
FilialsUI->>User: Render list with search
User->>FiliaisUI: Create new filial
FiliaisUI->>API: create({name, code})
API->>API: Validate code uniqueness
API->>DB: INSERT filial
DB-->>API: Success / CONFLICT
API-->>FiliaisUI: Result + toast
FilialsUI->>User: Show success/error
User->>FilialsUI: Select filial → edit users
FilialsUI->>API: getById(filialId)
API->>DB: SELECT filial with users
DB-->>API: Filial + users
API-->>FilialsUI: Filial detail
FilialsUI->>User: Render filial users
Loading
sequenceDiagram
actor User as Form Respondent
participant ResponsesUI as Form Responses List
participant ExportDialog as Export Dialog
participant API as tRPC Router<br/>(formResponse)
participant DB as Database<br/>(formResponses table)
participant Client as Browser Client
User->>ResponsesUI: View form responses
ResponsesUI->>ResponsesUI: Check canExportSpreadsheet<br/>(isOwner + flag)
ResponsesUI->>ExportDialog: Render export button
User->>ExportDialog: Click export
ExportDialog->>ExportDialog: Select fields & dates
User->>ExportDialog: Submit export
ExportDialog->>API: exportSpreadsheetCsv<br/>({formId, fieldIds, dates})
API->>DB: SELECT responses (8k limit)<br/>with date filter
DB-->>API: Matching responses
API->>API: Format CSV rows<br/>+ static columns
API->>API: Build CSV string + BOM
API-->>ExportDialog: {csv, filename, truncated}
ExportDialog->>Client: Create Blob + download
Client-->>User: CSV file downloaded
ExportDialog->>ExportDialog: Show success/warning toast
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 A warren of filials now managed with care,
CSV exports floating through digital air,
Type assertions banished, the code shines so bright,
From schema to UI, each piece set right!
Branches are budding in this burrow's delight. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 365-intranet---problema-com-o-next-das-imagens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@GRHInvDev
GRHInvDev merged commit 4d6bd21 into mainApr 30, 2026
5 of 8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rbxyz@GRHInvDev