@kelpie/ui 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/resources/bulkActions.d.ts +50 -0
- package/dist/api/resources/bulkActions.d.ts.map +1 -0
- package/dist/api/resources/bulkActions.js +192 -0
- package/dist/api/resources/bulkActions.js.map +1 -0
- package/dist/api/resources/forms.d.ts +26 -1
- package/dist/api/resources/forms.d.ts.map +1 -1
- package/dist/api/resources/forms.js +98 -1
- package/dist/api/resources/forms.js.map +1 -1
- package/dist/app/KelpieApp.d.ts.map +1 -1
- package/dist/app/KelpieApp.js +3 -1
- package/dist/app/KelpieApp.js.map +1 -1
- package/dist/components/BulkActions.d.ts +61 -0
- package/dist/components/BulkActions.d.ts.map +1 -0
- package/dist/components/BulkActions.js +351 -0
- package/dist/components/BulkActions.js.map +1 -0
- package/dist/components/BulkParamFields.d.ts +13 -0
- package/dist/components/BulkParamFields.d.ts.map +1 -0
- package/dist/components/BulkParamFields.js +177 -0
- package/dist/components/BulkParamFields.js.map +1 -0
- package/dist/components/CellLinks.d.ts +38 -0
- package/dist/components/CellLinks.d.ts.map +1 -0
- package/dist/components/CellLinks.js +58 -0
- package/dist/components/CellLinks.js.map +1 -0
- package/dist/components/CustomFieldsPanel.d.ts +12 -1
- package/dist/components/CustomFieldsPanel.d.ts.map +1 -1
- package/dist/components/CustomFieldsPanel.js +5 -1
- package/dist/components/CustomFieldsPanel.js.map +1 -1
- package/dist/components/DataTable.d.ts +42 -1
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable.js +51 -16
- package/dist/components/DataTable.js.map +1 -1
- package/dist/components/PhonesField.d.ts.map +1 -1
- package/dist/components/PhonesField.js +1 -3
- package/dist/components/PhonesField.js.map +1 -1
- package/dist/components/Shell.d.ts.map +1 -1
- package/dist/components/Shell.js +16 -6
- package/dist/components/Shell.js.map +1 -1
- package/dist/components/TagInput.d.ts.map +1 -1
- package/dist/components/TagInput.js +5 -0
- package/dist/components/TagInput.js.map +1 -1
- package/dist/components/bulkActionParams.d.ts +71 -0
- package/dist/components/bulkActionParams.d.ts.map +1 -0
- package/dist/components/bulkActionParams.js +241 -0
- package/dist/components/bulkActionParams.js.map +1 -0
- package/dist/components/bulkActionSummary.d.ts +22 -0
- package/dist/components/bulkActionSummary.d.ts.map +1 -0
- package/dist/components/bulkActionSummary.js +68 -0
- package/dist/components/bulkActionSummary.js.map +1 -0
- package/dist/components/bulkJobStatus.d.ts +4 -0
- package/dist/components/bulkJobStatus.d.ts.map +1 -0
- package/dist/components/bulkJobStatus.js +10 -0
- package/dist/components/bulkJobStatus.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/bulkSelection.d.ts +43 -0
- package/dist/lib/bulkSelection.d.ts.map +1 -0
- package/dist/lib/bulkSelection.js +70 -0
- package/dist/lib/bulkSelection.js.map +1 -0
- package/dist/lib/contactLinks.d.ts +15 -0
- package/dist/lib/contactLinks.d.ts.map +1 -0
- package/dist/lib/contactLinks.js +22 -0
- package/dist/lib/contactLinks.js.map +1 -0
- package/dist/pages/BulkJobsPage.d.ts +3 -0
- package/dist/pages/BulkJobsPage.d.ts.map +1 -0
- package/dist/pages/BulkJobsPage.js +92 -0
- package/dist/pages/BulkJobsPage.js.map +1 -0
- package/dist/pages/CompaniesPage.d.ts.map +1 -1
- package/dist/pages/CompaniesPage.js +8 -4
- package/dist/pages/CompaniesPage.js.map +1 -1
- package/dist/pages/DealsPage.d.ts.map +1 -1
- package/dist/pages/DealsPage.js +15 -4
- package/dist/pages/DealsPage.js.map +1 -1
- package/dist/pages/DecisionsPage.d.ts.map +1 -1
- package/dist/pages/DecisionsPage.js +11 -1
- package/dist/pages/DecisionsPage.js.map +1 -1
- package/dist/pages/EnquiriesPage.d.ts.map +1 -1
- package/dist/pages/EnquiriesPage.js +15 -6
- package/dist/pages/EnquiriesPage.js.map +1 -1
- package/dist/pages/EventDetail.d.ts.map +1 -1
- package/dist/pages/EventDetail.js +14 -6
- package/dist/pages/EventDetail.js.map +1 -1
- package/dist/pages/EventsPage.d.ts.map +1 -1
- package/dist/pages/EventsPage.js +13 -3
- package/dist/pages/EventsPage.js.map +1 -1
- package/dist/pages/FormsPage.d.ts.map +1 -1
- package/dist/pages/FormsPage.js +2 -2
- package/dist/pages/FormsPage.js.map +1 -1
- package/dist/pages/FundraisingPage.d.ts.map +1 -1
- package/dist/pages/FundraisingPage.js +15 -4
- package/dist/pages/FundraisingPage.js.map +1 -1
- package/dist/pages/HiringPage.d.ts.map +1 -1
- package/dist/pages/HiringPage.js +2 -1
- package/dist/pages/HiringPage.js.map +1 -1
- package/dist/pages/ListDetail.d.ts.map +1 -1
- package/dist/pages/ListDetail.js +39 -7
- package/dist/pages/ListDetail.js.map +1 -1
- package/dist/pages/ListsPage.d.ts.map +1 -1
- package/dist/pages/ListsPage.js +2 -1
- package/dist/pages/ListsPage.js.map +1 -1
- package/dist/pages/OpportunitiesPage.d.ts.map +1 -1
- package/dist/pages/OpportunitiesPage.js +15 -6
- package/dist/pages/OpportunitiesPage.js.map +1 -1
- package/dist/pages/PartnershipsPage.d.ts.map +1 -1
- package/dist/pages/PartnershipsPage.js +15 -4
- package/dist/pages/PartnershipsPage.js.map +1 -1
- package/dist/pages/PeoplePage.d.ts.map +1 -1
- package/dist/pages/PeoplePage.js +10 -9
- package/dist/pages/PeoplePage.js.map +1 -1
- package/dist/pages/PlanningPage.d.ts.map +1 -1
- package/dist/pages/PlanningPage.js +15 -4
- package/dist/pages/PlanningPage.js.map +1 -1
- package/dist/pages/RoleDetail.d.ts.map +1 -1
- package/dist/pages/RoleDetail.js +12 -4
- package/dist/pages/RoleDetail.js.map +1 -1
- package/dist/pages/forms/BlockedSendersPage.d.ts +10 -0
- package/dist/pages/forms/BlockedSendersPage.d.ts.map +1 -0
- package/dist/pages/forms/BlockedSendersPage.js +65 -0
- package/dist/pages/forms/BlockedSendersPage.js.map +1 -0
- package/dist/pages/forms/MarkSpamPanel.d.ts +19 -0
- package/dist/pages/forms/MarkSpamPanel.d.ts.map +1 -0
- package/dist/pages/forms/MarkSpamPanel.js +62 -0
- package/dist/pages/forms/MarkSpamPanel.js.map +1 -0
- package/dist/pages/forms/SubmissionDetail.d.ts.map +1 -1
- package/dist/pages/forms/SubmissionDetail.js +41 -11
- package/dist/pages/forms/SubmissionDetail.js.map +1 -1
- package/dist/pages/forms/SubmissionsTable.d.ts +1 -1
- package/dist/pages/forms/SubmissionsTable.d.ts.map +1 -1
- package/dist/pages/forms/SubmissionsTable.js +6 -4
- package/dist/pages/forms/SubmissionsTable.js.map +1 -1
- package/dist/pages/forms/markSpamChoices.d.ts +51 -0
- package/dist/pages/forms/markSpamChoices.d.ts.map +1 -0
- package/dist/pages/forms/markSpamChoices.js +96 -0
- package/dist/pages/forms/markSpamChoices.js.map +1 -0
- package/dist/pages/positionDirectory.d.ts +5 -0
- package/dist/pages/positionDirectory.d.ts.map +1 -1
- package/dist/pages/positionDirectory.js +11 -3
- package/dist/pages/positionDirectory.js.map +1 -1
- package/dist/registry/context.d.ts +3 -1
- package/dist/registry/context.d.ts.map +1 -1
- package/dist/registry/context.js +4 -0
- package/dist/registry/context.js.map +1 -1
- package/dist/registry/contributions.d.ts +23 -0
- package/dist/registry/contributions.d.ts.map +1 -1
- package/dist/registry/contributions.js.map +1 -1
- package/dist/registry/registry.d.ts +4 -1
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +6 -0
- package/dist/registry/registry.js.map +1 -1
- package/dist/registry/visibleNav.d.ts.map +1 -1
- package/dist/registry/visibleNav.js +1 -0
- package/dist/registry/visibleNav.js.map +1 -1
- package/package.json +3 -3
- package/src/api/resources/bulkActions.ts +267 -0
- package/src/api/resources/forms.ts +135 -0
- package/src/app/KelpieApp.tsx +5 -0
- package/src/components/BulkActions.tsx +961 -0
- package/src/components/BulkParamFields.tsx +524 -0
- package/src/components/CellLinks.tsx +138 -0
- package/src/components/CustomFieldsPanel.tsx +6 -2
- package/src/components/DataTable.tsx +142 -2
- package/src/components/PhonesField.tsx +2 -4
- package/src/components/Shell.tsx +23 -6
- package/src/components/TagInput.tsx +5 -0
- package/src/components/bulkActionParams.ts +405 -0
- package/src/components/bulkActionSummary.ts +104 -0
- package/src/components/bulkJobStatus.ts +11 -0
- package/src/index.ts +3 -0
- package/src/lib/bulkSelection.ts +128 -0
- package/src/lib/contactLinks.ts +25 -0
- package/src/pages/BulkJobsPage.tsx +206 -0
- package/src/pages/CompaniesPage.tsx +20 -5
- package/src/pages/DealsPage.tsx +30 -2
- package/src/pages/DecisionsPage.tsx +21 -1
- package/src/pages/EnquiriesPage.tsx +33 -5
- package/src/pages/EventDetail.tsx +43 -16
- package/src/pages/EventsPage.tsx +26 -2
- package/src/pages/FormsPage.tsx +7 -1
- package/src/pages/FundraisingPage.tsx +30 -2
- package/src/pages/HiringPage.tsx +6 -1
- package/src/pages/ListDetail.tsx +69 -5
- package/src/pages/ListsPage.tsx +6 -1
- package/src/pages/OpportunitiesPage.tsx +33 -5
- package/src/pages/PartnershipsPage.tsx +30 -2
- package/src/pages/PeoplePage.tsx +26 -21
- package/src/pages/PlanningPage.tsx +65 -24
- package/src/pages/RoleDetail.tsx +35 -7
- package/src/pages/forms/BlockedSendersPage.tsx +155 -0
- package/src/pages/forms/MarkSpamPanel.tsx +193 -0
- package/src/pages/forms/SubmissionDetail.tsx +73 -18
- package/src/pages/forms/SubmissionsTable.tsx +7 -5
- package/src/pages/forms/markSpamChoices.ts +141 -0
- package/src/pages/positionDirectory.ts +16 -4
- package/src/registry/context.ts +6 -0
- package/src/registry/contributions.ts +25 -0
- package/src/registry/registry.ts +12 -0
- package/src/registry/visibleNav.ts +1 -0
package/src/pages/EventsPage.tsx
CHANGED
|
@@ -9,6 +9,8 @@ import { Link, useNavigate } from 'react-router'
|
|
|
9
9
|
|
|
10
10
|
import { useTimezone } from '../api/resources/account.ts'
|
|
11
11
|
import { useCreateEvent, useEvents } from '../api/resources/events.ts'
|
|
12
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
13
|
+
import { RecordLink } from '../components/CellLinks.tsx'
|
|
12
14
|
import { Chip } from '../components/Chip.tsx'
|
|
13
15
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
14
16
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -18,6 +20,8 @@ import { FilterBar, PageHeader } from '../components/PageHeader.tsx'
|
|
|
18
20
|
import { Paginator } from '../components/Paginator.tsx'
|
|
19
21
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
20
22
|
import { SegmentedControl } from '../components/SegmentedControl.tsx'
|
|
23
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
24
|
+
import type { BulkFilter } from '../lib/bulkSelection.ts'
|
|
21
25
|
import { formatDateTime } from '../lib/dates.ts'
|
|
22
26
|
import { useListView } from '../lib/listView.ts'
|
|
23
27
|
import { serverSortOnly } from '../lib/sort.ts'
|
|
@@ -84,6 +88,13 @@ export function EventsPage(): React.JSX.Element {
|
|
|
84
88
|
),
|
|
85
89
|
limit: board === 'calendar' ? 200 : undefined,
|
|
86
90
|
})
|
|
91
|
+
// The calendar has no checkboxes, so switching to it clears a selection.
|
|
92
|
+
const bulkFilter: BulkFilter = {
|
|
93
|
+
...(term.trim().length > 0 ? { q: term.trim() } : {}),
|
|
94
|
+
...(fromTo.from === undefined ? {} : { from: fromTo.from }),
|
|
95
|
+
...(fromTo.to === undefined ? {} : { to: fromTo.to }),
|
|
96
|
+
}
|
|
97
|
+
const bulk = useBulkSelection({ filter: bulkFilter, resetOn: [sort, board] })
|
|
87
98
|
|
|
88
99
|
async function addEvent(event: FormEvent): Promise<void> {
|
|
89
100
|
event.preventDefault()
|
|
@@ -113,7 +124,11 @@ export function EventsPage(): React.JSX.Element {
|
|
|
113
124
|
key: 'name',
|
|
114
125
|
header: 'Event',
|
|
115
126
|
sortKey: 'name',
|
|
116
|
-
render: (record) =>
|
|
127
|
+
render: (record) => (
|
|
128
|
+
<RecordLink to={`/events/${record.id}`} className="font-medium text-ink">
|
|
129
|
+
{record.name}
|
|
130
|
+
</RecordLink>
|
|
131
|
+
),
|
|
117
132
|
},
|
|
118
133
|
{
|
|
119
134
|
key: 'starts',
|
|
@@ -196,7 +211,15 @@ export function EventsPage(): React.JSX.Element {
|
|
|
196
211
|
}
|
|
197
212
|
/>
|
|
198
213
|
|
|
199
|
-
<
|
|
214
|
+
<BulkActions
|
|
215
|
+
targetType="event"
|
|
216
|
+
selection={bulk}
|
|
217
|
+
pageIds={events.records.map((record) => record.id)}
|
|
218
|
+
hasNextPage={events.hasNext}
|
|
219
|
+
noun={{ one: 'event', many: 'events' }}
|
|
220
|
+
>
|
|
221
|
+
<FilterBar value={term} onChange={setTerm} placeholder="Search events…" />
|
|
222
|
+
</BulkActions>
|
|
200
223
|
|
|
201
224
|
{adding && (
|
|
202
225
|
<form
|
|
@@ -269,6 +292,7 @@ export function EventsPage(): React.JSX.Element {
|
|
|
269
292
|
sort={sort}
|
|
270
293
|
onSortChange={setSort}
|
|
271
294
|
visibleColumnKeys={listView.visibleKeys}
|
|
295
|
+
selection={{ ...bulk, rowLabel: (record) => record.name }}
|
|
272
296
|
/>
|
|
273
297
|
<Paginator list={events} />
|
|
274
298
|
</>
|
package/src/pages/FormsPage.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Form } from '@kelpie/schemas'
|
|
2
2
|
import { useState } from 'react'
|
|
3
|
-
import { useNavigate } from 'react-router'
|
|
3
|
+
import { Link, useNavigate } from 'react-router'
|
|
4
4
|
|
|
5
5
|
import { useTimezone } from '../api/resources/account.ts'
|
|
6
6
|
import { useCreateForm, useForms } from '../api/resources/forms.ts'
|
|
@@ -185,6 +185,12 @@ export function FormsPage(): React.JSX.Element {
|
|
|
185
185
|
visibleKeys={listView.visibleKeys}
|
|
186
186
|
onChange={listView.setVisibleKeys}
|
|
187
187
|
/>
|
|
188
|
+
<Link
|
|
189
|
+
to="/forms/blocked-senders"
|
|
190
|
+
className="rounded-md border border-border px-2.5 py-1 text-[12px] font-medium text-ink-muted transition hover:border-border-strong hover:text-ink"
|
|
191
|
+
>
|
|
192
|
+
Blocked senders
|
|
193
|
+
</Link>
|
|
188
194
|
</>
|
|
189
195
|
}
|
|
190
196
|
/>
|
|
@@ -10,6 +10,8 @@ import { useCreateRaise, useRaises, useUpdateRaise } from '../api/resources/rais
|
|
|
10
10
|
import { useTimezone } from '../api/resources/account.ts'
|
|
11
11
|
import { AddCompanyRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
12
12
|
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
13
|
+
import { CompanyLink, RecordLink } from '../components/CellLinks.tsx'
|
|
14
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
13
15
|
import { Chip } from '../components/Chip.tsx'
|
|
14
16
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
15
17
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -20,6 +22,7 @@ import { PageHeader } from '../components/PageHeader.tsx'
|
|
|
20
22
|
import { Paginator } from '../components/Paginator.tsx'
|
|
21
23
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
22
24
|
import { SegmentedControl } from '../components/SegmentedControl.tsx'
|
|
25
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
23
26
|
import { formatDate, formatDay } from '../lib/dates.ts'
|
|
24
27
|
import { useListView } from '../lib/listView.ts'
|
|
25
28
|
import { formatMoney } from '../lib/money.ts'
|
|
@@ -111,6 +114,15 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
111
114
|
const visibleStageIds = new Set(visibleStages.map((stage) => stage.id))
|
|
112
115
|
const visibleRaises = raises.records.filter((raise) => visibleStageIds.has(raise.stageId))
|
|
113
116
|
|
|
117
|
+
// The board has no checkboxes, so a selection lives only in the list, and
|
|
118
|
+
// switching view clears it. The Open scope is a filter on stage, so a
|
|
119
|
+
// filter selection names the open stages the list is showing.
|
|
120
|
+
const openStageIds = visibleStages.map((stage) => stage.id)
|
|
121
|
+
const bulk = useBulkSelection({
|
|
122
|
+
filter: scope === 'open' && openStageIds.length > 0 ? { stage_id: openStageIds } : {},
|
|
123
|
+
resetOn: [sort, view],
|
|
124
|
+
})
|
|
125
|
+
|
|
114
126
|
// The next-step column asks about the records on screen by id. `?target_id=`
|
|
115
127
|
// takes at most one page of them (`docs/agents/api-and-webhooks.md`), so past that ceiling the rest
|
|
116
128
|
// read as having no plan; the note under the table says so.
|
|
@@ -151,13 +163,19 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
151
163
|
key: 'name',
|
|
152
164
|
header: 'Raise',
|
|
153
165
|
sortKey: 'name',
|
|
154
|
-
render: (raise) =>
|
|
166
|
+
render: (raise) => (
|
|
167
|
+
<RecordLink to={`/fundraising/${raise.id}`} className="font-medium text-ink">
|
|
168
|
+
{raise.name}
|
|
169
|
+
</RecordLink>
|
|
170
|
+
),
|
|
155
171
|
},
|
|
156
172
|
{
|
|
157
173
|
key: 'company',
|
|
158
174
|
header: 'Firm',
|
|
159
175
|
getSortValue: (raise) => companyNameById.get(raise.companyId) ?? null,
|
|
160
|
-
render: (raise) =>
|
|
176
|
+
render: (raise) => (
|
|
177
|
+
<CompanyLink id={raise.companyId} name={companyNameById.get(raise.companyId)} />
|
|
178
|
+
),
|
|
161
179
|
},
|
|
162
180
|
{
|
|
163
181
|
key: 'stage',
|
|
@@ -416,6 +434,15 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
416
434
|
<LoadingPanel label="Loading raises…" />
|
|
417
435
|
) : (
|
|
418
436
|
<>
|
|
437
|
+
{view === 'list' && (
|
|
438
|
+
<BulkActions
|
|
439
|
+
targetType="raise"
|
|
440
|
+
selection={bulk}
|
|
441
|
+
pageIds={visibleRaises.map((raise) => raise.id)}
|
|
442
|
+
hasNextPage={raises.hasNext}
|
|
443
|
+
noun={{ one: 'raise', many: 'raises' }}
|
|
444
|
+
/>
|
|
445
|
+
)}
|
|
419
446
|
{view === 'list' && <Paginator list={raises} placement="top" />}
|
|
420
447
|
{view === 'columns' ? (
|
|
421
448
|
<KanbanBoard
|
|
@@ -471,6 +498,7 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
471
498
|
listView.setSort(next)
|
|
472
499
|
}}
|
|
473
500
|
visibleColumnKeys={listView.visibleKeys}
|
|
501
|
+
selection={{ ...bulk, rowLabel: (raise) => raise.name }}
|
|
474
502
|
/>
|
|
475
503
|
)}
|
|
476
504
|
{updateRaise.error !== null && (
|
package/src/pages/HiringPage.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { useNavigate } from 'react-router'
|
|
|
5
5
|
|
|
6
6
|
import { useTimezone } from '../api/resources/account.ts'
|
|
7
7
|
import { useCreateRole, useRoles } from '../api/resources/roles.ts'
|
|
8
|
+
import { RecordLink } from '../components/CellLinks.tsx'
|
|
8
9
|
import { Chip } from '../components/Chip.tsx'
|
|
9
10
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
10
11
|
import { DataTable } from '../components/DataTable.tsx'
|
|
@@ -67,7 +68,11 @@ export function HiringPage(): React.JSX.Element {
|
|
|
67
68
|
key: 'title',
|
|
68
69
|
header: 'Role',
|
|
69
70
|
sortKey: 'title',
|
|
70
|
-
render: (role) =>
|
|
71
|
+
render: (role) => (
|
|
72
|
+
<RecordLink to={`/hiring/${role.id}`} className="font-medium text-ink">
|
|
73
|
+
{role.title}
|
|
74
|
+
</RecordLink>
|
|
75
|
+
),
|
|
71
76
|
},
|
|
72
77
|
{
|
|
73
78
|
key: 'status',
|
package/src/pages/ListDetail.tsx
CHANGED
|
@@ -20,7 +20,10 @@ import { useOpportunities } from '../api/resources/opportunities.ts'
|
|
|
20
20
|
import { usePartnerships } from '../api/resources/partnerships.ts'
|
|
21
21
|
import { usePeople } from '../api/resources/people.ts'
|
|
22
22
|
import { useRaises } from '../api/resources/raises.ts'
|
|
23
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
24
|
+
import type { BulkActionPreset, RecordNoun } from '../components/BulkActions.tsx'
|
|
23
25
|
import { Chip } from '../components/Chip.tsx'
|
|
26
|
+
import { CardSelectionHeader, RowCheckbox } from '../components/DataTable.tsx'
|
|
24
27
|
import { DeleteRecord } from '../components/DeleteRecord.tsx'
|
|
25
28
|
import { EntitySearch } from '../components/EntitySearch.tsx'
|
|
26
29
|
import type { SearchOption } from '../components/EntitySearch.tsx'
|
|
@@ -28,6 +31,7 @@ import { InlineEdit } from '../components/InlineEdit.tsx'
|
|
|
28
31
|
import { Paginator } from '../components/Paginator.tsx'
|
|
29
32
|
import { ErrorPanel, LoadingPanel, NotFoundPanel } from '../components/QueryState.tsx'
|
|
30
33
|
import { SectionHeader } from '../components/SectionHeader.tsx'
|
|
34
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
31
35
|
import { formatRelativeTime } from '../lib/dates.ts'
|
|
32
36
|
import type { List, ListInput } from '@kelpie/schemas'
|
|
33
37
|
|
|
@@ -92,7 +96,7 @@ export function ListDetail(): React.JSX.Element {
|
|
|
92
96
|
|
|
93
97
|
<ListStatsRow listId={record.id} />
|
|
94
98
|
|
|
95
|
-
<ListMembers listId={record.id} targetType={record.targetType} />
|
|
99
|
+
<ListMembers listId={record.id} listName={record.name} targetType={record.targetType} />
|
|
96
100
|
</div>
|
|
97
101
|
)
|
|
98
102
|
}
|
|
@@ -193,16 +197,48 @@ function StatTile({
|
|
|
193
197
|
)
|
|
194
198
|
}
|
|
195
199
|
|
|
200
|
+
/** The action that takes records off a list, fixed to this one on its page. */
|
|
201
|
+
const REMOVE_FROM_LIST = 'core.remove_from_list'
|
|
202
|
+
|
|
203
|
+
/** No filter: no list `GET` of a record type filters by list membership. */
|
|
204
|
+
const NO_FILTER = {}
|
|
205
|
+
|
|
206
|
+
/** How the action bar counts a list's records: "3 people selected". */
|
|
207
|
+
const MEMBER_NOUNS: Readonly<Record<RecordTargetType, RecordNoun>> = {
|
|
208
|
+
person: { one: 'person', many: 'people' },
|
|
209
|
+
company: { one: 'company', many: 'companies' },
|
|
210
|
+
deal: { one: 'deal', many: 'deals' },
|
|
211
|
+
opportunity: { one: 'opportunity', many: 'opportunities' },
|
|
212
|
+
partnership: { one: 'partnership', many: 'partnerships' },
|
|
213
|
+
raise: { one: 'raise', many: 'raises' },
|
|
214
|
+
enquiry: { one: 'enquiry', many: 'enquiries' },
|
|
215
|
+
candidate: { one: 'candidate', many: 'candidates' },
|
|
216
|
+
event: { one: 'event', many: 'events' },
|
|
217
|
+
attendance: { one: 'attendance', many: 'attendances' },
|
|
218
|
+
}
|
|
219
|
+
|
|
196
220
|
function ListMembers({
|
|
197
221
|
listId,
|
|
222
|
+
listName,
|
|
198
223
|
targetType,
|
|
199
224
|
}: {
|
|
200
225
|
readonly listId: string
|
|
226
|
+
readonly listName: string
|
|
201
227
|
readonly targetType: RecordTargetType
|
|
202
228
|
}): React.JSX.Element {
|
|
203
229
|
const members = useListMembers(listId)
|
|
204
230
|
const addMember = useAddListMember()
|
|
205
231
|
const [adding, setAdding] = useState(false)
|
|
232
|
+
// A bulk job runs on the records, so the selection holds their ids, not the memberships'.
|
|
233
|
+
const bulk = useBulkSelection({ filter: NO_FILTER })
|
|
234
|
+
const pageIds = members.records.map((member) => member.targetId)
|
|
235
|
+
const presets: Readonly<Record<string, BulkActionPreset>> = {
|
|
236
|
+
[REMOVE_FROM_LIST]: {
|
|
237
|
+
label: 'Remove from this list',
|
|
238
|
+
params: { list_id: listId },
|
|
239
|
+
choices: { list_id: listName },
|
|
240
|
+
},
|
|
241
|
+
}
|
|
206
242
|
|
|
207
243
|
const attached = new Set(members.records.map((member) => member.targetId))
|
|
208
244
|
|
|
@@ -225,6 +261,18 @@ function ListMembers({
|
|
|
225
261
|
addLabel={`Add ${RECORD_TARGET_TYPE_LABELS[targetType].toLowerCase()}`}
|
|
226
262
|
/>
|
|
227
263
|
|
|
264
|
+
{/* The record type's own actions, with "Remove from this list" among
|
|
265
|
+
them. "Select all that match" is not offered: it would select every
|
|
266
|
+
record of the type, since no filter narrows a type to one list. */}
|
|
267
|
+
<BulkActions
|
|
268
|
+
targetType={targetType}
|
|
269
|
+
selection={bulk}
|
|
270
|
+
pageIds={pageIds}
|
|
271
|
+
hasNextPage={false}
|
|
272
|
+
noun={MEMBER_NOUNS[targetType]}
|
|
273
|
+
presets={presets}
|
|
274
|
+
/>
|
|
275
|
+
|
|
228
276
|
{adding && (
|
|
229
277
|
<div className="mb-3 flex gap-2">
|
|
230
278
|
<div className="min-w-0 flex-1">
|
|
@@ -260,9 +308,20 @@ function ListMembers({
|
|
|
260
308
|
) : (
|
|
261
309
|
<>
|
|
262
310
|
<Paginator list={members} placement="top" />
|
|
311
|
+
{pageIds.length > 0 && (
|
|
312
|
+
<CardSelectionHeader ids={pageIds} isSelected={bulk.isSelected} onTogglePage={bulk.onTogglePage} />
|
|
313
|
+
)}
|
|
263
314
|
<ul className="overflow-hidden rounded-md border border-border">
|
|
264
315
|
{members.records.map((member) => (
|
|
265
|
-
<MemberRow
|
|
316
|
+
<MemberRow
|
|
317
|
+
key={member.id}
|
|
318
|
+
listId={listId}
|
|
319
|
+
member={member}
|
|
320
|
+
selected={bulk.isSelected(member.targetId)}
|
|
321
|
+
onToggle={() => {
|
|
322
|
+
bulk.onToggle(member.targetId)
|
|
323
|
+
}}
|
|
324
|
+
/>
|
|
266
325
|
))}
|
|
267
326
|
</ul>
|
|
268
327
|
</>
|
|
@@ -276,15 +335,20 @@ function ListMembers({
|
|
|
276
335
|
function MemberRow({
|
|
277
336
|
listId,
|
|
278
337
|
member,
|
|
338
|
+
selected,
|
|
339
|
+
onToggle,
|
|
279
340
|
}: {
|
|
280
341
|
readonly listId: string
|
|
281
342
|
readonly member: ListMember
|
|
343
|
+
readonly selected: boolean
|
|
344
|
+
readonly onToggle: () => void
|
|
282
345
|
}): React.JSX.Element {
|
|
283
346
|
const remove = useRemoveListMember()
|
|
284
347
|
|
|
285
348
|
return (
|
|
286
|
-
<li className=
|
|
287
|
-
<div className="flex flex-wrap items-center
|
|
349
|
+
<li className={`border-b border-border px-4 py-3 last:border-0 ${selected ? 'bg-accent-soft/40' : ''}`}>
|
|
350
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
351
|
+
<RowCheckbox label={member.targetName ?? member.targetId} checked={selected} onToggle={onToggle} />
|
|
288
352
|
<Link
|
|
289
353
|
to={detailPathFor(member.targetType, member.targetId)}
|
|
290
354
|
className="text-left text-[13px] font-medium text-ink hover:text-accent"
|
|
@@ -296,7 +360,7 @@ function MemberRow({
|
|
|
296
360
|
onClick={() => {
|
|
297
361
|
remove.run({ listId, id: member.id })
|
|
298
362
|
}}
|
|
299
|
-
className="text-[11px] font-medium text-danger hover:underline"
|
|
363
|
+
className="ml-auto text-[11px] font-medium text-danger hover:underline"
|
|
300
364
|
>
|
|
301
365
|
Remove
|
|
302
366
|
</button>
|
package/src/pages/ListsPage.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import { useNavigate } from 'react-router'
|
|
|
9
9
|
|
|
10
10
|
import { useTimezone } from '../api/resources/account.ts'
|
|
11
11
|
import { useCreateList, useLists } from '../api/resources/lists.ts'
|
|
12
|
+
import { RecordLink } from '../components/CellLinks.tsx'
|
|
12
13
|
import { Chip } from '../components/Chip.tsx'
|
|
13
14
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
14
15
|
import { DataTable } from '../components/DataTable.tsx'
|
|
@@ -49,7 +50,11 @@ export function ListsPage(): React.JSX.Element {
|
|
|
49
50
|
key: 'name',
|
|
50
51
|
header: 'Name',
|
|
51
52
|
sortKey: 'name',
|
|
52
|
-
render: (list) =>
|
|
53
|
+
render: (list) => (
|
|
54
|
+
<RecordLink to={`/lists/${list.id}`} className="font-medium text-ink">
|
|
55
|
+
{list.name}
|
|
56
|
+
</RecordLink>
|
|
57
|
+
),
|
|
53
58
|
},
|
|
54
59
|
{
|
|
55
60
|
key: 'type',
|
|
@@ -14,6 +14,8 @@ import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
|
14
14
|
import { useTimezone } from '../api/resources/account.ts'
|
|
15
15
|
import { AddRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
16
16
|
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
17
|
+
import { CompanyLink, RecordLink } from '../components/CellLinks.tsx'
|
|
18
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
17
19
|
import { Chip } from '../components/Chip.tsx'
|
|
18
20
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
19
21
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -24,6 +26,7 @@ import { PageHeader } from '../components/PageHeader.tsx'
|
|
|
24
26
|
import { Paginator } from '../components/Paginator.tsx'
|
|
25
27
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
26
28
|
import { SegmentedControl } from '../components/SegmentedControl.tsx'
|
|
29
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
27
30
|
import { formatDate, formatDay } from '../lib/dates.ts'
|
|
28
31
|
import { useListView } from '../lib/listView.ts'
|
|
29
32
|
import { DUE_BUCKETS, byDateThenTitle, dueBucketFor, nextOpenByTarget } from '../lib/plan.ts'
|
|
@@ -111,6 +114,15 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
111
114
|
visibleStageIds.has(opportunity.stageId),
|
|
112
115
|
)
|
|
113
116
|
|
|
117
|
+
// The board has no checkboxes, so a selection lives only in the list, and
|
|
118
|
+
// switching view clears it. The Open scope is a filter on stage, so a
|
|
119
|
+
// filter selection names the open stages the list is showing.
|
|
120
|
+
const openStageIds = visibleStages.map((stage) => stage.id)
|
|
121
|
+
const bulk = useBulkSelection({
|
|
122
|
+
filter: scope === 'open' && openStageIds.length > 0 ? { stage_id: openStageIds } : {},
|
|
123
|
+
resetOn: [sort, view],
|
|
124
|
+
})
|
|
125
|
+
|
|
114
126
|
// The next-step column asks about the records on screen by id. `?target_id=`
|
|
115
127
|
// takes at most one page of them (`docs/agents/api-and-webhooks.md`), so past that ceiling the rest
|
|
116
128
|
// read as having no plan; the note under the table says so.
|
|
@@ -146,7 +158,11 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
146
158
|
key: 'name',
|
|
147
159
|
header: 'Opportunity',
|
|
148
160
|
sortKey: 'name',
|
|
149
|
-
render: (opportunity) =>
|
|
161
|
+
render: (opportunity) => (
|
|
162
|
+
<RecordLink to={`/opportunities/${opportunity.id}`} className="font-medium text-ink">
|
|
163
|
+
{opportunity.name}
|
|
164
|
+
</RecordLink>
|
|
165
|
+
),
|
|
150
166
|
},
|
|
151
167
|
{
|
|
152
168
|
key: 'kind',
|
|
@@ -159,10 +175,12 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
159
175
|
header: 'Company',
|
|
160
176
|
getSortValue: (opportunity) =>
|
|
161
177
|
opportunity.companyId === null ? null : (companyNameById.get(opportunity.companyId) ?? null),
|
|
162
|
-
render: (opportunity) =>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
:
|
|
178
|
+
render: (opportunity) => (
|
|
179
|
+
<CompanyLink
|
|
180
|
+
id={opportunity.companyId}
|
|
181
|
+
name={opportunity.companyId === null ? undefined : companyNameById.get(opportunity.companyId)}
|
|
182
|
+
/>
|
|
183
|
+
),
|
|
166
184
|
},
|
|
167
185
|
{
|
|
168
186
|
key: 'stage',
|
|
@@ -390,6 +408,15 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
390
408
|
<LoadingPanel label="Loading opportunities…" />
|
|
391
409
|
) : (
|
|
392
410
|
<>
|
|
411
|
+
{view === 'list' && (
|
|
412
|
+
<BulkActions
|
|
413
|
+
targetType="opportunity"
|
|
414
|
+
selection={bulk}
|
|
415
|
+
pageIds={visibleOpportunities.map((opportunity) => opportunity.id)}
|
|
416
|
+
hasNextPage={opportunities.hasNext}
|
|
417
|
+
noun={{ one: 'opportunity', many: 'opportunities' }}
|
|
418
|
+
/>
|
|
419
|
+
)}
|
|
393
420
|
{view === 'list' && <Paginator list={opportunities} placement="top" />}
|
|
394
421
|
{view === 'columns' ? (
|
|
395
422
|
<KanbanBoard
|
|
@@ -447,6 +474,7 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
447
474
|
listView.setSort(next)
|
|
448
475
|
}}
|
|
449
476
|
visibleColumnKeys={listView.visibleKeys}
|
|
477
|
+
selection={{ ...bulk, rowLabel: (opportunity) => opportunity.name }}
|
|
450
478
|
/>
|
|
451
479
|
)}
|
|
452
480
|
{updateOpportunity.error !== null && (
|
|
@@ -14,6 +14,8 @@ import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
|
14
14
|
import { useTimezone } from '../api/resources/account.ts'
|
|
15
15
|
import { AddCompanyRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
16
16
|
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
17
|
+
import { CompanyLink, RecordLink } from '../components/CellLinks.tsx'
|
|
18
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
17
19
|
import { Chip } from '../components/Chip.tsx'
|
|
18
20
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
19
21
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -24,6 +26,7 @@ import { PageHeader } from '../components/PageHeader.tsx'
|
|
|
24
26
|
import { Paginator } from '../components/Paginator.tsx'
|
|
25
27
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
26
28
|
import { SegmentedControl } from '../components/SegmentedControl.tsx'
|
|
29
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
27
30
|
import { formatDate, formatDay } from '../lib/dates.ts'
|
|
28
31
|
import { useListView } from '../lib/listView.ts'
|
|
29
32
|
import { DUE_BUCKETS, byDateThenTitle, dueBucketFor, nextOpenByTarget } from '../lib/plan.ts'
|
|
@@ -112,6 +115,15 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
112
115
|
visibleStageIds.has(partnership.stageId),
|
|
113
116
|
)
|
|
114
117
|
|
|
118
|
+
// The board has no checkboxes, so a selection lives only in the list, and
|
|
119
|
+
// switching view clears it. The Open scope is a filter on stage, so a
|
|
120
|
+
// filter selection names the open stages the list is showing.
|
|
121
|
+
const openStageIds = visibleStages.map((stage) => stage.id)
|
|
122
|
+
const bulk = useBulkSelection({
|
|
123
|
+
filter: scope === 'open' && openStageIds.length > 0 ? { stage_id: openStageIds } : {},
|
|
124
|
+
resetOn: [sort, view],
|
|
125
|
+
})
|
|
126
|
+
|
|
115
127
|
// The next-step column asks about the records on screen by id. `?target_id=`
|
|
116
128
|
// takes at most one page of them (`docs/agents/api-and-webhooks.md`), so past that ceiling the rest
|
|
117
129
|
// read as having no plan; the note under the table says so.
|
|
@@ -152,13 +164,19 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
152
164
|
key: 'name',
|
|
153
165
|
header: 'Partnership',
|
|
154
166
|
sortKey: 'name',
|
|
155
|
-
render: (partnership) =>
|
|
167
|
+
render: (partnership) => (
|
|
168
|
+
<RecordLink to={`/partnerships/${partnership.id}`} className="font-medium text-ink">
|
|
169
|
+
{partnership.name}
|
|
170
|
+
</RecordLink>
|
|
171
|
+
),
|
|
156
172
|
},
|
|
157
173
|
{
|
|
158
174
|
key: 'company',
|
|
159
175
|
header: 'Company',
|
|
160
176
|
getSortValue: (partnership) => companyNameById.get(partnership.companyId) ?? null,
|
|
161
|
-
render: (partnership) =>
|
|
177
|
+
render: (partnership) => (
|
|
178
|
+
<CompanyLink id={partnership.companyId} name={companyNameById.get(partnership.companyId)} />
|
|
179
|
+
),
|
|
162
180
|
},
|
|
163
181
|
{
|
|
164
182
|
key: 'stage',
|
|
@@ -409,6 +427,15 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
409
427
|
<LoadingPanel label="Loading partnerships…" />
|
|
410
428
|
) : (
|
|
411
429
|
<>
|
|
430
|
+
{view === 'list' && (
|
|
431
|
+
<BulkActions
|
|
432
|
+
targetType="partnership"
|
|
433
|
+
selection={bulk}
|
|
434
|
+
pageIds={visiblePartnerships.map((partnership) => partnership.id)}
|
|
435
|
+
hasNextPage={partnerships.hasNext}
|
|
436
|
+
noun={{ one: 'partnership', many: 'partnerships' }}
|
|
437
|
+
/>
|
|
438
|
+
)}
|
|
412
439
|
{view === 'list' && <Paginator list={partnerships} placement="top" />}
|
|
413
440
|
{view === 'columns' ? (
|
|
414
441
|
<KanbanBoard
|
|
@@ -466,6 +493,7 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
466
493
|
listView.setSort(next)
|
|
467
494
|
}}
|
|
468
495
|
visibleColumnKeys={listView.visibleKeys}
|
|
496
|
+
selection={{ ...bulk, rowLabel: (partnership) => partnership.name }}
|
|
469
497
|
/>
|
|
470
498
|
)}
|
|
471
499
|
{updatePartnership.error !== null && (
|
package/src/pages/PeoplePage.tsx
CHANGED
|
@@ -8,16 +8,19 @@ import { useCreatePerson, usePeople } from '../api/resources/people.ts'
|
|
|
8
8
|
import { AddRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
9
9
|
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
10
10
|
import { useAiDrawer } from '../components/aiDrawerState.ts'
|
|
11
|
+
import { CompanyLinks, EmailLink, PhoneLinks, RecordLink } from '../components/CellLinks.tsx'
|
|
11
12
|
import { Chip } from '../components/Chip.tsx'
|
|
12
13
|
import { SocialNetworkIcon } from '../components/SocialNetworkIcon.tsx'
|
|
13
14
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
14
15
|
import { DataTable } from '../components/DataTable.tsx'
|
|
16
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
15
17
|
import { AddFromNotesButton } from '../components/PersonIntakePanel.tsx'
|
|
16
18
|
import { personIntakeTask } from '../components/personIntakeTask.tsx'
|
|
17
19
|
import type { Column } from '../components/DataTable.tsx'
|
|
18
20
|
import { FilterBar, PageHeader } from '../components/PageHeader.tsx'
|
|
19
21
|
import { Paginator } from '../components/Paginator.tsx'
|
|
20
22
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
23
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
21
24
|
import { formatDate } from '../lib/dates.ts'
|
|
22
25
|
import { useListView } from '../lib/listView.ts'
|
|
23
26
|
import { serverSortOnly } from '../lib/sort.ts'
|
|
@@ -62,6 +65,7 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
62
65
|
term: hasFilter ? term.trim() : undefined,
|
|
63
66
|
sort: serverSortOnly(sort, SERVER_SORT_KEYS),
|
|
64
67
|
})
|
|
68
|
+
const bulk = useBulkSelection({ filter: hasFilter ? { q: term.trim() } : {}, resetOn: [sort] })
|
|
65
69
|
const directory = usePeopleDirectory(people.records.map((person) => person.id))
|
|
66
70
|
const createPerson = useCreatePerson()
|
|
67
71
|
const aiDrawer = useAiDrawer()
|
|
@@ -81,7 +85,11 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
81
85
|
key: 'name',
|
|
82
86
|
header: 'Name',
|
|
83
87
|
sortKey: 'name',
|
|
84
|
-
render: (person) =>
|
|
88
|
+
render: (person) => (
|
|
89
|
+
<RecordLink to={`/people/${person.id}`} className="font-medium text-ink">
|
|
90
|
+
{person.name}
|
|
91
|
+
</RecordLink>
|
|
92
|
+
),
|
|
85
93
|
},
|
|
86
94
|
// Hidden by default, and sorted page-locally rather than by the server: the
|
|
87
95
|
// parts are nullable, and `?sort=` is keyset paged, which cannot seek past a
|
|
@@ -105,31 +113,19 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
105
113
|
key: 'company',
|
|
106
114
|
header: 'Company',
|
|
107
115
|
getSortValue: (person) => directory.companyNamesFor(person.id).join(', ') || null,
|
|
108
|
-
render: (person) => {
|
|
109
|
-
const names = directory.companyNamesFor(person.id)
|
|
110
|
-
|
|
111
|
-
return names.length > 0 ? names.join(', ') : '—'
|
|
112
|
-
},
|
|
116
|
+
render: (person) => <CompanyLinks companies={directory.companiesFor(person.id)} />,
|
|
113
117
|
},
|
|
114
118
|
{
|
|
115
119
|
key: 'email',
|
|
116
120
|
header: 'Email',
|
|
117
121
|
getSortValue: (person) => person.email,
|
|
118
|
-
render: (person) =>
|
|
119
|
-
person.email === null ? (
|
|
120
|
-
'—'
|
|
121
|
-
) : (
|
|
122
|
-
<span className="font-mono text-[12px] text-ink-muted">{person.email}</span>
|
|
123
|
-
),
|
|
122
|
+
render: (person) => <EmailLink email={person.email} />,
|
|
124
123
|
},
|
|
125
124
|
{
|
|
126
125
|
key: 'phones',
|
|
127
126
|
header: 'Phones',
|
|
128
127
|
getSortValue: (person) => person.phones.join(', ') || null,
|
|
129
|
-
render: (person) =>
|
|
130
|
-
person.phones.length === 0 ? '—' : (
|
|
131
|
-
<span className="font-mono text-[12px] text-ink-muted">{person.phones.join(', ')}</span>
|
|
132
|
-
),
|
|
128
|
+
render: (person) => <PhoneLinks phones={person.phones} />,
|
|
133
129
|
},
|
|
134
130
|
{
|
|
135
131
|
key: 'socials',
|
|
@@ -266,11 +262,19 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
266
262
|
</>
|
|
267
263
|
}
|
|
268
264
|
/>
|
|
269
|
-
<
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
265
|
+
<BulkActions
|
|
266
|
+
targetType="person"
|
|
267
|
+
selection={bulk}
|
|
268
|
+
pageIds={people.records.map((person) => person.id)}
|
|
269
|
+
hasNextPage={people.hasNext}
|
|
270
|
+
noun={{ one: 'person', many: 'people' }}
|
|
271
|
+
>
|
|
272
|
+
<FilterBar
|
|
273
|
+
value={term}
|
|
274
|
+
onChange={setTerm}
|
|
275
|
+
placeholder="Filter by name, position, company…"
|
|
276
|
+
/>
|
|
277
|
+
</BulkActions>
|
|
274
278
|
|
|
275
279
|
{adding && (
|
|
276
280
|
<AddRecordPanel
|
|
@@ -318,6 +322,7 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
318
322
|
sort={sort}
|
|
319
323
|
onSortChange={setSort}
|
|
320
324
|
visibleColumnKeys={listView.visibleKeys}
|
|
325
|
+
selection={{ ...bulk, rowLabel: (person) => person.name }}
|
|
321
326
|
/>
|
|
322
327
|
{!directory.isComplete && !directory.isLoading && (
|
|
323
328
|
<p className="mt-2 text-[11px] text-ink-faint">
|