Made new module, "opencase_defaults".Added a role
This commit is contained in:
parent
a0ab7282b8
commit
4c7cd2067b
@ -1 +0,0 @@
|
|||||||
bundle: opencase_features
|
|
@ -1,4 +0,0 @@
|
|||||||
name: 'Opencase User Roles'
|
|
||||||
type: module
|
|
||||||
core: 8.x
|
|
||||||
package: 'OpenCase Features'
|
|
14
modules/opencase_defaults/composer.json
Normal file
14
modules/opencase_defaults/composer.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "drupal/opencase_defaults",
|
||||||
|
"type": "drupal-module",
|
||||||
|
"description": "OpenCase Default Configuration",
|
||||||
|
"keywords": ["Drupal"],
|
||||||
|
"license": "GPL-2.0+",
|
||||||
|
"homepage": "https://www.drupal.org/project/opencase_defaults",
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://www.drupal.org/project/issues/opencase_defaults",
|
||||||
|
"source": "http://cgit.drupalcode.org/opencase_defaults"
|
||||||
|
},
|
||||||
|
"require": { }
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies: { }
|
||||||
|
id: opencase_admin
|
||||||
|
label: 'CRM Admin'
|
||||||
|
weight: 7
|
||||||
|
is_admin: null
|
||||||
|
permissions:
|
||||||
|
- 'add client entities'
|
||||||
|
- 'add volunteer entities'
|
||||||
|
- 'administer oc_activity fields'
|
||||||
|
- 'administer oc_actor fields'
|
||||||
|
- 'administer oc_case fields'
|
||||||
|
- 'administer opencase entity bundles'
|
||||||
|
- 'administer users'
|
||||||
|
- 'delete activity entities'
|
||||||
|
- 'delete case entities'
|
||||||
|
- 'delete client entities'
|
||||||
|
- 'delete volunteer entities'
|
||||||
|
- 'edit client entities'
|
||||||
|
- 'edit volunteer entities'
|
5
modules/opencase_defaults/opencase_defaults.info.yml
Normal file
5
modules/opencase_defaults/opencase_defaults.info.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: 'opencase_defaults'
|
||||||
|
type: module
|
||||||
|
description: 'OpenCase Default Configuration'
|
||||||
|
core: 8.x
|
||||||
|
package: 'OpenCase'
|
35
modules/opencase_defaults/opencase_defaults.module
Normal file
35
modules/opencase_defaults/opencase_defaults.module
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Contains opencase_defaults.module.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Drupal\Core\Routing\RouteMatchInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements hook_help().
|
||||||
|
*/
|
||||||
|
function opencase_defaults_help($route_name, RouteMatchInterface $route_match) {
|
||||||
|
switch ($route_name) {
|
||||||
|
// Main module help for the opencase_defaults module.
|
||||||
|
case 'help.page.opencase_defaults':
|
||||||
|
$output = '';
|
||||||
|
$output .= '<h3>' . t('About') . '</h3>';
|
||||||
|
$output .= '<p>' . t('OpenCase Default Configuration') . '</p>';
|
||||||
|
return $output;
|
||||||
|
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements hook_theme().
|
||||||
|
*/
|
||||||
|
function opencase_defaults_theme() {
|
||||||
|
return [
|
||||||
|
'opencase_defaults' => [
|
||||||
|
'render element' => 'children',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<!-- Add you custom twig html here -->
|
46
modules/opencase_defaults/tests/src/Functional/LoadTest.php
Normal file
46
modules/opencase_defaults/tests/src/Functional/LoadTest.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Drupal\Tests\opencase_defaults\Functional;
|
||||||
|
|
||||||
|
use Drupal\Core\Url;
|
||||||
|
use Drupal\Tests\BrowserTestBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple test to ensure that main page loads with module enabled.
|
||||||
|
*
|
||||||
|
* @group opencase_defaults
|
||||||
|
*/
|
||||||
|
class LoadTest extends BrowserTestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modules to enable.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $modules = ['opencase_defaults'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user with permission to administer site configuration.
|
||||||
|
*
|
||||||
|
* @var \Drupal\user\UserInterface
|
||||||
|
*/
|
||||||
|
protected $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function setUp() {
|
||||||
|
parent::setUp();
|
||||||
|
$this->user = $this->drupalCreateUser(['administer site configuration']);
|
||||||
|
$this->drupalLogin($this->user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests that the home page loads with a 200 response.
|
||||||
|
*/
|
||||||
|
public function testLoad() {
|
||||||
|
$this->drupalGet(Url::fromRoute('<front>'));
|
||||||
|
$this->assertSession()->statusCodeEquals(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user