Skip to content

Commit

Permalink
Merge branch 'main' into VACMS-18070-public_file_base_header_response
Browse files Browse the repository at this point in the history
  • Loading branch information
timcosgrove authored Jul 3, 2024
2 parents b3eef65 + 7c8b911 commit 9e0c956
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 10 deletions.
47 changes: 47 additions & 0 deletions READMES/cms-collab-cycle/collab-cycle-accessibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CMS Collaboration Cycle Accessibility Discovery and Recomendations

## Discovery

Currently, the Platform Collaboration Cycle incorporates Accessibility throughout all touch points from Design Intent, Midpoint Review, and Staging Review. At both the Midpoint Review and Staging Review they have the following testing and artifacts:

1. Midpoint Review

1. **Finalized design prototype - Required**

- Desktop and mobile prototypes including accessibility annotations.

1. Staging Review

1. **Foundational accessibility tests - Required**
- [Use of color and color contrast](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#use-of-color)
- [Automated testing with axe by Deque](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#axe)
- [Content zoom and reflow](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#content-zoom)
- [Keyboard navigation](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#keyboard-nav)

2. **Foundational testing artifact - Required**
- The [accessibility testing artifact](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#artifact) is required and must be submitted prior to each staging review. It documents the results of their foundational testing.

3. **Advanced accessibility testing - Recommended**
- [WAVE spot checks](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#wave)
- [Code quality review](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#code-quality)
- [Mouse-only and touchscreen](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#mouse-and-touch)
- [Screen readers](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#screen-readers)
- [Voice commands](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#voice)

Talking with Laura, sitewide teams are only building cypress tests when it's appropriate, but not accessibility specific tests.

## Recommendations for Collab cycle changes

1. **Mouse-only and touchscreen checks**
- For CMS specifically, since Drupal is not accessible via mobile devices unless they have a GFE phone, we need a secondary way of completing the step of `Using a mobile device, make sure you can use the full functionality of a feature with only one finger to gesture (tapping, swiping, etc.)` by being able to `change the view in developer tools to be mobile`. The test should still be done for those users who want to use GFE tablets or phones to access Drupal.

## Recommendations for future work

1. **Automated testing with axe by Deque**
1. Tasks for CMS team:
- Investigate why axe-core is being used instead of the perfered Attest mentioned in the [508-ds-process memo](https://github.com/department-of-veterans-affairs/va.gov-team-sensitive/blob/master/Administrative/memos/508-ds-process.md#automated-and-integrated-508-compliance-tests-and-digital-service-reviews) (dated 2016 and added to github in 2019) found under the [axe scans in end-to-end tests heading](https://depo-platform-documentation.scrollhelp.site/collaboration-cycle/prepare-for-an-accessibility-staging-review#Prepareforanaccessibilitystagingreview-axescansinend-to-endtests) on the Prepare for an accessibility staging review page.
- Currently Platform teams are only using axe-core and all documentation points to axe-core despite the memo. Speaking with Brian DeConinck that's the only reference he knows of to Attest.
- Better understand what automated tests are running in the code. This will need to be a collaboration between Accessibility and QA. Once this is understood, devs will need to augment their required QA tests to make sure they are testing their builds for accessibility using the [axe checks](https://depo-platform-documentation.scrollhelp.site/developer-docs/accessibility-testing-helper-functions).
- Currently in the [accessibility.js](https://github.com/department-of-veterans-affairs/va.gov-cms/blob/main/tests/cypress/support/accessibility.js) file we're only testing for `values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]`. This should be expanded to the 22a and 22aa rules like the Platform team is planning on doing for the [conten-build testing rules](https://github.com/department-of-veterans-affairs/va.gov-team/issues/45693).
2. Tasks for teams in collab cycle:
- Teams need to start adding accessibility checks into each cypress test written.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ third_party_settings:
show_empty_fields: '1'
show_label: '1'
tooltip_description: ''
description: 'Facility services are created on a different page.'
description: 'Adds a link to create a VBA Facility service. The actual content is overridden by createLinksFacilityServices() in va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php'
required_fields: '1'
id: facility-services
classes: 'not-editable centralized'
Expand Down Expand Up @@ -392,7 +392,8 @@ content:
type: address_default
weight: 11
region: content
settings: { }
settings:
wrapper_type: fieldset
third_party_settings: { }
field_administration:
type: options_select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ dependencies:
module:
- entity_reference_validators
- epp
- tmgmt_content
third_party_settings:
entity_reference_validators:
circular_reference: false
circular_reference_deep: false
duplicate_reference: true
epp:
value: ''
value: '[current-page:query:field_administration]'
on_update: 0
tmgmt_content:
excluded: false
id: node.vba_facility_service.field_administration
field_name: field_administration
entity_type: node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ dependencies:
module:
- entity_reference_validators
- epp
- tmgmt_content
third_party_settings:
entity_reference_validators:
circular_reference: false
circular_reference_deep: false
duplicate_reference: false
epp:
value: ''
value: '[current-page:query:field_office]'
on_update: 0
tmgmt_content:
excluded: false
id: node.vba_facility_service.field_office
field_name: field_office
entity_type: node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct(
UserPermsService $user_perms_service,
EntityTypeManagerInterface $entity_type_manager,
RendererInterface $renderer
) {
) {
$this->stringTranslation = $string_translation;
$this->userPermsService = $user_perms_service;
$this->entityTypeManager = $entity_type_manager;
Expand All @@ -90,7 +90,7 @@ public static function getSubscribedEvents(): array {
* @param \Drupal\core_event_dispatcher\Event\Entity\EntityViewAlterEvent $event
* The entity view alter service.
*/
public function entityViewAlter(EntityViewAlterEvent $event):void {
public function entityViewAlter(EntityViewAlterEvent $event): void {
$this->appendServiceTermDescriptionToVbaFacilityService($event);
}

Expand All @@ -100,7 +100,7 @@ public function entityViewAlter(EntityViewAlterEvent $event):void {
* @param \Drupal\core_event_dispatcher\Event\Entity\EntityViewAlterEvent $event
* The entity view alter service.
*/
public function appendServiceTermDescriptionToVbaFacilityService(EntityViewAlterEvent $event):void {
public function appendServiceTermDescriptionToVbaFacilityService(EntityViewAlterEvent $event): void {
$display = $event->getDisplay();
if (($display->getTargetBundle() === 'vba_facility_service') && ($display->getOriginalMode() === 'full')) {
$build = &$event->getBuild();
Expand All @@ -119,7 +119,8 @@ public function appendServiceTermDescriptionToVbaFacilityService(EntityViewAlter
else {
$description = new FormattableMarkup(
'<div><strong>Notice: The national service description was not found.</strong></div>',
[]);
[]
);
}
$formatted_markup = new FormattableMarkup($description, []);
$build['field_service_name_and_descripti']['#suffix'] = $formatted_markup;
Expand All @@ -136,6 +137,43 @@ public function alterVbaFacilityNodeForm(FormIdAlterEvent $event): void {
$this->addStateManagementToBannerFields($event);
$this->changeBannerType($event);
$this->changeDismissibleOption($event);
$this->createLinksFacilityServices($event);
}

/**
* Adds links for creating and managing facility services.
*
* One link prepopulates the section and facility for editorial convenience.
* One link goes to the content search page, passing in the facility name.
*
* @param \Drupal\core_event_dispatcher\Event\Form\FormIdAlterEvent $event
* The event.
*/
protected function createLinksFacilityServices(FormIdAlterEvent $event): void {
$form = &$event->getForm();

if (!isset($form["#fieldgroups"]["group_facility_services"])) {
return;
}

$form_state = $event->getFormState();
/** @var \Drupal\Core\Entity\EntityFormInterface $form_object */
$form_object = $form_state->getFormObject();
$entity = $form_object->getEntity();
$section_tid = $entity->field_administration->target_id;
$facility_nid = $entity->nid->value;
$create_service_url = "/node/add/vba_facility_service?field_administration=$section_tid&field_office=$facility_nid";
$create_service_text = $this->t('Create a new service for this facility (opens in new window)');
$encoded_facility_name = urlencode($entity->title->value);
$manage_services_url = "/admin/content?title=$encoded_facility_name&type=vba_facility_service&moderation_state=All&owner=All";
$manage_services_text = $this->t('Manage existing services for this facility (opens in new window)');

if (isset($form["#fieldgroups"]["group_facility_services"]->format_settings["description"])) {
$form["#fieldgroups"]["group_facility_services"]->format_settings["description"] = "
<p><a href='$create_service_url' target='_blank'>$create_service_text</p>
<p><a href='$manage_services_url' target='_blank'>$manage_services_text</p>
";
}
}

/**
Expand Down Expand Up @@ -254,8 +292,10 @@ public function entityPresave(EntityPresaveEvent $event): void {
protected function clearBannerFields(EntityInterface $entity): void {
/** @var \Drupal\node\NodeInterface $entity */
if ($entity->bundle() === "vba_facility") {
if ($entity->hasField('field_show_banner')
&& $entity->field_show_banner->value == FALSE) {
if (
$entity->hasField('field_show_banner')
&& $entity->field_show_banner->value == FALSE
) {
if ($entity->field_alert_type) {
$entity->field_alert_type->value = NULL;
}
Expand Down

0 comments on commit 9e0c956

Please sign in to comment.