Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed May 12, 2022
1 parent f54e313 commit 735414a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,10 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder
`Can't find property owner class for property '${protocol.property.property}'`,
);
}
property = getOwnProperty(propertyOwner, protocol.property.property);
property =
propertyOwner instanceof Class
? getClassProperty(propertyOwner, protocol.property.property)
: getOwnProperty(propertyOwner, protocol.property.property);
}
// NOTE: mapping for derived property is not supported
// since we are not doing embedded property mappings yet, the target must have already been added to the mapping
Expand Down
7 changes: 4 additions & 3 deletions packages/legend-query/src/stores/QueryBuilderExplorerState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
guaranteeNonNullable,
addUniqueEntry,
uniq,
returnUndefOnError,
} from '@finos/legend-shared';
import {
type AbstractProperty,
Expand Down Expand Up @@ -284,10 +285,10 @@ const isAutoMappedProperty = (
setImpl: SetImplementation,
): boolean => {
if (setImpl instanceof PureInstanceSetImplementation) {
const sourceClass = setImpl.srcClass;
const sourceClass = setImpl.srcClass.value;
return Boolean(
sourceClass.value
? getClassProperty(sourceClass.value, property.name)
sourceClass
? returnUndefOnError(() => getClassProperty(sourceClass, property.name))
: undefined,
);
}
Expand Down

0 comments on commit 735414a

Please sign in to comment.