feat(envio-de-emails): add customizar assunto e corpo antes de enviar#627
feat(envio-de-emails): add customizar assunto e corpo antes de enviar#627
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request adds a new email composition workflow by introducing a dedicated route and view for users to compose emails with subject and body fields before sending, alongside store updates to accept and transmit these parameters to the backend API. Changes
Sequence DiagramsequenceDiagram
participant User
participant ListaView as EnvioDeEmailsLista.vue
participant Router
participant DetalhesView as EnvioDeEmailsDetalhes.vue
participant Store as envioDeEmails.store
participant API
User->>ListaView: Click "Enviar e-mail"
ListaView->>Router: Navigate to envioDeEmails.detalhes
Router->>DetalhesView: Mount view
DetalhesView->>Store: Get assuntoUltimoEmail & corpoUltimoEmail
Store-->>DetalhesView: Return stored subject & body
DetalhesView->>DetalhesView: Populate form fields
User->>DetalhesView: Fill/modify subject and body
User->>DetalhesView: Click submit
DetalhesView->>User: Show confirmation dialog
User->>DetalhesView: Confirm action
DetalhesView->>Store: dispararEmail(assunto, corpo)
Store->>API: POST with subject & body
API-->>Store: Response
Store-->>DetalhesView: Return ok status
DetalhesView->>Router: Navigate to envioDeEmails.listar
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 39 minutes and 27 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/src/stores/envioDeEmails.store.ts`:
- Around line 75-78: The code assigns this.corpoUltimoEmail from a non-existent
corpo field on DemandaEmailParlamentarDto so it always falls back to ''. Replace
the assignment of this.corpoUltimoEmail (in the same block where this.lista and
this.assuntoUltimoEmail are set) to source the email body from a real response
that contains the body (e.g., call the API or service that returns the full
email/detail DTO and use its body field), or remove the UI binding for
corpoUltimoEmail and related usage if bodies are not provided; ensure references
to DemandaEmailParlamentarDto are updated accordingly so the UI gets the actual
body field name returned by the backend (or remove the field from the contract).
In `@frontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vue`:
- Around line 18-34: The page must always reload its seed email instead of
relying on the store cache: remove the conditional cache check and call
envioDeEmailsStore.buscarTudo({ pagina: 1 }) unconditionally when the component
mounts (replace the if (!envioDeEmailsStore.lista.length) { ... } block). This
ensures envioDeEmailsStore.buscarTudo is invoked every time the component loads
so the form preloads the freshest row rather than stale data from
envioDeEmailsStore.lista.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 10dba606-97b5-41f3-92b4-4ecf84e893f5
📒 Files selected for processing (4)
frontend/src/router/configuracoes.jsfrontend/src/stores/envioDeEmails.store.tsfrontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vuefrontend/src/views/envioDeEmails/EnvioDeEmailsLista.vue
…viar Adiciona página de detalhes do e-mail onde o usuário edita assunto e conteúdo pré-preenchidos com o último envio antes de confirmar o disparo.
6577496 to
f02f372
Compare
Deploying smae with
|
| Latest commit: |
751edee
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a3e58aa3.smae.pages.dev |
| Branch Preview URL: | https://feature-seri-s03-08-customiz.smae.pages.dev |
Adiciona campo `corpo` à interface EmailItem refletindo retorno do backend. Remove cast `any` e busca dados sempre ao montar a página de detalhes.
|
❌ The last analysis has failed. |
Adiciona página de detalhes do e-mail onde o usuário edita assunto e conteúdo pré-preenchidos com o último envio antes de confirmar o disparo.
Summary by CodeRabbit