https://sonarly.com/issue/21546?type=bug When users select all records (exclusion mode), the delete option never appears in the command menu because the `noneDefined(selectedRecords, "deletedAt")` check in the conditional availability expression evaluates to `false` on empty arrays, and `selectedRecords` is always `[]` in exclusion mode. Fix: Modified the `conditionalAvailabilityExpression` for the three bulk record commands (delete, restore, destroy) in `standard-command-menu-item.constant.ts` to handle the "select all" (exclusion) mode. **Problem:** When "select all" is used, the context store switches to exclusion mode where `selectedRecords` is always `[]` (empty array). The `noneDefined()` and `everyDefined()` functions in the expression parser return `false` for empty arrays by design. This caused the delete/restore/destroy commands to never appear in the command menu during "select all". **Fix:** Wrapped each `selectedRecords` array check with `(isSelectAll or ...)` so that: - In **selection mode** (individual records selected): the original `noneDefined`/`everyDefined` checks still apply, verifying each record's `deletedAt` status - In **exclusion mode** (select all): the `selectedRecords` check is bypassed since individual records aren't available in the context, and the backend handles filtering during the actual operation The `isSelectAll` boolean is already computed and available in the `commandMenuContextApi` (set in `useCommandMenuContextApi.ts` line 116 as `contextStoreTargetedRecordsRule.mode === 'exclusion'`). Changes: 1. **deleteRecords**: `noneDefined(selectedRecords, "deletedAt")` → `(isSelectAll or noneDefined(selectedRecords, "deletedAt"))` 2. **restoreRecords**: `everyDefined(selectedRecords, "deletedAt")` → `(isSelectAll or everyDefined(selectedRecords, "deletedAt"))` 3. **destroyRecords**: `everyDefined(selectedRecords, "deletedAt")` → `(isSelectAll or everyDefined(selectedRecords, "deletedAt"))` Note: For restore/destroy in select-all mode, the commands will appear even though we can't verify all records have `deletedAt` set. This is acceptable because these commands already require `hasAnySoftDeleteFilterOnView` (restore) or the user being in a deleted records view, and the backend filters appropriately during execution. Existing workspaces will need a `workspace:sync-metadata` run to pick up the updated expressions. |
||
|---|---|---|
| .cursor | ||
| .github | ||
| .vscode | ||
| .yarn | ||
| packages | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .mcp.json | ||
| .nvmrc | ||
| .yarnrc.yml | ||
| CLAUDE.md | ||
| jest.preset.js | ||
| LICENSE | ||
| nx.json | ||
| package.json | ||
| README.md | ||
| tsconfig.base.json | ||
| yarn.config.cjs | ||
| yarn.lock | ||
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Why Twenty
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Jotai, Linaria and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!