diff --git a/config/install/views.view.activities.yml b/modules/opencase_defaults/config/optional/views.view.activities.yml similarity index 100% rename from config/install/views.view.activities.yml rename to modules/opencase_defaults/config/optional/views.view.activities.yml diff --git a/modules/opencase_entities/src/Entity/OCActivity.php b/modules/opencase_entities/src/Entity/OCActivity.php index 40c788b..f2dac8d 100644 --- a/modules/opencase_entities/src/Entity/OCActivity.php +++ b/modules/opencase_entities/src/Entity/OCActivity.php @@ -282,6 +282,11 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte ->setTranslatable(TRUE) ->setCardinality(1) ->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::defaultVal') + ->setDisplayOptions('view', [ + 'label' => 'hidden', + 'type' => 'string', + 'weight' => -3, + ]) ->setRequired(TRUE); $fields['description'] = BaseFieldDefinition::create('string_long') diff --git a/modules/opencase_entities/src/Entity/OCCase.php b/modules/opencase_entities/src/Entity/OCCase.php index 406ff3e..78856b3 100644 --- a/modules/opencase_entities/src/Entity/OCCase.php +++ b/modules/opencase_entities/src/Entity/OCCase.php @@ -220,6 +220,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setDisplayOptions('view', [ 'label' => 'above', 'type' => 'author', + 'weight' => 80, ]); $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Title')) @@ -266,6 +267,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setDescription(t('When the case was created.')) ->setDisplayOptions('view', [ 'label' => 'above', + 'weight' => 80, ]); $fields['changed'] = BaseFieldDefinition::create('changed') @@ -273,6 +275,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setDescription(t('When the case was last edited.')) ->setDisplayOptions('view', [ 'label' => 'above', + 'weight' => 80, ]); $fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean') diff --git a/opencase.module b/opencase.module index 5ba503f..1d79f53 100644 --- a/opencase.module +++ b/opencase.module @@ -86,10 +86,8 @@ function opencase_theme() { */ function opencase_uninstall() { $configs = [ - 'block.block.opencasecontextualmenu', 'block.block.opencase', 'system.menu.opencase', - 'views.view.activities', 'views.view.contact_details_changes' ]; foreach($configs as $config) { @@ -134,5 +132,5 @@ function _opencase_delete_case_redirect($form, &$form_state) { } function _opencase_delete_activity_redirect($form, &$form_state) { $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]); }