Skip to content

Commit

Permalink
Updates to allow getActionsForPipelines to be used as a TreeGrid so…
Browse files Browse the repository at this point in the history
…urce

- Updated the url for the TreeGrid to point at `/etl/pipelines/actions`
- Upated the `getActionsforPipelines` method chain so that it produces output
  suitable for use in an ExtJS TreeGrid.
  - The change @ ubccr#201 was needed due to `get_object_vars` returning a keyed
    array `<property> => <value>`.
  - ubccr#289: This function preps the output for use use in an EXtJS TreeGrid.
  - ubccr#453: This was simplify / declutter the display of the action name from it's
    fully qualified form `xdmod.pipeline.action` to `action` as the nodes
    immediately preceeding the action node will already be displaying the full
    pipeline name.
  • Loading branch information
Ryan Rathsam committed Feb 25, 2021
1 parent b3bd2ad commit 47471c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions classes/Rest/Controllers/ETLControllerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function setupRoutes(Application $app, ControllerCollection $controller)
$class = get_class($this);

$controller->get("$root/pipelines/actions", "$class::getActionsForPipelines");
$controller->post("$root/pipelines/actions", "$class::getActionsForPipelines");

$controller->get("$root/pipelines/{pipeline}/actions", "$class::getActionsForPipeline");
$controller->get("$root/pipelines/{pipeline}/endpoints", "$class::getEndpointsForPipeline");

Expand All @@ -51,8 +53,6 @@ public function setupRoutes(Application $app, ControllerCollection $controller)
$controller->post("$root/files", "$class::getFileNames");

$controller->get("$root/endpoints", "$class::getDataEndpoints");


}

/**
Expand Down Expand Up @@ -201,7 +201,7 @@ protected function convertForTreeGrid($source)
if ($isArray) {
$keys = array_keys($source);
} elseif ($isObject) {
$keys = get_object_vars($source);
$keys = array_keys(get_object_vars($source));
}

foreach ($keys as $key) {
Expand Down Expand Up @@ -289,7 +289,7 @@ public function getActionsForPipelines(Request $request, Application $app)
#echo "\t Skipping $pipelineName\n";
}
}
return $app->json($results);
return $app->json($this->convertForTreeGrid($results));
}

public function getActionsForPipeline(Request $request, Application $app, $pipeline)
Expand Down Expand Up @@ -453,7 +453,8 @@ function ($carry, $item) {
$endpoints[$destination['key']] = $destination;
}

$results[$pipelineName][] = array(
$name = substr($actionName, strlen($pipelineName) + 1);
$results[$name] = array(
'name' => $actionName,
'class' => $configClass,
'source' => $source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ XDMoD.Admin.ETL.ETLViewerTreePanel = Ext.extend(XDMoD.Admin.ETL.ETLViewerTree, {
url: null,

initComponent: function () {
this.url = XDMoD.REST.url + '/etl/pipelines';
this.url = XDMoD.REST.url + '/etl/pipelines/actions';
this.loaded = false;

XDMoD.Admin.ETL.ETLViewerTreePanel.superclass.initComponent.call(this, arguments);
Expand Down
3 changes: 1 addition & 2 deletions html/internal_dashboard/js/etl_viewer/ETLViewerTreeTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ XDMoD.Admin.ETL.ETLViewerTreeTab = Ext.extend(Ext.Panel, {
updateHistory: true,
title: 'ETL Pipeline Viewer',
autoScroll: true,
columnResize: true,
enableDD: true,
dataUrl: XDMoD.REST.url + '/etl/pipelines',
dataUrl: XDMoD.REST.url + '/etl/pipelines/actions',
columns: [
{
header: 'Name',
Expand Down

0 comments on commit 47471c2

Please sign in to comment.