Commit fe010e5c authored by New Zeal's avatar New Zeal

refine local tasks

parent 6609b345
......@@ -28,4 +28,10 @@ Add message history functionality
Fix thread delete function
8.x-1.0-alpha10
Make the threads control area tidier adding tabs and improving workflow
\ No newline at end of file
Make the threads control area tidier adding tabs and improving workflow
8.x-1.0-alpha11
Fix thread urls and redirects
8.x-1.0-alpha12
Refine tabs and access rules
......@@ -5,9 +5,6 @@ template: conversation
label: Messages
description: 'Message thread to accompany Private Messages'
message_template: private_message
view_display: null
view_display_id: null
text: { }
settings:
message_template: private_message
view_id: private_messages
......
......@@ -6,11 +6,10 @@ dependencies:
- field.storage.message_thread.field_thread_title
- message_thread.template.conversation
module:
- message_private
- message_thread
- user
_core:
default_config_hash: UqAY1HdOAH7JtNrXnK5OGCxXSIJ6uZhbgRMT488UMSw
default_config_hash: aRS7Mqf_xk1HwqOeqK7NTPslQUTaNXpSD4tzeCF2mKw
id: conversations
label: Messages
module: views
......@@ -27,8 +26,9 @@ display:
position: 0
display_options:
access:
type: message_private
options: { }
type: perm
options:
perm: 'create and receive conversation message threads'
cache:
type: tag
options: { }
......@@ -402,9 +402,9 @@ display:
position: 1
display_options:
display_extenders: { }
path: user/%/conversations
path: user/%user/conversations
menu:
type: 'default tab'
type: tab
title: Messages
description: ''
expanded: false
......@@ -417,6 +417,22 @@ display:
title: ''
description: ''
weight: 0
empty:
area:
id: area
table: views
field: area
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: false
content:
value: '<a href="/message/thread/add/conversation">Start a new conversation</a>'
format: basic_html
plugin_id: text
defaults:
empty: false
cache_metadata:
max-age: -1
contexts:
......
......@@ -10,7 +10,7 @@ dependencies:
- message_ui
- user
_core:
default_config_hash: 2Up5NUvwF4aBVoO6eFTPeBXtnpUw_yiexv9I5u6ZD-g
default_config_hash: DOOWzqkXI77o2Q96QVFt65R_TVHiRqAJrWPp7JfWA0I
id: message_thread_messages
label: 'Message Thread Messages'
module: views
......@@ -29,7 +29,7 @@ display:
access:
type: perm
options:
perm: 'create and receive conversation'
perm: 'create and receive conversation message threads'
cache:
type: none
options: { }
......
......@@ -9,11 +9,6 @@ task.message_thread.threads.sent:
base_route: message_thread.threads
title: Sent
task.message_thread.threads:
route_name: message_thread.threads
base_route: message_thread.threads
title: Inbox
task.message_thread.add:
route_name: message_thread.add_page
base_route: message_thread.threads
......@@ -35,5 +30,5 @@ task.message_thread.delete_form:
title: Delete
## Provide dynamic local tasks.
message_thread.dynamic_tasks:
deriver: 'Drupal\message_thread\Plugin\Derivative\DynamicLocalTasks'
\ No newline at end of file
#message_thread.dynamic_tasks:
# deriver: 'Drupal\message_thread\Plugin\Derivative\DynamicLocalTasks'
\ No newline at end of file
......@@ -68,6 +68,7 @@ class MessageThreadRoutes implements ContainerInjectionInterface {
$thread_templates = $this->entityTypeManager->getListBuilder('message_thread_template')->load();
foreach ($thread_templates as $name => $template) {
$settings = $template->getSettings();
// This is being called before the view route is being registered when the module is first installed
......@@ -92,10 +93,10 @@ class MessageThreadRoutes implements ContainerInjectionInterface {
'_title' => $template->label(),
],
[
'_permission' => 'create and receive ' . $template->id()
'_permission' => 'create and receive ' . $template->id() . ' message threads'
]
);
$route_collection->add('message_thread.' . $name, $route);
$route_collection->add('message_thread.' . $template->id(), $route);
}
$route = (new Route('/message/thread/{message_thread}'))
......@@ -105,6 +106,7 @@ class MessageThreadRoutes implements ContainerInjectionInterface {
])
->setRequirement('message_thread', '\d+')
->setRequirement('_entity_access', 'message_thread.view');
$route_collection->add('entity.message_thread.canonical', $route);
return $route_collection;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment