Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications tab + new hierarchy #9454

Merged
merged 25 commits into from Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0229ba0
Introduce new controler for tab notifications, renamed alerts
Quetzacoalt91 Jun 26, 2018
3935ce2
Introduce new controler for module updates
Quetzacoalt91 Jun 26, 2018
d968132
Add upgrade file for adding new module updates tab
Quetzacoalt91 Jun 26, 2018
915b527
Fix tab link AdminModuleUpdates
Quetzacoalt91 Jun 26, 2018
7981795
Update notification count call to update several tabs
Quetzacoalt91 Jun 26, 2018
b5c53ac
Update tab notifications > Alerts
Quetzacoalt91 Jun 27, 2018
d5aee10
Add Updates tab in installation data
Quetzacoalt91 Jul 2, 2018
a7ed5ea
Rename Notifications Tab in upgrade script
Quetzacoalt91 Jul 2, 2018
dbc11c8
Replace return; with continue;
Quetzacoalt91 Jul 2, 2018
12ef0e0
Allow all BO tabs to have a notification count
Quetzacoalt91 Jul 2, 2018
3d775b2
Rename ModuleAbstractController & Add PHPDoc
Quetzacoalt91 Jul 3, 2018
ee46c4e
Use AddonsCollection for module presenter
Quetzacoalt91 Jul 3, 2018
0af2a66
Remove TODO
Quetzacoalt91 Jul 3, 2018
24dbcb1
Add new module controllers to survival tests
Quetzacoalt91 Jul 3, 2018
9e87208
Allow array & AddonsCollection to be sent
Quetzacoalt91 Jul 9, 2018
760ac37
Merge branch 'develop' of github.com:PrestaShop/PrestaShop into new-m…
PierreRambaud Jul 25, 2018
ff706ed
Continue refactoring
PierreRambaud Jul 27, 2018
c79a0b1
Fix undefined routes
PierreRambaud Aug 16, 2018
e455e21
Merge branch 'develop' of github.com:PrestaShop/PrestaShop into featu…
PierreRambaud Aug 16, 2018
407be44
Address @tomlev comments
PierreRambaud Aug 17, 2018
b89f343
Fix tests
PierreRambaud Aug 17, 2018
0a570b8
Merge branch 'develop' of github.com:PrestaShop/PrestaShop into featu…
PierreRambaud Aug 23, 2018
bfa2aa5
Rename all tabs
PierreRambaud Aug 24, 2018
6d87a6c
Change menu order & names
PierreRambaud Aug 27, 2018
955cb90
Merge branch 'develop' of github.com:PrestaShop/PrestaShop into featu…
PierreRambaud Aug 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -31,6 +31,7 @@
use PrestaShop\PrestaShop\Core\Addon\AddonListFilterStatus;
use PrestaShop\PrestaShop\Core\Addon\AddonListFilterType;
use PrestaShop\PrestaShop\Core\Addon\AddonsCollection;
use PrestaShop\PrestaShop\Adapter\Module\Module as ApiModule;
use PrestaShop\PrestaShop\Core\Addon\Module\ModuleRepository;
use PrestaShop\PrestaShop\Core\Addon\Module\Exception\UnconfirmedModuleActionException;
use PrestaShopBundle\Controller\Admin\Improve\Modules\ModuleAbstractController;
Expand All @@ -55,7 +56,8 @@ class ModuleController extends ModuleAbstractController
const CONTROLLER_NAME = 'ADMINMODULESSF';

/**
* @AdminSecurity("is_granted(['read', 'create'], 'ADMINMODULESSF_')")
* @AdminSecurity("is_granted(['read', 'create', 'update', 'delete'], 'ADMINMODULESSF_')")
*
* @return Response
*/
public function catalogAction()
Expand Down Expand Up @@ -83,7 +85,7 @@ public function catalogAction()
/**
* Controller responsible for displaying "Catalog Module Grid" section of Module management pages with ajax.
*
* @AdminSecurity("is_granted(['read', 'create'], 'ADMINMODULESSF_')")
* @AdminSecurity("is_granted(['read', 'create', 'update', 'delete'], 'ADMINMODULESSF_')")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we ask for all privileges to reach the catalog content? Modules actions should are allowed accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't delete something you can't see :D
This is how it's configure in many Symfony controller, just did the same thing :/

*
* @param Request $request
*
Expand Down Expand Up @@ -148,7 +150,7 @@ public function manageAction()
}

/**
* @AdminSecurity("is_granted(['read', 'create'], 'ADMINMODULESSF_')")
* @AdminSecurity("is_granted(['read', 'create', 'update', 'delete'], 'ADMINMODULESSF_')")
*
* @param Request $request
* @return Response
Expand Down Expand Up @@ -302,7 +304,9 @@ public function refreshCatalogAction(Request $request)
$deniedAccess = $this->checkPermissions(
[
PageVoter::LEVEL_READ,
PageVoter::LEVEL_CREATE
PageVoter::LEVEL_CREATE,
PageVoter::LEVEL_DELETE,
PageVoter::LEVEL_UPDATE
]
);
if (null !== $deniedAccess) {
Expand Down Expand Up @@ -727,8 +731,10 @@ private function constructJsonCatalogCategoriesMenuResponse($categoriesMenu)
/**
* Find module type
*
* @param ApiModule $installedProduct Installed product
* @param array $modulesTheme Modules theme
*/
private function findModuleType(object $installedProduct, $modulesTheme)
private function findModuleType(ApiModule $installedProduct, array $modulesTheme)
{
if (in_array($installedProduct->attributes->get('name'), $modulesTheme)) {
return 'theme_bundle';
Expand Down
Expand Up @@ -91,3 +91,10 @@ admin_module_notification_count:
defaults:
_controller: PrestaShopBundle:Admin\Improve\Modules\Alerts:notificationsCount
_legacy_controller: AdminModulesNotifications

admin_module_updates:
path: /updates
methods: [GET]
defaults:
_controller: PrestaShopBundle:Admin/Improve/Modules/Updates:index
_legacy_controller: AdminModulesUpdates
Expand Up @@ -3,7 +3,7 @@ admin_addons_login:
methods: [POST]
defaults:
_controller: PrestaShopBundle:Admin/Addons:login

admin_addons_logout:
path: /logout
methods: [GET]
Expand Down