feat: agreement filters#208
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughReworks agreement pages and flow comment UI: Agreement detail replaces PartnerAgreementCard with a Section showing active badge, dates (date-fns ru) and patent status via getPatentStatus; agreement list adds sort/filter USelects and composable sorting/filtering; ItemComment and flow page adjust spacing and badge rendering; minor navigation styling tweaks. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant ListPage as Agreement List Page
participant UI as USelect / UBadge
participant SortFilter as Sort/Filter Logic
User->>ListPage: Open agreements list
ListPage->>UI: Render USelect (sort/filter) and labeled badge
User->>UI: Change sort or filter
UI->>SortFilter: chooseSortFunction(), chooseFilterFunction()
SortFilter-->>ListPage: toSorted(...).filter(...)
ListPage-->>User: Render filteredAgreements
sequenceDiagram
actor User
participant DetailPage as Agreement Detail Page
participant Helpers as date-fns / getPatentStatus
User->>DetailPage: Open agreement #[id]
DetailPage->>Helpers: format(concludedAt/willEndAt, ru)
DetailPage->>Helpers: getPatentStatus(patentStatus)
Helpers-->>DetailPage: formatted dates / patent status
DetailPage-->>User: Render Section with active badge, dates, royalty (if any), patent status, comment
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
apps/atrium-telegram/app/pages/agreement/index.vue (2)
99-106: Use a more precise six-month calculation.The current calculation
6 * 30 * 24 * 60 * 60 * 1000assumes all months have exactly 30 days, which is imprecise. Consider usingdate-fns(already a dependency) for accurate date arithmetic.Apply this diff to use
date-fnsfor accurate six-month calculation:+import { subMonths } from 'date-fns' + function filterByWillEndSoon(agreement: PartnerAgreementWithAllData) { - const SIX_MONTHS = 6 * 30 * 24 * 60 * 60 * 1000 + const sixMonthsFromNow = subMonths(new Date(), -6) return ( agreement.isActive && agreement.willEndAt - && new Date(agreement.willEndAt).getTime() - new Date().getTime() < SIX_MONTHS + && new Date(agreement.willEndAt) <= sixMonthsFromNow ) }
91-93: Add parameter tofilterByAllfor signature consistency.While
filterByAlldoesn't need the agreement parameter, adding it maintains consistency with the other filter functions and makes the signature uniform.Apply this diff:
-function filterByAll() { +function filterByAll(_agreement: PartnerAgreementWithAllData) { return true }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/atrium-telegram/app/components/PartnerAgreementCard.vue(1 hunks)apps/atrium-telegram/app/components/flow/ItemComment.vue(2 hunks)apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue(1 hunks)apps/atrium-telegram/app/pages/agreement/index.vue(2 hunks)apps/atrium-telegram/app/pages/flow/[itemId]/index.vue(1 hunks)apps/atrium-telegram/app/pages/navigation.vue(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
|



Summary by CodeRabbit
New Features
Style