Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
988b22c
update issue #605
oyeaussie Feb 12, 2025
3f93cfb
update #34, fix issue with core version not being updated.
oyeaussie Feb 12, 2025
e1de83a
update #34, working on uninstall.
oyeaussie Feb 12, 2025
7a94bbc
issue #34, Add menu to component during install. Fix issue with menu …
oyeaussie Feb 13, 2025
85abe5e
fix issue #606
oyeaussie Feb 13, 2025
e2caa7a
update issue #34
oyeaussie Feb 13, 2025
825371d
fix issue #607
oyeaussie Feb 13, 2025
4c85764
fix issue #608
oyeaussie Feb 13, 2025
f34fb20
fix issue #609
oyeaussie Feb 14, 2025
5f5b0e4
update issue #34, add setting for force uninstall a module even if it…
oyeaussie Feb 14, 2025
d848062
Initial commit #610
oyeaussie Feb 14, 2025
df821bd
update issue #609
oyeaussie Feb 14, 2025
126ea4a
update #34, uninstall
oyeaussie Feb 14, 2025
1286476
update issue #610 added check for apptype as well. If app type is not…
oyeaussie Feb 14, 2025
d00ee12
update #605. Fix bug where if you remove 1 module, it removes all.
oyeaussie Feb 14, 2025
15003fb
update #605, Fix bug where if you remove 1 module, it removes all.
oyeaussie Feb 14, 2025
8166598
update #34, update uninstall for app type. App type uninstall, uninst…
oyeaussie Feb 14, 2025
444f49e
update #610. Check if error component is installed or not.
oyeaussie Feb 14, 2025
91f30ca
update #609. If installed components is 0, remove all menu.
oyeaussie Feb 14, 2025
01b44ef
update #34, fixed some minor bugs with sync. Added proper response tr…
oyeaussie Feb 15, 2025
9d526b9
Fix issue #597
oyeaussie Feb 15, 2025
142d081
update #34. fix issue with pnotify messages popping up again from pre…
oyeaussie Feb 15, 2025
1d1e6aa
update issue #34 added db and menu uninstaller.
oyeaussie Feb 15, 2025
e8fbded
update #34, changed get methods for modules to getById as we need to …
oyeaussie Feb 15, 2025
7f65651
update #34, fix issue with queue errors not showing up.
oyeaussie Feb 15, 2025
115264b
update #34, remove and menu uninstall.
oyeaussie Feb 15, 2025
de1aeb3
update #34, fix minor bugs.
oyeaussie Feb 15, 2025
0b34a91
update #34, add import for only specific repository
oyeaussie Feb 16, 2025
fcefe1d
update #34, removeModule
oyeaussie Feb 16, 2025
7cdd355
update issue #34, moved apptype remove to queue so the queue process …
oyeaussie Feb 16, 2025
c192a3d
update #34, fixed bugs with apptype not being processed.
oyeaussie Feb 16, 2025
0f6e313
fix issue #613
oyeaussie Feb 17, 2025
c292a76
fix issue #611
oyeaussie Feb 17, 2025
46e9ec4
update #611. Add reset dependencies button for modules and bundles.
oyeaussie Feb 17, 2025
a91333f
update issue #611. baseviews need packages like adminltetags package …
oyeaussie Feb 17, 2025
c773cdb
update #611, fix bug with analyzing queue and syncing
oyeaussie Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions apps/Core/Components/Apps/AppsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ public function viewAction()
}
}

$this->view->modulesMenus = $this->basepackages->menus->getMenusForApp($app['id']);
$this->view->modulesMenus = $this->basepackages->menus->getMenusForAppType($app['app_type'], false);

//Components
$componentsArr = $this->modules->components->getComponentsForAppType($app['app_type']);
$componentsArr = $this->modules->components->getComponentsForAppType($app['app_type'], true);

if (count($componentsArr) === 0) {
$this->view->menuBaseStructure = $this->view->modulesMenus = [];
}

