Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-17885: Create facility services links on VBA Facility page #18442

Merged
merged 13 commits into from
Jul 3, 2024

Conversation

omahane
Copy link
Contributor

@omahane omahane commented Jul 2, 2024

Description

Relates to #17885

Testing done

Manually

Screenshots

Screenshot 2024-07-02 at 2 56 56 PM

QA steps

Set up QA Content Publisher

  • As an admin, update the QA Content Editor
    • Assign the following roles
      • Content creator - VBA
      • Content editor
    • Assign the following Section
      • Portland VA Regional Benefit Office
      • Cheyenne VA Regional Benefit Office

Create a service in Portland VA Regional Benefit Office

  • As QA Content Editor, go to the Portland VA Regional Benefit Office
  • Click on Create a new service for this facility (opens in new window).
  • Confirm that the Section is set to "Portland VA Regional Benefit Office"
  • Confirm that the Facility is "Portland VA Regional Benefit Office"
  • Create a new service (such as Disability compensation)
  • Save the service
  • Close the window

Review the Portland VA Regional Benefit Office facility services

  • On the Portland VA Regional Benefit Office page, click on Manage existing services for this facility (opens in new window)
  • Confirm that the VBA Facilities are listed, filtered for the Portland VA Regional Benefit Office

Create a service in Cheyenne VA Regional Benefit Office

  • As QA Content Editor, go to the VA Regional Benefit Satellite Office at Sheridan VA Medical Center
  • Click on Create a new service for this facility (opens in new window).
  • Confirm that the Section is set to "Cheyenne VA Regional Benefit Office"
  • Confirm that the Facility is "VA Regional Benefit Satellite Office at Sheridan VA Medical Center"
  • Create a new service (such as Disability compensation)
  • Save the service
  • Close the window

Review the Cheyenne VA Regional Benefit Office facility services

  • On the VA Regional Benefit Satellite Office at Sheridan VA Medical Center page, click on Manage existing services for this facility (opens in new window)
  • Confirm that the VBA Facilities are listed, filtered for the VA Regional Benefit Satellite Office at Sheridan VA Medical Center

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

@omahane omahane force-pushed the VACMS-17885-vba-service-link-ux branch from 85f47a2 to 509cf8f Compare July 2, 2024 20:03
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 2, 2024 20:03 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 2, 2024 20:10 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 2, 2024 20:30 Destroyed
@omahane omahane marked this pull request as ready for review July 2, 2024 20:40
@omahane omahane requested a review from a team as a code owner July 2, 2024 20:40
@omahane omahane requested a review from dsasser July 2, 2024 20:43
@github-actions github-actions bot added the Facilities Facilities products (VAMC, Vet Center, etc) label Jul 2, 2024

if (isset($form["#fieldgroups"]["group_facility_services"]->format_settings["description"])) {
$form["#fieldgroups"]["group_facility_services"]->format_settings["description"] = "
<p><a href='$add_new_service_url' target='_blank'>Create a new service for this facility (opens in new window)</a></p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHOULD...
...use a more structured approach to the markup here to support readability and ultimately translations. eg:

  $form["#fieldgroups"]["group_facility_services"]->format_settings["description"]['create'] = [
    '#title' => $this->t('Create a new service for this facility (opens in new window)'),
    '#type' => 'link',
    '#url' => // the url,
    '#prefix' => '<p>',
    '#suffix' => '</p>',
  ];
  $form["#fieldgroups"]["group_facility_services"]->format_settings["description"]['manage'] = [
    '#title' => $this->t('Manage existing services for this facility (opens in new window)'),
    '#type' => 'link',
    '#url' => // the url,
    '#prefix' => '<p>',
    '#suffix' => '</p>',
  ];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to implement this, but kept getting errors that appear to be related to how ['description'] is expecting a string, not an array.
Screenshot 2024-07-03 at 8 46 11 AM

I wrapped the link text in a t() and made it all a little more readable.

$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>
        ";
    }

@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 3, 2024 14:02 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 3, 2024 14:07 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 3, 2024 14:17 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 3, 2024 14:20 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 3, 2024 14:25 Destroyed
Copy link
Contributor

@dsasser dsasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Both create and manage links are working per ACs.

Screenshot 2024-07-03 at 8 29 09 AM
Screenshot 2024-07-03 at 8 29 02 AM
Screenshot 2024-07-03 at 8 28 59 AM

@davidmpickett
Copy link
Contributor

Works as expected on Node:Edit. Would adding it to Node:View be a significant additional lift?

@omahane
Copy link
Contributor Author

omahane commented Jul 3, 2024

Works as expected on Node:Edit. Would adding it to Node:View be a significant additional lift?

Yes, it would. Adding stuff to node:view and node:edit is different enough to make this a scope change.

@omahane omahane merged commit 12ccfa8 into main Jul 3, 2024
39 checks passed
@omahane omahane deleted the VACMS-17885-vba-service-link-ux branch July 3, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Facilities Facilities products (VAMC, Vet Center, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants