diff --git a/composer.json b/composer.json index a4e813fc..404b2018 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,7 @@ "bcgov/bcbb": "1.0.x@dev", "bcgov/bcbb_theme": "1.0.x@dev", "composer/installers": "^2.0", + "drupal/cancel_button": "^1.4", "drupal/ckeditor_codemirror": "^3.0@beta", "drupal/clipboardjs": "dev-2.0.x#adb3f68", "drupal/core-composer-scaffold": "^10.1", diff --git a/composer.lock b/composer.lock index e2811262..acae7981 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "786552ad83937fcc68d2e5fe045bd510", + "content-hash": "3a820c66b10a63f4c628182f92c25d59", "packages": [ { "name": "asm89/stack-cors", @@ -2006,6 +2006,62 @@ "issues": "https://www.drupal.org/project/issues/bootstrap5" } }, + { + "name": "drupal/cancel_button", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/cancel_button.git", + "reference": "8.x-1.4" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/cancel_button-8.x-1.4.zip", + "reference": "8.x-1.4", + "shasum": "d1d932a4aff53938066f329a04fa3adb61367d0e" + }, + "require": { + "drupal/core": "^8 || ^9 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.4", + "datestamp": "1676921894", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "danmuzyka", + "homepage": "https://www.drupal.org/user/48685" + }, + { + "name": "heddn", + "homepage": "https://www.drupal.org/user/1463982" + }, + { + "name": "kevin.dutra", + "homepage": "https://www.drupal.org/user/1312744" + }, + { + "name": "sukanya.ramakrishnan", + "homepage": "https://www.drupal.org/user/3320069" + } + ], + "description": "This small module adds a Cancel button to Entity forms.", + "homepage": "https://www.drupal.org/project/cancel_button", + "support": { + "source": "https://git.drupalcode.org/project/cancel_button" + } + }, { "name": "drupal/ckeditor5_fullscreen", "version": "1.0.0-beta5", @@ -17183,5 +17239,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/config/sync/cancel_button.settings.yml b/config/sync/cancel_button.settings.yml new file mode 100644 index 00000000..bb0e3f78 --- /dev/null +++ b/config/sync/cancel_button.settings.yml @@ -0,0 +1,96 @@ +_core: + default_config_hash: K_LddvA0aVOWbF6aw7aoX1n_BmWah6y3HWE1Ya7QmUc +entity_type_cancel_destination: + default: + path: / + enabled: true + comment: + path: / + enabled: false + block: + path: /admin/structure/block + enabled: true + block_content_type: + path: /admin/structure/block/block-content/types + enabled: true + comment_type: + path: /admin/structure/comment + enabled: true + contact_form: + path: /admin/structure/contact + enabled: true + editor: + path: / + enabled: false + field_storage_config: + path: / + enabled: false + field_config: + path: / + enabled: true + file: + path: / + enabled: false + filter_format: + path: /admin/config/content/formats + enabled: true + image_style: + path: /admin/config/media/image-styles + enabled: true + node_type: + path: /admin/structure/types + enabled: true + node: + path: / + enabled: true + shortcut_set: + path: / + enabled: false + shortcut: + path: / + enabled: false + action: + path: / + enabled: false + menu: + path: / + enabled: false + taxonomy_term: + path: / + enabled: false + taxonomy_vocabulary: + path: /admin/structure/taxonomy + enabled: true + tour: + path: / + enabled: false + user_role: + path: /admin/people/roles + enabled: true + user: + path: / + enabled: true + menu_link_content: + path: / + enabled: false + view: + path: / + enabled: false + base_field_override: + path: / + enabled: false + date_format: + path: / + enabled: false + entity_view_mode: + path: /admin/structure/display-modes/view + enabled: true + entity_form_display: + path: / + enabled: false + entity_view_display: + path: / + enabled: false + entity_form_mode: + path: /admin/structure/display-modes/form + enabled: true diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 3bca0277..8321062c 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -14,6 +14,7 @@ module: block_content: 0 book: 0 breakpoint: 0 + cancel_button: 0 ckeditor5: 0 ckeditor5_fullscreen: 0 ckeditor_codemirror: 0 diff --git a/html/modules/custom/bc_dc/bc_dc.info.yml b/html/modules/custom/bc_dc/bc_dc.info.yml index acb873d8..419ba242 100644 --- a/html/modules/custom/bc_dc/bc_dc.info.yml +++ b/html/modules/custom/bc_dc/bc_dc.info.yml @@ -8,6 +8,7 @@ dependencies: - bcbb:bcbb_book - bcbb:bcbb_other - bcbb:bcbb_search + - cancel_button:cancel_button - ckeditor5_fullscreen:ckeditor5_fullscreen - ckeditor_codemirror:ckeditor_codemirror - clipboardjs:clipboardjs diff --git a/html/modules/custom/bc_dc/bc_dc.install b/html/modules/custom/bc_dc/bc_dc.install index 2bbe0844..9a9d26fa 100644 --- a/html/modules/custom/bc_dc/bc_dc.install +++ b/html/modules/custom/bc_dc/bc_dc.install @@ -21,3 +21,10 @@ function bc_dc_requirements(string $phase): array { return $requirements; } + +/** + * Set bc_dc module weight . + */ +function bc_dc_update_8001() { + module_set_weight('bc_dc', 100); +} diff --git a/html/modules/custom/bc_dc/bc_dc.module b/html/modules/custom/bc_dc/bc_dc.module index 6ff2aab4..7b4b7c46 100644 --- a/html/modules/custom/bc_dc/bc_dc.module +++ b/html/modules/custom/bc_dc/bc_dc.module @@ -365,6 +365,9 @@ function bc_dc_form_node_data_set_edit_form_alter(array &$form, FormStateInterfa if (!isset($form['#validate'])) { $form['#validate'] = []; } + if (isset($form['actions']['cancel'])) { + $form['actions']['cancel']['#attributes']['class'][] = 'btn btn-danger'; + } array_unshift($form['#validate'], '_bc_dc_form_node_data_set_edit_form_submit'); }