foreach ($componentsArr as $key => &$componentValue) {
if ($componentValue['apps']) {
if (is_string($componentValue['apps'])) {
Expand Down Expand Up @@ -163,7 +168,7 @@ public function viewAction()
}

//Middlewares
$middlewaresArr = $this->modules->middlewares->getMiddlewaresForAppType($app['app_type'], $app['id']);
$middlewaresArr = $this->modules->middlewares->getMiddlewaresForAppType($app['app_type'], $app['id'], true);
foreach ($middlewaresArr as $key => &$middlewareValue) {
if ($middlewareValue['apps']) {
if (is_string($middlewareValue['apps'])) {
Expand All @@ -189,7 +194,7 @@ public function viewAction()
}

//Views
$viewsArr = $this->modules->views->getViewsForAppType($app['app_type'], false);
$viewsArr = $this->modules->views->getViewsForAppType($app['app_type'], false, true);
if (count($viewsArr) === 1) {
array_push($mandatoryViews, $this->helper->first($viewsArr)['name']);

Expand Down
110 changes: 102 additions & 8 deletions apps/Core/Components/Devtools/Modules/ModulesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public function initialize()
*/
public function viewAction()
{
$this->view->bundles = false;
$this->view->bundlesjson = false;
if (isset($this->getData()['bundles'])) {
$this->view->bundles = true;

Expand Down Expand Up @@ -99,20 +101,79 @@ public function viewAction()
$modulesArr = $this->processModulesArr(msort($this->modules->{$modulesType}->{$modulesType}, 'name'));
${$modulesType . 'CategoryArr'} = $modulesArr['categoryArr'];
}

if ($modulesArr['modules'] && count($modulesArr['modules']) > 0) {
$modules[$modulesType]['value'] = ucfirst($modulesType);
$modules[$modulesType]['childs'] = $modulesArr['modules'];
if ($modulesType === 'views') {
if (isset($this->view->subview)) {
foreach ($modulesArr['modules'] as $moduleArrKey => $moduleArr) {
if (array_key_exists('is_subview', $moduleArr) &&
$moduleArr['is_subview'] == true
) {
continue;
}
$modules[$modulesType]['value'] = ucfirst($modulesType);
$modules[$modulesType]['childs'][$moduleArrKey] = $moduleArr;
}
} else if (!isset($this->view->subview)) {
$modules[$modulesType]['value'] = ucfirst($modulesType);
$modules[$modulesType]['childs'] = $modulesArr['modules'];
}
} else {
$modules[$modulesType]['value'] = ucfirst($modulesType);
$modules[$modulesType]['childs'] = $modulesArr['modules'];
}
} else {
$modules[$modulesType]['childs'] = [];
}
}

if (isset($this->getData()['type'])) {
// For all - core, apptype
// For components - packages, middlewares, views (only subview), externals
// For packages - middlewares, externals
// For middlewares - packages, externals
// For views (baseview) - packages (for any tag packages like adminltetags)
// For views (sub) - views (only baseview)
// For bundles - components, packages, middlewares, views, bundles, externals
if ($this->getData()['type'] === 'components') {
unset($modules['components']);
unset($modules['bundles']);
if (count($modules['views']['childs']) > 0) {
foreach ($modules['views']['childs'] as $childKey => $child) {
if ($child['is_subview'] != true) {
unset($modules['views']['childs'][$childKey]);
}
}
}
} else if ($this->getData()['type'] === 'packages') {
unset($modules['packages']);
unset($modules['views']);
unset($modules['bundles']);
$this->view->packageSettingsModules = $modules;
unset($modules['components']);
} else if ($this->getData()['type'] === 'middlewares') {
unset($modules['components']);
unset($modules['middlewares']);
unset($modules['views']);
unset($modules['bundles']);
} else if ($this->getData()['type'] === 'views') {
unset($modules['components']);
unset($modules['middlewares']);
unset($modules['bundles']);
if (!isset($this->view->subview)) {
unset($modules['views']);
}
}
}

$this->view->modules = $modules;

$modulesJson = [];

foreach ($modules as $moduleKey => $moduleJson) {
if ($moduleKey === 'bundles') {
if ($moduleKey === 'bundles' &&
!$this->view->bundles
) {
continue;
}

Expand Down Expand Up @@ -149,6 +210,11 @@ public function viewAction()

if ($type !== 'apptypes') {
if ($type !== 'core' && $type !== 'bundles') {
if (isset($modules['bundles'])) {
unset($modules['bundles']);
}
$this->view->modules = $modules;

$this->view->categoryArr = ${$type . 'CategoryArr'};

if ($type === 'components') {
Expand All @@ -165,7 +231,11 @@ public function viewAction()
$this->view->apis = $apis;
$this->view->moduleTypes = $this->modulesPackage->getModuleTypes();
$this->view->moduleSettings = $this->modulesPackage->getDefaultSettings();
$this->view->moduleDependencies = $this->modulesPackage->getDefaultDependencies($type);
if (isset($this->view->subview)) {
$this->view->moduleDependencies = $this->modulesPackage->getDefaultDependencies($type, true);
} else {
$this->view->moduleDependencies = $this->modulesPackage->getDefaultDependencies($type);
}
$this->view->moduleMenu = $this->helper->encode([]);
$this->view->moduleWidgets = $this->helper->encode([]);

Expand Down Expand Up @@ -388,7 +458,7 @@ public function viewAction()
$this->view->apis = $apis;
unset($appTypes['core']);//Remove core
$this->view->appTypes = $appTypes;
$this->view->bundleModules = $this->modulesPackage->getDefaultDependencies();
$this->view->bundleModules = $this->modulesPackage->getDefaultDependencies('bundles');

if ($this->getData()['id'] != 0) {
$bundle = $this->modules->bundles->getById($this->getData()['id']);
Expand All @@ -402,10 +472,18 @@ public function viewAction()
}
$this->view->bundle = $bundle;
$this->view->bundleModules = $bundle['bundle_modules'];
}

if (isset($modules['bundles'])) {
unset($modules['bundles']);
if (isset($modules['bundles']['childs'])) {
foreach ($modules['bundles']['childs'] as $childBundleKey => $childBundle) {
if ($bundle['id'] === $childBundle['id']) {
unset($modules['bundles']['childs'][$childBundleKey]);
}
}

if (count($modules['bundles']['childs']) === 0) {
unset($modules['bundles']);
}
}
}

$this->view->modules = $modules;
Expand Down Expand Up @@ -696,6 +774,22 @@ public function generateModuleRepoUrlAction()
}
}

public function getDefaultDependenciesAction()
{
$this->requestIsPost();

$this->modulesPackage->getDefaultDependencies($this->postData()['type'], $this->postData()['is_subview']);

$this->addResponse(
$this->modulesPackage->packagesData->responseMessage,
$this->modulesPackage->packagesData->responseCode
);

if ($this->modulesPackage->packagesData->responseData) {
$this->view->responseData = $this->modulesPackage->packagesData->responseData;
}
}

public function checkVersionAction()
{
$this->requestIsPost();
Expand Down
14 changes: 14 additions & 0 deletions apps/Core/Components/Errors/ErrorsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,27 @@ public function controllerNotFoundAction()
$this->addResponse('Component Not Found', 1);
}

public function controllerDependencyErrorAction()
{
$this->view->pick('common/errors/controllerdependencyerror');

$this->addResponse('Component Dependency Error', 1);
}

public function actionNotFoundAction()
{
$this->view->pick('common/errors/actionnotfound');

$this->addResponse('Component Action Not Found', 1);
}

public function templateErrorAction()
{
$this->view->pick('common/errors/templateerror');

$this->addResponse('Template For Component Not Found', 1);
}

public function routeNotFoundAction()
{
$this->view->pick('common/errors/routenotfound');
Expand Down
11 changes: 6 additions & 5 deletions apps/Core/Components/Home/HomeComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ class HomeComponent extends BaseComponent
public function viewAction()
{
try {
$defaultComponentId = $this->app['default_component'];

if ($this->app['default_component'] == 0) {
$dashboardComponent = $this->modules->components->getComponentByRouteForAppId('dashboards');
return;
}

$defaultComponent = $this->modules->components->getById($this->app['default_component']);

$defaultComponentId = $dashboardComponent['id'];
if ($defaultComponent['class'] === get_class($this)) {
return;
}

$defaultComponent = $this->modules->components->getById($defaultComponentId);
$controller = $this->helper->last(explode('/', $defaultComponent['route']));
$routeArr = explode('/', $defaultComponent['route']);
unset($routeArr[$this->helper->lastKey($routeArr)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public function viewAction()
if (is_string($view['settings'])) {
$view['settings'] = $this->helper->decode($view['settings'], true);
}
if (is_array($view['settings']['branding'])) {

if (isset($view['settings']['branding']) &&
is_array($view['settings']['branding'])
) {
foreach ($view['settings']['branding'] as $brandKey => $brand) {

if (is_array($brand) && !isset($brand['brand'])) {
Expand Down
82 changes: 62 additions & 20 deletions apps/Core/Packages/Devtools/Modules/DevtoolsModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,32 +671,64 @@ public function getDefaultSettings()
return $this->helper->encode($defaultSettings);
}

public function getDefaultDependencies($type = null)
public function getDefaultDependencies($type, $isSubView = false)
{
// For all - core, apptype
// For components - packages, middlewares, views (only subview), externals
// For packages - middlewares, externals
// For middlewares - packages, externals
// For views (baseview) - packages (for any tag packages like adminltetags)
// For views (sub) - views (only baseview)
// For bundles - components, packages, middlewares, views, bundles, externals

$defaultDependencies =
[
'core' => [],
'apptype' => [],
'components' => [],
'packages' => [],
'middlewares' => [],
'views' => [],
'external' => [
'composer' => [
'require' => []
],
'config' => [
'allow-plugins' => []
],
'extra' => [
'patches' => []
]
'apptype' => []
];

$externalDependencies =
[
'composer' =>
[
'require' => []
],
'config' =>
[
'allow-plugins' => []
],
'extra' =>
[
'patches' => []
]
];

if ($type && $type === 'views') {
unset($defaultDependencies['external']);
}
if ($type === 'components') {
$defaultDependencies['packages'] = [];
$defaultDependencies['middlewares'] = [];
$defaultDependencies['views'] = [];
$defaultDependencies['externals'] = $externalDependencies;
} else if ($type === 'packages') {
$defaultDependencies['middlewares'] = [];
$defaultDependencies['externals'] = $externalDependencies;
} else if ($type === 'middlewares') {
$defaultDependencies['packages'] = [];
$defaultDependencies['externals'] = $externalDependencies;
} else if ($type === 'views') {
$defaultDependencies['packages'] = [];
if ($isSubView == 'true') {
$defaultDependencies['views'] = [];
}
} else if ($type === 'bundles') {
$defaultDependencies['components'] = [];
$defaultDependencies['packages'] = [];
$defaultDependencies['middlewares'] = [];
$defaultDependencies['views'] = [];
$defaultDependencies['bundles'] = [];
$defaultDependencies['externals'] = $externalDependencies;
}

$this->addResponse('Generated default dependencies', 0, ['defaultDependencies' => $defaultDependencies]);

return $this->helper->encode($defaultDependencies);
}
Expand Down Expand Up @@ -945,7 +977,11 @@ protected function getModuleJsonFileLocation(&$data)

$routePath = implode('/', $pathArr) . '/Install/';
} else if ($data['module_type'] === 'views') {
if ($data['base_view_module_id'] == 0) {
if ($data['is_subview'] == true &&
$data['base_view_module_id'] == 0
) {
throw new \Exception('View dependency for this subview not set.');
} else if ($data['base_view_module_id'] == 0) {
$routePath = $data['name'] . '/';
} else {
$baseView = $this->modules->views->getViewById($data['base_view_module_id']);
Expand Down Expand Up @@ -3044,6 +3080,12 @@ public function generateModuleRepoUrl($data)

if ($data['module_type'] === 'views' && isset($data['is_subview']) && $data['is_subview'] == 'true') {
$baseView = $this->modules->views->getViewById($data['base_view_module_id']);

if (!$baseView) {
$this->addResponse('View dependency for this subview not set.', 1);

return false;
}
}

if ($data['module_type'] === 'components' || $data['module_type'] === 'apps_types') {
Expand Down
Loading