Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions apps/Core/Components/Devtools/Modules/ModulesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
namespace Apps\Core\Components\Devtools\Modules;

use Apps\Core\Packages\Devtools\Modules\DevtoolsModules;
use League\Flysystem\FilesystemException;
use League\Flysystem\UnableToCheckExistence;
use League\Flysystem\UnableToListContents;
use League\Flysystem\UnableToRetrieveMetadata;
use System\Base\BaseComponent;
use z4kn4fein\SemVer\Version;

Expand Down Expand Up @@ -176,6 +180,30 @@ public function viewAction()
unset($modules['views']);
}
}
} else if (isset($this->getData()['changes']) &&
$this->getData()['changes'] == true
) {
unset($modules['core']);
unset($modules['apptypes']);
unset($modules['bundles']);

foreach ($modules as $moduleType => &$modulesTypeArr) {
if (isset($modulesTypeArr['childs']) && count($modulesTypeArr['childs']) > 0) {
foreach ($modulesTypeArr['childs'] as $childKey => &$child) {
$child = $this->modulesPackage->validateFilesHash($child);

if ($child['repoExists'] && !$child['isModified']) {
unset($modules[$moduleType]['childs'][$childKey]);
}
}
}
}

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

$this->view->pick('modules/changes');

return;
}

$this->view->modules = $modules;
Expand Down
99 changes: 56 additions & 43 deletions apps/Core/Components/Devtools/Test/Install/component.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,58 @@
{
"route" : "devtools/test",
"name" : "Test",
"description" : "Test anything in this component.",
"module_type" : "components",
"app_type" : "core",
"category" : "devtools",
"version" : "0.0.0",
"repo" : "https://.../dash-component-system-devtools-test",
"class" : "Apps\\Core\\Components\\Devtools\\Test\\TestComponent",
"dependencies" : {
"core" : {
"name" : "Core",
"version" : "0.0.0",
"repo" : "https://.../"
},
"components" : [],
"packages" :
[
{
"name" : "Test",
"version" : "0.0.0",
"repo" : "https://.../dash-package-system-devtools-test"
}
],
"middlewares" : [],
"views" : [],
"external" : []
},
"menu" : {
"seq" : 99,
"devtools" : {
"title" : "devtools",
"icon" : "code",
"childs" : {
"test" : {
"title" : "test",
"link" : "devtools/test"
}
}
}
},
"settings" : {
}
"name" : "Test",
"route" : "devtools/test",
"description" : "Test anything in this component.",
"module_type" : "components",
"app_type" : "core",
"category" : "devtools",
"version" : "0.0.0",
"repo" : "https://.../dash-component-system-devtools-test",
"class" : "Apps\\Core\\Components\\Devtools\\Test\\TestComponent",
"dependencies" :
{
"core" :
{
"name" : "Core",
"version" : "0.0.0",
"repo" : "https://.../"
},
"apptype" : [],
"packages" : [],
"middlewares" : [],
"views" : [],
"externals" :
{
"composer" :
{
"require" : []
},
"config" :
{
"allow-plugins" : []
},
"extra" :
{
"patches" : []
}
}
},
"menu" :
{
"seq" : 99,
"devtools" :
{
"title" : "devtools",
"icon" : "code",
"childs" :
{
"test" :
{
"title" : "test",
"link" : "devtools/test"
}
}
}
},
"settings" : [],
"widgets" : []
}
75 changes: 53 additions & 22 deletions apps/Core/Components/Devtools/Test/TestComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,24 @@
namespace Apps\Core\Components\Devtools\Test;

use Apps\Core\Packages\Devtools\DicExtractData\DevtoolsDicExtractData;
use Apps\Core\Packages\Devtools\Test\DevtoolsTest;
use System\Base\BaseComponent;

