-
Notifications
You must be signed in to change notification settings - Fork 70
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
Conversation
85f47a2
to
509cf8f
Compare
|
||
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> |
There was a problem hiding this comment.
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>',
];
There was a problem hiding this comment.
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.
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>
";
}
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
docroot/modules/custom/va_gov_vba_facility/src/EventSubscriber/VbaFacilitySubscriber.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Description
Relates to #17885
Testing done
Manually
Screenshots
QA steps
Set up QA Content Publisher
Create a service in Portland VA Regional Benefit Office
Review the Portland VA Regional Benefit Office facility services
Create a service in Cheyenne VA Regional Benefit Office
Review the Cheyenne VA Regional Benefit Office facility services
Select Team for PR review
CMS Team
Public websites
Facilities
User support
Accelerated Publishing