Skip to content

Commit

Permalink
Merge pull request #41 from CU-CommunityApps/fix-ivalid-date-ff
Browse files Browse the repository at this point in the history
fix bug in invalid date in firefox and use dependency injection in drupal block
  • Loading branch information
philwilliammee authored Jan 31, 2022
2 parents 74ae00b + 9eb2fb0 commit 17d8c9d
Show file tree
Hide file tree
Showing 56 changed files with 42,657 additions and 12,317 deletions.
3 changes: 0 additions & 3 deletions cwd_events.libraries.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
cwdeventslib:
version: 8.x
header: true
css:
theme:
includes/cwd_events.css: {}
js:
includes/cwd_events.js: {preprocess: false}
dependencies:
Expand Down
18 changes: 9 additions & 9 deletions includes/cwd_events.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions includes/cwd_events.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
***************************************************************************** */

/**
* build-url - A small library that builds a URL given its components
* @version v6.0.0
* @link https://github.com/steverydz/build-url#readme
* A better abstraction over CSS.
*
* @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
* @website https://github.com/cssinjs/jss
* @license MIT
*/

Expand Down
3 changes: 1 addition & 2 deletions includes/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"/cwd_events.js": "/cwd_events.js",
"/cwd_events.css": "/cwd_events.css"
"/cwd_events.js": "/cwd_events.js"
}
35 changes: 31 additions & 4 deletions src/Plugin/Block/EventsBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Drupal\cwd_events\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Block\BlockPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Component\Uuid\Php;

/**
* Provides an Events Block containing Localist Data.
Expand All @@ -15,7 +17,33 @@
* category = @Translation("Events Block"),
* )
*/
class EventsBlock extends BlockBase implements BlockPluginInterface {
class EventsBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* Service uuid.
*
* @var Drupal\Component\Uuid\Php
*/
protected $uuidService;

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('uuid'),
);
}

/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Php $uuidService) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->uuidService = $uuidService;
}

/**
* List of supported format options.
Expand Down Expand Up @@ -270,8 +298,7 @@ public function blockSubmit($form, FormStateInterface $form_state) {
parent::blockSubmit($form, $form_state);
$values = $form_state->getValues();
$formatOptions = $this->formatOptions;
$uuid = \Drupal::service('uuid');
$id = $uuid->generate();
$id = $this->uuidService->generate();
$this->configuration['id'] = $id;
$this->configuration['target'] = "events-listing-$id";

Expand Down
1 change: 0 additions & 1 deletion src/app/css/drupal/icons/333333/caret-down.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/app/css/drupal/icons/333333/grid.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/app/css/drupal/icons/333333/table.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/app/css/drupal/icons/ee0000/ex.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/app/css/drupal/icons/ee0000/required.svg

This file was deleted.

Loading

0 comments on commit 17d8c9d

Please sign in to comment.