Skip to content

Commit 84e2716

Browse files
cablemanjekuaitk
andcommitted
ITKDev: Code review ajustments
Co-authored-by: Jeppe Kuhlmann Andersen <[email protected]>
1 parent 5924d6c commit 84e2716

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

modules/os2web_audit_entity/os2web_audit_entity.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "OS2web Audit logging entity access"
2-
description: "Logs CUD events for entities"
2+
description: "Logs CRUD events for entities"
33
type: module
44
core_version_requirement: ^8 || ^9 || ^10
55
dependencies:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os2web_audit_entity.admin_settings:
22
title: 'OS2web Audit entity settings'
33
parent: system.admin_config_system
4-
description: 'Settings for the OS2 Audit entity module'
4+
description: 'Settings for the OS2web Audit entity module'
55
route_name: os2web_audit_entity.settings

modules/os2web_audit_entity/os2web_audit_entity.module

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ function os2web_audit_entity_webform_post_load_data(mixed $submissions): void {
6161

6262
// Detect field of type that contains "cpr" in name or where field name
6363
// contains "cpr".
64-
/** @var \Drupal\webform_revisions\Entity\WebformRevisions $webform */
6564
$webform = $submission->getWebform();
6665
$elements = $webform->getElementsDecoded();
6766
foreach ($elements as $fieldName => $element) {
@@ -125,12 +124,7 @@ function os2web_audit_entity_log(string $message): void {
125124

126125
// Detect user type.
127126
$account = \Drupal::currentUser();
128-
$apiUser = FALSE;
129-
if (os2web_audit_entity_is_api_user($account)) {
130-
$apiUser = TRUE;
131-
}
132-
133127
$metadata['userId'] = $account->getEmail();
134-
$metadata['userType'] = $apiUser ? 'api' : 'web';
128+
$metadata['userType'] = os2web_audit_entity_is_api_user($account) ? 'api' : 'web';
135129
$logger->info('Entity', $message, FALSE, $metadata);
136130
}

modules/os2web_audit_entity/src/Form/SettingsForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public function buildForm(array $form, FormStateInterface $form_state): array {
7070

7171
$form['roles'] = [
7272
'#type' => 'checkboxes',
73-
'#title' => $this->t('Choose an Option'),
74-
'#description' => $this->t('Please select an option from the dropdown menu.'),
73+
'#title' => $this->t('Select API access roles'),
74+
'#description' => $this->t('The selected roles will be use to determine who is accessing entities through the API.'),
7575
'#options' => $items,
7676
'#default_value' => $config->get('roles') ?? [],
7777
'#required' => TRUE,

0 commit comments

Comments
 (0)