Skip to content
This repository was archived by the owner on Feb 23, 2020. It is now read-only.

Add admin/structure/rng to menu #137

Open
wants to merge 3 commits into
base: 8.x-1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions rng.links.menu.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
rng.registration_type.overview:
title: 'Registration types'
parent: system.admin_structure
parent: rng.structure
description: 'Manage registration types.'
route_name: rng.registration_type.overview

entity.registrant_type.collection:
title: 'Registrant types'
parent: system.admin_structure
parent: rng.structure
description: 'Manage registrant types.'
route_name: entity.registrant_type.collection

rng.config:
title: 'RNG'
parent: system.admin_config
description: 'Manage registration types.'
description: 'Manage global registration settings.'
route_name: rng.config

rng.event.overview:
title: 'Event types'
parent: system.admin_structure
parent: rng.structure
description: 'Manage which entity bundles are designated as events.'
route_name: rng.event_type.overview

Expand All @@ -33,3 +33,9 @@ rng.config.plugin.condition:
parent: rng.config
description: 'Manage global settings for conditions defined by RNG.'
route_name: rng.config.plugin.condition

rng.structure:
title: 'RNG'
parent: system.admin_structure
description: 'Manage registration entity types.'
route_name: rng.structure
9 changes: 9 additions & 0 deletions rng.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ rng.rng_event_type_rule.component.edit:
component_id:
type: 'rng_component_id'

# RNG Structure overview
rng.structure:
path: '/admin/structure/rng'
defaults:
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_title: 'RNG'
requirements:
_permission: 'access administration pages'

# RNG Configuration
rng.config:
path: '/admin/config/rng'
Expand Down
9 changes: 7 additions & 2 deletions src/Tests/RngEventTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ function testEventType() {
$event_type->delete();
$event_bundle->delete();

// Event types button on admin.
// Admin structure overview
$this->drupalGet('admin/structure');
$this->assertLinkByHref(Url::fromRoute('rng.structure')->toString());
$this->assertRaw('Manage registration entity types.', 'RNG shows in administration structure.');

// Event types button on admin.
$this->drupalGet('admin/structure/rng');
$this->assertLinkByHref(Url::fromRoute('rng.event_type.overview')->toString());
$this->assertRaw('Manage which entity bundles are designated as events.', 'Button shows in administration.');
$this->assertRaw('Manage which entity bundles are designated as events.', 'Event type overview link shows in RNG administration.');

// No events.
$this->assertEqual(0, count(EventType::loadMultiple()), 'There are no event type entities.');
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/RngRegistrationTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function testRegistrationTypes() {
$this->registration_type->delete();

// Administration.
$this->drupalGet('admin/structure');
$this->drupalGet('admin/structure/rng');
$this->assertLinkByHref(Url::fromRoute('rng.registration_type.overview')->toString());

$this->drupalGet('admin/structure/rng/registration_types');
Expand Down