feat: add Object Edit Settings section with Object preview (#4216)

* feat: add Object Edit Settings section with Object preview

Closes #3834

* fix: fix preview card stories

* test: improve getFieldDefaultPreviewValue tests

* test: add getFieldPreviewValueFromRecord tests

* test: add useFieldPreview tests

* refactor: rename and move components

* fix: restore RecordStoreDecorator
This commit is contained in:
Thaïs
2024-02-29 11:23:56 -03:00
committed by GitHub
parent 6ad3880696
commit a892d0f653
43 changed files with 1665 additions and 937 deletions

View File

@ -62,9 +62,9 @@ export const getObjectRecordIdentifier = ({
// TODO: This is a temporary solution before we seed imageIdentifierFieldMetadataId in the database
const avatarUrl =
(objectMetadataItem.nameSingular === CoreObjectNameSingular.Company
? getLogoUrlFromDomainName(record['domainName'] ?? '')
? getLogoUrlFromDomainName(record.domainName ?? '')
: objectMetadataItem.nameSingular === CoreObjectNameSingular.Person
? record['avatarUrl'] ?? ''
? record.avatarUrl ?? ''
: imageIdentifierFieldValue) ?? '';
const basePathToShowPage = getBasePathToShowPage({
@ -74,9 +74,10 @@ export const getObjectRecordIdentifier = ({
const isWorkspaceMemberObjectMetadata =
objectMetadataItem.nameSingular === CoreObjectNameSingular.WorkspaceMember;
const linkToShowPage = isWorkspaceMemberObjectMetadata
? ''
: `${basePathToShowPage}${record.id}`;
const linkToShowPage =
isWorkspaceMemberObjectMetadata || !record.id
? ''
: `${basePathToShowPage}${record.id}`;
return {
id: record.id,