Skip to content

Commit

Permalink
Fixed parts of Inbox view and Routing notice mccrodp#9.
Browse files Browse the repository at this point in the history
  • Loading branch information
mccrodp committed Jun 30, 2016
1 parent 0518150 commit 9599ae4
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 24 deletions.
24 changes: 19 additions & 5 deletions config/optional/views.view.message_private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- message_private
- system
_core:
default_config_hash: jsUTeO74uA5Ft0ThwwfWSAOa4WyOxJC-SEBRXAZLlPM
default_config_hash: bVibi5tmBTw8tXLLgtnOwJPfY7PdJAaKIC8KgGX0mS0
id: message_private
label: 'Message Private'
module: views
Expand Down Expand Up @@ -468,7 +468,20 @@ display:
title: 'Message Private'
header: { }
footer: { }
empty: { }
empty:
area:
id: area
table: views
field: area
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: false
content:
value: 'No messages here yet.'
format: basic_html
plugin_id: text
relationships: { }
arguments:
field_message_private_to_user_target_id:
Expand Down Expand Up @@ -528,15 +541,16 @@ display:
position: 1
display_options:
display_extenders: { }
path: user/%user/messages
path: user/%/messages
menu:
type: tab
title: 'Message Inbox'
description: ''
parent: system.admin_content
expanded: false
parent: ''
weight: 0
context: '0'
menu_name: admin
menu_name: account
tab_options:
type: none
title: ''
Expand Down
2 changes: 1 addition & 1 deletion message_private.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
- views
- message
- message_notify
- message_ui
- message_ui
4 changes: 1 addition & 3 deletions message_private.install
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ function message_private_uninstall() {
/* @var \Drupal\Core\Field\FieldConfigBase $field */
// If we have the user notify field, purge the data and remove.
if(!empty($field->getName() == 'field_message_private_usr_notify')) {
$entity_type = $field->getTargetEntityTypeId();
Drupal::entityManager()->getStorage($entity_type)->purgeFieldData($field, 100);
field_purge_field($field);
field_cron(); // Purge previously deleted field tables.
$field->delete();
}
}
Expand Down
2 changes: 1 addition & 1 deletion message_private.links.action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ message_private.messages.add:
route_name: message_ui.add
title: 'Create a new message for...'
appears_on:
- message_private.messages
- message_private.messages
13 changes: 12 additions & 1 deletion message_private.links.task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ message_private.messages:
route_name: message_private.messages
base_route: entity.user.canonical
title: 'Messages'

message_private.messages.inbox:
route_name: message_private.messages
base_route: message_private.messages
title: 'Inbox'

message_private.messages.sent:
route_name: message_private.messages.sent
base_route: message_private.messages
title: 'Sent'

# Provide dynamic local tasks.
message_private.messages:
deriver: 'Drupal\message_private\Plugin\Derivative\DynamicLocalTasks'
weight: -10
weight: -10
18 changes: 8 additions & 10 deletions message_private.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ message_private.admin_settings:

message_private.messages:
path: '/user/{user}/messages'
title: 'Inbox'
defaults:
_title: 'Inbox'
description: 'Message Private Inbox'
base_route: system.admin_content
requirements:
_permission: 'overview messages'

message_private.messages.inbox:
route_name: message_private.messages
title: 'Inbox'
parent_id: message_private.messages

message_private.messages.sent:
route_name: message_private.messages
title: 'Sent'
parent_id: message_private.messages
path: '/user/{user}/messages/sent'
defaults:
_title: 'Sent'
description: 'Message Private Inbox'
requirements:
_permission: 'overview messages'
4 changes: 1 addition & 3 deletions src/Plugin/Derivative/DynamicLocalTasks.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @file
* Contains \Drupal\message_private\Plugin\Derivative\DyanmicLocalTasks.
* Contains \Drupal\message_private\Plugin\Derivative\DynamicLocalTasks.
*/

namespace Drupal\message_private\Plugin\Derivative;
Expand All @@ -27,5 +27,3 @@ public function getDerivativeDefinitions($base_plugin_definition) {
return $this->derivatives;
}
}

?>

0 comments on commit 9599ae4

Please sign in to comment.