Fix linter and remove console logs
This commit is contained in:
@ -35,9 +35,11 @@ export const RecordShowPage = () => {
|
||||
objectMetadataId: string;
|
||||
}>();
|
||||
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem({
|
||||
objectNameSingular,
|
||||
});
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem(
|
||||
{
|
||||
objectNameSingular,
|
||||
},
|
||||
);
|
||||
|
||||
const { favorites, createFavorite, deleteFavorite } = useFavorites({
|
||||
objectNamePlural: foundObjectMetadataItem?.namePlural,
|
||||
|
||||
@ -32,9 +32,11 @@ export const RecordTableContainer = ({
|
||||
}: {
|
||||
objectNamePlural: string;
|
||||
}) => {
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem({
|
||||
objectNamePlural,
|
||||
});
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem(
|
||||
{
|
||||
objectNamePlural,
|
||||
},
|
||||
);
|
||||
const { columnDefinitions } = useComputeDefinitionsFromFieldMetadata(
|
||||
foundObjectMetadataItem,
|
||||
);
|
||||
|
||||
@ -48,11 +48,14 @@ export const useFindManyObjectRecords = <
|
||||
isFetchingMoreObjectsFamilyState(objectNamePlural),
|
||||
);
|
||||
|
||||
const { objectMetadataItem: foundObjectMetadataItem, objectNotFoundInMetadata, findManyQuery } =
|
||||
useObjectMetadataItem({
|
||||
objectNamePlural,
|
||||
skip,
|
||||
});
|
||||
const {
|
||||
objectMetadataItem: foundObjectMetadataItem,
|
||||
objectNotFoundInMetadata,
|
||||
findManyQuery,
|
||||
} = useObjectMetadataItem({
|
||||
objectNamePlural,
|
||||
skip,
|
||||
});
|
||||
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
|
||||
@ -15,10 +15,13 @@ export const useFindOneObjectRecord = <
|
||||
onCompleted?: (data: ObjectType) => void;
|
||||
skip?: boolean;
|
||||
}) => {
|
||||
const { objectMetadataItem: foundObjectMetadataItem, objectNotFoundInMetadata, findOneQuery } =
|
||||
useObjectMetadataItem({
|
||||
objectNameSingular,
|
||||
});
|
||||
const {
|
||||
objectMetadataItem: foundObjectMetadataItem,
|
||||
objectNotFoundInMetadata,
|
||||
findOneQuery,
|
||||
} = useObjectMetadataItem({
|
||||
objectNameSingular,
|
||||
});
|
||||
|
||||
const { data, loading, error } = useQuery<
|
||||
{ [nameSingular: string]: ObjectType },
|
||||
|
||||
@ -14,9 +14,11 @@ import { useFindManyObjectRecords } from './useFindManyObjectRecords';
|
||||
export const useObjectRecordTable = () => {
|
||||
const { scopeId: objectNamePlural } = useRecordTable();
|
||||
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem({
|
||||
objectNamePlural,
|
||||
});
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem(
|
||||
{
|
||||
objectNamePlural,
|
||||
},
|
||||
);
|
||||
|
||||
const { registerOptimisticEffect } = useOptimisticEffect({
|
||||
objectNameSingular: foundObjectMetadataItem?.nameSingular,
|
||||
|
||||
@ -29,9 +29,11 @@ export const useRecordTableContextMenuEntries = () => {
|
||||
const { scopeId: objectNamePlural, resetTableRowSelection } =
|
||||
useRecordTable();
|
||||
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem({
|
||||
objectNamePlural,
|
||||
});
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem(
|
||||
{
|
||||
objectNamePlural,
|
||||
},
|
||||
);
|
||||
|
||||
const { createFavorite, deleteFavorite, favorites } = useFavorites({
|
||||
objectNamePlural,
|
||||
|
||||
@ -15,7 +15,6 @@ export const mapPaginatedObjectsToObjects = <
|
||||
pagedObjects: ObjectTypeQuery | undefined;
|
||||
objectNamePlural: string;
|
||||
}) => {
|
||||
console.log(objectNamePlural);
|
||||
const formattedObjects: ObjectType[] =
|
||||
pagedObjects?.[objectNamePlural].edges.map((objectEdge: ObjectEdge) => ({
|
||||
...objectEdge.node,
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { useSpreadsheetImport } from '@/spreadsheet-import/hooks/useSpreadsheetImport';
|
||||
import { SpreadsheetOptions } from '@/spreadsheet-import/types';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar/hooks/useSnackBar';
|
||||
|
||||
import { fieldsForPerson } from '../utils/fieldsForPerson';
|
||||
|
||||
@ -10,7 +7,6 @@ export type FieldPersonMapping = (typeof fieldsForPerson)[number]['key'];
|
||||
|
||||
export const useSpreadsheetPersonImport = () => {
|
||||
const { openSpreadsheetImport } = useSpreadsheetImport<FieldPersonMapping>();
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
const openPersonSpreadsheetImport = (
|
||||
options?: Omit<
|
||||
@ -20,20 +16,19 @@ export const useSpreadsheetPersonImport = () => {
|
||||
) => {
|
||||
openSpreadsheetImport({
|
||||
...options,
|
||||
onSubmit: async (data) => {
|
||||
onSubmit: async (_data) => {
|
||||
// TODO: Add better type checking in spreadsheet import later
|
||||
const createInputs = data.validData.map((person) => ({
|
||||
id: uuidv4(),
|
||||
firstName: person.firstName as string | undefined,
|
||||
lastName: person.lastName as string | undefined,
|
||||
email: person.email as string | undefined,
|
||||
linkedinUrl: person.linkedinUrl as string | undefined,
|
||||
xUrl: person.xUrl as string | undefined,
|
||||
jobTitle: person.jobTitle as string | undefined,
|
||||
phone: person.phone as string | undefined,
|
||||
city: person.city as string | undefined,
|
||||
}));
|
||||
|
||||
// const createInputs = data.validData.map((person) => ({
|
||||
// id: uuidv4(),
|
||||
// firstName: person.firstName as string | undefined,
|
||||
// lastName: person.lastName as string | undefined,
|
||||
// email: person.email as string | undefined,
|
||||
// linkedinUrl: person.linkedinUrl as string | undefined,
|
||||
// xUrl: person.xUrl as string | undefined,
|
||||
// jobTitle: person.jobTitle as string | undefined,
|
||||
// phone: person.phone as string | undefined,
|
||||
// city: person.city as string | undefined,
|
||||
// }));
|
||||
// TODO : abstract this part for any object
|
||||
// try {
|
||||
// const result = await createManyPerson({
|
||||
@ -42,7 +37,6 @@ export const useSpreadsheetPersonImport = () => {
|
||||
// },
|
||||
// refetchQueries: 'active',
|
||||
// });
|
||||
|
||||
// if (result.errors) {
|
||||
// throw result.errors;
|
||||
// }
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
type ChipDisplayProps = {
|
||||
displayName: string;
|
||||
entityId: string | null;
|
||||
avatarUrlValue?: string;
|
||||
};
|
||||
|
||||
export const ChipDisplay = ({
|
||||
displayName,
|
||||
entityId,
|
||||
avatarUrlValue,
|
||||
}: ChipDisplayProps) => {
|
||||
switch (true) {
|
||||
// case Entity.Company: {
|
||||
// return (
|
||||
// <CompanyChip
|
||||
// id={entityId ?? ''}
|
||||
// name={displayName}
|
||||
// avatarUrl={getLogoUrlFromDomainName(avatarUrlValue)}
|
||||
// />
|
||||
// );
|
||||
// }
|
||||
// case Entity.Person: {
|
||||
// return (
|
||||
// <PersonChip
|
||||
// id={entityId ?? ''}
|
||||
// name={displayName}
|
||||
// avatarUrl={avatarUrlValue}
|
||||
// />
|
||||
// );
|
||||
// }
|
||||
default:
|
||||
return <> </>;
|
||||
}
|
||||
};
|
||||
@ -22,9 +22,11 @@ export const RecordTableBody = () => {
|
||||
|
||||
const { scopeId: objectNamePlural } = useRecordTable();
|
||||
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem({
|
||||
objectNamePlural,
|
||||
});
|
||||
const { objectMetadataItem: foundObjectMetadataItem } = useObjectMetadataItem(
|
||||
{
|
||||
objectNamePlural,
|
||||
},
|
||||
);
|
||||
|
||||
const [isFetchingMoreObjects] = useRecoilState(
|
||||
isFetchingMoreObjectsFamilyState(foundObjectMetadataItem?.namePlural),
|
||||
|
||||
Reference in New Issue
Block a user