moved activities view to opencase_default

This commit is contained in:
Naomi 2020-11-20 17:36:51 +00:00
parent 7ecdfbf3e6
commit d026173c8f
4 changed files with 9 additions and 3 deletions

View File

@ -282,6 +282,11 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
->setTranslatable(TRUE) ->setTranslatable(TRUE)
->setCardinality(1) ->setCardinality(1)
->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::defaultVal') ->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::defaultVal')
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'string',
'weight' => -3,
])
->setRequired(TRUE); ->setRequired(TRUE);
$fields['description'] = BaseFieldDefinition::create('string_long') $fields['description'] = BaseFieldDefinition::create('string_long')

View File

@ -220,6 +220,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
->setDisplayOptions('view', [ ->setDisplayOptions('view', [
'label' => 'above', 'label' => 'above',
'type' => 'author', 'type' => 'author',
'weight' => 80,
]); ]);
$fields['name'] = BaseFieldDefinition::create('string') $fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Title')) ->setLabel(t('Title'))
@ -266,6 +267,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
->setDescription(t('When the case was created.')) ->setDescription(t('When the case was created.'))
->setDisplayOptions('view', [ ->setDisplayOptions('view', [
'label' => 'above', 'label' => 'above',
'weight' => 80,
]); ]);
$fields['changed'] = BaseFieldDefinition::create('changed') $fields['changed'] = BaseFieldDefinition::create('changed')
@ -273,6 +275,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
->setDescription(t('When the case was last edited.')) ->setDescription(t('When the case was last edited.'))
->setDisplayOptions('view', [ ->setDisplayOptions('view', [
'label' => 'above', 'label' => 'above',
'weight' => 80,
]); ]);
$fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean') $fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')

View File

@ -86,10 +86,8 @@ function opencase_theme() {
*/ */
function opencase_uninstall() { function opencase_uninstall() {
$configs = [ $configs = [
'block.block.opencasecontextualmenu',
'block.block.opencase', 'block.block.opencase',
'system.menu.opencase', 'system.menu.opencase',
'views.view.activities',
'views.view.contact_details_changes' 'views.view.contact_details_changes'
]; ];
foreach($configs as $config) { foreach($configs as $config) {
@ -134,5 +132,5 @@ function _opencase_delete_case_redirect($form, &$form_state) {
} }
function _opencase_delete_activity_redirect($form, &$form_state) { function _opencase_delete_activity_redirect($form, &$form_state) {
$case_id = $form_state->getFormObject()->getEntity()->oc_case->target_id; $case_id = $form_state->getFormObject()->getEntity()->oc_case->target_id;
$form_state->setRedirect('view.activities.page_1', ['case_id' => $case_id]); // redirect to the activity list $form_state->setRedirect('entity.oc_case.canonical', ['oc_case' => $case_id]);
} }