Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): dereference issues #12109

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const StructuredPropValues = ({ schemaFieldEntity, propColumn }: Props) => {
const entityRegistry = useEntityRegistry();

const property = schemaFieldEntity.structuredProperties?.properties?.find(
(prop) => prop.structuredProperty.urn === propColumn?.entity.urn,
(prop) => prop.structuredProperty.urn === propColumn?.entity?.urn,
);
const propRow = property ? mapStructuredPropertyToPropertyRow(property) : undefined;
const values = propRow?.values;
const isRichText = propRow?.dataType?.info.type === StdDataType.RichText;
const isRichText = propRow?.dataType?.info?.type === StdDataType.RichText;

const hasMoreValues = values && values.length > 2;
const displayedValues = hasMoreValues ? values.slice(0, 1) : values;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const StructuredPropertyBadge = ({ structuredProperties }: Props) => {

if (!badgeStructuredProperty) return null;

const propertyValue = propRow?.values[0].value;
const relatedDescription = propRow?.structuredProperty.definition.allowedValues?.find(
const propertyValue = propRow?.values[0]?.value;
const relatedDescription = propRow?.structuredProperty?.definition?.allowedValues?.find(
(v) => getStructuredPropertyValue(v.value) === propertyValue,
)?.description;

Expand All @@ -56,7 +56,7 @@ const StructuredPropertyBadge = ({ structuredProperties }: Props) => {
<Text color="gray" size="sm" weight="bold">
Value
</Text>
<Text color="gray">{propRow?.values[0].value}</Text>
<Text color="gray">{propRow?.values[0]?.value}</Text>
</ValueContainer>
{relatedDescription && (
<ValueContainer>
Expand All @@ -79,7 +79,7 @@ const StructuredPropertyBadge = ({ structuredProperties }: Props) => {
>
<BadgeContainer>
<Pill
label={propRow?.values[0].value?.toString() || ''}
label={propRow?.values[0]?.value?.toString() || ''}
size="sm"
colorScheme="violet"
clickable={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const SidebarStructuredPropsSection = ({ properties }: Props) => {
property,
currentProperties,
);
const isRichText = propertyRow?.dataType?.info.type === StdDataType.RichText;
const isRichText = propertyRow?.dataType?.info?.type === StdDataType.RichText;
const values = propertyRow?.values;
const hasMultipleValues = values && values.length > 1;
const propertyName = getDisplayName(property.entity as StructuredPropertyEntity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Form({ formUrn }: Props) {
const title = formAssociation?.form?.info?.name;
const associatedUrn = formAssociation?.associatedUrn;
const description = formAssociation?.form?.info?.description;
const owners = formAssociation?.form.ownership?.owners;
const owners = formAssociation?.form?.ownership?.owners;

return (
<TabWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function EditStructuredPropertyModal({

return (
<Modal
title={`${isAddMode ? 'Add property' : 'Edit property'} ${structuredProperty?.definition.displayName}`}
title={`${isAddMode ? 'Add property' : 'Edit property'} ${structuredProperty?.definition?.displayName}`}
onCancel={closeModal}
open={isOpen}
width={650}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const StructuredProperties = () => {

const searchAcrossEntities = data?.searchAcrossEntities;
const noOfProperties = searchAcrossEntities?.searchResults?.length;
const badgeProperty = searchAcrossEntities?.searchResults.find(
const badgeProperty = searchAcrossEntities?.searchResults?.find(
(prop) => (prop.entity as StructuredPropertyEntity).settings?.showAsAssetBadge,
)?.entity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ViewAdvancedOptions = ({ propEntity }: Props) => {
{propEntity && (
<RowContainer>
<StyledLabel>Qualified Name</StyledLabel>
<Text color="gray"> {propEntity?.definition.qualifiedName}</Text>
<Text color="gray"> {propEntity?.definition?.qualifiedName}</Text>
</RowContainer>
)}
</Collapse.Panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const ViewStructuredPropsDrawer = ({

const selectedPropEntity = selectedProperty && (selectedProperty?.entity as StructuredPropertyEntity);

const allowedValues = selectedPropEntity?.definition.allowedValues;
const allowedValues = selectedPropEntity?.definition?.allowedValues;

const allowedTypes = selectedPropEntity?.definition.typeQualifier?.allowedTypes;
const allowedTypes = selectedPropEntity?.definition?.typeQualifier?.allowedTypes;

const propType = getValueTypeLabel(
selectedPropEntity.definition.valueType.urn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const ExecutionDetailsModal = ({ urn, open, onClose }: Props) => {
(status && <Typography.Text type="secondary">{getExecutionRequestSummaryText(status)}</Typography.Text>) ||
undefined;

const recipeJson = data?.executionRequest?.input.arguments?.find((arg) => arg.key === 'recipe')?.value;
const recipeJson = data?.executionRequest?.input?.arguments?.find((arg) => arg.key === 'recipe')?.value;
let recipeYaml: string;
try {
recipeYaml = recipeJson && YAML.stringify(JSON.parse(recipeJson), 8, 2).trim();
Expand Down
Loading