Skip to content

Commit

Permalink
#220 missing information
Browse files Browse the repository at this point in the history
added missing information of the usecases as show-hide details (collapsing of individual sections does not work yes)
  • Loading branch information
forkch committed Jul 23, 2014
1 parent 680da87 commit ee61a17
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 27 deletions.
12 changes: 12 additions & 0 deletions scenarioo-client/app/scripts/controllers/usecase.js
Expand Up @@ -19,6 +19,8 @@

angular.module('scenarioo.controllers').controller('UseCaseCtrl', function ($scope, $q, $filter, $routeParams, $location, ScenarioResource, Config, SelectedBranchAndBuild) {

var transformMetadataToTree = $filter('scMetadataTreeCreator')
var transformMetadataToTreeArray = $filter('scMetadataTreeListCreator');
SelectedBranchAndBuild.callOnSelectionChange(loadScenariosAndUseCase);

function loadScenariosAndUseCase(selected) {
Expand All @@ -32,10 +34,13 @@ angular.module('scenarioo.controllers').controller('UseCaseCtrl', function ($sco
function onSuccess(result) {
$scope.useCase = result.useCase;
$scope.scenarios = result.scenarios;
$scope.usecaseInformationTree = createUseCaseInformationTree($scope.useCase);
$scope.metadataTree = transformMetadataToTreeArray($scope.useCase.details);
}
);

$scope.propertiesToShow = Config.scenarioPropertiesInOverview();

}


Expand Down Expand Up @@ -69,4 +74,11 @@ angular.module('scenarioo.controllers').controller('UseCaseCtrl', function ($sco
$scope.table.search = {searchTerm: ''};
};

function createUseCaseInformationTree(usecase) {
var usecaseInformation = {};
usecaseInformation.Description = usecase.description;
usecaseInformation.Status = usecase.status;
return transformMetadataToTree(usecaseInformation);
}

});
73 changes: 46 additions & 27 deletions scenarioo-client/app/views/usecase.html
Expand Up @@ -30,31 +30,50 @@
</div>
</div>

<sc-show-hide-details sc-showHideStorageKey="usecase">
<div>
<table class="table table-bordered scenario-table" sc-navigator-table="filtered" >
<thead>
<tr>
<th sc-sortable-column="status">Status</th>
<th sc-sortable-column="name">Scenario name</th>
<th>Actions</th>
<th>Description</th>
<th ng-repeat="property in propertiesToShow" sc-sortable-column="details.properties.{{property}}">{{property | scHumanReadable}}</th>
<th sc-sortable-column="calculatedData.numberOfSteps"># Steps</th>
</tr>
</thead>
<tbody>
<tr ng-class="{'selected':$index==selectedRowIndex}" ng-click="goToScenario(useCase.name, scenario.name)" class="link" ng-repeat="scenario in filtered=(scenarios | scFilterArray: table.search.searchTerm | orderBy: table.sort.column: table.sort.reverse)">
<td>
<span class="label state" ng-class="getStatusStyleClass(scenario.status)">{{scenario.status}}</span>
</td>
<td>{{scenario.name | scHumanReadable }}</td>
<td>
<a><i class="icon-list-ul icon-with-padding" tooltip="Go to scenario overview" tooltip-placement="bottom"></i></a>
<a ng-click="goToFirstStep(useCase.name, scenario.name)" tooltip="Go to first step" tooltip-placement="bottom"><i class="icon-tablet icon-with-padding"></i></a>
</td>
<td>{{scenario.description}}</td>
<td ng-repeat="property in propertiesToShow">{{scenario.details[property]}}</td>
<td>{{scenario.calculatedData.numberOfSteps}}</td>
</tr>
</tbody>
</table>
</div>
<div>
<!-- scenario -->
<div>
<div class="panel panel-default">
<div class="panel-heading link" ng-click="toggleMetadataExpanded('sc-usecase-properties')">
<h3 class="panel-title">Use Case</h3>
</div>
<div class="panel-body" ng-class="{hidden: isMetadataCollapsed('sc-usecase-properties'), metadata: true}">
<sc-tree data='usecaseInformationTree'></sc-tree>
</div>
</div>
</div>

<table class="table table-bordered scenario-table" sc-navigator-table="filtered" >
<thead>
<tr>
<th sc-sortable-column="status">Status</th>
<th sc-sortable-column="name">Scenario name</th>
<th>Actions</th>
<th>Description</th>
<th ng-repeat="property in propertiesToShow" sc-sortable-column="details.properties.{{property}}">{{property | scHumanReadable}}</th>
<th sc-sortable-column="calculatedData.numberOfSteps"># Steps</th>
</tr>
</thead>
<tbody>
<tr ng-class="{'selected':$index==selectedRowIndex}" ng-click="goToScenario(useCase.name, scenario.name)" class="link" ng-repeat="scenario in filtered=(scenarios | scFilterArray: table.search.searchTerm | orderBy: table.sort.column: table.sort.reverse)">
<td>
<span class="label state" ng-class="getStatusStyleClass(scenario.status)">{{scenario.status}}</span>
</td>
<td>{{scenario.name | scHumanReadable }}</td>
<td>
<a><i class="icon-list-ul icon-with-padding" tooltip="Go to scenario overview" tooltip-placement="bottom"></i></a>
<a ng-click="goToFirstStep(useCase.name, scenario.name)" tooltip="Go to first step" tooltip-placement="bottom"><i class="icon-tablet icon-with-padding"></i></a>
</td>
<td>{{scenario.description}}</td>
<td ng-repeat="property in propertiesToShow">{{scenario.details[property]}}</td>
<td>{{scenario.calculatedData.numberOfSteps}}</td>
</tr>
</tbody>
</table>
<!-- Metadata -->
<span sc-static-include="views/metadata.html"></span>
</div>
</sc-show-hide-details>

0 comments on commit ee61a17

Please sign in to comment.