Skip to content

Commit

Permalink
Fix missing fonts from font-awesome in the assets build
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkrovitch committed Jun 25, 2020
1 parent 36de0ee commit f8144a2
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 3,634 deletions.
2 changes: 1 addition & 1 deletion assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'bootstrap/dist/js/bootstrap';
import 'bootstrap/dist/css/bootstrap.css';

import '@fortawesome/fontawesome-free/js/all.js';
import '@fortawesome/fontawesome-free/css/all.css';
//import '@fortawesome/fontawesome-free/css/all.css';

import '../scss/admin.scss';
import Collapse from "./components/Collapse";
Expand Down
4 changes: 4 additions & 0 deletions assets/scss/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
@import "partials/menu";

@import "partials/crud/list";

@import "~@fortawesome/fontawesome-free/scss/fontawesome";
@import "~@fortawesome/fontawesome-free/scss/solid";
@import "~@fortawesome/fontawesome-free/scss/regular";
2 changes: 1 addition & 1 deletion assets/scss/partials/_variables.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$fa-font-path: "../fonts";

16 changes: 9 additions & 7 deletions src/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function handleRequest(Request $request)
{
$this->request = $request;
$event = new AdminEvent($this, $request);
$this->eventDispatcher->dispatch(Events::ADMIN_HANDLE_REQUEST, $event);
$this->eventDispatcher->dispatch($event, Events::ADMIN_HANDLE_REQUEST);

if (!$event->hasAction()) {
throw new Exception('The current action was not set during the dispatch of the event');
Expand All @@ -87,23 +87,23 @@ public function handleRequest(Request $request)

// Dispatch an event to allow entities to be filtered
$filterEvent = new FilterEvent($this, $request);
$this->eventDispatcher->dispatch(Events::ADMIN_FILTER, $filterEvent);
$this->eventDispatcher->dispatch($filterEvent, Events::ADMIN_FILTER);

$event = new EntityEvent($this, $request);
$event->setFilters($filterEvent->getFilters());
$this->eventDispatcher->dispatch(Events::ENTITY_LOAD, $event);
$this->eventDispatcher->dispatch($event, Events::ENTITY_LOAD);

if (null !== $event->getEntities()) {
$this->entities = $event->getEntities();
}
$event = new FormEvent($this, $request);
$this->eventDispatcher->dispatch(Events::ADMIN_CREATE_FORM, $event);
$this->eventDispatcher->dispatch($event, Events::ADMIN_CREATE_FORM);

// Merge the regular forms and the filter forms
$this->forms = array_merge($filterEvent->getForms(), $event->getForms());

$this->handleEntityForm($request);
$this->eventDispatcher->dispatch(Events::ADMIN_HANDLE_FORM, new FormEvent($this, $request));
$this->eventDispatcher->dispatch(new FormEvent($this, $request), Events::ADMIN_HANDLE_FORM);
}

public function getRequest(): Request
Expand Down Expand Up @@ -146,7 +146,7 @@ public function createView(): ViewInterface
throw new Exception('The handleRequest() method should be called before creating a view');
}
$event = new ViewEvent($this, $this->request);
$this->eventDispatcher->dispatch(Events::ADMIN_VIEW, $event);
$this->eventDispatcher->dispatch($event, Events::ADMIN_VIEW);

return $event->getView();
}
Expand Down Expand Up @@ -194,11 +194,13 @@ private function handleEntityForm(Request $request)
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
dump($form->getData());
//die;
if ($this->entities->isEmpty()) {
$this->entities->add($form->getData());
}
$event = new EntityEvent($this, $request);
$this->eventDispatcher->dispatch(Events::ENTITY_SAVE, $event);
$this->eventDispatcher->dispatch($event, Events::ENTITY_SAVE);
}
}
}
2 changes: 1 addition & 1 deletion src/Factory/FormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function createEntityForm(AdminInterface $admin, Request $request, $entit
])
;
$event = new FormEvent($admin, $request);
$this->eventDispatcher->dispatch(Events::FORM_PRE_CREATE_ENTITY_FORM, $event);
$this->eventDispatcher->dispatch($event, Events::FORM_PRE_CREATE_ENTITY_FORM);

foreach ($event->getFieldDefinitions() as $field => $definition) {
if (!$definition instanceof FieldDefinitionInterface) {
Expand Down
14 changes: 14 additions & 0 deletions src/Factory/FormFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@

interface FormFactoryInterface
{
/**
* @param AdminInterface $admin
* @param Request $request
* @param null $entity
*
* @return FormInterface
*/
public function createEntityForm(AdminInterface $admin, Request $request, $entity = null): FormInterface;

/**
* @param ActionInterface $action
* @param Request $request
* @param $entity
*
* @return FormInterface
*/
public function createDeleteForm(ActionInterface $action, Request $request, $entity): FormInterface;
}
15 changes: 13 additions & 2 deletions src/Resources/public/assets/admin.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Resources/public/assets/admin.js

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f8144a2

Please sign in to comment.