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

Usagov 2132 hide contact info by page #2186

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

whitealbum
Copy link
Contributor

@whitealbum whitealbum commented Jan 23, 2025

Jira Task

https://cm-jira.usa.gov/browse/USAGOV-2132

Description

Goal of this task is to hide call center info on certain pages.
Call center info can appear in the header, footer, and mobile menu.
I created a new role of content_superadmin whose only perm is administer blocks
Created new regions for this task
For this to work, config, code and content have to be in sync. To achieve this, I added a new module "Structure Sync". It allows for devs to export blocks, menus, and taxonomy content as config. Blocks are the only ones currently in use.

Type of Changes

  • New Feature
  • Bugfix
  • Frontend (Twig, Sass, JS)
    • Add screenshot showing what it should look like
  • Drupal Config (requires "drush cim")
  • New Modules (requires rebuild)
  • Documentation
  • Infrastructure
    • CMS
    • WAF
    • WWW
    • Egress
    • Tools
    • Cron
  • Other

Testing Instructions

You must run bin/composer install to gain access to the structure sync module.
Then, go to http://localhost/admin/structure/structure-sync/blocks.
Next, click on the Import custom blocks (safely) button
Screenshot 2025-02-03 at 10 32 02 AM

Contact info should not be visible the following pages:

English Spanish
/benefit-finder /es/averiguar-estado-reembolso-impuestos
/benefit-finder/* /es/buscador-beneficios
/chat /es/buscador-beneficios/*
/check-tax-status /es/chat
/contact-irs /es/compensacion-reembolsos-impuestos
/elected-officials-email /es/contactar-irs
/elected-officials-results /es/donde-reportar-una-estafa
/local-governments /es/estatal-consumidor
/phone /es/estatales-servicios-sociales
/state-attorney-general /es/funcionarios-electos-correo-electronico
/state-consumer /es/funcionarios-electos-resultados
/state-corrections /es/gobiernos-estatales
/state-election-office /es/gobiernos-estatales/*
/state-emergency-management /es/llamenos
/state-governments /es/obtener-reembolso-de-impuestos-por-deposito-directo
/state-governments/* /es/oficina-elecciones-estatal-local
/state-governor /es/reembolsos-impuestos
/state-health /es/reembolsos-impuestos-no-entregados
/state-motor-vehicle-services
/state-social-services
/tax-refund-direct-deposit
/tax-refund-offset
/tax-refunds
/unclaimed-tax-refunds
/where-report-scams

New blocks can found under content blocks
Position of new block can be found at Block Layout

  • From there you can click on Configure to see visibility rules.

Change Requirements

  • Requires New Documentation (Link: {})
  • Requires New Config
  • Requires New Content

Validation Steps

  • Confirm contact info is not visible on above pages.
  • Confirm contact info is visible on other pages.
  • Profit.

Security Review

  • Adds/updates software (including a library or Drupal module)
  • Communication with external service
  • Changes permissions or workflow
  • Requires SSPP updates

Reviewer Reminders

  • Reviewed code changes
  • Reviewed functionality
  • Security review complete or not required

Post PR Approval Instructions

Follow these steps as soon as you merge the new changes.

  1. Go to the USAGov Circle CI project.
  2. Find the commit of this pull request.
  3. Build and deploy the changes.
  4. Update the Jira ticket by changing the ticket status to Review in Test and add a comment. State whether the change is already visible on cms-dev.usa.gov and beta-dev.usa.gov, or if the deployment is still in process.

Copy link
Member

@akf akf left a comment

Choose a reason for hiding this comment

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

I took a look at this and unfortunately the blocks are broken for me. I now remember running into this before -- the blocks you exported as config are somewhat present, but are "broken."

I can get to the edit pages for them by clicking "configure" next to the message "This block is broken or missing" when viewing a node. So I can find my way to, for example, http://localhost/admin/structure/block/manage/usagov_topnavphone and I can see the Visibility configuration, but the Block description says "Broken/Missing."

The new blocks do not appear at /admin/content/block

Is this what you meant by "Content may be required for this to work." ?

Copy link
Member

Choose a reason for hiding this comment

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

Let's not give this permission to Content Administrators. We've given too many people that role.
An alternative would be to add a new role (maybe "Content Superadmin") with the administer blocks permission and give it to selected people in addition to the "Content Administrator" role.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akf Updated task to include structure sync which treats block content like config.

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.

2 participants