@kelpie/ui 0.22.0 → 0.24.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/resource.d.ts +12 -0
- package/dist/api/resource.d.ts.map +1 -1
- package/dist/api/resource.js +11 -0
- package/dist/api/resource.js.map +1 -1
- package/dist/api/resources/decisions.d.ts +31 -0
- package/dist/api/resources/decisions.d.ts.map +1 -1
- package/dist/api/resources/decisions.js +51 -1
- package/dist/api/resources/decisions.js.map +1 -1
- package/dist/api/resources/oauth.d.ts +2 -0
- package/dist/api/resources/oauth.d.ts.map +1 -1
- package/dist/api/resources/oauth.js +13 -1
- package/dist/api/resources/oauth.js.map +1 -1
- package/dist/api/resources/personIntake.d.ts +15 -3
- package/dist/api/resources/personIntake.d.ts.map +1 -1
- package/dist/api/resources/personIntake.js +38 -9
- package/dist/api/resources/personIntake.js.map +1 -1
- package/dist/api/resources/session.d.ts.map +1 -1
- package/dist/api/resources/session.js +4 -0
- package/dist/api/resources/session.js.map +1 -1
- package/dist/app/KelpieApp.d.ts.map +1 -1
- package/dist/app/KelpieApp.js +2 -1
- package/dist/app/KelpieApp.js.map +1 -1
- package/dist/components/AddRecordPanel.d.ts +35 -0
- package/dist/components/AddRecordPanel.d.ts.map +1 -0
- package/dist/components/AddRecordPanel.js +35 -0
- package/dist/components/AddRecordPanel.js.map +1 -0
- package/dist/components/AiDrawer.d.ts.map +1 -1
- package/dist/components/AiDrawer.js +29 -6
- package/dist/components/AiDrawer.js.map +1 -1
- package/dist/components/ApiKeysPanel.d.ts.map +1 -1
- package/dist/components/ApiKeysPanel.js +101 -44
- package/dist/components/ApiKeysPanel.js.map +1 -1
- package/dist/components/CustomFieldsPanel.d.ts.map +1 -1
- package/dist/components/CustomFieldsPanel.js +5 -2
- package/dist/components/CustomFieldsPanel.js.map +1 -1
- package/dist/components/DecisionProvenance.d.ts +27 -0
- package/dist/components/DecisionProvenance.d.ts.map +1 -0
- package/dist/components/DecisionProvenance.js +53 -0
- package/dist/components/DecisionProvenance.js.map +1 -0
- package/dist/components/DecisionsPanel.d.ts +3 -0
- package/dist/components/DecisionsPanel.d.ts.map +1 -1
- package/dist/components/DecisionsPanel.js +9 -5
- package/dist/components/DecisionsPanel.js.map +1 -1
- package/dist/components/MarkdownView.d.ts.map +1 -1
- package/dist/components/MarkdownView.js +18 -2
- package/dist/components/MarkdownView.js.map +1 -1
- package/dist/components/NotesPanel.d.ts.map +1 -1
- package/dist/components/NotesPanel.js +7 -3
- package/dist/components/NotesPanel.js.map +1 -1
- package/dist/components/OriginLabel.d.ts +5 -0
- package/dist/components/OriginLabel.d.ts.map +1 -0
- package/dist/components/OriginLabel.js +22 -0
- package/dist/components/OriginLabel.js.map +1 -0
- package/dist/components/Shell.d.ts.map +1 -1
- package/dist/components/Shell.js +17 -5
- package/dist/components/Shell.js.map +1 -1
- package/dist/components/aiDrawerState.d.ts +12 -0
- package/dist/components/aiDrawerState.d.ts.map +1 -1
- package/dist/components/aiDrawerState.js.map +1 -1
- package/dist/components/personIntakeTask.d.ts +15 -0
- package/dist/components/personIntakeTask.d.ts.map +1 -1
- package/dist/components/personIntakeTask.js +42 -0
- package/dist/components/personIntakeTask.js.map +1 -1
- package/dist/lib/personIntakeRunStorage.d.ts +15 -0
- package/dist/lib/personIntakeRunStorage.d.ts.map +1 -0
- package/dist/lib/personIntakeRunStorage.js +88 -0
- package/dist/lib/personIntakeRunStorage.js.map +1 -0
- package/dist/modules/PersonIntakeWizard.d.ts +1 -1
- package/dist/modules/PersonIntakeWizard.d.ts.map +1 -1
- package/dist/modules/PersonIntakeWizard.js +243 -29
- package/dist/modules/PersonIntakeWizard.js.map +1 -1
- package/dist/modules/ai.d.ts +1 -1
- package/dist/modules/ai.js +1 -1
- package/dist/pages/CompaniesPage.d.ts.map +1 -1
- package/dist/pages/CompaniesPage.js +13 -6
- package/dist/pages/CompaniesPage.js.map +1 -1
- package/dist/pages/DealsPage.d.ts.map +1 -1
- package/dist/pages/DealsPage.js +16 -8
- package/dist/pages/DealsPage.js.map +1 -1
- package/dist/pages/DecisionsPage.d.ts.map +1 -1
- package/dist/pages/DecisionsPage.js +7 -3
- package/dist/pages/DecisionsPage.js.map +1 -1
- package/dist/pages/EnquiriesPage.d.ts.map +1 -1
- package/dist/pages/EnquiriesPage.js +14 -6
- package/dist/pages/EnquiriesPage.js.map +1 -1
- package/dist/pages/FundraisingPage.d.ts.map +1 -1
- package/dist/pages/FundraisingPage.js +16 -11
- package/dist/pages/FundraisingPage.js.map +1 -1
- package/dist/pages/OpportunitiesPage.d.ts.map +1 -1
- package/dist/pages/OpportunitiesPage.js +14 -6
- package/dist/pages/OpportunitiesPage.js.map +1 -1
- package/dist/pages/PartnershipsPage.d.ts.map +1 -1
- package/dist/pages/PartnershipsPage.js +16 -11
- package/dist/pages/PartnershipsPage.js.map +1 -1
- package/dist/pages/PeoplePage.d.ts.map +1 -1
- package/dist/pages/PeoplePage.js +13 -8
- package/dist/pages/PeoplePage.js.map +1 -1
- package/dist/pages/PersonDetail.js +2 -2
- package/dist/pages/PersonDetail.js.map +1 -1
- package/dist/pages/SearchPage.d.ts.map +1 -1
- package/dist/pages/SearchPage.js +2 -1
- package/dist/pages/SearchPage.js.map +1 -1
- package/dist/pages/account/ConnectedAppsPage.d.ts +0 -5
- package/dist/pages/account/ConnectedAppsPage.d.ts.map +1 -1
- package/dist/pages/account/ConnectedAppsPage.js +38 -6
- package/dist/pages/account/ConnectedAppsPage.js.map +1 -1
- package/dist/pages/admin/AgentsPanel.d.ts +10 -0
- package/dist/pages/admin/AgentsPanel.d.ts.map +1 -0
- package/dist/pages/admin/AgentsPanel.js +81 -0
- package/dist/pages/admin/AgentsPanel.js.map +1 -0
- package/dist/pages/admin/AiAdminPage.d.ts.map +1 -1
- package/dist/pages/admin/AiAdminPage.js +9 -6
- package/dist/pages/admin/AiAdminPage.js.map +1 -1
- package/dist/pages/admin/AiPage.js +1 -1
- package/dist/pages/admin/TeamPage.d.ts.map +1 -1
- package/dist/pages/admin/TeamPage.js +16 -3
- package/dist/pages/admin/TeamPage.js.map +1 -1
- package/dist/pages/ai/AiAccessPage.d.ts +11 -0
- package/dist/pages/ai/AiAccessPage.d.ts.map +1 -0
- package/dist/pages/ai/AiAccessPage.js +16 -0
- package/dist/pages/ai/AiAccessPage.js.map +1 -0
- package/dist/pages/ai/McpPanel.d.ts +7 -0
- package/dist/pages/ai/McpPanel.d.ts.map +1 -0
- package/dist/pages/ai/McpPanel.js +86 -0
- package/dist/pages/ai/McpPanel.js.map +1 -0
- package/dist/pages/auth/nextPath.d.ts +6 -0
- package/dist/pages/auth/nextPath.d.ts.map +1 -1
- package/dist/pages/auth/nextPath.js +16 -1
- package/dist/pages/auth/nextPath.js.map +1 -1
- package/dist/pages/dashboard/sections.d.ts.map +1 -1
- package/dist/pages/dashboard/sections.js +4 -2
- package/dist/pages/dashboard/sections.js.map +1 -1
- package/dist/pages/forms/EmbedPanel.js +1 -1
- package/dist/pages/forms/EmbedPanel.js.map +1 -1
- package/dist/pages/forms/FormEmails.d.ts.map +1 -1
- package/dist/pages/forms/FormEmails.js +6 -1
- package/dist/pages/forms/FormEmails.js.map +1 -1
- package/dist/pages/forms/FormSettings.d.ts.map +1 -1
- package/dist/pages/forms/FormSettings.js +6 -2
- package/dist/pages/forms/FormSettings.js.map +1 -1
- package/dist/pages/forms/SubmissionDetail.js +15 -3
- package/dist/pages/forms/SubmissionDetail.js.map +1 -1
- package/dist/pages/forms/SubmissionsTable.js +5 -2
- package/dist/pages/forms/SubmissionsTable.js.map +1 -1
- package/dist/pages/oauth/ConsentPage.d.ts.map +1 -1
- package/dist/pages/oauth/ConsentPage.js +132 -15
- package/dist/pages/oauth/ConsentPage.js.map +1 -1
- package/dist/registry/contributions.d.ts +1 -1
- package/package.json +4 -4
- package/src/api/resource.ts +16 -0
- package/src/api/resources/decisions.ts +81 -1
- package/src/api/resources/oauth.ts +15 -1
- package/src/api/resources/personIntake.ts +54 -13
- package/src/api/resources/session.ts +4 -0
- package/src/app/KelpieApp.tsx +4 -2
- package/src/components/AddRecordPanel.tsx +143 -0
- package/src/components/AiDrawer.tsx +34 -7
- package/src/components/ApiKeysPanel.tsx +193 -75
- package/src/components/CustomFieldsPanel.tsx +15 -5
- package/src/components/DecisionProvenance.tsx +95 -0
- package/src/components/DecisionsPanel.tsx +30 -2
- package/src/components/MarkdownView.tsx +45 -11
- package/src/components/NotesPanel.tsx +15 -6
- package/src/components/OriginLabel.tsx +26 -0
- package/src/components/Shell.tsx +30 -6
- package/src/components/aiDrawerState.ts +12 -0
- package/src/components/personIntakeTask.tsx +48 -0
- package/src/lib/personIntakeRunStorage.ts +97 -0
- package/src/modules/PersonIntakeWizard.tsx +391 -30
- package/src/modules/ai.tsx +1 -1
- package/src/pages/CompaniesPage.tsx +22 -5
- package/src/pages/DealsPage.tsx +25 -8
- package/src/pages/DecisionsPage.tsx +28 -1
- package/src/pages/EnquiriesPage.tsx +23 -5
- package/src/pages/FundraisingPage.tsx +25 -11
- package/src/pages/OpportunitiesPage.tsx +23 -5
- package/src/pages/PartnershipsPage.tsx +25 -11
- package/src/pages/PeoplePage.tsx +22 -7
- package/src/pages/PersonDetail.tsx +4 -2
- package/src/pages/SearchPage.tsx +3 -0
- package/src/pages/account/ConnectedAppsPage.tsx +97 -14
- package/src/pages/admin/{McpPanel.tsx → AgentsPanel.tsx} +11 -168
- package/src/pages/admin/AiAdminPage.tsx +16 -11
- package/src/pages/admin/AiPage.tsx +1 -1
- package/src/pages/admin/TeamPage.tsx +33 -0
- package/src/pages/ai/AiAccessPage.tsx +23 -0
- package/src/pages/ai/McpPanel.tsx +261 -0
- package/src/pages/auth/nextPath.ts +18 -1
- package/src/pages/dashboard/sections.tsx +4 -0
- package/src/pages/forms/EmbedPanel.tsx +3 -2
- package/src/pages/forms/FormEmails.tsx +11 -2
- package/src/pages/forms/FormSettings.tsx +5 -0
- package/src/pages/forms/SubmissionDetail.tsx +23 -4
- package/src/pages/forms/SubmissionsTable.tsx +9 -1
- package/src/pages/oauth/ConsentPage.tsx +271 -33
- package/src/registry/contributions.ts +1 -1
package/src/pages/DealsPage.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Deal, PipelineStage } from '@kelpie/schemas'
|
|
2
|
+
import { useState } from 'react'
|
|
2
3
|
import { Link, useNavigate } from 'react-router'
|
|
3
4
|
|
|
4
5
|
import { useCompanies } from '../api/resources/companies.ts'
|
|
@@ -7,6 +8,8 @@ import { useMembers } from '../api/resources/members.ts'
|
|
|
7
8
|
import { usePipelineStages } from '../api/resources/pipelineStages.ts'
|
|
8
9
|
import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
9
10
|
import { useTimezone } from '../api/resources/account.ts'
|
|
11
|
+
import { AddCompanyRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
12
|
+
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
10
13
|
import { Chip } from '../components/Chip.tsx'
|
|
11
14
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
12
15
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -125,16 +128,19 @@ export function DealsPage(): React.JSX.Element {
|
|
|
125
128
|
|
|
126
129
|
const companyNameById = new Map(companies.records.map((company) => [company.id, company.name]))
|
|
127
130
|
|
|
128
|
-
|
|
129
|
-
const firstCompany = companies.records[0]
|
|
131
|
+
const [adding, setAdding] = useState(false)
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
function addDeal(values: AddRecordValues): void {
|
|
134
|
+
// The panel asks for a company, so one is always set here.
|
|
135
|
+
if (values.companyId === undefined) {
|
|
132
136
|
return
|
|
133
137
|
}
|
|
134
138
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
createDeal
|
|
140
|
+
.runAsync({ name: values.name, companyId: values.companyId })
|
|
141
|
+
.then((record) => navigate(`/deals/${record.id}`))
|
|
142
|
+
// The failure is shown from `createDeal.error` below.
|
|
143
|
+
.catch(() => undefined)
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
const stageLabelById = new Map(allStages.map((stage) => [stage.id, stage.label]))
|
|
@@ -340,7 +346,7 @@ export function DealsPage(): React.JSX.Element {
|
|
|
340
346
|
<PageHeader
|
|
341
347
|
title="Deals"
|
|
342
348
|
onAdd={() => {
|
|
343
|
-
|
|
349
|
+
setAdding(true)
|
|
344
350
|
}}
|
|
345
351
|
addLabel="Add deal"
|
|
346
352
|
actions={
|
|
@@ -397,6 +403,17 @@ export function DealsPage(): React.JSX.Element {
|
|
|
397
403
|
}
|
|
398
404
|
/>
|
|
399
405
|
|
|
406
|
+
{adding && (
|
|
407
|
+
<AddCompanyRecordPanel
|
|
408
|
+
title="Add deal"
|
|
409
|
+
isPending={createDeal.isPending}
|
|
410
|
+
onCancel={() => {
|
|
411
|
+
setAdding(false)
|
|
412
|
+
}}
|
|
413
|
+
onCreate={addDeal}
|
|
414
|
+
/>
|
|
415
|
+
)}
|
|
416
|
+
|
|
400
417
|
{createDeal.error !== null && (
|
|
401
418
|
<div className="mb-3">
|
|
402
419
|
<ErrorPanel error={createDeal.error} />
|
|
@@ -454,7 +471,7 @@ export function DealsPage(): React.JSX.Element {
|
|
|
454
471
|
? {
|
|
455
472
|
label: 'Add deal',
|
|
456
473
|
onClick: () => {
|
|
457
|
-
|
|
474
|
+
setAdding(true)
|
|
458
475
|
},
|
|
459
476
|
}
|
|
460
477
|
: scope === 'open'
|
|
@@ -5,7 +5,7 @@ import { Link } from 'react-router'
|
|
|
5
5
|
import { useTimezone } from '../api/resources/account.ts'
|
|
6
6
|
import { useCompanies } from '../api/resources/companies.ts'
|
|
7
7
|
import { useDeals } from '../api/resources/deals.ts'
|
|
8
|
-
import { useDecisions } from '../api/resources/decisions.ts'
|
|
8
|
+
import { useConfirmDecision, useDecisions } from '../api/resources/decisions.ts'
|
|
9
9
|
import { useEvents } from '../api/resources/events.ts'
|
|
10
10
|
import { useMembers } from '../api/resources/members.ts'
|
|
11
11
|
import { useOpportunities } from '../api/resources/opportunities.ts'
|
|
@@ -15,6 +15,11 @@ import { useRaises } from '../api/resources/raises.ts'
|
|
|
15
15
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
16
16
|
import { DataTable } from '../components/DataTable.tsx'
|
|
17
17
|
import type { Column } from '../components/DataTable.tsx'
|
|
18
|
+
import {
|
|
19
|
+
ConfirmDecisionButton,
|
|
20
|
+
ConfirmedAnnouncement,
|
|
21
|
+
DecisionProvenance,
|
|
22
|
+
} from '../components/DecisionProvenance.tsx'
|
|
18
23
|
import { FilterBar, PageHeader } from '../components/PageHeader.tsx'
|
|
19
24
|
import { Paginator } from '../components/Paginator.tsx'
|
|
20
25
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
@@ -141,6 +146,7 @@ export function DecisionsPage(): React.JSX.Element {
|
|
|
141
146
|
term: term.trim().length > 0 ? term.trim() : undefined,
|
|
142
147
|
sort: serverSortOnly(sort, SERVER_SORT_KEYS),
|
|
143
148
|
})
|
|
149
|
+
const confirmDecision = useConfirmDecision()
|
|
144
150
|
const directory = useTargetDirectory()
|
|
145
151
|
const members = useMembers()
|
|
146
152
|
const timezone = useTimezone()
|
|
@@ -156,6 +162,20 @@ export function DecisionsPage(): React.JSX.Element {
|
|
|
156
162
|
{decision.rationale !== null && (
|
|
157
163
|
<div className="mt-0.5 text-[12px] text-ink-muted">{decision.rationale}</div>
|
|
158
164
|
)}
|
|
165
|
+
{(decision.origin === 'agent' || decision.origin === 'ai' || decision.confirmedAt === null) && (
|
|
166
|
+
<div className="mt-1 flex flex-wrap items-center gap-2">
|
|
167
|
+
<DecisionProvenance origin={decision.origin} confirmedAt={decision.confirmedAt} />
|
|
168
|
+
{decision.confirmedAt === null && (
|
|
169
|
+
<ConfirmDecisionButton
|
|
170
|
+
body={decision.body}
|
|
171
|
+
onConfirm={() => {
|
|
172
|
+
confirmDecision.run({ id: decision.id, updatedAt: decision.updatedAt })
|
|
173
|
+
}}
|
|
174
|
+
isPending={confirmDecision.pendingIds.has(decision.id)}
|
|
175
|
+
/>
|
|
176
|
+
)}
|
|
177
|
+
</div>
|
|
178
|
+
)}
|
|
159
179
|
</>
|
|
160
180
|
),
|
|
161
181
|
},
|
|
@@ -243,6 +263,13 @@ export function DecisionsPage(): React.JSX.Element {
|
|
|
243
263
|
/>
|
|
244
264
|
<FilterBar value={term} onChange={setTerm} placeholder="Filter decisions…" />
|
|
245
265
|
|
|
266
|
+
<ConfirmedAnnouncement count={confirmDecision.confirmedCount} />
|
|
267
|
+
{confirmDecision.error !== null && (
|
|
268
|
+
<div className="mb-3">
|
|
269
|
+
<ErrorPanel error={confirmDecision.error} />
|
|
270
|
+
</div>
|
|
271
|
+
)}
|
|
272
|
+
|
|
246
273
|
{decisions.error !== null ? (
|
|
247
274
|
<ErrorPanel error={decisions.error} />
|
|
248
275
|
) : decisions.isLoading ? (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Enquiry, PipelineStage } from '@kelpie/schemas'
|
|
2
|
+
import { useState } from 'react'
|
|
2
3
|
import { Link, useNavigate } from 'react-router'
|
|
3
4
|
|
|
4
5
|
import { useCompanies } from '../api/resources/companies.ts'
|
|
@@ -11,6 +12,8 @@ import { useMembers } from '../api/resources/members.ts'
|
|
|
11
12
|
import { usePipelineStages } from '../api/resources/pipelineStages.ts'
|
|
12
13
|
import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
13
14
|
import { useTimezone } from '../api/resources/account.ts'
|
|
15
|
+
import { AddRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
16
|
+
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
14
17
|
import { Chip } from '../components/Chip.tsx'
|
|
15
18
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
16
19
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -120,10 +123,14 @@ export function EnquiriesPage(): React.JSX.Element {
|
|
|
120
123
|
|
|
121
124
|
const companyNameById = new Map(companies.records.map((company) => [company.id, company.name]))
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
const enquiry = await createEnquiry.runAsync({ name: 'New enquiry' })
|
|
126
|
+
const [adding, setAdding] = useState(false)
|
|
125
127
|
|
|
126
|
-
|
|
128
|
+
function addEnquiry(values: AddRecordValues): void {
|
|
129
|
+
createEnquiry
|
|
130
|
+
.runAsync({ name: values.name })
|
|
131
|
+
.then((record) => navigate(`/enquiries/${record.id}`))
|
|
132
|
+
// The failure is shown from `createEnquiry.error` below.
|
|
133
|
+
.catch(() => undefined)
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
const stageLabelById = new Map(allStages.map((stage) => [stage.id, stage.label]))
|
|
@@ -282,7 +289,7 @@ export function EnquiriesPage(): React.JSX.Element {
|
|
|
282
289
|
<PageHeader
|
|
283
290
|
title="Enquiries"
|
|
284
291
|
onAdd={() => {
|
|
285
|
-
|
|
292
|
+
setAdding(true)
|
|
286
293
|
}}
|
|
287
294
|
addLabel="Add enquiry"
|
|
288
295
|
actions={
|
|
@@ -339,6 +346,17 @@ export function EnquiriesPage(): React.JSX.Element {
|
|
|
339
346
|
}
|
|
340
347
|
/>
|
|
341
348
|
|
|
349
|
+
{adding && (
|
|
350
|
+
<AddRecordPanel
|
|
351
|
+
title="Add enquiry"
|
|
352
|
+
isPending={createEnquiry.isPending}
|
|
353
|
+
onCancel={() => {
|
|
354
|
+
setAdding(false)
|
|
355
|
+
}}
|
|
356
|
+
onCreate={addEnquiry}
|
|
357
|
+
/>
|
|
358
|
+
)}
|
|
359
|
+
|
|
342
360
|
{createEnquiry.error !== null && (
|
|
343
361
|
<div className="mb-3">
|
|
344
362
|
<ErrorPanel error={createEnquiry.error} />
|
|
@@ -391,7 +409,7 @@ export function EnquiriesPage(): React.JSX.Element {
|
|
|
391
409
|
? {
|
|
392
410
|
label: 'Add enquiry',
|
|
393
411
|
onClick: () => {
|
|
394
|
-
|
|
412
|
+
setAdding(true)
|
|
395
413
|
},
|
|
396
414
|
}
|
|
397
415
|
: scope === 'open'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PipelineStage, Raise } from '@kelpie/schemas'
|
|
2
|
+
import { useState } from 'react'
|
|
2
3
|
import { Link, useNavigate } from 'react-router'
|
|
3
4
|
|
|
4
5
|
import { useCompanies } from '../api/resources/companies.ts'
|
|
@@ -7,6 +8,8 @@ import { usePipelineStages } from '../api/resources/pipelineStages.ts'
|
|
|
7
8
|
import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
8
9
|
import { useCreateRaise, useRaises, useUpdateRaise } from '../api/resources/raises.ts'
|
|
9
10
|
import { useTimezone } from '../api/resources/account.ts'
|
|
11
|
+
import { AddCompanyRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
12
|
+
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
10
13
|
import { Chip } from '../components/Chip.tsx'
|
|
11
14
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
12
15
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -126,19 +129,19 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
126
129
|
|
|
127
130
|
const companyNameById = new Map(companies.records.map((company) => [company.id, company.name]))
|
|
128
131
|
|
|
129
|
-
|
|
130
|
-
const firstCompany = companies.records[0]
|
|
132
|
+
const [adding, setAdding] = useState(false)
|
|
131
133
|
|
|
132
|
-
|
|
134
|
+
function addRaise(values: AddRecordValues): void {
|
|
135
|
+
// The panel asks for a company, so one is always set here.
|
|
136
|
+
if (values.companyId === undefined) {
|
|
133
137
|
return
|
|
134
138
|
}
|
|
135
139
|
|
|
136
|
-
|
|
137
|
-
name:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
await navigate(`/fundraising/${raise.id}`)
|
|
140
|
+
createRaise
|
|
141
|
+
.runAsync({ name: values.name, companyId: values.companyId })
|
|
142
|
+
.then((record) => navigate(`/fundraising/${record.id}`))
|
|
143
|
+
// The failure is shown from `createRaise.error` below.
|
|
144
|
+
.catch(() => undefined)
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
const stageLabelById = new Map(allStages.map((stage) => [stage.id, stage.label]))
|
|
@@ -327,7 +330,7 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
327
330
|
<PageHeader
|
|
328
331
|
title="Fundraising"
|
|
329
332
|
onAdd={() => {
|
|
330
|
-
|
|
333
|
+
setAdding(true)
|
|
331
334
|
}}
|
|
332
335
|
addLabel="Add raise"
|
|
333
336
|
actions={
|
|
@@ -390,6 +393,17 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
390
393
|
</p>
|
|
391
394
|
)}
|
|
392
395
|
|
|
396
|
+
{adding && (
|
|
397
|
+
<AddCompanyRecordPanel
|
|
398
|
+
title="Add raise"
|
|
399
|
+
isPending={createRaise.isPending}
|
|
400
|
+
onCancel={() => {
|
|
401
|
+
setAdding(false)
|
|
402
|
+
}}
|
|
403
|
+
onCreate={addRaise}
|
|
404
|
+
/>
|
|
405
|
+
)}
|
|
406
|
+
|
|
393
407
|
{createRaise.error !== null && (
|
|
394
408
|
<div className="mb-3">
|
|
395
409
|
<ErrorPanel error={createRaise.error} />
|
|
@@ -440,7 +454,7 @@ export function FundraisingPage(): React.JSX.Element {
|
|
|
440
454
|
? {
|
|
441
455
|
label: 'Add raise',
|
|
442
456
|
onClick: () => {
|
|
443
|
-
|
|
457
|
+
setAdding(true)
|
|
444
458
|
},
|
|
445
459
|
}
|
|
446
460
|
: scope === 'open'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Opportunity, PipelineStage } from '@kelpie/schemas'
|
|
2
|
+
import { useState } from 'react'
|
|
2
3
|
import { Link, useNavigate } from 'react-router'
|
|
3
4
|
|
|
4
5
|
import { useCompanies } from '../api/resources/companies.ts'
|
|
@@ -11,6 +12,8 @@ import {
|
|
|
11
12
|
import { usePipelineStages } from '../api/resources/pipelineStages.ts'
|
|
12
13
|
import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
13
14
|
import { useTimezone } from '../api/resources/account.ts'
|
|
15
|
+
import { AddRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
16
|
+
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
14
17
|
import { Chip } from '../components/Chip.tsx'
|
|
15
18
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
16
19
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -126,10 +129,14 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
126
129
|
|
|
127
130
|
const companyNameById = new Map(companies.records.map((company) => [company.id, company.name]))
|
|
128
131
|
|
|
129
|
-
|
|
130
|
-
const opportunity = await createOpportunity.runAsync({ name: 'New opportunity' })
|
|
132
|
+
const [adding, setAdding] = useState(false)
|
|
131
133
|
|
|
132
|
-
|
|
134
|
+
function addOpportunity(values: AddRecordValues): void {
|
|
135
|
+
createOpportunity
|
|
136
|
+
.runAsync({ name: values.name })
|
|
137
|
+
.then((record) => navigate(`/opportunities/${record.id}`))
|
|
138
|
+
// The failure is shown from `createOpportunity.error` below.
|
|
139
|
+
.catch(() => undefined)
|
|
133
140
|
}
|
|
134
141
|
|
|
135
142
|
const stageLabelById = new Map(allStages.map((stage) => [stage.id, stage.label]))
|
|
@@ -303,7 +310,7 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
303
310
|
<PageHeader
|
|
304
311
|
title="Opportunities"
|
|
305
312
|
onAdd={() => {
|
|
306
|
-
|
|
313
|
+
setAdding(true)
|
|
307
314
|
}}
|
|
308
315
|
addLabel="Add opportunity"
|
|
309
316
|
actions={
|
|
@@ -360,6 +367,17 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
360
367
|
}
|
|
361
368
|
/>
|
|
362
369
|
|
|
370
|
+
{adding && (
|
|
371
|
+
<AddRecordPanel
|
|
372
|
+
title="Add opportunity"
|
|
373
|
+
isPending={createOpportunity.isPending}
|
|
374
|
+
onCancel={() => {
|
|
375
|
+
setAdding(false)
|
|
376
|
+
}}
|
|
377
|
+
onCreate={addOpportunity}
|
|
378
|
+
/>
|
|
379
|
+
)}
|
|
380
|
+
|
|
363
381
|
{createOpportunity.error !== null && (
|
|
364
382
|
<div className="mb-3">
|
|
365
383
|
<ErrorPanel error={createOpportunity.error} />
|
|
@@ -412,7 +430,7 @@ export function OpportunitiesPage(): React.JSX.Element {
|
|
|
412
430
|
? {
|
|
413
431
|
label: 'Add opportunity',
|
|
414
432
|
onClick: () => {
|
|
415
|
-
|
|
433
|
+
setAdding(true)
|
|
416
434
|
},
|
|
417
435
|
}
|
|
418
436
|
: scope === 'open'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Partnership, PipelineStage } from '@kelpie/schemas'
|
|
2
|
+
import { useState } from 'react'
|
|
2
3
|
import { Link, useNavigate } from 'react-router'
|
|
3
4
|
|
|
4
5
|
import { useCompanies } from '../api/resources/companies.ts'
|
|
@@ -11,6 +12,8 @@ import {
|
|
|
11
12
|
import { usePipelineStages } from '../api/resources/pipelineStages.ts'
|
|
12
13
|
import { MAX_PAGE_SIZE, usePlanItems } from '../api/resources/planItems.ts'
|
|
13
14
|
import { useTimezone } from '../api/resources/account.ts'
|
|
15
|
+
import { AddCompanyRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
16
|
+
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
14
17
|
import { Chip } from '../components/Chip.tsx'
|
|
15
18
|
import type { ChipTone } from '../components/Chip.tsx'
|
|
16
19
|
import { ColumnPicker } from '../components/ColumnPicker.tsx'
|
|
@@ -127,19 +130,19 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
127
130
|
|
|
128
131
|
const companyNameById = new Map(companies.records.map((company) => [company.id, company.name]))
|
|
129
132
|
|
|
130
|
-
|
|
131
|
-
const firstCompany = companies.records[0]
|
|
133
|
+
const [adding, setAdding] = useState(false)
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
function addPartnership(values: AddRecordValues): void {
|
|
136
|
+
// The panel asks for a company, so one is always set here.
|
|
137
|
+
if (values.companyId === undefined) {
|
|
134
138
|
return
|
|
135
139
|
}
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
name:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
await navigate(`/partnerships/${partnership.id}`)
|
|
141
|
+
createPartnership
|
|
142
|
+
.runAsync({ name: values.name, companyId: values.companyId })
|
|
143
|
+
.then((record) => navigate(`/partnerships/${record.id}`))
|
|
144
|
+
// The failure is shown from `createPartnership.error` below.
|
|
145
|
+
.catch(() => undefined)
|
|
143
146
|
}
|
|
144
147
|
|
|
145
148
|
const stageLabelById = new Map(allStages.map((stage) => [stage.id, stage.label]))
|
|
@@ -320,7 +323,7 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
320
323
|
<PageHeader
|
|
321
324
|
title="Partnerships"
|
|
322
325
|
onAdd={() => {
|
|
323
|
-
|
|
326
|
+
setAdding(true)
|
|
324
327
|
}}
|
|
325
328
|
addLabel="Add partnership"
|
|
326
329
|
actions={
|
|
@@ -383,6 +386,17 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
383
386
|
</p>
|
|
384
387
|
)}
|
|
385
388
|
|
|
389
|
+
{adding && (
|
|
390
|
+
<AddCompanyRecordPanel
|
|
391
|
+
title="Add partnership"
|
|
392
|
+
isPending={createPartnership.isPending}
|
|
393
|
+
onCancel={() => {
|
|
394
|
+
setAdding(false)
|
|
395
|
+
}}
|
|
396
|
+
onCreate={addPartnership}
|
|
397
|
+
/>
|
|
398
|
+
)}
|
|
399
|
+
|
|
386
400
|
{createPartnership.error !== null && (
|
|
387
401
|
<div className="mb-3">
|
|
388
402
|
<ErrorPanel error={createPartnership.error} />
|
|
@@ -435,7 +449,7 @@ export function PartnershipsPage(): React.JSX.Element {
|
|
|
435
449
|
? {
|
|
436
450
|
label: 'Add partnership',
|
|
437
451
|
onClick: () => {
|
|
438
|
-
|
|
452
|
+
setAdding(true)
|
|
439
453
|
},
|
|
440
454
|
}
|
|
441
455
|
: scope === 'open'
|
package/src/pages/PeoplePage.tsx
CHANGED
|
@@ -5,6 +5,8 @@ import { useNavigate } from 'react-router'
|
|
|
5
5
|
|
|
6
6
|
import { useTimezone } from '../api/resources/account.ts'
|
|
7
7
|
import { useCreatePerson, usePeople } from '../api/resources/people.ts'
|
|
8
|
+
import { AddRecordPanel } from '../components/AddRecordPanel.tsx'
|
|
9
|
+
import type { AddRecordValues } from '../components/AddRecordPanel.tsx'
|
|
8
10
|
import { useAiDrawer } from '../components/aiDrawerState.ts'
|
|
9
11
|
import { Chip } from '../components/Chip.tsx'
|
|
10
12
|
import { SocialNetworkIcon } from '../components/SocialNetworkIcon.tsx'
|
|
@@ -64,12 +66,14 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
64
66
|
const createPerson = useCreatePerson()
|
|
65
67
|
const aiDrawer = useAiDrawer()
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
// The same defaults the API applies, so a person created here and one
|
|
69
|
-
// created through the API are the same record.
|
|
70
|
-
const person = await createPerson.runAsync({ name: 'New person' })
|
|
69
|
+
const [adding, setAdding] = useState(false)
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
function addPerson(values: AddRecordValues): void {
|
|
72
|
+
createPerson
|
|
73
|
+
.runAsync({ name: values.name })
|
|
74
|
+
.then((record) => navigate(`/people/${record.id}`))
|
|
75
|
+
// The failure is shown from `createPerson.error` below.
|
|
76
|
+
.catch(() => undefined)
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
const columns: readonly Column<Person>[] = [
|
|
@@ -244,7 +248,7 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
244
248
|
<PageHeader
|
|
245
249
|
title="People"
|
|
246
250
|
onAdd={() => {
|
|
247
|
-
|
|
251
|
+
setAdding(true)
|
|
248
252
|
}}
|
|
249
253
|
addLabel="Add person"
|
|
250
254
|
actions={
|
|
@@ -268,6 +272,17 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
268
272
|
placeholder="Filter by name, position, company…"
|
|
269
273
|
/>
|
|
270
274
|
|
|
275
|
+
{adding && (
|
|
276
|
+
<AddRecordPanel
|
|
277
|
+
title="Add person"
|
|
278
|
+
isPending={createPerson.isPending}
|
|
279
|
+
onCancel={() => {
|
|
280
|
+
setAdding(false)
|
|
281
|
+
}}
|
|
282
|
+
onCreate={addPerson}
|
|
283
|
+
/>
|
|
284
|
+
)}
|
|
285
|
+
|
|
271
286
|
{createPerson.error !== null && (
|
|
272
287
|
<div className="mb-3">
|
|
273
288
|
<ErrorPanel error={createPerson.error} />
|
|
@@ -296,7 +311,7 @@ export function PeoplePage(): React.JSX.Element {
|
|
|
296
311
|
: {
|
|
297
312
|
label: 'Add person',
|
|
298
313
|
onClick: () => {
|
|
299
|
-
|
|
314
|
+
setAdding(true)
|
|
300
315
|
},
|
|
301
316
|
}
|
|
302
317
|
}
|
|
@@ -838,7 +838,7 @@ function PersonConsents({ person }: { readonly person: Person }): React.JSX.Elem
|
|
|
838
838
|
) : (
|
|
839
839
|
person.consents.map((consent) => (
|
|
840
840
|
<SidebarField key={consent.purposeSlug} label={consent.purposeLabel}>
|
|
841
|
-
<div className="flex items-center gap-2">
|
|
841
|
+
<div className="flex flex-wrap items-center gap-x-2 gap-y-1">
|
|
842
842
|
<select
|
|
843
843
|
value={consent.inherited ? '' : consent.status}
|
|
844
844
|
onChange={(event) => {
|
|
@@ -855,7 +855,9 @@ function PersonConsents({ person }: { readonly person: Person }): React.JSX.Elem
|
|
|
855
855
|
<option value="withdrawn">Withdrawn</option>
|
|
856
856
|
</select>
|
|
857
857
|
{!consent.inherited && consent.source !== null && (
|
|
858
|
-
<span className="text-[10px] text-ink-faint">
|
|
858
|
+
<span className="min-w-0 break-all text-[10px] text-ink-faint">
|
|
859
|
+
via {consent.source}
|
|
860
|
+
</span>
|
|
859
861
|
)}
|
|
860
862
|
</div>
|
|
861
863
|
</SidebarField>
|
package/src/pages/SearchPage.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import type { SearchCollection, SearchResult, SearchResultGroup } from '@kelpie/
|
|
|
2
2
|
import { Link, useSearchParams } from 'react-router'
|
|
3
3
|
|
|
4
4
|
import { useSearch } from '../api/resources/search.ts'
|
|
5
|
+
import { Chip } from '../components/Chip.tsx'
|
|
5
6
|
import { ErrorPanel, LoadingPanel } from '../components/QueryState.tsx'
|
|
6
7
|
import { PageHeader } from '../components/PageHeader.tsx'
|
|
7
8
|
import { attachedHref } from '../lib/recordLinks.ts'
|
|
@@ -140,6 +141,8 @@ function ResultRow({
|
|
|
140
141
|
>
|
|
141
142
|
<div className="flex items-center justify-between gap-3">
|
|
142
143
|
<span className="min-w-0 flex-1 truncate text-[13px] font-medium text-ink">{item.title}</span>
|
|
144
|
+
{/* A Decision no member has confirmed is not a commitment yet. */}
|
|
145
|
+
{item.decision !== null && item.decision.confirmedAt === null && <Chip tone="warning">Proposed</Chip>}
|
|
143
146
|
{item.subtitle !== null && item.subtitle.length > 0 && (
|
|
144
147
|
<span className="max-w-[45%] truncate text-[11px] text-ink-faint">{item.subtitle}</span>
|
|
145
148
|
)}
|