department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
99 stars 68 forks source link

Drupal: Implement Drupal menu to manage new home page Hub list and add "12th Hub" menu item for "VA Departments" link #11968

Closed wesrowe closed 1 year ago

wesrowe commented 1 year ago

User stories

As a VAgov visitor who is interested in non-Veteran-facing topics, I want to see a link to the new VA Departments website on the homepage in the same area where Benfit Hubs are listed so that it's easy for me to find what interests me.

As a visitor to the new home page, I want to see the list of Benefit Hubs in order of relevance.

Daniel started the CMS backend work and is available here. It creates the new menu and related fields, but needs another pass to confirm it aligns to the Figma design.

Background

The current homepage of VA.gov displays a Benefit Hub List, set up right now as an EntityQueue that publishes Benefit Hub Landing Pages only. The icon, link, label, and teaser text are provided by the BHLP content type.

The new home page design specifies:

  1. A new order for Benefit Hubs in the list
  2. A "12th Benefit Hub:" VA Dept Info. This item is not actually a Benefit Hub Landing Page, but a link out to a Wordpress site built on a VA subdomain. image

In order to accommodate these 2 changes, we must update how the Hub List data is managed. We will implement as a menu, with updated order, and with added 12th item for VA Dept Info.

How this implementation was defined:

Implementation details

ACs describe hiding some default fields, one of which (Show as expanded checkbox) should be hidden from every role except Admin.

$perms_service = \Drupal::service('va_gov_user.user_perms');
if (!$perms_service->hasAdminRole(TRUE)) {

It should go in an event subscriber like this docroot/modules/custom/va_gov_vet_center/src/EventSubscriber/EntityEventSubscriber.php, in a new module va_gov_home rather than putting it in va_gov_backend.

Acceptance Criteria

CMS Team

Please check the team(s) that will do this work.

jilladams commented 1 year ago

Per refinement with Dave on 12/15:

Meaning: we have time to work out the correct solution.

jilladams commented 1 year ago

https://dsva.slack.com/archives/C03NSH4SLQY/p1671138379946699

jilladams commented 1 year ago

After #12044 for this project, this ticket needs updated for modernity, including:

Assigning to @wesrowe / moving to "Needs product definition."

dsasser commented 1 year ago

Can/should we offer links ("entity references"?) to nodes/content? Or will links to drupal content (e.g., benefit hub landing pages) be hard-coded?

Is the idea behind using a separate entity ref field for referencing BHLP to ease in sharing icons and other fields?

I would suggest we not do offer an additional entity ref field, for the following reasons:

dsasser commented 1 year ago

Should there be a character limit on description text?

It depends on what we mean by 'description text'. There is a core menu field called 'description'. There is a character limit of 255 characters on this description field, but it isn't exposed to the user in any way. Since this field is not "configurable" (no UI for managing the display of the field), we would need to add custom code to expose the field in the 'manage form' page, and then from there we would be able to use the maxLength module to add the relevant maximum length info which is found on many other fields in the CMS. The lift to do this is in the small to medium range.

If this is referring to the new text field for 'link summary', the character limit can be easily set once we identify what it should be. The lift would be trivial.

wesrowe commented 1 year ago

I would suggest we not do offer an additional entity ref field, for the following reasons

I buy this. Thanks for thinking it through. The particular use case I was thinking of (avoiding a broken link) is probably not a concern here, as these are well-governed URLs that will not change.

If this is referring to the new text field for 'link summary', the character limit can be easily set once we identify what it should be. The lift would be trivial.

The link summary is indeed what I was talking about, sorry for the confusion. (The confusion validates Steve's point that "description" can be confusing in drupal world.)

wesrowe commented 1 year ago

@dsasser, related question on character limits – Can we set a char limit on the menu link text? SW Content team requested a limit of 25 chars. But afaik the link text field is a default field – so would that be harder, maybe similar to your first case above?

dsasser commented 1 year ago

@dsasser, related question on character limits – Can we set a char limit on the menu link text? SW Content team requested a limit of 25 chars. But afaik the link text field is a default field – so would that be harder, maybe similar to your first case above?

We could do that, but the same situation applies here as the core description field as noted above. There is a Drupal contrib module which exposes these types of fields in the Admin UI, which I tested quickly to confirm it would work to allow us to easily add character limits to the link text (Title) field. So providing we are good to use that module (I haven't done a code review yet), the lift should be trivial.

thejordanwood commented 1 year ago

Design was approved and we're ready to move forward. Design can be found in this Figma file.

dsasser commented 1 year ago

PR ready for review: https://github.com/department-of-veterans-affairs/va.gov-cms/pull/12436

thejordanwood commented 1 year ago

Looks good! This is approved and has design sign off.