Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
782708e
Add ContactEditPanel component for inline contact editing
jeremyzilar Jun 26, 2026
4096c7e
Add edit panel to Contact show page
jeremyzilar Jun 26, 2026
30a69ec
Remove Create button from Contacts list page
jeremyzilar Jun 26, 2026
4c382e1
Remove old edit/create routes from contact and well resource definitions
jeremyzilar Jun 26, 2026
3fa0b84
Remove old contact create/edit and well edit routes
jeremyzilar Jun 26, 2026
acdaf77
Delete old contact create/edit pages and well full-page edit page
jeremyzilar Jun 26, 2026
c448c2c
Add PostHog edit funnel events to ContactEditPanel
jeremyzilar Jun 26, 2026
fb2aac0
Add PostHog edit funnel events to WellEditPanel
jeremyzilar Jun 26, 2026
59194e1
Add @testing-library/jest-dom to global test setup
jeremyzilar Jun 26, 2026
8fb0d7d
Add unit tests for ContactEditPanel
jeremyzilar Jun 26, 2026
894126e
Add unit tests for WellEditPanel
jeremyzilar Jun 26, 2026
4c53052
Expand ContactEditPanel to edit emails, phones, and addresses
jeremyzilar Jun 26, 2026
03543da
Add tests for email, phone, and address editing in ContactEditPanel
jeremyzilar Jun 26, 2026
aba9821
Move phone numbers section above email addresses in contact edit panel
jeremyzilar Jun 26, 2026
fcb4398
Fix trash icon alignment in email and phone rows so it sits on the sa…
jeremyzilar Jun 26, 2026
a2d2ac1
Add phone formatting and email/phone validation to contact edit panel
jeremyzilar Jun 26, 2026
19a5731
Improve validation UX in contact edit panel email and phone rows
jeremyzilar Jun 26, 2026
5113a6e
Only show email and phone validation errors after the field loses focus
jeremyzilar Jun 26, 2026
8707d5a
Reorder contact details fields: Contact Type, Role, Name, Organization
jeremyzilar Jun 26, 2026
f175535
Update organization field placeholder text
jeremyzilar Jun 26, 2026
37884d5
Replace state text input with US state dropdown, defaulting to NM
jeremyzilar Jun 26, 2026
ce59466
Fix useLexicon truncating options for large categories by setting pag…
jeremyzilar Jun 26, 2026
279388b
Fix edit panel border not extending to bottom when content overflows
jeremyzilar Jun 26, 2026
c01083a
Replace organization free-text input with lexicon-backed select
jeremyzilar Jun 26, 2026
4ddb60c
Trigger refetch on contact show page after edit panel saves
jeremyzilar Jun 26, 2026
a2052a9
Update ContactEditPanel tests for org select and add validation UX tests
jeremyzilar Jun 26, 2026
b536a78
Add missing created_at field to IGroup test fixtures
jeremyzilar Jun 26, 2026
09ce7b7
Fix outline button border invisible in dark mode
jeremyzilar Jun 26, 2026
995c565
Remove export button from Contacts list page header
jeremyzilar Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,272 changes: 1,272 additions & 0 deletions src/components/ContactEdit/ContactEditPanel.tsx

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/components/WellEdit/WellEditPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useRef, useState } from 'react'
import { useCustomMutation, useList, useNotification } from '@refinedev/core'
import { useQueryClient } from '@tanstack/react-query'
import { captureEvent } from '@/analytics/posthog'
import { Loader2, XIcon } from 'lucide-react'
import { Button, buttonVariants } from '@/components/ui/button'
import {
Expand Down Expand Up @@ -137,6 +138,10 @@ export function WellEditPanel({
const isGroupsLoading = groupsQuery.isLoading
const isLoading = isAssignedGroupsLoading || isGroupsLoading

useEffect(() => {
captureEvent('edit_panel_opened', { resource: 'well', well_id: wellId })
}, [wellId])

useEffect(() => {
wasLoadingRef.current = true
}, [wellId])
Expand Down Expand Up @@ -221,6 +226,11 @@ export function WellEditPanel({
])

await invalidateWellDetails(queryClient, wellId)
captureEvent('edit_saved', {
resource: 'well',
well_id: wellId,
fields_changed: ['groups'],
})
onClose()
} catch {
notify?.({
Expand All @@ -245,6 +255,11 @@ export function WellEditPanel({
}

const handleDiscardChanges = () => {
captureEvent('edit_abandoned', {
resource: 'well',
well_id: wellId,
had_changes: isDirty,
})
onClose()
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/editing/EditPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function EditPanel({
</Button>
</div>

<div className="flex-1 px-4 py-2 text-sm">{children}</div>
<div className="min-h-0 flex-1 overflow-y-auto px-4 py-2 text-sm">{children}</div>

{footer ? (
<div className="flex shrink-0 justify-end gap-2 border-t bg-background px-4 py-3">
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const buttonVariants = cva(
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/80",
outline:
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30 dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
ghost:
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useLexicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const useLexicon = ({ category }: UseLexiconProps) => {
const data = useList<ITerm>({
resource: 'lexicon/term',
dataProviderName: 'ocotillo',
pagination: { pageSize: 500 },
queryOptions: {
gcTime: 1000 * 60 * 5, // 5 minutes
staleTime: 1000 * 60 * 2, // 2 minutes
Expand Down
87 changes: 0 additions & 87 deletions src/pages/ocotillo/contact/create.tsx

This file was deleted.

94 changes: 0 additions & 94 deletions src/pages/ocotillo/contact/edit.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/pages/ocotillo/contact/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export * from './list'
export * from './create'
export * from './edit'
export * from './show'
16 changes: 2 additions & 14 deletions src/pages/ocotillo/contact/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import {
} from '@/interfaces/ocotillo/IContact'
import { Card, CardHeader, SxProps } from '@mui/material'
import { Email, Home, Phone } from '@mui/icons-material'
import { Plus } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { useLink, useNavigation } from '@refinedev/core'
import { useLink } from '@refinedev/core'
import { settings } from '@/settings'
import { formatAppDateTime, formatPhone } from '@/utils'
import { getContactDisplayName } from '@/utils/contactDisplayName'
Expand Down Expand Up @@ -44,7 +42,6 @@ export const ContactList: React.FC = () => {
[canViewConfidential, dataGridProps.rows]
)

const { create } = useNavigation()
const Link = useLink()

const columns = useMemo<GridColDef<IContact>[]>(
Expand Down Expand Up @@ -193,23 +190,14 @@ export const ContactList: React.FC = () => {
meta: { enabled: !!selectedContactId },
})

const customHeaderButtons = () => (
<>
<Button onClick={() => create('contact')}>
<Plus />
Create
</Button>
</>
)

return (
<>
<ListPage
title="Contacts & Owners"
columns={columns}
dataGridProps={{ ...dataGridPropsWithAnalytics, rows: visibleContacts }}
getRowId={(row) => row.id}
headerButtons={customHeaderButtons}
hideHeaderButtons
onRowClick={(params) =>
captureEvent('contacts_row_clicked', { contact_id: params.id })
}
Expand Down
Loading
Loading