Skip to content

Commit

Permalink
Merge pull request #22 from forumone/tests
Browse files Browse the repository at this point in the history
Resolve linting errors in foia_wizard module
  • Loading branch information
mattdanger authored Aug 21, 2023
2 parents ba8c683 + b608fc8 commit 16b90c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Drupal\foia_wizard\Controller;

use Drupal\Core\Cache\CacheableJsonResponse;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RequestStack;

/**
Expand Down Expand Up @@ -52,6 +52,7 @@ public function __construct(ConfigFactoryInterface $config_factory, RequestStack
* Standard Drupal Container Interface.
*
* @return \Drupal\Core\Controller\ControllerBase|void
* Returns a cached response.
*/
public static function create(ContainerInterface $container) {
return new static(
Expand Down Expand Up @@ -97,8 +98,7 @@ public function wizard() {
: [];

// Return JSON response.
return new JsonResponse($data, 200, $headers);
//return CacheableJsonResponse::create($data)->setMaxAge(self::SECONDS_IN_A_DAY);
return CacheableJsonResponse::create($data)->setMaxAge(self::SECONDS_IN_A_DAY);
}

}
10 changes: 1 addition & 9 deletions docroot/modules/custom/foia_wizard/src/Form/SettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#markup' => $this->t('This form allows you to configure the FOIA Request Wizard.'),
];

// Hacky but huge UX improvement
// Hacky but huge UX improvement.
$form['CSS'] = [
'#children' => '<style>.foia-wizard-settings .vertical-tabs__menu {max-height: 30rem; overflow-y: auto; overflow-x:hidden}</style>',
];
Expand Down Expand Up @@ -90,14 +90,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {
return parent::buildForm($form, $form_state);
}

/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {

parent::validateForm($form, $form_state);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 16b90c9

Please sign in to comment.