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-14793: Hide Link Description Field in Footers #15069

Merged
merged 7 commits into from
Sep 21, 2023

Conversation

chri5tia
Copy link
Contributor

@chri5tia chri5tia commented Sep 1, 2023

Description

Related to #14793

Testing done

Local functional testing

Screenshots

Hides description field:
Screenshot 2023-09-08 at 3 50 59 AM

QA steps

As any testcontentadmin with the content_admin roll, go to admin/structure/menu/manage/footer-bottom-rail and click to edit any link.

  • Ensure that the description field is not showing.

Go to admin/structure/menu/manage/va-gov-footer and click to edit any link.

  • Ensure that the description field is not showing

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.

Select Team for PR review

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

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 1, 2023 15:25 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 72bcf04 to 25ad90e Compare September 1, 2023 15:38
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 1, 2023 15:38 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from ed538d9 to 551fc24 Compare September 8, 2023 10:50
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 8, 2023 10:50 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.

Reminder: we don't want PRs to close issues automatically when they are merged. This gives us a chance to prod verify the solution before closing the issue:

Screenshot 2023-09-11 at 8 38 03 AM

@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 11, 2023 17:38 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 12, 2023 18:07 Destroyed
@chri5tia chri5tia requested a review from dsasser September 13, 2023 21:00
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 0e31ab6 to b1e100b Compare September 15, 2023 06:57
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 15, 2023 06:57 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 15, 2023 07:49 Destroyed
@chri5tia
Copy link
Contributor Author

chri5tia commented Sep 15, 2023

@dsasser The PR is failing because the new trait MenuFormAlter lives in the new module va_gov_header_footer, which cannot be installed due to drush failing on this error, where the already-installed va_gov_home module depends on an expected trait that it can't find, throwing a drush error.

Here is what I was seeing in my browser locally:

Fatal error: Trait "Drupal\va_gov_header_footer\Traits\MenuFormAlter" not found in /var/www/html/docroot/modules/custom/va_gov_home/src/EventSubscriber/FormEventSubscriber.php on line 14

It makes sense that this wouldn't have been caught during development because the new module would have been installed already as part of the process.

I thought about simply adding a dependency in va_gov_home for va_gov_header_footer but this would still be an issue when merging to prod.

I propose that I move the new MenuFormAlter trait to the va_gov_home module instead, or move everything related to menus that is in va_gov_home and va_gov_header_footer to a module called va_gov_menus.

It would be nice if we could avoid having too many dependencies with custom modules toward each other in order to avoid circular dependencies. I know it can't be avoided and I see some like va_gov_home being dependent on va_gov_users but it would be nice to establish an hierarchy. This is a sidebar. But for this reason I think it'll be more elegant all the menu stuff to a menu module.
Thoughts?

Update: Turns out that there isn't anything left in va_gov_home after moving all the menu stuff.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 15, 2023 12:56 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from ca578fb to 0b67e38 Compare September 15, 2023 13:10
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 15, 2023 13:10 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 0b67e38 to 70e5bbc Compare September 15, 2023 21:31
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 15, 2023 21:31 Destroyed
@chri5tia chri5tia requested a review from dsasser September 15, 2023 21:42
@chri5tia
Copy link
Contributor Author

Ticket created for follow up:
#15279

@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 70e5bbc to b421dea Compare September 18, 2023 15:37
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 18, 2023 15:37 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from b421dea to 909e431 Compare September 18, 2023 15:45
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 18, 2023 15:45 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 909e431 to b30241b Compare September 19, 2023 01:34
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 19, 2023 01:34 Destroyed
@chri5tia chri5tia requested a review from dsasser September 19, 2023 01:36
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from b30241b to eec8573 Compare September 20, 2023 20:08
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 20:08 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from eec8573 to 5fb8549 Compare September 20, 2023 20:17
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 20:17 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 20:37 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 22:20 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 677c77b to 126ec4d Compare September 20, 2023 23:23
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 23:23 Destroyed
@chri5tia chri5tia force-pushed the VACMS-14793-Hide-Footer-Description-Field branch from 126ec4d to 3461a04 Compare September 20, 2023 23:35
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 23:35 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 20, 2023 23:50 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 21, 2023 02:20 Destroyed
$formId = $event->getFormId();
$admin = $this->permsService->hasAdminRole(TRUE);
if (in_array($formId, $this->menus) && !$admin) {
$form['description']['#access'] = FALSE;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note for future us: this line should use the new trait added in va_gov_menus, but we can't roll out a new trait in a new module while also using it elsewhere in the codebase at the same time, as we get a php error:

PHP Fatal error:  Trait "Drupal\va_gov_menus\Traits\MenuFormAlterTrait" not found in /var/www/html/docroot/modules/custom/va_gov_header_footer/src/EventSubscriber/FormEventSubscriber.php on line 14

We will want to go back and leverage the trait here, as well as in va_gov_home (after moving va_gov_home's menu alter methods to the trait as well).

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!

As admin:
Screenshot 2023-09-20 at 7 30 26 PM

As non-admin:
Screenshot 2023-09-20 at 7 29 08 PM

@chri5tia chri5tia merged commit e43fa91 into main Sep 21, 2023
16 checks passed
@chri5tia chri5tia deleted the VACMS-14793-Hide-Footer-Description-Field branch September 21, 2023 03:32
@dsasser dsasser mentioned this pull request Nov 13, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants