Browse Source

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/CaracoleSkeleton into develop

feature/ticket
Fab 3 years ago
parent
commit
7b4e2207e2
4 changed files with 56 additions and 22 deletions
  1. +3
    -1
      config/packages/twig.yaml
  2. +11
    -11
      src/Controller/Dashboard/DashboardAdminController.php
  3. +40
    -9
      src/DataFixtures/CaracoleFixtures.php
  4. +2
    -1
      webpack.config.js

+ 3
- 1
config/packages/twig.yaml View File

twig: twig:
default_path: '%kernel.project_dir%/templates' default_path: '%kernel.project_dir%/templates'
globals: globals:
app_locales: "%app.locales%"
app_locales: "%app.locales%"
section_resolver: '@Lc\CaracoleBundle\Resolver\SectionResolver'
merchant_resolver: '@Lc\CaracoleBundle\Resolver\MerchantResolver'

+ 11
- 11
src/Controller/Dashboard/DashboardAdminController.php View File



public function configureMenuItems(): iterable public function configureMenuItems(): iterable
{ {
yield MenuItem::linkToDashboard('dashboard', 'circle');
yield MenuItem::linkToDashboard('dashboard', 'far fa-circle');


yield MenuItem::linkToCrud('page', 'copy', Page::class);
yield MenuItem::subMenu('user', 'user')->setSubItems(
yield MenuItem::linkToCrud('page', 'far fa-copy', Page::class);
yield MenuItem::subMenu('user', 'far fa-user')->setSubItems(
[ [
MenuItem::linkToCrud('user_index', '', User::class), MenuItem::linkToCrud('user_index', '', User::class),
MenuItem::linkToCrud('user_merchant_index', '', UserMerchant::class), MenuItem::linkToCrud('user_merchant_index', '', UserMerchant::class),
] ]
); );


yield MenuItem::subMenu('setting', 'circle')->setSubItems(
yield MenuItem::subMenu('setting', 'far fa-circle')->setSubItems(
[ [
MenuItem::linkToRoute('setting_merchant', 'circle', 'carac_admin_setting_merchant'),
MenuItem::linkToRoute('setting_section', 'circle', 'carac_admin_setting_section'),
MenuItem::linkToRoute('setting_merchant', '', 'carac_admin_setting_merchant'),
MenuItem::linkToRoute('setting_section', '', 'carac_admin_setting_section'),
] ]
); );


yield MenuItem::subMenu('admin', 'circle')->setSubItems(
yield MenuItem::subMenu('admin', 'far fa-circle')->setSubItems(
[ [
MenuItem::linkToCrud('admin_merchant', 'circle', Merchant::class),
MenuItem::linkToCrud('admin_section', 'circle', Section::class),
MenuItem::linkToCrud('admin_tva', 'circle', TaxRate::class),
MenuItem::linkToCrud('admin_merchant', '', Merchant::class),
MenuItem::linkToCrud('admin_section', '', Section::class),
MenuItem::linkToCrud('admin_tva', '', TaxRate::class),
] ]
); );


yield MenuItem::subMenu('account', 'user')->setSubItems(
yield MenuItem::subMenu('account', 'far fa-user')->setSubItems(
[ [
MenuItem::linkToRoute('account_profile', '', 'sov_admin_account_profile'), MenuItem::linkToRoute('account_profile', '', 'sov_admin_account_profile'),
MenuItem::linkToRoute('account_password', '', 'sov_admin_account_password'), MenuItem::linkToRoute('account_password', '', 'sov_admin_account_password'),

+ 40
- 9
src/DataFixtures/CaracoleFixtures.php View File

use App\Entity\Merchant\Merchant; use App\Entity\Merchant\Merchant;
use App\Entity\Section\Section; use App\Entity\Section\Section;
use App\Entity\User\User; use App\Entity\User\User;
use App\Entity\User\UserMerchant;
use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManager;
class CaracoleFixtures extends Fixture class CaracoleFixtures extends Fixture
{ {
protected $em; protected $em;
public function __construct(EntityManagerInterface $entityManager){

public function __construct(EntityManagerInterface $entityManager)
{
$this->em = $entityManager; $this->em = $entityManager;
} }

public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$fab = $this->createUserFab(); $fab = $this->createUserFab();
$gui = $this->createUserGui(); $gui = $this->createUserGui();
$charly = $this->createUserCharly();


foreach (self::$unitsArray as $unit => $unitInfos) { foreach (self::$unitsArray as $unit => $unitInfos) {
$unitEntity = new Unit(); $unitEntity = new Unit();
$hubBesac->setTitle('Besançon'); $hubBesac->setTitle('Besançon');
$hubBesac->setTaxRate($taxRate2); $hubBesac->setTaxRate($taxRate2);


$this->createUserMerchant($fab, $hubBelfort) ;
$this->createUserMerchant($fab, $hubBesac) ;
$this->createUserMerchant($gui, $hubBelfort) ;
$this->createUserMerchant($gui, $hubBesac) ;

$this->createSessionsBesak($hubBesac, $fab); $this->createSessionsBesak($hubBesac, $fab);
$this->createSectionBelfort($hubBelfort, $fab); $this->createSectionBelfort($hubBelfort, $fab);


$hubBelfort->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1); $hubBelfort->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1);
$hubBesac->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1); $hubBesac->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1);


$this->em->persist($charly);
$this->em->persist($fab); $this->em->persist($fab);
$this->em->persist($gui); $this->em->persist($gui);
$this->em->persist($taxRate); $this->em->persist($taxRate);
} }




protected function createSectionBelfort($hubBelfort, $user){
protected function createSectionBelfort($hubBelfort, $user)
{
$sectionBelfort[0] = new Section(); $sectionBelfort[0] = new Section();
$sectionBelfort[0]->setTitle('Marché'); $sectionBelfort[0]->setTitle('Marché');
$sectionBelfort[0]->setStatus(1); $sectionBelfort[0]->setStatus(1);
return $sectionBelfort; return $sectionBelfort;
} }


protected function createSessionsBesak($hubBesak, $user){
protected function createSessionsBesak($hubBesak, $user)
{
$sectionBesac = new Section(); $sectionBesac = new Section();
$sectionBesac->setTitle('Marché'); $sectionBesac->setTitle('Marché');
$sectionBesac->setStatus(1); $sectionBesac->setStatus(1);
return $sectionBesac; return $sectionBesac;
} }


protected
function createUserFab()
protected function createUserFab()
{ {
$fab = new User(); $fab = new User();
$fab->setEmail('fab@laclic.fr'); $fab->setEmail('fab@laclic.fr');
$fab->setFirstname('Fab'); $fab->setFirstname('Fab');
$fab->setPassword('$2y$13$ExSKxXX8bQ20fBocZrUAJugov2MfE2x14BxsQaVyODsousxPWS2gS'); $fab->setPassword('$2y$13$ExSKxXX8bQ20fBocZrUAJugov2MfE2x14BxsQaVyODsousxPWS2gS');
$fab->setRoles(array('ROLE_ADMIN', 'ROLE_SUPER_ADMIN')); $fab->setRoles(array('ROLE_ADMIN', 'ROLE_SUPER_ADMIN'));

return $fab; return $fab;
} }


protected
function createUserGui()
protected function createUserGui()
{ {
$gui = new User(); $gui = new User();
$gui->setEmail('guillaume@laclic.fr'); $gui->setEmail('guillaume@laclic.fr');
return $gui; return $gui;
} }


protected function createUserCharly()
{
$charly = new User();
$charly->setEmail('charly@laclic.fr');
$charly->setLastname('Charly');
$charly->setFirstname('Mainier');
$charly->setPassword('$argon2id$v=19$m=65536,t=4,p=1$5eVep168MSPP4klWgyPMrQ$1qrwInxOzS5PxNML2ZmneUeNeoAeD2o6CmZhp5iMaec');
$charly->setRoles(array('ROLE_ADMIN', 'ROLE_SUPER_ADMIN'));
return $charly;
}



public function createUserMerchant($user, $merchant)
{
$userMerchant = new UserMerchant() ;
$userMerchant->setUser($user) ;
$userMerchant->setMerchant($merchant) ;
$userMerchant->setCreditActive(false) ;
$userMerchant->setActive(true) ;
$userMerchant->setRoles(array('ROLE_ADMIN', 'ROLE_SUPER_ADMIN')) ;
$this->em->persist($userMerchant); ;
return $userMerchant ;
}


public static $unitsArray = [ public static $unitsArray = [
'piece' => [ 'piece' => [

+ 2
- 1
webpack.config.js View File

.addEntry('adminlte-sort', './Lc/SovBundle/Resources/assets/app/adminlte/sort/app.sort.js') .addEntry('adminlte-sort', './Lc/SovBundle/Resources/assets/app/adminlte/sort/app.sort.js')
.addEntry('adminlte-field-filemanager', './Lc/SovBundle/Resources/assets/app/adminlte/field/filemanager/app.filemanager.js') .addEntry('adminlte-field-filemanager', './Lc/SovBundle/Resources/assets/app/adminlte/field/filemanager/app.filemanager.js')
.addEntry('adminlte-field-collection', './Lc/SovBundle/Resources/assets/app/adminlte/field/collection/app.collection.js') .addEntry('adminlte-field-collection', './Lc/SovBundle/Resources/assets/app/adminlte/field/collection/app.collection.js')
.addEntry('common-switch-merchant', './Lc/CaracoleBundle/Resources/assets/app/switchmerchant/app.switchmerchant.js')
.addEntry('carac-switch-merchant', './Lc/CaracoleBundle/Resources/assets/app/switchmerchant/app.switchmerchant.js')
.addEntry('carac-common', './Lc/CaracoleBundle/Resources/assets/app/adminlte/common/app.common.js')


// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js) // enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
.enableStimulusBridge('./assets/controllers.json') .enableStimulusBridge('./assets/controllers.json')

Loading…
Cancel
Save