-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
movements of features from project-base to packages (#3735)
- Loading branch information
Showing
116 changed files
with
4,281 additions
and
388 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,22 @@ | ||
import Register from '../../common/utils/Register'; | ||
|
||
(new Register()).registerCallback($container => { | ||
const getCheckedPositionName = function () { | ||
return $('#advert_form_settings_positionName').val(); | ||
}; | ||
|
||
const initAdvertForm = function () { | ||
const positionNamesWithCategoryTree = [ | ||
'productListSecondRow' | ||
]; | ||
|
||
if (positionNamesWithCategoryTree.includes(getCheckedPositionName())) { | ||
$('#advert_form_settings').find('.js-category-tree-form').closest('.form-line').show(); | ||
} else { | ||
$('#advert_form_settings').find('.js-category-tree-form').closest('.form-line').hide(); | ||
} | ||
}; | ||
|
||
initAdvertForm(); | ||
$('#advert_form_settings_positionName').change(initAdvertForm); | ||
}); |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import './advert'; | ||
import './AdministratorForm'; | ||
import './AdvancedSearch'; | ||
import './AjaxConfirm'; | ||
|
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,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shopsys\FrameworkBundle\Controller\Admin; | ||
|
||
use Shopsys\FrameworkBundle\Component\Setting\Setting; | ||
use Shopsys\FrameworkBundle\Form\Admin\CspHeaderSetting\CspHeaderSettingFormType; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class CspHeaderController extends AdminBaseController | ||
{ | ||
/** | ||
* @param \Shopsys\FrameworkBundle\Component\Setting\Setting $setting | ||
*/ | ||
public function __construct(protected readonly Setting $setting) | ||
{ | ||
} | ||
|
||
/** | ||
* @param \Symfony\Component\HttpFoundation\Request $request | ||
* @return \Symfony\Component\HttpFoundation\Response | ||
*/ | ||
#[Route(path: 'superadmin/csp-header-setting/')] | ||
public function settingAction(Request $request): Response | ||
{ | ||
$formData = ['cspHeader' => $this->setting->get(Setting::CSP_HEADER)]; | ||
|
||
$form = $this->createForm(CspHeaderSettingFormType::class, $formData); | ||
$form->handleRequest($request); | ||
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$this->setting->set(Setting::CSP_HEADER, $form->getData()['cspHeader']); | ||
$this->addSuccessFlashTwig(t('Content-Security-Policy header has been set.')); | ||
} | ||
|
||
return $this->render('@ShopsysFramework/Admin/Content/CspHeader/setting.html.twig', [ | ||
'form' => $form->createView(), | ||
]); | ||
} | ||
} |
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.