Skip to content

Commit

Permalink
TEMP: SAVE POINT
Browse files Browse the repository at this point in the history
  • Loading branch information
chri5tia committed Sep 15, 2023
1 parent b1e100b commit 812720e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
1 change: 0 additions & 1 deletion config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ module:
va_gov_github: 0
va_gov_govdelivery: 0
va_gov_graphql: 0
va_gov_header_footer: 0
va_gov_help_center: 0
va_gov_links: 0
va_gov_live_field_migration: 0
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Drupal\core_event_dispatcher\Event\Form\FormAlterEvent;
use Drupal\core_event_dispatcher\FormHookEvents;
use Drupal\va_gov_header_footer\Traits\MenuFormAlter;
use Drupal\va_gov_menus\Traits\MenuFormAlter;
use Drupal\va_gov_user\Service\UserPermsService;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand Down
2 changes: 1 addition & 1 deletion docroot/modules/custom/va_gov_home/va_gov_home.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ description: Provides custom logic for the va.gov home page.
package: Custom
core_version_requirement: ^9 || ^10
dependencies:
- va_gov_user
- core_event_dispatcher
- va_gov_user
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Drupal\va_gov_header_footer\EventSubscriber;
namespace Drupal\va_gov_menus\EventSubscriber;

use Drupal\core_event_dispatcher\Event\Form\FormAlterEvent;
use Drupal\core_event_dispatcher\FormHookEvents;
use Drupal\va_gov_header_footer\Traits\MenuFormAlter;
use Drupal\va_gov_menus\Traits\MenuFormAlter;
use Drupal\va_gov_user\Service\UserPermsService;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand Down Expand Up @@ -60,8 +60,9 @@ public static function getSubscribedEvents(): array {
public function formAlter(FormAlterEvent $event): void {
$form = &$event->getForm();
$formId = $event->getFormId();
$admin = $this->permsService->hasAdminRole(TRUE);
if (in_array($formId, $this->menus) && $admin) {
if (in_array($formId, $this->menus)) {
// $admin = $this->permsService->hasAdminRole(TRUE);
// if (in_array($formId, $this->menus) && $admin) {
$this->hideMenuLinkDescriptionField($form);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Drupal\va_gov_header_footer\Traits;
namespace Drupal\va_gov_menus\Traits;

/**
* Provides centralized menu form alter methods.
Expand Down
6 changes: 6 additions & 0 deletions docroot/modules/custom/va_gov_menus/va_gov_menus.services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
va_gov_menus.event_subscriber:
class: Drupal\va_gov_menus\EventSubscriber\FormEventSubscriber
arguments: ['@va_gov_user.user_perms']
tags:
- { name: event_subscriber }

0 comments on commit 812720e

Please sign in to comment.