A full-featured CRM built with React, shadcn/ui, and Supabase.
Revert "Fix(deals): Company name was not displayed in deal show modal"
Jonathan ARNAULT941c79337533
diff --git a/src/companies/CompanyAside.tsx b/src/companies/CompanyAside.tsxindex cb628d5e..4a8e4721 100644--- a/src/companies/CompanyAside.tsx+++ b/src/companies/CompanyAside.tsx@@ -102,7 +102,7 @@ const CompanyInfo = ({ record }: { record: Company }) => {};const ContextInfo = ({ record }: { record: Company }) => {- if (!record.revenue && !record.id) {+ if (!record.revenue && !record.identifier) {return null;}diff --git a/src/companies/CompanyShow.tsx b/src/companies/CompanyShow.tsxindex 5580455f..29e0ea18 100644--- a/src/companies/CompanyShow.tsx+++ b/src/companies/CompanyShow.tsx@@ -228,7 +228,7 @@ const DealsIterator = () => {currencyDisplay: 'narrowSymbol',minimumSignificantDigits: 3,})}- {deal.category ? `, ${deal.category}` : ''}+ , {deal.type}</>}/>diff --git a/src/deals/ContactList.tsx b/src/deals/ContactList.tsxindex 513b2f2e..c26e9834 100644--- a/src/deals/ContactList.tsx+++ b/src/deals/ContactList.tsx@@ -1,5 +1,6 @@-import { Link, Stack, Typography } from '@mui/material';+import * as React from 'react';import { useListContext } from 'react-admin';+import { Link, Stack, Typography } from '@mui/material';import { Link as RouterLink } from 'react-router-dom';import { Avatar } from '../contacts/Avatar';diff --git a/src/deals/DealCard.tsx b/src/deals/DealCard.tsxindex 065668dd..124421a8 100644--- a/src/deals/DealCard.tsx+++ b/src/deals/DealCard.tsx@@ -1,8 +1,9 @@-import { Draggable } from '@hello-pangea/dnd';-import { Box, Card, Typography } from '@mui/material';+import * as React from 'react';import { ReferenceField, useRedirect } from 'react-admin';-import { CompanyAvatar } from '../companies/CompanyAvatar';+import { Box, Card, Typography } from '@mui/material';+import { Draggable } from '@hello-pangea/dnd';import { Deal } from '../types';+import { CompanyAvatar } from '../companies/CompanyAvatar';export const DealCard = ({ deal, index }: { deal: Deal; index: number }) => {if (!deal) return null;@@ -72,7 +73,7 @@ export const DealCardContent = ({currencyDisplay: 'narrowSymbol',minimumSignificantDigits: 3,})}- {deal.category ? `, ${deal.category}` : ''}+ , {deal.category}</Typography></Box></Box>diff --git a/src/deals/DealShow.tsx b/src/deals/DealShow.tsxindex 2d10fadd..230cfe97 100644--- a/src/deals/DealShow.tsx+++ b/src/deals/DealShow.tsx@@ -207,7 +207,7 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {</Typography><ReferenceArrayFieldsource="contact_ids"- reference="contacts_summary"+ reference="contacts"><ContactList /></ReferenceArrayField>diff --git a/src/notes/Note.tsx b/src/notes/Note.tsxindex e7ada349..3330b344 100644--- a/src/notes/Note.tsx+++ b/src/notes/Note.tsx@@ -1,5 +1,3 @@-import TrashIcon from '@mui/icons-material/Delete';-import EditIcon from '@mui/icons-material/Edit';import ContentSave from '@mui/icons-material/Save';import {Box,@@ -19,16 +17,18 @@ import {useUpdate,WithRecord,} from 'react-admin';+import TrashIcon from '@mui/icons-material/Delete';+import EditIcon from '@mui/icons-material/Edit';import { FieldValues, SubmitHandler } from 'react-hook-form';-import { CompanyAvatar } from '../companies/CompanyAvatar';import { Avatar } from '../contacts/Avatar';-import { RelativeDate } from '../misc/RelativeDate';import { Status } from '../misc/Status';-import { SaleName } from '../sales/SaleName';import { ContactNote, DealNote } from '../types';import { NoteAttachments } from './NoteAttachments';import { NoteInputs } from './NoteInputs';+import { SaleName } from '../sales/SaleName';+import { RelativeDate } from '../misc/RelativeDate';+import { CompanyAvatar } from '../companies/CompanyAvatar';export const Note = ({showStatus,@@ -112,10 +112,7 @@ export const Note = ({render={record => <SaleName sale={record} />}/></ReferenceField>{' '}- added a note{' '}- {showStatus && note.status && (- <Status status={note.status} />- )}+ added a note {showStatus && <Status status={note.status} />}<Boxcomponent="span"sx={{diff --git a/src/types.ts b/src/types.tsindex 8aca43e5..4429a720 100644--- a/src/types.ts+++ b/src/types.ts@@ -1,4 +1,3 @@-import { SvgIconComponent } from '@mui/icons-material';import { Identifier, RaRecord } from 'react-admin';import {COMPANY_CREATED,@@ -7,6 +6,7 @@ import {DEAL_CREATED,DEAL_NOTE_CREATED,} from './consts';+import { SvgIconComponent } from '@mui/icons-material';export type SignUpData = {email: string;@@ -29,7 +29,7 @@ export type UpdatePasswordData = {newPassword: string;};-export type Sale = {+export interface Sale extends RaRecord {first_name: string;last_name: string;administrator: boolean;@@ -40,9 +40,9 @@ export type Sale = {// This is a copy of the user's email, to make it easier to handle by react admin// DO NOT UPDATE this field directly, it should be updated by the backendemail: string;-} & Pick<RaRecord, 'id'>;+}-export type Company = {+export interface Company extends RaRecord {name: string;logo: RAFile;sector: string;@@ -63,9 +63,9 @@ export type Company = {context_links?: string[];nb_contacts?: number;nb_deals?: number;-} & Pick<RaRecord, 'id'>;+}-export type Contact = {+export interface Contact extends RaRecord {first_name: string;last_name: string;title: string;@@ -85,21 +85,18 @@ export type Contact = {phone_1_number: string;phone_2_type: 'Work' | 'Home' | 'Other';phone_2_number: string;+}- nb_tasks?: number;- company_name?: string;-} & Pick<RaRecord, 'id'>;--export type ContactNote = {+export interface ContactNote extends RaRecord {contact_id: Identifier;text: string;date: string;sales_id: Identifier;status: string;attachments?: AttachmentNote[];-} & Pick<RaRecord, 'id'>;+}-export type Deal = {+export interface Deal extends RaRecord {name: string;company_id: Identifier;contact_ids: Identifier[];@@ -113,32 +110,29 @@ export type Deal = {expected_closing_date: string;sales_id: Identifier;index: number;-} & Pick<RaRecord, 'id'>;+}-export type DealNote = {+export interface DealNote extends RaRecord {deal_id: Identifier;text: string;date: string;sales_id: Identifier;attachments?: AttachmentNote[];+}- // This is defined for compatibility with `ContactNote`- status?: undefined;-} & Pick<RaRecord, 'id'>;--export type Tag = {+export interface Tag extends RaRecord {name: string;color: string;-} & Pick<RaRecord, 'id'>;+}-export type Task = {+export interface Task extends RaRecord {contact_id: Identifier;type: string;text: string;due_date: string;done_date?: string | null;sales_id?: Identifier;-} & Pick<RaRecord, 'id'>;+}export type ActivityCompanyCreated = {type: typeof COMPANY_CREATED;