summaryrefslogtreecommitdiff
path: root/modules/fahad/notification
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fahad/notification')
-rw-r--r--modules/fahad/notification/composer.json14
-rw-r--r--modules/fahad/notification/config/install/core.entity_form_display.node.notification.default.yml111
-rw-r--r--modules/fahad/notification/config/install/core.entity_view_display.node.notification.default.yml61
-rw-r--r--modules/fahad/notification/config/install/core.entity_view_display.node.notification.teaser.yml33
-rw-r--r--modules/fahad/notification/config/install/field.field.node.notification.body.yml24
-rw-r--r--modules/fahad/notification/config/install/field.field.node.notification.field_notification_date.yml23
-rw-r--r--modules/fahad/notification/config/install/field.field.node.notification.field_notification_file.yml29
-rw-r--r--modules/fahad/notification/config/install/field.field.node.notification.field_notitfication_category.yml31
-rw-r--r--modules/fahad/notification/config/install/field.storage.node.field_notification_date.yml23
-rw-r--r--modules/fahad/notification/config/install/field.storage.node.field_notification_file.yml26
-rw-r--r--modules/fahad/notification/config/install/field.storage.node.field_notitfication_category.yml23
-rw-r--r--modules/fahad/notification/config/install/node.type.notification.yml20
-rw-r--r--modules/fahad/notification/config/install/taxonomy.vocabulary.notification_category.yml12
-rw-r--r--modules/fahad/notification/notification.info.yml14
-rw-r--r--modules/fahad/notification/notification.module35
-rw-r--r--modules/fahad/notification/templates/notification.html.twig1
-rw-r--r--modules/fahad/notification/tests/src/Functional/LoadTest.php46
17 files changed, 526 insertions, 0 deletions
diff --git a/modules/fahad/notification/composer.json b/modules/fahad/notification/composer.json
new file mode 100644
index 0000000..4fa3d4a
--- /dev/null
+++ b/modules/fahad/notification/composer.json
@@ -0,0 +1,14 @@
+{
+ "name": "drupal/notification",
+ "type": "drupal-module",
+ "description": "My Awesome Module",
+ "keywords": ["Drupal"],
+ "license": "GPL-2.0+",
+ "homepage": "https://www.drupal.org/project/notification",
+ "minimum-stability": "dev",
+ "support": {
+ "issues": "https://www.drupal.org/project/issues/notification",
+ "source": "http://cgit.drupalcode.org/notification"
+ },
+ "require": { }
+}
diff --git a/modules/fahad/notification/config/install/core.entity_form_display.node.notification.default.yml b/modules/fahad/notification/config/install/core.entity_form_display.node.notification.default.yml
new file mode 100644
index 0000000..2045610
--- /dev/null
+++ b/modules/fahad/notification/config/install/core.entity_form_display.node.notification.default.yml
@@ -0,0 +1,111 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.notification.body
+ - field.field.node.notification.field_notification_date
+ - field.field.node.notification.field_notification_file
+ - field.field.node.notification.field_notitfication_category
+ - node.type.notification
+ module:
+ - datetime
+ - file
+ - path
+ - text
+ enforced:
+ module:
+ - notification
+id: node.notification.default
+targetEntityType: node
+bundle: notification
+mode: default
+content:
+ body:
+ type: text_textarea_with_summary
+ weight: 121
+ settings:
+ rows: 9
+ summary_rows: 3
+ placeholder: ''
+ third_party_settings: { }
+ region: content
+ created:
+ type: datetime_timestamp
+ weight: 10
+ region: content
+ settings: { }
+ third_party_settings: { }
+ field_notification_date:
+ weight: 124
+ settings: { }
+ third_party_settings: { }
+ type: datetime_default
+ region: content
+ field_notification_file:
+ weight: 122
+ settings:
+ progress_indicator: throbber
+ third_party_settings: { }
+ type: file_generic
+ region: content
+ field_notitfication_category:
+ weight: 123
+ settings:
+ match_operator: CONTAINS
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: entity_reference_autocomplete
+ region: content
+ langcode:
+ type: language_select
+ weight: 2
+ region: content
+ settings:
+ include_locked: true
+ third_party_settings: { }
+ path:
+ type: path
+ weight: 30
+ region: content
+ settings: { }
+ third_party_settings: { }
+ promote:
+ type: boolean_checkbox
+ settings:
+ display_label: true
+ weight: 15
+ region: content
+ third_party_settings: { }
+ status:
+ type: boolean_checkbox
+ settings:
+ display_label: true
+ weight: 120
+ region: content
+ third_party_settings: { }
+ sticky:
+ type: boolean_checkbox
+ settings:
+ display_label: true
+ weight: 16
+ region: content
+ third_party_settings: { }
+ title:
+ type: string_textfield
+ weight: -5
+ region: content
+ settings:
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ uid:
+ type: entity_reference_autocomplete
+ weight: 5
+ settings:
+ match_operator: CONTAINS
+ size: 60
+ placeholder: ''
+ region: content
+ third_party_settings: { }
+hidden: { }
diff --git a/modules/fahad/notification/config/install/core.entity_view_display.node.notification.default.yml b/modules/fahad/notification/config/install/core.entity_view_display.node.notification.default.yml
new file mode 100644
index 0000000..1816e1c
--- /dev/null
+++ b/modules/fahad/notification/config/install/core.entity_view_display.node.notification.default.yml
@@ -0,0 +1,61 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.notification.body
+ - field.field.node.notification.field_notification_date
+ - field.field.node.notification.field_notification_file
+ - field.field.node.notification.field_notitfication_category
+ - node.type.notification
+ module:
+ - datetime
+ - file
+ - text
+ - user
+ enforced:
+ module:
+ - notification
+id: node.notification.default
+targetEntityType: node
+bundle: notification
+mode: default
+content:
+ body:
+ label: hidden
+ type: text_default
+ weight: 101
+ settings: { }
+ third_party_settings: { }
+ region: content
+ field_notification_date:
+ weight: 104
+ label: hidden
+ settings:
+ format_type: medium
+ timezone_override: ''
+ third_party_settings: { }
+ type: datetime_default
+ region: content
+ field_notification_file:
+ weight: 102
+ label: above
+ settings:
+ use_description_as_link_text: true
+ third_party_settings: { }
+ type: file_default
+ region: content
+ field_notitfication_category:
+ weight: 103
+ label: hidden
+ settings:
+ link: true
+ third_party_settings: { }
+ type: entity_reference_label
+ region: content
+ links:
+ weight: 100
+ region: content
+ settings: { }
+ third_party_settings: { }
+hidden:
+ langcode: true
diff --git a/modules/fahad/notification/config/install/core.entity_view_display.node.notification.teaser.yml b/modules/fahad/notification/config/install/core.entity_view_display.node.notification.teaser.yml
new file mode 100644
index 0000000..6a72474
--- /dev/null
+++ b/modules/fahad/notification/config/install/core.entity_view_display.node.notification.teaser.yml
@@ -0,0 +1,33 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - core.entity_view_mode.node.teaser
+ - field.field.node.notification.body
+ - node.type.notification
+ module:
+ - text
+ - user
+ enforced:
+ module:
+ - notification
+id: node.notification.teaser
+targetEntityType: node
+bundle: notification
+mode: teaser
+content:
+ body:
+ label: hidden
+ type: text_summary_or_trimmed
+ weight: 101
+ settings:
+ trim_length: 600
+ third_party_settings: { }
+ region: content
+ links:
+ weight: 100
+ settings: { }
+ third_party_settings: { }
+ region: content
+hidden:
+ langcode: true
diff --git a/modules/fahad/notification/config/install/field.field.node.notification.body.yml b/modules/fahad/notification/config/install/field.field.node.notification.body.yml
new file mode 100644
index 0000000..3509680
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.field.node.notification.body.yml
@@ -0,0 +1,24 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.body
+ - node.type.notification
+ module:
+ - text
+ enforced:
+ module:
+ - notification
+id: node.notification.body
+field_name: body
+entity_type: node
+bundle: notification
+label: Body
+description: ''
+required: false
+translatable: true
+default_value: { }
+default_value_callback: ''
+settings:
+ display_summary: true
+field_type: text_with_summary
diff --git a/modules/fahad/notification/config/install/field.field.node.notification.field_notification_date.yml b/modules/fahad/notification/config/install/field.field.node.notification.field_notification_date.yml
new file mode 100644
index 0000000..0953a9d
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.field.node.notification.field_notification_date.yml
@@ -0,0 +1,23 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_notification_date
+ - node.type.notification
+ module:
+ - datetime
+ enforced:
+ module:
+ - notification
+id: node.notification.field_notification_date
+field_name: field_notification_date
+entity_type: node
+bundle: notification
+label: notification_date
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings: { }
+field_type: datetime
diff --git a/modules/fahad/notification/config/install/field.field.node.notification.field_notification_file.yml b/modules/fahad/notification/config/install/field.field.node.notification.field_notification_file.yml
new file mode 100644
index 0000000..9c77b40
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.field.node.notification.field_notification_file.yml
@@ -0,0 +1,29 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_notification_file
+ - node.type.notification
+ module:
+ - file
+ enforced:
+ module:
+ - notification
+id: node.notification.field_notification_file
+field_name: field_notification_file
+entity_type: node
+bundle: notification
+label: Notification_file
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings:
+ file_directory: '[date:custom:Y]-[date:custom:m]'
+ file_extensions: 'txt pdf doc docx'
+ max_filesize: ''
+ description_field: false
+ handler: 'default:file'
+ handler_settings: { }
+field_type: file
diff --git a/modules/fahad/notification/config/install/field.field.node.notification.field_notitfication_category.yml b/modules/fahad/notification/config/install/field.field.node.notification.field_notitfication_category.yml
new file mode 100644
index 0000000..6602e9b
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.field.node.notification.field_notitfication_category.yml
@@ -0,0 +1,31 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_notitfication_category
+ - node.type.notification
+ - taxonomy.vocabulary.notification_category
+ enforced:
+ module:
+ - notification
+id: node.notification.field_notitfication_category
+field_name: field_notitfication_category
+entity_type: node
+bundle: notification
+label: notitfication_category
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings:
+ handler: 'default:taxonomy_term'
+ handler_settings:
+ target_bundles:
+ notification_category: notification_category
+ sort:
+ field: name
+ direction: asc
+ auto_create: false
+ auto_create_bundle: ''
+field_type: entity_reference
diff --git a/modules/fahad/notification/config/install/field.storage.node.field_notification_date.yml b/modules/fahad/notification/config/install/field.storage.node.field_notification_date.yml
new file mode 100644
index 0000000..745c6ab
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.storage.node.field_notification_date.yml
@@ -0,0 +1,23 @@
+uuid: 4c7c0c52-926b-437f-aa89-3426d718c443
+langcode: en
+status: true
+dependencies:
+ module:
+ - datetime
+ - node
+ enforced:
+ module:
+ - notification
+id: node.field_notification_date
+field_name: field_notification_date
+entity_type: node
+type: datetime
+settings:
+ datetime_type: datetime
+module: datetime
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/notification/config/install/field.storage.node.field_notification_file.yml b/modules/fahad/notification/config/install/field.storage.node.field_notification_file.yml
new file mode 100644
index 0000000..a4fa95d
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.storage.node.field_notification_file.yml
@@ -0,0 +1,26 @@
+uuid: b9fd98b9-1d46-4b69-b8ba-4bfac93b06f9
+langcode: en
+status: true
+dependencies:
+ module:
+ - file
+ - node
+ enforced:
+ module:
+ - notification
+id: node.field_notification_file
+field_name: field_notification_file
+entity_type: node
+type: file
+settings:
+ display_field: false
+ display_default: false
+ uri_scheme: public
+ target_type: file
+module: file
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/notification/config/install/field.storage.node.field_notitfication_category.yml b/modules/fahad/notification/config/install/field.storage.node.field_notitfication_category.yml
new file mode 100644
index 0000000..2c8386c
--- /dev/null
+++ b/modules/fahad/notification/config/install/field.storage.node.field_notitfication_category.yml
@@ -0,0 +1,23 @@
+uuid: 96307a90-43a2-4378-8535-af12f3ca1543
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ - taxonomy
+ enforced:
+ module:
+ - notification
+id: node.field_notitfication_category
+field_name: field_notitfication_category
+entity_type: node
+type: entity_reference
+settings:
+ target_type: taxonomy_term
+module: core
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/notification/config/install/node.type.notification.yml b/modules/fahad/notification/config/install/node.type.notification.yml
new file mode 100644
index 0000000..5c08eda
--- /dev/null
+++ b/modules/fahad/notification/config/install/node.type.notification.yml
@@ -0,0 +1,20 @@
+langcode: en
+status: true
+dependencies:
+ module:
+ - menu_ui
+ enforced:
+ module:
+ - notification
+third_party_settings:
+ menu_ui:
+ available_menus:
+ - main
+ parent: 'main:'
+name: Notification
+type: notification
+description: 'College Notifications'
+help: ''
+new_revision: true
+preview_mode: 1
+display_submitted: true
diff --git a/modules/fahad/notification/config/install/taxonomy.vocabulary.notification_category.yml b/modules/fahad/notification/config/install/taxonomy.vocabulary.notification_category.yml
new file mode 100644
index 0000000..c297c09
--- /dev/null
+++ b/modules/fahad/notification/config/install/taxonomy.vocabulary.notification_category.yml
@@ -0,0 +1,12 @@
+uuid: 0c1e3fee-8ad7-4f26-bbb2-68c2b616ac23
+langcode: en
+status: true
+dependencies:
+ enforced:
+ module:
+ - notification
+name: 'Notification Category'
+vid: notification_category
+description: 'Category of notification'
+hierarchy: 0
+weight: 0
diff --git a/modules/fahad/notification/notification.info.yml b/modules/fahad/notification/notification.info.yml
new file mode 100644
index 0000000..715efc0
--- /dev/null
+++ b/modules/fahad/notification/notification.info.yml
@@ -0,0 +1,14 @@
+name: 'notification'
+type: module
+description: 'My Awesome Module'
+core: 8.x
+package: 'Custom'
+dependencies:
+ - drupal:text
+ - drupal:path
+ - drupal:user
+ - drupal:node
+ - drupal:menu_ui
+ - drupal:file
+ - drupal:link
+ - drupal:taxonomy \ No newline at end of file
diff --git a/modules/fahad/notification/notification.module b/modules/fahad/notification/notification.module
new file mode 100644
index 0000000..5b34f30
--- /dev/null
+++ b/modules/fahad/notification/notification.module
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Contains notification.module.
+ */
+
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Implements hook_help().
+ */
+function notification_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
+ // Main module help for the notification module.
+ case 'help.page.notification':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('My Awesome Module') . '</p>';
+ return $output;
+
+ default:
+ }
+}
+
+/**
+ * Implements hook_theme().
+ */
+function notification_theme() {
+ return [
+ 'notification' => [
+ 'render element' => 'children',
+ ],
+ ];
+}
diff --git a/modules/fahad/notification/templates/notification.html.twig b/modules/fahad/notification/templates/notification.html.twig
new file mode 100644
index 0000000..91e43c8
--- /dev/null
+++ b/modules/fahad/notification/templates/notification.html.twig
@@ -0,0 +1 @@
+<!-- Add you custom twig html here --> \ No newline at end of file
diff --git a/modules/fahad/notification/tests/src/Functional/LoadTest.php b/modules/fahad/notification/tests/src/Functional/LoadTest.php
new file mode 100644
index 0000000..1f1880b
--- /dev/null
+++ b/modules/fahad/notification/tests/src/Functional/LoadTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\Tests\notification\Functional;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Simple test to ensure that main page loads with module enabled.
+ *
+ * @group notification
+ */
+class LoadTest extends BrowserTestBase {
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = ['notification'];
+
+ /**
+ * 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);
+ }
+
+}