# new ResourceDecorator(options)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object
|
||
resource |
BaseResource
|
resource which is decorated |
|
admin |
AdminJS
|
current instance of AdminJS |
|
options |
ResourceOptions
|
<optional> |
Classes
Members
# properties
under other mixed property.
Examples from PropertyOptions: { rootProperty: { type: mixed }, // root property
// nested property - this should go be the subProperty of rootProperty 'rootProperty.nested': { type: 'string' }
// also root property because there is no another property of type mixed 'another.property': { type: 'string' }, }
for a the reference {@see decorateProperties}
DecoratedProperties
# properties
under other mixed property.
Examples from PropertyOptions: { rootProperty: { type: mixed }, // root property
// nested property - this should go be the subProperty of rootProperty 'rootProperty.nested': { type: 'string' }
// also root property because there is no another property of type mixed 'another.property': { type: 'string' }, }
for a the reference {@see decorateProperties}
Methods
# bulkActions(currentAdmin) → {Array.<ActionDecorator>}
for a particular record
Parameters:
Name | Type | Description |
---|---|---|
currentAdmin |
CurrentAdmin
|
currently logged in admin user |
Actions assigned to resources
Array.<ActionDecorator>
# getFlattenProperties() → {Record.<string, PropertyDecorator>}
Record.<string, PropertyDecorator>
# getNavigation() → {Parent}
database type with its icon
ResourceJSON['parent']}
Parent
# getProperties(options) → {Array.<PropertyDecorator>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object
|
||
where |
String
|
one of: 'list', 'show', 'edit', 'filter' |
|
max |
String
|
<optional> |
maximum number of properties returned where there are no overrides in the options |
Array.<PropertyDecorator>
# getPropertyByKey(propertyPath) → {PropertyDecorator}
Parameters:
Name | Type | Description |
---|---|---|
propertyPath |
String
|
property path |
# recordActions(currentAdminopt) → {Array.<ActionDecorator>}
for an entire resource
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
currentAdmin |
CurrentAdmin
|
<optional> |
currently logged in admin user |
Actions assigned to each record
Array.<ActionDecorator>
# resourceActions(currentAdmin) → {Array.<ActionDecorator>}
for a particular record
Parameters:
Name | Type | Description |
---|---|---|
currentAdmin |
CurrentAdmin
|
currently logged in admin user |
Actions assigned to resources
Array.<ActionDecorator>
# titleOf(record) → {String}
For example: If given record has name
property and this property has isTitle
flag set in
options or by the Adapter - value for this property will be shown
Parameters:
Name | Type | Description |
---|---|---|
record |
BaseRecord
|
title of given record
String
# titleProperty() → {PropertyDecorator}
PropertyDecorator of title property
# toJSON(currentAdmin) → {ResourceJSON}
Parameters:
Name | Type | Description |
---|---|---|
currentAdmin |
CurrentAdmin
|