File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -76,19 +76,19 @@ export class JsonForms {
7676 * Uses the model mapping to find the schema id defining the type of the given object.
7777 * If no schema id can be determined either because the object is empty, there is no model
7878 * mapping, or the object does not contain a mappable property.
79+ * TODO expected behavior?
7980 *
8081 * @param object The object whose type is determined
8182 * @return The schema id of the object or null if it could not be determined
8283 */
8384 static getSchemaIdForObject = ( object : Object ) : string => {
84- // TODO implement
8585 if ( JsonForms . modelMapping !== undefined && ! _ . isEmpty ( object ) ) {
8686 const mappingAttribute = JsonForms . modelMapping . attribute ;
8787 if ( ! _ . isEmpty ( mappingAttribute ) ) {
8888 const mappingValue = object [ mappingAttribute ] ;
89- const schemaId : string = JsonForms . modelMapping . mapping [ mappingValue ] ;
89+ const schemaElementId : string = JsonForms . modelMapping . mapping [ mappingValue ] ;
9090
91- return ! _ . isEmpty ( schemaId ) ? schemaId : null ;
91+ return ! _ . isEmpty ( schemaElementId ) ? schemaElementId : null ;
9292 }
9393 }
9494
Original file line number Diff line number Diff line change @@ -74,10 +74,11 @@ export interface ReferenceProperty extends Property {
7474 getData ( root : Object , data : Object ) : Object ;
7575
7676 /**
77- * Returns all possible values which can be referenced.
77+ * Returns all possible objects which can be referenced by this property.
78+ *
7879 * @param root The root object needed for finding the values
7980 */
80- getOptions ( root : Object ) : Object [ ] ;
81+ findReferenceTargets ( root : Object ) : Object [ ] ;
8182}
8283
8384export class ContainmentPropertyImpl implements ContainmentProperty {
@@ -153,7 +154,7 @@ export class ReferencePropertyImpl implements ReferenceProperty {
153154 getData ( root : object , data : object ) : Object {
154155 return this . getFunction ( root , data ) ;
155156 }
156- getOptions ( root : Object ) : Object [ ] {
157+ findReferenceTargets ( root : Object ) : Object [ ] {
157158 const candidates = this . pathToContainment
158159 . split ( '/' )
159160 . reduce (
You can’t perform that action at this time.
0 commit comments