diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1a4e3e..19329847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,17 @@ + # Changelog for selvbetjening.aarhuskommune.dk Nedenfor ses dato for release og beskrivelse af opgaver som er implementeret. +## In develop + +* Disable access to webform error log +* Added retry action to error log +* Changed failed jobs view +* Opdaterede til [OS2forms failed jobs to +1.3.0](https://github.com/itk-dev/os2forms_failed_jobs/releases/tag/1.3.0) + ## [2.4.9] 2023-09-06 * Tilføjede webform options config ignore. diff --git a/config/sync/system.action.advancedqueue_queue_retry_action.yml b/config/sync/system.action.advancedqueue_queue_retry_action.yml new file mode 100644 index 00000000..ed26ddc6 --- /dev/null +++ b/config/sync/system.action.advancedqueue_queue_retry_action.yml @@ -0,0 +1,16 @@ +uuid: b70d762d-aded-46a0-a214-505a80711892 +langcode: en +status: true +dependencies: + module: + - os2forms_failed_jobs + enforced: + module: + - os2forms_failed_jobs +_core: + default_config_hash: pexPU9ftUC8P4KrPUZbAMG-riQDByKt2Y0_ap2QDhRE +id: advancedqueue_queue_retry_action +label: 'Retry processing' +type: advancedqueue_queue +plugin: advancedqueue_queue_retry_action +configuration: { } diff --git a/config/sync/user.role.forloeb_designer.yml b/config/sync/user.role.forloeb_designer.yml index 6d117203..b0bafe57 100644 --- a/config/sync/user.role.forloeb_designer.yml +++ b/config/sync/user.role.forloeb_designer.yml @@ -39,7 +39,6 @@ permissions: - 'access site in maintenance mode' - 'access toolbar' - 'access webform overview' - - 'access webform submission log' - 'access webform submission user' - 'administer webform element access' - 'administer webform revisions' diff --git a/config/sync/user.role.leder.yml b/config/sync/user.role.leder.yml index 13fc27fd..d66d1601 100644 --- a/config/sync/user.role.leder.yml +++ b/config/sync/user.role.leder.yml @@ -47,7 +47,6 @@ permissions: - 'access toolbar' - 'access user profiles' - 'access webform overview' - - 'access webform submission log' - 'access webform submission user' - 'administer block_content display' - 'administer block_content form display' diff --git a/config/sync/user.role.sagsbehandler.yml b/config/sync/user.role.sagsbehandler.yml index ac81dbb1..eddde619 100644 --- a/config/sync/user.role.sagsbehandler.yml +++ b/config/sync/user.role.sagsbehandler.yml @@ -35,7 +35,6 @@ permissions: - 'access toolbar' - 'access user profiles' - 'access webform overview' - - 'access webform submission log' - 'access webform submission user' - 'administer block_content display' - 'administer block_content display' diff --git a/config/sync/user.role.site_admin.yml b/config/sync/user.role.site_admin.yml index 9513473b..b7587473 100644 --- a/config/sync/user.role.site_admin.yml +++ b/config/sync/user.role.site_admin.yml @@ -45,7 +45,6 @@ permissions: - 'access toolbar' - 'access user profiles' - 'access webform overview' - - 'access webform submission log' - 'access webform submission user' - 'administer block_content display' - 'administer block_content form display' diff --git a/config/sync/views.view.os2forms_failed_jobs.yml b/config/sync/views.view.os2forms_failed_jobs.yml index 43daf0b7..79edd62a 100644 --- a/config/sync/views.view.os2forms_failed_jobs.yml +++ b/config/sync/views.view.os2forms_failed_jobs.yml @@ -1,4 +1,4 @@ -uuid: 38d8dc7b-a50b-4a1a-a843-7112283c4f8b +uuid: b77688a4-46fe-4c7c-98a7-e8690a789a10 langcode: en status: true dependencies: @@ -9,7 +9,7 @@ dependencies: module: - os2forms_failed_jobs _core: - default_config_hash: e0p4pdUCpNB0rc-ixNe21FMsdA4hjMK5g-AUXgx96B4 + default_config_hash: HSpzCDZMQy7B4Y3BQyKrRcZKU9TSQZO6HzluFWrBi5U id: os2forms_failed_jobs label: 'OS2forms failed jobs' module: views @@ -26,8 +26,57 @@ display: display_options: title: 'OS2forms failed jobs' fields: - type: - id: type + job_id: + id: job_id + table: advancedqueue + field: job_id + relationship: none + group_type: group + admin_label: '' + plugin_id: standard + label: 'Job ID' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + type_1: + id: type_1 table: advancedqueue field: type relationship: none @@ -35,7 +84,7 @@ display: admin_label: '' plugin_id: advancedqueue_job_type label: 'Job type' - exclude: false + exclude: true alter: alter_text: false text: '' @@ -75,16 +124,16 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - message: - id: message + webform_id: + id: webform_id table: advancedqueue - field: message + field: webform_id relationship: none group_type: group admin_label: '' - plugin_id: standard - label: Meddelelse - exclude: false + plugin_id: advancedqueue_job_webform_id + label: 'Webform id' + exclude: true alter: alter_text: false text: '' @@ -124,16 +173,65 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - processed: - id: processed + webform_submission_id: + id: webform_submission_id table: advancedqueue - field: processed + field: webform_submission_id relationship: none group_type: group admin_label: '' - plugin_id: date - label: 'Processed date' - exclude: false + plugin_id: advancedqueue_job_webform_submission_id + label: 'Webform submission id' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + webform_submission_serial_id: + id: webform_submission_serial_id + table: advancedqueue + field: webform_submission_serial_id + relationship: none + group_type: group + admin_label: '' + plugin_id: advancedqueue_job_webform_submission_serial_id + label: 'Webform submission serial id' + exclude: true alter: alter_text: false text: '' @@ -173,9 +271,6 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' retry_operation: id: retry_operation table: advancedqueue @@ -185,6 +280,105 @@ display: admin_label: '' plugin_id: advancedqueue_job_retry_operation label: 'Retry operation' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: aaa + hide_empty: false + empty_zero: false + hide_alter_empty: true + state: + id: state + table: advancedqueue + field: state + relationship: none + group_type: group + admin_label: '' + plugin_id: advancedqueue_job_state + label: State + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + icon: false + advancedqueue_bulk_form: + id: advancedqueue_bulk_form + table: advancedqueue + field: advancedqueue_bulk_form + relationship: none + group_type: group + admin_label: '' + plugin_id: advancedqueue_bulk_form + label: 'Advanced queue operations bulk form' exclude: false alter: alter_text: false @@ -225,6 +419,209 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true + action_title: Handling + include_exclude: include + selected_actions: + - advancedqueue_queue_retry_action + nothing: + id: nothing + table: views + field: nothing + relationship: none + group_type: group + admin_label: '' + plugin_id: custom + label: 'Site wide id / Webform submission id' + exclude: false + alter: + alter_text: true + text: '{{ webform_submission_id }} / {{ webform_submission_serial_id }}' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: false + nothing_1: + id: nothing_1 + table: views + field: nothing + relationship: none + group_type: group + admin_label: '' + plugin_id: custom + label: 'Related handler / Error message' + exclude: false + alter: + alter_text: true + text: '{{ type_1 }}' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: false + processed: + id: processed + table: advancedqueue + field: processed + relationship: none + group_type: group + admin_label: '' + plugin_id: date + label: 'Last processed date' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + date_format: fallback + custom_date_format: '' + timezone: '' + nothing_2: + id: nothing_2 + table: views + field: nothing + relationship: none + group_type: group + admin_label: '' + plugin_id: custom + label: 'State / Action' + exclude: false + alter: + alter_text: true + text: "{% if state == 'Queued' %}\r\n{{ state }}\r\n{% else %}\r\n{{ retry_operation }}\r\n{% endif %}" + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: aaa + hide_empty: false + empty_zero: false + hide_alter_empty: false pager: type: full options: @@ -264,10 +661,10 @@ display: options: { } empty: { } sorts: - available: - id: available + processed: + id: processed table: advancedqueue - field: available + field: processed relationship: none group_type: group admin_label: '' @@ -325,6 +722,7 @@ display: plugin_id: in_operator operator: in value: + queued: queued failure: failure group: 1 exposed: false @@ -355,6 +753,57 @@ display: default_group: All default_group_multiple: { } group_items: { } + webform_submission_serial_id: + id: webform_submission_serial_id + table: advancedqueue + field: webform_submission_serial_id + relationship: none + group_type: group + admin_label: '' + plugin_id: advancedqueue_job_submission_serial + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: webform_submission_serial_id_op + label: 'Webform submission id' + description: '' + use_operator: false + operator: webform_submission_serial_id_op + operator_limit_selection: false + operator_list: { } + identifier: webform_submission_serial_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + site_admin: '0' + flow_designer: '0' + forloeb_designer: '0' + sagsbehandler: '0' + medarbejder: '0' + leder: '0' + virksomhed: '0' + borger: '0' + os2forms_rest_api_user: '0' + os2forms_rest_api_user_write: '0' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } style: type: table row: @@ -372,7 +821,7 @@ display: footer: { } display_extenders: { } cache_metadata: - max-age: -1 + max-age: 0 contexts: - 'languages:language_interface' - url @@ -386,7 +835,7 @@ display: display_options: display_extenders: { } cache_metadata: - max-age: -1 + max-age: 0 contexts: - 'languages:language_interface' - url diff --git a/phpcs.xml.dist b/phpcs.xml.dist index cdf8a05c..98df3e71 100755 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -4,6 +4,9 @@ web/modules/custom/ + web/modules/custom/itkdev_booking/ + web/modules/custom/itkdev_booking/assets/ + diff --git a/phpstan.neon b/phpstan.neon index 4ecad86f..72abf3dc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -10,4 +10,5 @@ parameters: messages: - '#no value type specified in iterable type array.#' - '#has no return type specified.#' - + excludePaths: + - web/modules/custom/itkdev_booking \ No newline at end of file diff --git a/web/modules/custom/itkdev_booking/CHANGELOG.md b/web/modules/custom/itkdev_booking/CHANGELOG.md index 8c0fc574..4b12b85e 100644 --- a/web/modules/custom/itkdev_booking/CHANGELOG.md +++ b/web/modules/custom/itkdev_booking/CHANGELOG.md @@ -2,7 +2,8 @@ All notable changes to this project will be documented in this file. -See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information about writing changes to this log. +See [keep a changelog](https://keepachangelog.com/en/1.0.0/) +for information about writing changes to this log. ## [Unreleased] @@ -16,44 +17,36 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo ## [1.0.6] - 2023-08-21 -- Removed default business hours [#122](https://github.com/itk-dev/drupal_webform_booking_module/pull/122). +- Removed default business hours +[#122](https://github.com/itk-dev/drupal_webform_booking_module/pull/122). ## [1.0.5] - 2023-08-21 -- Added timepicker for selecting preferred vertical scroll of calendar + added properties for z-index to work as expected. +- Added timepicker for selecting preferred vertical scroll of calendar + +added properties for z-index to work as expected. ## [1.0.4] - 2023-08-21 -### Added - - Use resourceDisplayName when displaying resources to the user. - Remove html from resourceDescription -- Change map to use locationDisplayName for filter label and locationName as filter value. +- Change map to use locationDisplayName for filter label and locationName +as filter value. - Sorting to user panel. - Added text filtering to user panel. - -### Changed - - Added allowConflict option for allowing event overlap [#116](https://github.com/itk-dev/drupal_webform_booking_module/pull/116). - Removed NFS volume from docker setup [#116](https://github.com/itk-dev/drupal_webform_booking_module/pull/116). - Optimized calendar rendering [#116](https://github.com/itk-dev/drupal_webform_booking_module/pull/116). ## [1.0.3] -### Added - - - stuff +- stuff ## [1.0.2] -### Added - - - stuff +- stuff ## [1.0.1] - 2023-04-20 -### Added - - Added dayjs locale. - Added filter sorting on resources and locations - Added use of locationDisplayName diff --git a/web/modules/custom/itkdev_booking/README.md b/web/modules/custom/itkdev_booking/README.md index 55a93f21..8fdc48c5 100644 --- a/web/modules/custom/itkdev_booking/README.md +++ b/web/modules/custom/itkdev_booking/README.md @@ -1,7 +1,9 @@ # ITK Dev booking + Provides a webform element for creating bookings through the AAK booking service. ## Development + For setting up a local development environment and how to work in this project see: [documentation/development.md](documentation/development.md) @@ -9,5 +11,6 @@ For setting up a local development environment within an os2forms project see: [documentation/os2forms-module-setup-example.md](documentation/os2forms-module-setup-example.md) ## Production + For setting up a production environment with this module see: -[documentation/production.md](documentation/production.md) \ No newline at end of file +[documentation/production.md](documentation/production.md) diff --git a/web/modules/custom/itkdev_booking/assets/public/assets/claro_theme/images/core/README.md b/web/modules/custom/itkdev_booking/assets/public/assets/claro_theme/images/core/README.md deleted file mode 100644 index c456c6c0..00000000 --- a/web/modules/custom/itkdev_booking/assets/public/assets/claro_theme/images/core/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## Purpose of this folder -Icons in this folder are copied from Drupal core. This folder with its content -should be removed before moving Claro to Drupal core. See -https://www.drupal.org/project/claro/issues/3045216 for details. diff --git a/web/modules/custom/itkdev_booking/documentation/development.md b/web/modules/custom/itkdev_booking/documentation/development.md index 7e46dca8..f15e167b 100644 --- a/web/modules/custom/itkdev_booking/documentation/development.md +++ b/web/modules/custom/itkdev_booking/documentation/development.md @@ -1,27 +1,36 @@ # Module development + The booking app is a react app (CRA). A docker compose setup has been supplied to ease development of the app. ## Setup + ```shell itkdev-docker-compose run node npm install itkdev-docker-compose up -d itkdev-docker-compose exec node npm run build itkdev-docker-compose open ``` + This provides a react app ready for development. -To get proper output with working endpoints the app requires this drupal module enabled on a drupal site. +To get proper output with working endpoints the app +requires this drupal module enabled on a drupal site. ## Build + To build the code for use in the drupal module. This will copy the compiled css and js to the library that drupal expects. + ```shell ./create-build.sh ``` -## Configuration within a drupal environment. -When the app is served through Drupal it will look for `window.drupalSettings` and load those. -The following drupal settings are required for a drupal connection to work properly: +## Configuration within a drupal environment + +When the app is served through Drupal it will look for +`window.drupalSettings` and load those. The following drupal settings +are required for a drupal connection to work properly: + ```php // Required @@ -40,10 +49,11 @@ $settings['itkdev_booking_df_map_password'] = ''; // Fullcalendar $settings['itkdev_booking_fullcalendar_license'] = ''; ``` -To obtain the proper settings see [documentation/os2forms-module-setup-example.md](os2forms-module-setup-example.md) +To obtain the proper settings see [documentation/os2forms-module-setup-example.md](os2forms-module-setup-example.md) You can use sample data by setting the following settings: + ```php // Use sample data. $settings['itkdev_booking_api_sample_data'] = true; @@ -51,16 +61,20 @@ $settings['itkdev_booking_api_sample_data'] = true; $settings['itkdev_booking_api_sample_user'] = true; ``` -If served outside of Drupal, e.g. during development, a `assets/public/config.json` can be set with the config values. +If served outside of Drupal, e.g. during development, +a `assets/public/config.json` can be set with the config values. See `assets/public/example_config.json` for structure of `config.json` file. ## Coding standards + Apply (automatic fixes) js coding standards -``` + +```shell itkdev-docker-compose run --rm node npm run apply-coding-standards ``` Check js coding standards -``` + +```shell itkdev-docker-compose run --rm node npm run check-coding-standards ``` diff --git a/web/modules/custom/itkdev_booking/documentation/os2forms-module-setup-example.md b/web/modules/custom/itkdev_booking/documentation/os2forms-module-setup-example.md index 31553d9c..9ab4c06d 100644 --- a/web/modules/custom/itkdev_booking/documentation/os2forms-module-setup-example.md +++ b/web/modules/custom/itkdev_booking/documentation/os2forms-module-setup-example.md @@ -1,26 +1,28 @@ -# Setting up the module in os2forms context with separate booking api project. +# Setting up the module in os2forms context with separate booking api project -## 1. Install os2forms selvbetjening. +## 1. Install os2forms selvbetjening -Git clone https://github.com/itk-dev/os2forms_selvbetjening +Git clone [https://github.com/itk-dev/os2forms_selvbetjening](https://github.com/itk-dev/os2forms_selvbetjening) -Follow the steps in https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/README.md +Follow the steps in [https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/README.md](https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/README.md) -## 2. Git clone drupal_webform_booking_module into `web/modules/custom` and enable module. -@todo remove this step when the module is included in os2forms_selvbetjening composer.json. ```shell git clone https://github.com/itk-dev/drupal_webform_booking_module itkdev_booking ``` + ```shell itkdev-docker-compose drush pm:enable itkdev_booking ``` -## 3. Create an 'os2forms_rest_api' api key. +## 2. Create an 'os2forms_rest_api' api key + +[https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/web/modules/custom/os2forms_rest_api/README.md#authentication](https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/web/modules/custom/os2forms_rest_api/README.md#authentication) -https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/web/modules/custom/os2forms_rest_api/README.md#authentication +## 3. Create an Affiliation in os2forms selvbetjening + +@todo remove this step when affiliation term is added as part +of the os2forms_selvbetjening installation. -## 4. Create an Affiliation in os2forms selvbetjening -@todo remove this step when affiliation term is added as part of the os2forms_selvbetjening installation. ```text Structure->Taxonomy->Affiliation @@ -29,11 +31,11 @@ Structure->Taxonomy->Affiliation The name is not important in development. -## 5. Install booking service +## 4. Install booking service -Git clone: https://github.com/itk-dev/book_aarhus +Git clone: [https://github.com/itk-dev/book_aarhus](https://github.com/itk-dev/book_aarhus) -Follow the readme: https://github.com/itk-dev/book_aarhus/blob/develop/README.md +Follow the readme: [https://github.com/itk-dev/book_aarhus/blob/develop/README.md](https://github.com/itk-dev/book_aarhus/blob/develop/README.md) Create an ApiKeyUser with the following command: @@ -43,7 +45,7 @@ docker compose exec phpfpm bin/console app:auth:create-apikey use the api-key that was set up in step 3. -## 6. Set up settings.local.php +## 5. Set up settings.local.php Set up the book_aarhus service fields. @@ -66,38 +68,37 @@ $settings['itkdev_booking_df_map_password'] = '*** Get from 1password ***'; $settings['itkdev_booking_fullcalendar_license'] = '*** Get from 1password ***'; ``` -`$settings['itkdev_booking_api_endpoint']` is found by running: `docker ps` in the booking service project. -Find the internal name of the "bookaarhus" nginx container. Something like `bookaarhus-nginx-1` and append `.frontend`. +`$settings['itkdev_booking_api_endpoint']` is found by running: +`docker ps` in the booking service project. +Find the internal name of the "bookaarhus" nginx container. +Something like `bookaarhus-nginx-1` and append `.frontend`. `$settings['itkdev_booking_api_key']` is the apikey created in step 5. -## 7. Set up a webform +## 6. Set up a webform -Go to `http://selvbetjening.local.itkdev.dk/da/admin/structure/webform` and "Add webform". +Go to `http://selvbetjening.local.itkdev.dk/da/admin/structure/webform` +and "Add webform". Select a name and the Affiliation that was set up in step 4. In "build" press "+ Add element" and add "Booking" type. -## 8. Set up "Api request handler" +## 7. Set up "Api request handler" In "Settings -> Emails/Handlers" press "+ Add handler". -In "API url" set the SERVICE_ENDPOINT from step 6 with the path "v1/bookings-webform" appended. +In "API url" set the SERVICE_ENDPOINT from step 6 with the path +"v1/bookings-webform" appended. -Example: -``` -http://bookaarhus-nginx-1.frontend/v1/bookings-webform -``` +Example: `http://bookaarhus-nginx-1.frontend/v1/bookings-webform` -In "API authorization header" set the text "Apikey SERVICE_APIKEY" as created in step 5. -SERVICE_APIKEY is the same as $settings['itkdev_booking_api_key']. +In "API authorization header" set the text +"Apikey SERVICE_APIKEY" as created in step 5. SERVICE_APIKEY +is the same as `$settings['itkdev_booking_api_key']`. -Example: -``` -Apikey 1234567890qwertyuioasdfghjklzxcvbnm -``` +Example: `Apikey 1234567890qwertyuioasdfghjklzxcvbnm` -### 9. Creating a booking through the webform +### 8. Creating a booking through the webform First create a submission from the webform. @@ -114,9 +115,11 @@ This will create a "WebformSubmitMessage" job in the book_aarhus service. To create the booking in Exchange the job queue in book_aarhus needs to run. From the book aarhus api project run: + ```shell itkdev-docker-compose exec phpfpm composer queues ``` -This will handle the submission job. This job will retrieve the webform submission data and create a -"CreateBookingMessage" job will handle the actual submission to Exchange. \ No newline at end of file +This will handle the submission job. This job will retrieve the webform +submission data and create a "CreateBookingMessage" job will handle the +actual submission to Exchange. diff --git a/web/modules/custom/itkdev_booking/documentation/production.md b/web/modules/custom/itkdev_booking/documentation/production.md index c36f30fe..198eeef4 100644 --- a/web/modules/custom/itkdev_booking/documentation/production.md +++ b/web/modules/custom/itkdev_booking/documentation/production.md @@ -1,11 +1,16 @@ # Production -For this module to work in production it requires a drupal 8.8 or greater with the webform module enabled. + +For this module to work in production it requires a drupal 8.8 +or greater with the webform module enabled. ## Setup -Follow [documentation/os2forms-module-setup-example.md](os2forms-module-setup-example.md) steps 6-9 for information about setting up the project for production. + +Follow [documentation/os2forms-module-setup-example.md](os2forms-module-setup-example.md) +steps 6-9 for information about setting up the project for production. Obtain booking api information from the booking api production environment. Modify settings.local.php + ```php $settings['itkdev_booking_api_endpoint'] = '*** Get from book aarhus project ***'; $settings['itkdev_booking_api_key'] = '*** Get from book aarhus project ***'; @@ -16,4 +21,6 @@ $settings['itkdev_booking_fullcalendar_license'] = '*** Get from 1password ***'; ``` ## Release -New releases of this project follows semantic versioning principles and should be tagged as such. \ No newline at end of file + +New releases of this project follows semantic versioning +principles and should be tagged as such.