class TestComponent extends BaseComponent
{
protected $testPackage;

public function initialize()
{
$this->testPackage = new DevtoolsTest;
}

/**
* @acl(name=view)
*/
public function viewAction()
{
// $install = new \Apps\Fintech\Components\Dashboards\Install\Install;

// $install->init()->install();
// $adminComponents = $this->basepackages->utils->scanDir('apps/Core/Components/', true);

// foreach ($adminComponents['files'] as $adminComponentKey => $adminComponent) {
// if (strpos($adminComponent, 'component.json')) {
// try {
// $jsonFile =
// $this->helper->decode(
// $this->localContent->read($adminComponent),
// true
// );
// } catch (\throwable $e) {
// throw new \Exception($e->getMessage() . '. Problem reading component.json at location ' . $adminComponent);
// }

// if ($jsonFile['menu'] && $jsonFile['menu'] !== 'false') {
// $this->basepackages->menus->addMenu($jsonFile);
// }
// }
// }
return;
}

/**
Expand Down Expand Up @@ -82,4 +69,48 @@ public function apiRemoveAction()
{
$this->addResponse('Test', 0, ['remove' => true]);
}

public function testAction()
{
if ($this->basepackages->progress->checkProgressFile()) {
$this->basepackages->progress->deleteProgressFile();
}

$this->basepackages->progress->registerMethods(
[
[
'method' => 'testTest',
'text' => 'Test',
],
[
'method' => 'testTest',
'text' => 'Test',
],
[
'method' => 'testTest',
'text' => 'Test',
],
[
'method' => 'testDownload',
'text' => 'Download Data...',
'remoteWeb' => true
],
// [
// 'method' => 'testProcess',
// 'text' => 'Process Data...',
// 'steps' => true
// ]
]
);

$this->testPackage->testTest();
$this->testPackage->testTest();
$this->testPackage->testTest();
$this->testPackage->testDownload();

$this->addResponse(
$this->testPackage->packagesData->responseMessage,
$this->testPackage->packagesData->responseCode
);
}
}
4 changes: 2 additions & 2 deletions apps/Core/Components/Register/RegisterComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public function viewAction()
return;
}

$this->view->refresh = false;

if (isset($this->getData()['api'])) {
$api = $this->api->getById($this->getData()['api']);

Expand Down Expand Up @@ -144,8 +146,6 @@ public function viewAction()
$this->response->setStatusCode(404);

return $this->response->send();

exit;
}

$this->view->setLayout('auth');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public function viewAction()
$this->view->apiLocations = $this->apiPackage->apiLocations;

if (isset($this->getData()['id'])) {
if (isset($this->getData()['clone'])) {
$this->view->clone = true;
}

if ($this->getData()['id'] != 0) {
$api = $this->apiPackage->getApiById($this->getData()['id']);

Expand Down Expand Up @@ -96,6 +100,7 @@ function ($dataArr) {
'actionsToEnable' =>
[
'edit' => 'system/api/client/services',
'clone' => 'system/api/client/services',
'remove' => 'system/api/client/services/remove'
]
];
Expand Down
28 changes: 28 additions & 0 deletions apps/Core/Components/System/Progress/ProgressComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,32 @@ public function getProgressAction()
);
}
}

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

$fileName = $this->session->getId();

if (isset($this->postData()['session'])) {
$fileName = $this->postData()['session'];
} else if (isset($this->postData()['file_name'])) {
$fileName = $this->postData()['file_name'];
}

$progress = $this->basepackages->progress->cancelProgress($fileName);

if ($progress) {
$this->addResponse(
$this->basepackages->progress->packagesData->responseMessage,
$this->basepackages->progress->packagesData->responseCode,
$progress,
);
} else {
$this->addResponse(
$this->basepackages->progress->packagesData->responseMessage,
$this->basepackages->progress->packagesData->responseCode
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,12 @@ protected function generateRowsContent()
}

foreach ($column as $controlKey => $control) {

$this->dtParams['dtControlsLinkClass'] =
isset($this->params['dtControlsLinkClass']) ?
$this->params['dtControlsLinkClass'] :
'contentAjaxLink';

if ($controlKey === 'view') {

if (is_array($control)) {
$control = $control['link'];
$title =
Expand Down Expand Up @@ -410,7 +408,6 @@ protected function generateRowsContent()
]
);
} else if ($controlKey === 'edit') {

if (is_array($control)) {
$control = $control['link'];
$title =
Expand Down Expand Up @@ -444,8 +441,41 @@ protected function generateRowsContent()
]
]
);
} else if ($controlKey === 'remove') {
} else if ($controlKey === 'clone') {
if (is_array($control)) {
$control = $control['link'];
$title =
isset($control['title']) ?
strtoupper($control['title']) :
'CLONE';
$icon =
isset($control['icon']) ?
strtoupper($control['icon']) :
'clone';
$type =
isset($control['type']) ?
strtoupper($control['type']) :
'primary';

} else {
$title = 'CLONE';
$icon = 'clone';
$type = 'primary';
}

$controlButtons = array_merge($controlButtons,
[
$controlKey =>
[
'title' => $title,
'additionalClass' => 'rowEdit ' . $this->dtParams['dtControlsLinkClass'],
'icon' => $icon,
'buttonType' => $type,
'link' => $control
]
]
);
} else if ($controlKey === 'remove') {
if (is_array($control)) {
$control = $control['link'];
$title =
Expand Down
4 changes: 4 additions & 0 deletions apps/Core/Packages/Adminltetags/Traits/DynamicTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ public function generateDTContent(
$actions[$key] = $this->links->url($action . '/q/id/' . $row['id']);
}
}

if ($key === 'clone') {
$actions[$key] = $actions[$key] . '/clone/true';
}
}

$row["__control"] = $actions;
Expand Down
Loading