diff --git a/config/core.extension.yml b/config/core.extension.yml
index 6c472a6..d3d472a 100644
--- a/config/core.extension.yml
+++ b/config/core.extension.yml
@@ -38,8 +38,8 @@ module:
layout_paragraphs: 0
link: 0
locale: 0
- maintenance200: 0
mailsystem: 0
+ maintenance200: 0
media: 0
media_library: 0
memcache: 0
diff --git a/config/language/fr/monitoring.sensor_config.ocha_deployment_identifier.yml b/config/language/fr/monitoring.sensor_config.ocha_deployment_identifier.yml
deleted file mode 100644
index 84feadb..0000000
--- a/config/language/fr/monitoring.sensor_config.ocha_deployment_identifier.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-label: 'Identifiant de déploiement'
-description: 'Identifiant de déploiement'
diff --git a/config/monitoring.sensor_config.core_maintenance_mode.yml b/config/monitoring.sensor_config.core_maintenance_mode.yml
index eb6fb36..f85338a 100644
--- a/config/monitoring.sensor_config.core_maintenance_mode.yml
+++ b/config/monitoring.sensor_config.core_maintenance_mode.yml
@@ -1,6 +1,6 @@
uuid: b5e8298d-9c45-4547-b5ea-82843abdf1a3
langcode: en
-status: true
+status: false
dependencies: { }
_core:
default_config_hash: zogxfdFrxiieH69X2iP7PB00dkW62vHwpukdsyMCP5k
diff --git a/config/monitoring.sensor_config.core_requirements_memcache.yml b/config/monitoring.sensor_config.core_requirements_memcache.yml
index ddaeeb7..13633e3 100644
--- a/config/monitoring.sensor_config.core_requirements_memcache.yml
+++ b/config/monitoring.sensor_config.core_requirements_memcache.yml
@@ -1,6 +1,6 @@
uuid: 29c8c72f-fc38-4416-8723-f1f683b28e44
langcode: en
-status: true
+status: false
dependencies:
module:
- memcache
diff --git a/config/monitoring.sensor_config.core_requirements_mysql.yml b/config/monitoring.sensor_config.core_requirements_mysql.yml
index 468cadd..16be954 100644
--- a/config/monitoring.sensor_config.core_requirements_mysql.yml
+++ b/config/monitoring.sensor_config.core_requirements_mysql.yml
@@ -1,6 +1,6 @@
uuid: 79a2ef38-231e-474e-8ae8-2142e8e17cf6
langcode: en
-status: true
+status: false
dependencies:
module:
- mysql
diff --git a/config/monitoring.sensor_config.core_requirements_system.yml b/config/monitoring.sensor_config.core_requirements_system.yml
index b33efbd..fb04e87 100644
--- a/config/monitoring.sensor_config.core_requirements_system.yml
+++ b/config/monitoring.sensor_config.core_requirements_system.yml
@@ -1,6 +1,6 @@
uuid: 9d6214c6-7619-4a0c-92e9-f7ef60aa97e8
langcode: en
-status: true
+status: false
dependencies:
module:
- system
diff --git a/config/monitoring.sensor_config.dblog_image_missing_style.yml b/config/monitoring.sensor_config.dblog_image_missing_style.yml
new file mode 100644
index 0000000..f0d7b82
--- /dev/null
+++ b/config/monitoring.sensor_config.dblog_image_missing_style.yml
@@ -0,0 +1,39 @@
+uuid: 645045ed-301a-4296-aad4-7a0da3af34f9
+langcode: en
+status: false
+dependencies:
+ module:
+ - image
+_core:
+ default_config_hash: Uu1kUcL4Mv1YbMv-JLLPhOXVbfedWiQnZgEB9se6YFA
+id: dblog_image_missing_style
+label: 'Image derivative creation fail'
+description: 'Image derivative creation fails'
+category: Watchdog
+plugin_id: image_style_missing
+result_class: null
+value_label: 'Watchdog entries'
+value_type: number
+caching_time: 3600
+settings:
+ time_interval_field: timestamp
+ time_interval_value: 86400
+ conditions:
+ -
+ field: type
+ value: image
+ -
+ field: message
+ value: 'Source image at %source_image_path not found while trying to generate derivative image at %derivative_path.'
+ verbose_fields:
+ - wid
+ - message
+ - variables
+ - referer
+ - timestamp
+ table: watchdog
+ history_status: true
+thresholds:
+ type: exceeds
+ warning: 5
+ critical: 20
diff --git a/config/monitoring.sensor_config.ocha_common_design.yml b/config/monitoring.sensor_config.ocha_common_design.yml
new file mode 100644
index 0000000..2b9ce4a
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_common_design.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_common_design
+label: 'Common design'
+description: 'Common design'
+category: OCHA
+plugin_id: ocha_common_design
+result_class: null
+value_label: Version
+value_type: string
+caching_time: 86400
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.ocha_current_composer_version.yml b/config/monitoring.sensor_config.ocha_current_composer_version.yml
new file mode 100644
index 0000000..f776f88
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_current_composer_version.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_current_composer_version
+label: 'Current composer version'
+description: 'Current composer version'
+category: OCHA
+plugin_id: ocha_current_composer_version
+result_class: null
+value_label: null
+value_type: string
+caching_time: null
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.ocha_current_drupal_version.yml b/config/monitoring.sensor_config.ocha_current_drupal_version.yml
index 1901c01..8752fe8 100644
--- a/config/monitoring.sensor_config.ocha_current_drupal_version.yml
+++ b/config/monitoring.sensor_config.ocha_current_drupal_version.yml
@@ -1,20 +1,18 @@
-uuid: a648ffca-bde9-4b75-b663-e42f12076b73
+uuid: null
langcode: en
status: true
dependencies:
module:
- ocha_monitoring
-_core:
- default_config_hash: TxHIhlQ0nvYNd8MJkAweVS8rEP_M2GJV1z-vRvaPjdQ
id: ocha_current_drupal_version
label: 'Current drupal version'
description: 'Current drupal version'
category: OCHA
plugin_id: ocha_current_drupal_version
result_class: null
-value_label: null
+value_label: Version
value_type: string
-caching_time: null
+caching_time: 86400
settings: { }
thresholds:
type: none
diff --git a/config/monitoring.sensor_config.ocha_current_php_version.yml b/config/monitoring.sensor_config.ocha_current_php_version.yml
index 4413d33..562d7a1 100644
--- a/config/monitoring.sensor_config.ocha_current_php_version.yml
+++ b/config/monitoring.sensor_config.ocha_current_php_version.yml
@@ -1,20 +1,18 @@
-uuid: 15ef1188-805b-409d-98e7-dd59bb0f561f
+uuid: null
langcode: en
status: true
dependencies:
module:
- ocha_monitoring
-_core:
- default_config_hash: lGDhZ8Foil2aDR9bIlAHx0RePNCYR6TXMxvQ78hsvvY
id: ocha_current_php_version
label: 'Current PHP version'
description: 'Current PHP version'
category: OCHA
plugin_id: ocha_current_php_version
result_class: null
-value_label: null
+value_label: Version
value_type: string
-caching_time: null
+caching_time: 86400
settings: { }
thresholds:
type: none
diff --git a/config/monitoring.sensor_config.ocha_current_release.yml b/config/monitoring.sensor_config.ocha_current_release.yml
index e462524..9718893 100644
--- a/config/monitoring.sensor_config.ocha_current_release.yml
+++ b/config/monitoring.sensor_config.ocha_current_release.yml
@@ -1,20 +1,18 @@
-uuid: 434db6dc-6041-40cb-bc43-b12e93a13002
+uuid: null
langcode: en
status: true
dependencies:
module:
- ocha_monitoring
-_core:
- default_config_hash: i1BT_gUUpQfo0ImZLLyiNjW_iyFD_MCMjxLkJgVR_MA
id: ocha_current_release
label: 'Current release'
description: 'Current release'
category: OCHA
plugin_id: ocha_current_release
result_class: null
-value_label: null
+value_label: Release
value_type: string
-caching_time: null
+caching_time: 86400
settings: { }
thresholds:
type: none
diff --git a/config/monitoring.sensor_config.ocha_deployment_identifier.yml b/config/monitoring.sensor_config.ocha_deployment_identifier.yml
index 69aefe4..177806b 100644
--- a/config/monitoring.sensor_config.ocha_deployment_identifier.yml
+++ b/config/monitoring.sensor_config.ocha_deployment_identifier.yml
@@ -1,20 +1,18 @@
-uuid: 3b1f1460-9af3-4cda-af18-3156329ca662
+uuid: null
langcode: en
status: true
dependencies:
module:
- ocha_monitoring
-_core:
- default_config_hash: 1TnqONbMYVK4LMhvXu6AebNMWLXDcth71zzakY05V_E
id: ocha_deployment_identifier
label: 'Deployment identifier'
description: 'Deployment identifier'
category: OCHA
plugin_id: ocha_deployment_identifier
result_class: null
-value_label: null
+value_label: Deployment
value_type: string
-caching_time: null
+caching_time: 86400
settings: { }
thresholds:
type: none
diff --git a/config/monitoring.sensor_config.ocha_env_link_fixer.yml b/config/monitoring.sensor_config.ocha_env_link_fixer.yml
new file mode 100644
index 0000000..7061706
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_env_link_fixer.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_env_link_fixer
+label: 'Environment Link Fixer'
+description: 'Environment Link Fixer'
+category: OCHA
+plugin_id: ocha_env_link_fixer
+result_class: null
+value_label: Version
+value_type: string
+caching_time: 86400
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.ocha_google_tag.yml b/config/monitoring.sensor_config.ocha_google_tag.yml
new file mode 100644
index 0000000..58edac7
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_google_tag.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_google_tag
+label: 'Google tag'
+description: 'Google tag'
+category: OCHA
+plugin_id: ocha_google_tag
+result_class: null
+value_label: 'GTM Id'
+value_type: string
+caching_time: 86400
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.ocha_gtm_barebones.yml b/config/monitoring.sensor_config.ocha_gtm_barebones.yml
new file mode 100644
index 0000000..8cc266f
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_gtm_barebones.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_gtm_barebones
+label: 'GTM Barebones'
+description: 'GTM Barebones'
+category: OCHA
+plugin_id: ocha_gtm_barebones
+result_class: null
+value_label: 'GTM Id'
+value_type: string
+caching_time: 86400
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.ocha_ocha_monitoring.yml b/config/monitoring.sensor_config.ocha_ocha_monitoring.yml
new file mode 100644
index 0000000..072e559
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_ocha_monitoring.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_ocha_monitoring
+label: 'OCHA Monitoring'
+description: 'OCHA Monitoring'
+category: OCHA
+plugin_id: ocha_ocha_monitoring
+result_class: null
+value_label: Version
+value_type: string
+caching_time: 86400
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.ocha_un_date.yml b/config/monitoring.sensor_config.ocha_un_date.yml
new file mode 100644
index 0000000..cde3f1d
--- /dev/null
+++ b/config/monitoring.sensor_config.ocha_un_date.yml
@@ -0,0 +1,18 @@
+uuid: null
+langcode: en
+status: true
+dependencies:
+ module:
+ - ocha_monitoring
+id: ocha_un_date
+label: 'UN Date'
+description: 'UN Date'
+category: OCHA
+plugin_id: ocha_un_date
+result_class: null
+value_label: Version
+value_type: string
+caching_time: 86400
+settings: { }
+thresholds:
+ type: none
diff --git a/config/monitoring.sensor_config.user_sessions_all.yml b/config/monitoring.sensor_config.user_sessions_all.yml
index 056bf44..3cd4882 100644
--- a/config/monitoring.sensor_config.user_sessions_all.yml
+++ b/config/monitoring.sensor_config.user_sessions_all.yml
@@ -1,9 +1,7 @@
uuid: d087a9c8-f133-4e61-aa57-49f0e830d52e
langcode: en
status: false
-dependencies:
- module:
- - system
+dependencies: { }
_core:
default_config_hash: CgjKrimMTwQLluUztd3QSleqDmulTMOuotcztsnZgbw
id: user_sessions_all
diff --git a/config/monitoring.sensor_config.user_sessions_authenticated.yml b/config/monitoring.sensor_config.user_sessions_authenticated.yml
index 0a6e5a4..b7e0e4b 100644
--- a/config/monitoring.sensor_config.user_sessions_authenticated.yml
+++ b/config/monitoring.sensor_config.user_sessions_authenticated.yml
@@ -1,9 +1,7 @@
uuid: 4bc28a86-ab5c-4e6c-8787-404d9573fa17
langcode: en
status: false
-dependencies:
- module:
- - system
+dependencies: { }
_core:
default_config_hash: EpAogeIPxfKYPscZ5c_7tMyu8nazITOFQAZfPOLV09w
id: user_sessions_authenticated
diff --git a/config/views.view.my_documents.yml b/config/views.view.my_documents.yml
index 3ffaac2..a51bf1c 100644
--- a/config/views.view.my_documents.yml
+++ b/config/views.view.my_documents.yml
@@ -5,7 +5,6 @@ dependencies:
config:
- core.entity_view_mode.node.teaser
- node.type.page
- - system.menu.main
module:
- content_moderation
- node
@@ -337,19 +336,8 @@ display:
plugin_id: text_custom
label: ''
empty: true
- content: 'No front page content has been created yet.
Follow the User Guide to start building your site.'
+ content: "
Welcome to OCHA’s internal AI-based document summarization tool. This proof-of-concept is only available to OCHA personnel.
\r\n\r\n " tokenize: false - node_listing_empty: - id: node_listing_empty - table: node - field: node_listing_empty - relationship: none - group_type: group - admin_label: '' - entity_type: node - plugin_id: node_listing_empty - label: '' - empty: true title: id: title table: views @@ -360,7 +348,7 @@ display: plugin_id: title label: '' empty: true - title: Welcome! + title: 'AI Summarization Tool' sorts: created: id: created @@ -378,7 +366,42 @@ display: field_identifier: created exposed: false granularity: second - arguments: { } + arguments: + uid: + id: uid + table: node_field_data + field: uid + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: uid + plugin_id: numeric + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: current_user + default_argument_options: { } + summary_options: + base_path: '' + count: true + override: false + items_per_page: 25 + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false filters: langcode: id: langcode @@ -490,7 +513,9 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args + - user - 'user.node_grants:view' - user.permissions tags: { } @@ -503,7 +528,7 @@ display: display_extenders: { } path: my-documents menu: - type: normal + type: none title: 'My documents' description: '' weight: 0 @@ -516,7 +541,9 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args + - user - 'user.node_grants:view' - user.permissions tags: { } diff --git a/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.links.menu.yml b/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.links.menu.yml new file mode 100644 index 0000000..f43e41a --- /dev/null +++ b/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.links.menu.yml @@ -0,0 +1,6 @@ +ocha_ai_summarize.my_documents: + title: 'My documents' + menu_name: main + description: 'Access you own documents.' + route_name: ocha_ai_summarize.my_documents + weight: 50 diff --git a/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.module b/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.module index bc82457..d35408c 100644 --- a/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.module +++ b/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.module @@ -19,6 +19,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\node\NodeInterface; +use Drupal\user\UserInterface; use GuzzleHttp\Client as GuzzleClient; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\HandlerStack; @@ -1320,3 +1321,19 @@ function ocha_ai_summarize_get_entity_document(EntityInterface $entity) { } return $file->getFilename(); } + +/** + * Implements hook_ENTITY_TYPE_presave(). + */ +function ocha_ai_summarize_user_presave(UserInterface $user) { + if ($user->isNew()) { + $parts = explode('@', $user->getInitialEmail()); + if ($parts[1] != 'un.org') { + return; + } + + $user->setUsername($user->getInitialEmail()); + $user->activate(); + $user->addRole('document_analyzer'); + } +} diff --git a/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.routing.yml b/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.routing.yml index ac781d9..ef5b3ad 100644 --- a/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.routing.yml +++ b/html/modules/custom/ocha_ai_summarize/ocha_ai_summarize.routing.yml @@ -14,3 +14,13 @@ ocha_ai_summarize.compare.action_points: requirements: _permission: 'ocha_ai_summarize compare summary' id: ^\d+$ +ocha_ai_summarize.my_documents: + path: '/my-documents/{arg_0}' + defaults: + _title_callback: '\Drupal\views\Routing\ViewPageController::getTitle' + _controller: '\Drupal\views\Routing\ViewPageController::handle' + view_id: 'my_documents' + display_id: 'page_1' + arg_0: '' + requirements: + _user_is_logged_in: 'TRUE'