diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/css/style.css b/css/style.css old mode 100644 new mode 100755 index 2a37794..47aa2fb --- a/css/style.css +++ b/css/style.css @@ -1,30 +1,30 @@ /* Reset the table styles */ -table.wisski-cloud-account-manager-table { +table.wcam--table { border-collapse: collapse; width: 100%; } /* Style for table headers */ -table.wisski-cloud-account-manager-table th { +table.wcam--table th { background-color: #f2f2f2; padding: 8px; text-align: center; } /* Alternate row background color */ -table.wisski-cloud-account-manager-table tr:nth-child(even) { +table.wcam--table tr:nth-child(even) { background-color: #f2f2f2; } /* Style for table cells */ -table.wisski-cloud-account-manager-table td { +table.wcam--table td { padding: 8px; border: 1px solid #dddddd; } /* Center-align certain cells */ -table.wisski-cloud-account-manager-table td.valid, -table.wisski-cloud-account-manager-table td.provisioned { +table.wcam--table td.valid, +table.wcam--table td.provisioned { text-align: center; } diff --git a/js/accountOptions.js b/js/accountOptions.js new file mode 100644 index 0000000..6416bbd --- /dev/null +++ b/js/accountOptions.js @@ -0,0 +1,42 @@ +(function ($, Drupal, once) { + 'use strict'; + /** + * Implements collapsing of individual pathbuilder rows using a caret + */ + Drupal.behaviors.accountOptions = { + attach: function (context, settings) { + once('accountOptions', '#wcam--table', context).forEach(function (form) { + $('.wcam--select').change(function () { + console.log($(this)) + let selectedOption = $(this).val(); + let itemId = $(this).closest('tr').find('.wcam--row--item-id').text(); + switch (selectedOption) { + case 'delete': + // Führen Sie hier Ihren JavaScript-Code für 'delete' aus. + + console.log('delete:', itemId); + break; + + case 'edit': + // Führen Sie hier Ihren JavaScript-Code für 'edit' aus. + console.log('Edit:', itemId); + break; + + case 'provise': + // Führen Sie hier Ihren JavaScript-Code für 'provise' aus. + console.log('Provise', itemId); + break; + + case 'validate': + // Führen Sie hier Ihren JavaScript-Code für 'validate' aus. + console.log('Die Option "validate" wurde ausgewählt.'); + break; + + default: + console.log('Eine andere Option wurde ausgewählt.'); + } + }); + }); + } + }; +})(jQuery, Drupal, once); diff --git a/src/Controller/WisskiCloudAccountManagerController.php b/src/Controller/WisskiCloudAccountManagerController.php old mode 100644 new mode 100755 diff --git a/src/Form/WisskiCloudAccountManagerCreateForm.php b/src/Form/WisskiCloudAccountManagerCreateForm.php old mode 100644 new mode 100755 index 3e77fff..a88890a --- a/src/Form/WisskiCloudAccountManagerCreateForm.php +++ b/src/Form/WisskiCloudAccountManagerCreateForm.php @@ -8,6 +8,7 @@ use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\wisski_cloud_account_manager\WisskiCloudAccountManagerDaemonApiActions; +use mysql_xdevapi\Exception; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -230,6 +231,9 @@ class WisskiCloudAccountManagerCreateForm extends FormBase { $account["subdomain"] = $field['subdomain']; $accountResponse = $this->wisskiCloudAccountManagerDaemonApiActions->addAccount($account); + if (!$accountResponse['success']) { + throw new Exception('Get no valid response from api daemon. Can not send validiation email.'); + }; $this->wisskiCloudAccountManagerDaemonApiActions->sendValidationEmail($accountResponse['data']['email'], $accountResponse['data']['validationCode']); $this->messenger() diff --git a/src/Form/WisskiCloudAccountManagerSettingsForm.php b/src/Form/WisskiCloudAccountManagerSettingsForm.php old mode 100644 new mode 100755 index ca1c710..6d380a5 --- a/src/Form/WisskiCloudAccountManagerSettingsForm.php +++ b/src/Form/WisskiCloudAccountManagerSettingsForm.php @@ -36,35 +36,35 @@ class WisskiCloudAccountManagerSettingsForm extends ConfigFormBase { $config = $this->config('wisski_cloud_account_manager.settings'); $form['daemonUrl'] = [ - '#type' => 'url', + '#type' => 'textfield', '#title' => $this->t('The WissKI Cloud API Daemon URL'), '#description' => $this->t('Provide the complete base URL with protocol, domain (resp. service name in docker), ports and API path, i. e. "http://wisski_cloud_api_daemon:3000/wisski-cloud-daemon/api/v1"'), '#default_value' => $config->get('daemonUrl'), ]; $form['allAccounts'] = [ - '#type' => 'url', + '#type' => 'textfield', '#title' => $this->t('All accounts URL path'), - '#description' => $this->t('Provide the endpoint to the GET endpoint for all accounts, i. e. "http://wisski_cloud_api_daemon:3000/wisski-cloud-daemon/api/v1/account/all"'), + '#description' => $this->t('Provide the endpoint to the GET endpoint for all accounts, i. e. "/account/all"'), '#default_value' => $config->get('allAccounts'), ]; $form['accountPostUrlPath'] = [ - '#type' => 'url', + '#type' => 'textfield', '#title' => $this->t('POST URL path'), '#description' => $this->t('Provide the path to the POST endpoint, i. e. "/account"'), '#default_value' => $config->get('accountPostUrlPath'), ]; $form['accountFilterByData'] = [ - '#type' => 'url', + '#type' => 'textfield', '#title' => $this->t('Filter by Data URL path'), '#description' => $this->t('Provide the path to the Get account by data endpoint, i. e. "/account/by_data"'), '#default_value' => $config->get('accountFilterByData'), ]; $form['accountValidation'] = [ - '#type' => 'url', + '#type' => 'textfield', '#title' => $this->t('User Validation URL path'), '#description' => $this->t('Provide the path to the account validation PUT endpoint, i. e. "/account/validation"'), '#default_value' => $config->get('accountValidation'), @@ -121,8 +121,9 @@ class WisskiCloudAccountManagerSettingsForm extends ConfigFormBase { public function submitForm(array &$form, FormStateInterface $form_state) { $config = $this->config('wisski_cloud_account_manager.settings'); - $config->set('daemonURL', $form_state->getValue('daemonURL')) + $config->set('daemonUrl', $form_state->getValue('daemonUrl')) ->set('accountPostUrlPath', $form_state->getValue('accountPostUrlPath')) + ->set('allAccounts', $form_state->getValue('allAccounts')) ->set('accountFilterByData', $form_state->getValue('accountFilterByData')) ->set('accountProvisionAndValidationCheck', $form_state->getValue('accountProvisionAndValidationCheck')) ->set('accountValidation', $form_state->getValue('accountValidation')) diff --git a/src/WisskiCloudAccountManagerDaemonApiActions.php b/src/WisskiCloudAccountManagerDaemonApiActions.php old mode 100644 new mode 100755 diff --git a/templates/wisski-cloud-account-manager-account-managing-page.html.twig b/templates/wisski-cloud-account-manager-account-managing-page.html.twig old mode 100644 new mode 100755 index ffb3f5b..588cf96 --- a/templates/wisski-cloud-account-manager-account-managing-page.html.twig +++ b/templates/wisski-cloud-account-manager-account-managing-page.html.twig @@ -1,7 +1,7 @@ {# wisski_cloud_account_manager/templates/wisski_cloud_account_manager_account_managing_page.html.twig #}
{% if accounts is not empty %} - +
@@ -13,8 +13,8 @@ {% for item in accounts.data %} - - + + @@ -37,8 +37,9 @@ {% else %} unknown {% endif %} -
Id Person nameOptions
{{ item._id }}
{{ item._id }} {{ item.personName }} {{ item.email }} {{ item.username }} - +