some ts-error-fixes (#6563)
@FelixMalfait Let me know what do you think. Thanks
This commit is contained in:
@ -7,14 +7,14 @@ import { AuthContext } from '@/auth/contexts/AuthContext';
|
||||
import { FieldContext } from '../../contexts/FieldContext';
|
||||
|
||||
export const useActorFieldDisplay = () => {
|
||||
const { entityId, fieldDefinition } = useContext(FieldContext);
|
||||
const { recordId, fieldDefinition } = useContext(FieldContext);
|
||||
|
||||
const { currentWorkspaceMembers } = useContext(AuthContext);
|
||||
|
||||
const fieldName = fieldDefinition.metadata.fieldName;
|
||||
|
||||
const fieldValue = useRecordFieldValue<FieldActorValue | undefined>(
|
||||
entityId,
|
||||
recordId,
|
||||
fieldName,
|
||||
);
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ export type RelationFromManyFieldInputProps = {
|
||||
export const RelationFromManyFieldInput = ({
|
||||
onSubmit,
|
||||
}: RelationFromManyFieldInputProps) => {
|
||||
const { fieldDefinition, entityId } = useContext(FieldContext);
|
||||
const { fieldDefinition, recordId } = useContext(FieldContext);
|
||||
const relationPickerScopeId = `relation-picker-${fieldDefinition.fieldMetadataId}`;
|
||||
const { updateRelation } = useUpdateRelationFromManyFieldInput({
|
||||
scopeId: relationPickerScopeId,
|
||||
@ -48,7 +48,7 @@ export const RelationFromManyFieldInput = ({
|
||||
relationFieldDefinition.metadata.relationObjectMetadataNameSingular,
|
||||
relationObjectMetadataItem,
|
||||
relationFieldMetadataItem,
|
||||
entityId,
|
||||
recordId,
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@ -14,8 +14,8 @@ import { RelationPickerHotkeyScope } from '@/object-record/relation-picker/types
|
||||
import { useInlineCell } from '../hooks/useInlineCell';
|
||||
|
||||
import { useIsFieldReadOnly } from '@/object-record/record-field/hooks/useIsFieldReadOnly';
|
||||
import { RecordInlineCellContainer } from './RecordInlineCellContainer';
|
||||
import { getRecordFieldInputId } from '@/object-record/utils/getRecordFieldInputId';
|
||||
import { RecordInlineCellContainer } from './RecordInlineCellContainer';
|
||||
|
||||
type RecordInlineCellProps = {
|
||||
readonly?: boolean;
|
||||
@ -98,7 +98,10 @@ export const RecordInlineCell = ({
|
||||
isCentered={isCentered}
|
||||
editModeContent={
|
||||
<FieldInput
|
||||
recordFieldInputdId={getRecordFieldInputId(recordId, fieldDefinition?.metadata?.fieldName)}
|
||||
recordFieldInputdId={getRecordFieldInputId(
|
||||
recordId,
|
||||
fieldDefinition?.metadata?.fieldName,
|
||||
)}
|
||||
onEnter={handleEnter}
|
||||
onCancel={handleCancel}
|
||||
onEscape={handleEscape}
|
||||
|
||||
@ -6,9 +6,9 @@ import { AppTooltip, IconComponent, TooltipDelay } from 'twenty-ui';
|
||||
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
|
||||
import { useFieldFocus } from '@/object-record/record-field/hooks/useFieldFocus';
|
||||
import { RecordInlineCellValue } from '@/object-record/record-inline-cell/components/RecordInlineCellValue';
|
||||
import { getRecordFieldInputId } from '@/object-record/utils/getRecordFieldInputId';
|
||||
import { EllipsisDisplay } from '@/ui/field/display/components/EllipsisDisplay';
|
||||
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
|
||||
import { getRecordFieldInputId } from '@/object-record/utils/getRecordFieldInputId';
|
||||
|
||||
const StyledIconContainer = styled.div`
|
||||
align-items: center;
|
||||
@ -112,7 +112,10 @@ export const RecordInlineCellContainer = ({
|
||||
};
|
||||
|
||||
const theme = useTheme();
|
||||
const labelId = `label-${getRecordFieldInputId(recordId,fieldDefinition?.metadata?.fieldName)}`;
|
||||
const labelId = `label-${getRecordFieldInputId(
|
||||
recordId,
|
||||
fieldDefinition?.metadata?.fieldName,
|
||||
)}`;
|
||||
|
||||
return (
|
||||
<StyledInlineCellBaseContainer
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export const getRecordFieldInputId = (recordId: string, fieldName?: string): string => {
|
||||
return `${recordId}-${fieldName}`;
|
||||
};
|
||||
|
||||
export const getRecordFieldInputId = (
|
||||
recordId: string,
|
||||
fieldName?: string,
|
||||
): string => {
|
||||
return `${recordId}-${fieldName}`;
|
||||
};
|
||||
|
||||
@ -18,6 +18,10 @@ export const CustomAddBlockItem = ({
|
||||
}: CustomAddBlockItemProps) => {
|
||||
const Components = useComponentsContext();
|
||||
|
||||
if (!Components) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const handleClick = () => {
|
||||
const blockIdentifier = editor.getTextCursorPosition().block;
|
||||
const currentBlockContent = blockIdentifier?.content as
|
||||
|
||||
Reference in New Issue
Block a user