Removed published/enabled checkbox till decide what to do with that.

Also placed author on forms and views
This commit is contained in:
naomi 2018-04-06 14:12:29 +02:00
parent 190a90a4db
commit 0ecdf1247c
3 changed files with 32 additions and 17 deletions

View File

@ -280,11 +280,11 @@ class ContactDetails extends RevisionableContentEntityBase implements ContactDet
->setLabel(t('Enabled')) ->setLabel(t('Enabled'))
->setDescription(t('If this is ticked then this set of contact details is active.')) ->setDescription(t('If this is ticked then this set of contact details is active.'))
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setDefaultValue(TRUE) # ->setDisplayOptions('form', [
->setDisplayOptions('form', [ # 'type' => 'boolean_checkbox',
'type' => 'boolean_checkbox', # 'weight' => -3,
'weight' => -3, # ])
]); ->setDefaultValue(TRUE);
$fields['created'] = BaseFieldDefinition::create('created') $fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created')) ->setLabel(t('Created'))

View File

@ -191,6 +191,21 @@ class Person extends RevisionableContentEntityBase implements PersonInterface {
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setSetting('target_type', 'user') ->setSetting('target_type', 'user')
->setSetting('handler', 'default') ->setSetting('handler', 'default')
->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => [
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
],
])
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'author',
'weight' => 100,
])
->setTranslatable(TRUE); ->setTranslatable(TRUE);
$fields['full_name'] = BaseFieldDefinition::create('string') $fields['full_name'] = BaseFieldDefinition::create('string')
@ -272,11 +287,11 @@ class Person extends RevisionableContentEntityBase implements PersonInterface {
->setLabel(t('Enabled')) ->setLabel(t('Enabled'))
->setDescription(t('If this is ticked, the record is active')) ->setDescription(t('If this is ticked, the record is active'))
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setDefaultValue(TRUE) # ->setDisplayOptions('form', [
->setDisplayOptions('form', [ # 'type' => 'boolean_checkbox',
'type' => 'boolean_checkbox', # 'weight' => -3,
'weight' => -3, # ])
]); ->setDefaultValue(TRUE);
$fields['created'] = BaseFieldDefinition::create('created') $fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created')) ->setLabel(t('Created'))

View File

@ -211,9 +211,9 @@ class Profile extends RevisionableContentEntityBase implements ProfileInterface
->setSetting('handler', 'default') ->setSetting('handler', 'default')
->setTranslatable(TRUE) ->setTranslatable(TRUE)
->setDisplayOptions('view', [ ->setDisplayOptions('view', [
'label' => 'hidden', 'label' => 'inline',
'type' => 'author', 'type' => 'author',
'weight' => 0, 'weight' => 100,
]) ])
->setDisplayOptions('form', [ ->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete', 'type' => 'entity_reference_autocomplete',
@ -279,11 +279,11 @@ class Profile extends RevisionableContentEntityBase implements ProfileInterface
->setLabel(t('Publishing status')) ->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Profile is published.')) ->setDescription(t('A boolean indicating whether the Profile is published.'))
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setDefaultValue(TRUE) # ->setDisplayOptions('form', [
->setDisplayOptions('form', [ # 'type' => 'boolean_checkbox',
'type' => 'boolean_checkbox', # 'weight' => -3,
'weight' => -3, # ])
]); ->setDefaultValue(TRUE);
$fields['created'] = BaseFieldDefinition::create('created') $fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created')) ->setLabel(t('Created'))