-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from smartbooster/using_history_feature_from_c…
…ore_bundle New show_history_field based on tailwind class
- Loading branch information
Showing
41 changed files
with
967 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
UPGRADE FROM 2.X to 3.0 | ||
=================== | ||
|
||
## BC Break | ||
|
||
This section list all the changes that are considered BC Break and will node code adjustment from upgrading to version 3 (not released yet). | ||
|
||
### Entity | ||
|
||
- Remove `Smart\SonataBundle\Entity\Log\BatchLog`, use `Smart\CoreBundle\Entity\ProcessTrait` and `Smart\CoreBundle\Entity\ProcessInterface` instead | ||
- Remove `Smart\SonataBundle\Entity\Log\HistorizableInterface`, use `Smart\CoreBundle\Entity\Log\HistorizableInterface` instead | ||
- Remove `Smart\SonataBundle\Entity\Log\HistorizableTrait`, use `Smart\CoreBundle\Entity\Log\HistorizableTrait` instead | ||
|
||
### Logger | ||
|
||
- Remove `Smart\SonataBundle\Logger\BatchLogger`, use `Smart\CoreBundle\Monitor\ProcessMonitor` instead | ||
- Remove `Smart\SonataBundle\Logger\HistoryLogger`, use `Smart\CoreBundle\Logger\HistoryLogger` instead | ||
|
||
### Security | ||
|
||
- `SmartUserInterface` now extends `MailableInterface` so you need to define his methods | ||
|
||
### Templates | ||
|
||
- Remove `timeline_history_field.html.twig`, use `show_history_field.html.twig` instead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,9 @@ | |
@apply font-semibold; | ||
} | ||
} | ||
p { | ||
img { | ||
@apply block; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Smart\SonataBundle\Admin\Extension; | ||
|
||
use Smart\CoreBundle\Entity\Log\HistorizableInterface; | ||
use Sonata\AdminBundle\Admin\AbstractAdminExtension; | ||
use Sonata\AdminBundle\Show\ShowMapper; | ||
|
||
/** | ||
* @author Mathieu Ducrot <[email protected]> | ||
*/ | ||
class HistoryExtension extends AbstractAdminExtension | ||
{ | ||
public function configureShowFields(ShowMapper $show): void | ||
{ | ||
$admin = $show->getAdmin(); | ||
$subject = $admin->getSubject(); | ||
if (!$subject instanceof HistorizableInterface) { | ||
return; | ||
} | ||
|
||
$tabs = $admin->getShowTabs(); | ||
if (count($tabs) === 1 && $tabs[array_key_first($tabs)]['auto_created']) { | ||
$show->end(); | ||
} | ||
$groups = $admin->getShowGroups(); | ||
if (!isset($tabs['history_tab'])) { | ||
$show->tab('history_tab', ['label' => 'label.history']); | ||
if (!isset($groups['history_group'])) { | ||
$show->with('history_group', ['label' => 'label.history']); | ||
} | ||
} | ||
|
||
if (!$show->has('history')) { | ||
$show->add('history', null, ['template' => $admin->showHistoryTemplate ?? '@SmartSonata/admin/base_field/show_history_field.html.twig']); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.