@kelpie/ui 0.26.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/account.d.ts +7 -1
- package/dist/api/resources/account.d.ts.map +1 -1
- package/dist/api/resources/account.js +17 -1
- package/dist/api/resources/account.js.map +1 -1
- 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/ActivitiesPanel.d.ts.map +1 -1
- package/dist/components/ActivitiesPanel.js +3 -12
- package/dist/components/ActivitiesPanel.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/NotesPanel.d.ts.map +1 -1
- package/dist/components/NotesPanel.js +2 -15
- package/dist/components/NotesPanel.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/attribution.d.ts +31 -0
- package/dist/lib/attribution.d.ts.map +1 -0
- package/dist/lib/attribution.js +48 -0
- package/dist/lib/attribution.js.map +1 -0
- 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 +9 -5
- package/dist/pages/CompaniesPage.js.map +1 -1
- package/dist/pages/CompanyDetail.d.ts.map +1 -1
- package/dist/pages/CompanyDetail.js +4 -3
- package/dist/pages/CompanyDetail.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 +22 -5
- 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/dashboard/sections.d.ts.map +1 -1
- package/dist/pages/dashboard/sections.js +8 -10
- package/dist/pages/dashboard/sections.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/account.ts +20 -0
- 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/ActivitiesPanel.tsx +3 -14
- 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/NotesPanel.tsx +2 -17
- 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/attribution.ts +59 -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 +21 -6
- package/src/pages/CompanyDetail.tsx +4 -3
- 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 +35 -4
- 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/dashboard/sections.tsx +13 -14
- 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
|
@@ -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">
|
|
@@ -20,12 +20,16 @@ import {
|
|
|
20
20
|
usePlanItems,
|
|
21
21
|
} from '../api/resources/planItems.ts'
|
|
22
22
|
import { useRaises } from '../api/resources/raises.ts'
|
|
23
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
23
24
|
import { Chip } from '../components/Chip.tsx'
|
|
25
|
+
import { CardSelectionHeader, RowCheckbox } from '../components/DataTable.tsx'
|
|
24
26
|
import { PageHeader } from '../components/PageHeader.tsx'
|
|
25
27
|
import { PlanTargetLink } from '../components/PlanAttention.tsx'
|
|
26
28
|
import { Paginator } from '../components/Paginator.tsx'
|
|
27
29
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
28
30
|
import { SegmentedControl } from '../components/SegmentedControl.tsx'
|
|
31
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
32
|
+
import type { BulkSelectionController } from '../lib/bulkSelection.ts'
|
|
29
33
|
import { formatDay } from '../lib/dates.ts'
|
|
30
34
|
import { monthBounds, planStatusTone, todayIso } from '../lib/plan.ts'
|
|
31
35
|
|
|
@@ -81,6 +85,13 @@ export function PlanningPage(): React.JSX.Element {
|
|
|
81
85
|
: typeQuery,
|
|
82
86
|
)
|
|
83
87
|
|
|
88
|
+
// Selection is in the list view only, as on pages with a board. Its
|
|
89
|
+
// "all that match" is the type filter the list shows.
|
|
90
|
+
const bulk = useBulkSelection({
|
|
91
|
+
filter: typeFilter === 'all' ? {} : { target_type: typeFilter },
|
|
92
|
+
resetOn: [view],
|
|
93
|
+
})
|
|
94
|
+
|
|
84
95
|
function shiftMonth(delta: number): void {
|
|
85
96
|
setMonth((current) => {
|
|
86
97
|
const moved = new Date(current.year, current.month + delta, 1)
|
|
@@ -157,6 +168,16 @@ export function PlanningPage(): React.JSX.Element {
|
|
|
157
168
|
/>
|
|
158
169
|
)}
|
|
159
170
|
|
|
171
|
+
{view === 'list' && (
|
|
172
|
+
<BulkActions
|
|
173
|
+
targetType="plan_item"
|
|
174
|
+
selection={bulk}
|
|
175
|
+
pageIds={items.records.map((item) => item.id)}
|
|
176
|
+
hasNextPage={items.hasNext}
|
|
177
|
+
noun={{ one: 'plan item', many: 'plan items' }}
|
|
178
|
+
/>
|
|
179
|
+
)}
|
|
180
|
+
|
|
160
181
|
{view === 'calendar' && (
|
|
161
182
|
<div className="mb-4 flex items-center gap-2">
|
|
162
183
|
<button
|
|
@@ -192,7 +213,7 @@ export function PlanningPage(): React.JSX.Element {
|
|
|
192
213
|
) : view === 'list' ? (
|
|
193
214
|
<>
|
|
194
215
|
<Paginator list={items} placement="top" />
|
|
195
|
-
<PlanList items={items.records} targetNames={targets.nameById} />
|
|
216
|
+
<PlanList items={items.records} targetNames={targets.nameById} selection={bulk} />
|
|
196
217
|
</>
|
|
197
218
|
) : (
|
|
198
219
|
<PlanCalendar year={month.year} month={month.month} items={items.records} />
|
|
@@ -400,9 +421,11 @@ function AddPlanItemForm({
|
|
|
400
421
|
function PlanList({
|
|
401
422
|
items,
|
|
402
423
|
targetNames,
|
|
424
|
+
selection,
|
|
403
425
|
}: {
|
|
404
426
|
readonly items: readonly PlanItem[]
|
|
405
427
|
readonly targetNames: ReadonlyMap<string, string>
|
|
428
|
+
readonly selection: BulkSelectionController
|
|
406
429
|
}): React.JSX.Element {
|
|
407
430
|
const members = useMembers()
|
|
408
431
|
|
|
@@ -411,31 +434,49 @@ function PlanList({
|
|
|
411
434
|
}
|
|
412
435
|
|
|
413
436
|
return (
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
437
|
+
<>
|
|
438
|
+
<CardSelectionHeader
|
|
439
|
+
ids={items.map((item) => item.id)}
|
|
440
|
+
isSelected={selection.isSelected}
|
|
441
|
+
onTogglePage={selection.onTogglePage}
|
|
442
|
+
/>
|
|
443
|
+
<ul className="overflow-hidden rounded-md border border-border">
|
|
444
|
+
{items.map((item) => (
|
|
445
|
+
<li
|
|
446
|
+
key={item.id}
|
|
447
|
+
className={`flex flex-wrap items-baseline gap-x-3 gap-y-1 border-b border-border px-4 py-2.5 last:border-0 ${
|
|
448
|
+
selection.isSelected(item.id) ? 'bg-accent-soft/40' : ''
|
|
449
|
+
}`}
|
|
423
450
|
>
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
{members.nameById.get(item.ownerId) ?? 'Unknown'}
|
|
451
|
+
<span className="self-center">
|
|
452
|
+
<RowCheckbox
|
|
453
|
+
label={item.title}
|
|
454
|
+
checked={selection.isSelected(item.id)}
|
|
455
|
+
onToggle={() => {
|
|
456
|
+
selection.onToggle(item.id)
|
|
457
|
+
}}
|
|
458
|
+
/>
|
|
433
459
|
</span>
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
460
|
+
<time
|
|
461
|
+
dateTime={item.date}
|
|
462
|
+
className="w-[120px] shrink-0 text-[12px] font-medium text-ink tabular-nums"
|
|
463
|
+
>
|
|
464
|
+
{formatDay(item.date)}
|
|
465
|
+
</time>
|
|
466
|
+
<div className="min-w-0 flex-1">
|
|
467
|
+
<div className="text-[13px] font-medium text-ink">{item.title}</div>
|
|
468
|
+
<PlanTargetLink item={item} targetNames={targetNames} />
|
|
469
|
+
</div>
|
|
470
|
+
{item.ownerId !== null && (
|
|
471
|
+
<span className="text-[12px] text-ink-muted">
|
|
472
|
+
{members.nameById.get(item.ownerId) ?? 'Unknown'}
|
|
473
|
+
</span>
|
|
474
|
+
)}
|
|
475
|
+
<Chip tone={planStatusTone(item.status)}>{PLAN_ITEM_STATUS_LABELS[item.status]}</Chip>
|
|
476
|
+
</li>
|
|
477
|
+
))}
|
|
478
|
+
</ul>
|
|
479
|
+
</>
|
|
439
480
|
)
|
|
440
481
|
}
|
|
441
482
|
|
package/src/pages/RoleDetail.tsx
CHANGED
|
@@ -12,7 +12,9 @@ import { useCreateNote, useDeleteNote, useUpdateNote } from '../api/resources/no
|
|
|
12
12
|
import { useCreatePerson, usePeople } from '../api/resources/people.ts'
|
|
13
13
|
import { useDeleteRole, useRole, useUpdateRole } from '../api/resources/roles.ts'
|
|
14
14
|
import { AgentTasks } from '../components/AgentTasks.tsx'
|
|
15
|
+
import { BulkActions } from '../components/BulkActions.tsx'
|
|
15
16
|
import { Chip } from '../components/Chip.tsx'
|
|
17
|
+
import { CardSelectionHeader, RowCheckbox } from '../components/DataTable.tsx'
|
|
16
18
|
import { DeleteRecord } from '../components/DeleteRecord.tsx'
|
|
17
19
|
import { EntitySearch } from '../components/EntitySearch.tsx'
|
|
18
20
|
import { InlineEdit } from '../components/InlineEdit.tsx'
|
|
@@ -20,6 +22,7 @@ import { LinkedEventsPanel } from '../components/LinkedEventsPanel.tsx'
|
|
|
20
22
|
import { Paginator } from '../components/Paginator.tsx'
|
|
21
23
|
import { ErrorPanel, LoadingPanel, NotFoundPanel } from '../components/QueryState.tsx'
|
|
22
24
|
import { SectionHeader } from '../components/SectionHeader.tsx'
|
|
25
|
+
import { useBulkSelection } from '../lib/bulkSelection.ts'
|
|
23
26
|
import {
|
|
24
27
|
CandidateReferrerField,
|
|
25
28
|
CandidateStageField,
|
|
@@ -166,6 +169,9 @@ function RoleCandidates({ role }: { readonly role: Role }): React.JSX.Element {
|
|
|
166
169
|
const searchable = usePeople({ term: search.trim().length > 0 ? search.trim() : undefined })
|
|
167
170
|
|
|
168
171
|
const attached = new Set(candidates.records.map((candidate) => candidate.personId))
|
|
172
|
+
// "All that match" is every candidate for this role, as the API filters them.
|
|
173
|
+
const bulk = useBulkSelection({ filter: { role_id: [role.id] } })
|
|
174
|
+
const pageIds = candidates.records.map((candidate) => candidate.id)
|
|
169
175
|
|
|
170
176
|
function add(personId: string): void {
|
|
171
177
|
if (attached.has(personId)) {
|
|
@@ -198,6 +204,14 @@ function RoleCandidates({ role }: { readonly role: Role }): React.JSX.Element {
|
|
|
198
204
|
addLabel="Add candidate"
|
|
199
205
|
/>
|
|
200
206
|
|
|
207
|
+
<BulkActions
|
|
208
|
+
targetType="candidate"
|
|
209
|
+
selection={bulk}
|
|
210
|
+
pageIds={pageIds}
|
|
211
|
+
hasNextPage={candidates.hasNext}
|
|
212
|
+
noun={{ one: 'candidate', many: 'candidates' }}
|
|
213
|
+
/>
|
|
214
|
+
|
|
201
215
|
{adding && (
|
|
202
216
|
<div className="mb-3 flex gap-2">
|
|
203
217
|
<div className="min-w-0 flex-1">
|
|
@@ -253,11 +267,18 @@ function RoleCandidates({ role }: { readonly role: Role }): React.JSX.Element {
|
|
|
253
267
|
) : (
|
|
254
268
|
<>
|
|
255
269
|
<Paginator list={candidates} placement="top" />
|
|
270
|
+
{pageIds.length > 0 && (
|
|
271
|
+
<CardSelectionHeader ids={pageIds} isSelected={bulk.isSelected} onTogglePage={bulk.onTogglePage} />
|
|
272
|
+
)}
|
|
256
273
|
<ul className="rounded-md border border-border">
|
|
257
274
|
{candidates.records.map((candidate) => (
|
|
258
275
|
<CandidateRow
|
|
259
276
|
key={candidate.id}
|
|
260
277
|
candidate={candidate}
|
|
278
|
+
selected={bulk.isSelected(candidate.id)}
|
|
279
|
+
onToggle={() => {
|
|
280
|
+
bulk.onToggle(candidate.id)
|
|
281
|
+
}}
|
|
261
282
|
personName={names.nameFor(candidate.personId)}
|
|
262
283
|
referrerName={
|
|
263
284
|
candidate.referrerPersonId === null
|
|
@@ -279,12 +300,16 @@ function RoleCandidates({ role }: { readonly role: Role }): React.JSX.Element {
|
|
|
279
300
|
|
|
280
301
|
function CandidateRow({
|
|
281
302
|
candidate,
|
|
303
|
+
selected,
|
|
304
|
+
onToggle,
|
|
282
305
|
personName,
|
|
283
306
|
referrerName,
|
|
284
307
|
note,
|
|
285
308
|
noteResolved,
|
|
286
309
|
}: {
|
|
287
310
|
readonly candidate: Candidate
|
|
311
|
+
readonly selected: boolean
|
|
312
|
+
readonly onToggle: () => void
|
|
288
313
|
readonly personName: string | undefined
|
|
289
314
|
readonly referrerName: string | undefined
|
|
290
315
|
readonly note: Note | undefined
|
|
@@ -293,17 +318,20 @@ function CandidateRow({
|
|
|
293
318
|
const removeCandidate = useDeleteCandidate()
|
|
294
319
|
|
|
295
320
|
return (
|
|
296
|
-
<li className=
|
|
321
|
+
<li className={`border-b border-border px-4 py-3.5 last:border-0 ${selected ? 'bg-accent-soft/40' : ''}`}>
|
|
297
322
|
{/* On a phone the controls always take their own line under the name.
|
|
298
323
|
Left to wrap, whether they fit beside it depends on the name length
|
|
299
324
|
and on the stage field, so rows in one list came out different. */}
|
|
300
325
|
<div className="flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-start sm:justify-between sm:gap-3">
|
|
301
|
-
<
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
326
|
+
<div className="flex items-center gap-2 self-start">
|
|
327
|
+
<RowCheckbox label={personName ?? candidate.personId} checked={selected} onToggle={onToggle} />
|
|
328
|
+
<Link
|
|
329
|
+
to={`/people/${candidate.personId}`}
|
|
330
|
+
className="text-left text-[13px] font-medium text-ink hover:text-accent"
|
|
331
|
+
>
|
|
332
|
+
{personName ?? candidate.personId}
|
|
333
|
+
</Link>
|
|
334
|
+
</div>
|
|
307
335
|
<div className="flex flex-wrap items-center gap-2">
|
|
308
336
|
<AgentTasks
|
|
309
337
|
targetType="candidate"
|
|
@@ -15,6 +15,7 @@ import { DecisionProvenance } from '../../components/DecisionProvenance.tsx'
|
|
|
15
15
|
import { MarkdownView } from '../../components/MarkdownView.tsx'
|
|
16
16
|
import { OriginLabel } from '../../components/OriginLabel.tsx'
|
|
17
17
|
import { SectionHeader } from '../../components/SectionHeader.tsx'
|
|
18
|
+
import { activityActorName, noteAuthorName } from '../../lib/attribution.ts'
|
|
18
19
|
import { formatDate, formatRelativeTime } from '../../lib/dates.ts'
|
|
19
20
|
import { targetHref } from '../../lib/recordLinks.ts'
|
|
20
21
|
import { targetTypeLabel } from './attention.ts'
|
|
@@ -173,7 +174,7 @@ export function ActivityFeed({
|
|
|
173
174
|
<div className="min-w-0 flex-1">
|
|
174
175
|
<div className="flex items-baseline justify-between gap-3">
|
|
175
176
|
<p className="min-w-0 text-[12px] leading-snug text-ink">
|
|
176
|
-
<span className="font-semibold">{
|
|
177
|
+
<span className="font-semibold">{activityActorName(activity, nameById)}</span>{' '}
|
|
177
178
|
<ActivityAction action={activity.action} subject={activity.subject} />
|
|
178
179
|
</p>
|
|
179
180
|
<time
|
|
@@ -202,19 +203,18 @@ export function ActivityFeed({
|
|
|
202
203
|
)
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
function actorNameFor(
|
|
210
|
-
activity: DashboardActivity,
|
|
211
|
-
nameById: ReadonlyMap<string, string>,
|
|
212
|
-
): string {
|
|
213
|
-
if (activity.actorMemberId === null) {
|
|
214
|
-
return activity.actorLabel ?? 'System'
|
|
206
|
+
/** The author and the separator after it, or nothing when the note shows no name. */
|
|
207
|
+
function NoteAuthor({ name }: { readonly name: string | undefined }): React.JSX.Element | null {
|
|
208
|
+
if (name === undefined) {
|
|
209
|
+
return null
|
|
215
210
|
}
|
|
216
211
|
|
|
217
|
-
return
|
|
212
|
+
return (
|
|
213
|
+
<>
|
|
214
|
+
<span>{name}</span>
|
|
215
|
+
<span>·</span>
|
|
216
|
+
</>
|
|
217
|
+
)
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
export function NotesList({
|
|
@@ -250,8 +250,7 @@ export function NotesList({
|
|
|
250
250
|
<span>·</span>
|
|
251
251
|
<span>{targetTypeLabel(note.targetType)}</span>
|
|
252
252
|
<span>·</span>
|
|
253
|
-
<
|
|
254
|
-
<span>·</span>
|
|
253
|
+
<NoteAuthor name={noteAuthorName(note, nameById)} />
|
|
255
254
|
<span>{formatRelativeTime(note.createdAt, timezone, now)}</span>
|
|
256
255
|
<OriginLabel origin={note.origin} />
|
|
257
256
|
</div>
|