@@ -3,7 +3,7 @@ import PropertyOptions from './property-options.interface'
3
3
import BaseResource from '../../adapters/resource/base-resource'
4
4
import BaseProperty , { PropertyType } from '../../adapters/property/base-property'
5
5
import ResourceDecorator from '../resource/resource-decorator'
6
- import { PropertyPlace , PropertyJSON } from '../../../frontend/interfaces'
6
+ import { PropertyPlace , BasePropertyJSON } from '../../../frontend/interfaces'
7
7
import { overrideFromOptions } from './utils'
8
8
9
9
/**
@@ -23,7 +23,7 @@ class PropertyDecorator {
23
23
* This path serves as a key in {@link PropertyOptions} to identify which
24
24
* property has to be updated
25
25
*/
26
- public path : string
26
+ public propertyPath : string
27
27
28
28
/**
29
29
* Indicates if given property has been created in AdminBro and hasn't been returned by the
@@ -63,7 +63,7 @@ class PropertyDecorator {
63
63
this . property = property
64
64
this . _admin = admin
65
65
this . _resource = resource
66
- this . path = path || property . name ( )
66
+ this . propertyPath = path || property . name ( )
67
67
this . isVirtual = ! ! isVirtual
68
68
this . virtualSubProperties = [ ]
69
69
@@ -123,7 +123,7 @@ class PropertyDecorator {
123
123
* @return {string }
124
124
*/
125
125
label ( ) : string {
126
- return this . _admin . translateProperty ( this . path , this . _resource . id ( ) )
126
+ return this . _admin . translateProperty ( this . propertyPath , this . _resource . id ( ) )
127
127
}
128
128
129
129
/**
@@ -153,7 +153,7 @@ class PropertyDecorator {
153
153
return values . map ( val => ( {
154
154
value : val ,
155
155
label : this . _admin . translateProperty (
156
- `${ this . path } .${ val } ` ,
156
+ `${ this . propertyPath } .${ val } ` ,
157
157
this . _resource . id ( ) ,
158
158
{ defaultValue : val } ,
159
159
) ,
@@ -246,7 +246,7 @@ class PropertyDecorator {
246
246
*
247
247
* @return {PropertyJSON }
248
248
*/
249
- toJSON ( where ?: PropertyPlace ) : PropertyJSON {
249
+ toJSON ( where ?: PropertyPlace ) : BasePropertyJSON {
250
250
return {
251
251
isTitle : this . isTitle ( ) ,
252
252
isId : this . isId ( ) ,
@@ -256,7 +256,7 @@ class PropertyDecorator {
256
256
isRequired : this . isRequired ( ) ,
257
257
availableValues : this . availableValues ( ) ,
258
258
name : this . name ( ) ,
259
- path : this . path ,
259
+ propertyPath : this . propertyPath ,
260
260
isDisabled : this . isDisabled ( ) ,
261
261
label : this . label ( ) ,
262
262
type : this . type ( ) ,
@@ -280,7 +280,7 @@ class PropertyDecorator {
280
280
*/
281
281
subProperties ( ) : Array < PropertyDecorator > {
282
282
const dbSubProperties = this . property . subProperties ( ) . map ( ( subProperty ) => {
283
- const path = `${ this . path } .${ subProperty . name ( ) } `
283
+ const path = `${ this . propertyPath } .${ subProperty . name ( ) } `
284
284
const decorated = new PropertyDecorator ( {
285
285
property : subProperty ,
286
286
admin : this . _admin ,
@@ -301,14 +301,14 @@ class PropertyDecorator {
301
301
* Returns PropertyOptions passed by the user for a subProperty. Furthermore
302
302
* it changes property name to the nested property key.
303
303
*
304
- * @param {BaseProperty } subProperty
304
+ * @param {String } propertyPath
305
305
* @return {PropertyOptions }
306
306
* @private
307
307
*/
308
- private getOptionsForSubProperty ( path : string ) : PropertyOptions {
308
+ private getOptionsForSubProperty ( propertyPath : string ) : PropertyOptions {
309
309
const propertyOptions = ( this . _resource . options || { } ) . properties || { }
310
310
return {
311
- ...propertyOptions [ path ] ,
311
+ ...propertyOptions [ propertyPath ] ,
312
312
}
313
313
}
314
314
}
0 commit comments