Quellcode durchsuchen

Divers

feature/ticket
Guillaume vor 3 Jahren
Ursprung
Commit
cdfbba7617
4 geänderte Dateien mit 56 neuen und 22 gelöschten Zeilen
  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 Datei anzeigen

@@ -1,4 +1,6 @@
twig:
default_path: '%kernel.project_dir%/templates'
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 Datei anzeigen

@@ -16,31 +16,31 @@ class DashboardAdminController extends CaracDashboardController

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),
]
);

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_password', '', 'sov_admin_account_password'),

+ 40
- 9
src/DataFixtures/CaracoleFixtures.php Datei anzeigen

@@ -11,6 +11,7 @@ use App\Entity\Config\Unit;
use App\Entity\Merchant\Merchant;
use App\Entity\Section\Section;
use App\Entity\User\User;
use App\Entity\User\UserMerchant;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager;
@@ -19,13 +20,17 @@ use Lc\SovBundle\Model\User\UserInterface;
class CaracoleFixtures extends Fixture
{
protected $em;
public function __construct(EntityManagerInterface $entityManager){

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

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

foreach (self::$unitsArray as $unit => $unitInfos) {
$unitEntity = new Unit();
@@ -68,6 +73,11 @@ class CaracoleFixtures extends Fixture
$hubBesac->setTitle('Besançon');
$hubBesac->setTaxRate($taxRate2);

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

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

@@ -78,7 +88,7 @@ class CaracoleFixtures extends Fixture
$hubBelfort->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1);
$hubBesac->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1);

$this->em->persist($charly);
$this->em->persist($fab);
$this->em->persist($gui);
$this->em->persist($taxRate);
@@ -93,7 +103,8 @@ class CaracoleFixtures extends Fixture
}


protected function createSectionBelfort($hubBelfort, $user){
protected function createSectionBelfort($hubBelfort, $user)
{
$sectionBelfort[0] = new Section();
$sectionBelfort[0]->setTitle('Marché');
$sectionBelfort[0]->setStatus(1);
@@ -136,7 +147,8 @@ class CaracoleFixtures extends Fixture
return $sectionBelfort;
}

protected function createSessionsBesak($hubBesak, $user){
protected function createSessionsBesak($hubBesak, $user)
{
$sectionBesac = new Section();
$sectionBesac->setTitle('Marché');
$sectionBesac->setStatus(1);
@@ -152,8 +164,7 @@ class CaracoleFixtures extends Fixture
return $sectionBesac;
}

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

return $fab;
}

protected
function createUserGui()
protected function createUserGui()
{
$gui = new User();
$gui->setEmail('guillaume@laclic.fr');
@@ -177,8 +188,28 @@ class CaracoleFixtures extends Fixture
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 = [
'piece' => [

+ 2
- 1
webpack.config.js Datei anzeigen

@@ -48,7 +48,8 @@ Encore
.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-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)
.enableStimulusBridge('./assets/controllers.json')

Laden…
Abbrechen
Speichern