Skip to content

Commit

Permalink
Merge pull request #87 from davidwatkins73/master
Browse files Browse the repository at this point in the history
Adding pies to people/groups/capabilities pages
  • Loading branch information
davidwatkins73 committed Feb 21, 2016
2 parents d11ceae + 1c001ec commit 9b76005
Show file tree
Hide file tree
Showing 23 changed files with 569 additions and 232 deletions.
1 change: 1 addition & 0 deletions waltz-ng/client/app-groups/app-group-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
complexity="ctrl.complexity"
server-stats="ctrl.serverStats"
app-group="ctrl.groupDetail.appGroup"
flows="ctrl.dataFlows.flows"
editable="ctrl.isGroupEditable()">
</waltz-app-group-summary>

Expand Down
21 changes: 21 additions & 0 deletions waltz-ng/client/app-groups/directives/app-group-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ <h3 style="margin-top: 10px; padding-bottom: 4px; border-bottom: 1px solid #eee;
{{ ctrl.appGroup.description }}
</div>


<div class="row">
<div class="col-sm-4">
<waltz-apps-by-investment-pie applications="ctrl.applications"
size="80">
</waltz-apps-by-investment-pie>
</div>

<div class="col-sm-4">
<waltz-apps-by-lifecycle-phase-pie applications="ctrl.applications"
size="80">
</waltz-apps-by-lifecycle-phase-pie>
</div>

<div class="col-sm-4">
<waltz-data-flows-by-direction-pie applications='ctrl.applications'
flows="ctrl.flows"
size="80">
</waltz-data-flows-by-direction-pie>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<waltz-basic-info-tile name="Portfolio Cost"
Expand Down
3 changes: 2 additions & 1 deletion waltz-ng/client/app-groups/directives/app-group-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const BINDINGS = {
assetCosts: '=',
complexity: '=',
serverStats: '=',
editable: '='
editable: '=',
flows: '='
};


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
<waltz-pie-table data="ctrl.data"
config="ctrl.config"
class="clickable"
waltz-jump-to="apps-section"
icon="money"
title="Apps By Investment Status">
</waltz-pie-table>
</div>
81 changes: 81 additions & 0 deletions waltz-ng/client/applications/directives/apps-by-investment-pie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

/*
* This file is part of Waltz.
*
* Waltz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Waltz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Waltz. If not, see <http://www.gnu.org/licenses/>.
*
*/

import {
lifecyclePhaseColorScale,
ragColorScale } from '../../common/colors';


const BINDINGS = {
applications: '=',
size: '='
};


const investmentLabels = {
'R' : 'Disinvest',
'A' : 'Maintain',
'G' : 'Invest'
};


const config = {
colorProvider: (d) => ragColorScale(d.data.key),
size: 80,
labelProvider: (k) => investmentLabels[k] || 'Unknown'
};


function calcAppInvestmentPieStats(apps) {
return _.chain(apps)
.countBy('overallRating')
.map((v, k) => ({ key: k, count: v }))
.value();
}


function controller($scope) {
const vm = this;

vm.config = config;
vm.data = [];

$scope.$watch('ctrl.size', sz => vm.config.size = sz ? sz : 80);

$scope.$watch('ctrl.applications', apps => {
if (!apps) return;
vm.data = calcAppInvestmentPieStats(apps);
});

}

controller.$inject = ['$scope'];


export default () => {
return {
restrict: 'E',
replace: true,
template: require('./apps-by-investment-pie.html'),
scope: {},
bindToController: BINDINGS,
controllerAs: 'ctrl',
controller
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
<waltz-pie-table data="ctrl.data"
config="ctrl.config"
class="clickable"
waltz-jump-to="apps-section"
icon="desktop"
title="Apps By Lifecycle Phase">
</waltz-pie-table>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

/*
* This file is part of Waltz.
*
* Waltz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Waltz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Waltz. If not, see <http://www.gnu.org/licenses/>.
*
*/

import {
lifecyclePhaseColorScale,
ragColorScale } from '../../common/colors';


const BINDINGS = {
applications: '=',
size: '='
};


const config = {
colorProvider: (d) => lifecyclePhaseColorScale(d.data.key),
size: 80
};



function calcAppPhasePieStats(apps) {
return _.chain(apps)
.countBy('lifecyclePhase')
.map((v, k) => ({ key: k, count: v }))
.value();
}


function controller($scope) {
const vm = this;

vm.config = config;
vm.data = [];

$scope.$watch('ctrl.size', sz => vm.config.size = sz ? sz : 80);

$scope.$watch('ctrl.applications', apps => {
if (!apps) return;
vm.data = calcAppPhasePieStats(apps);
});

}

controller.$inject = ['$scope'];


export default () => {
return {
restrict: 'E',
replace: true,
template: require('./apps-by-lifecycle-phase-pie.html'),
scope: {},
bindToController: BINDINGS,
controllerAs: 'ctrl',
controller
};
};
2 changes: 2 additions & 0 deletions waltz-ng/client/applications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ export default (module) => {
module.directive('waltzAppSelector', require('./directives/app-selector'));
module.directive('waltzAssetCodeExplorer', require('./directives/asset-code-explorer'));
module.directive('waltzAppTable', require('./directives/app-table'));
module.directive('waltzAppsByInvestmentPie', require('./directives/apps-by-investment-pie'));
module.directive('waltzAppsByLifecyclePhasePie', require('./directives/apps-by-lifecycle-phase-pie'));

};
58 changes: 2 additions & 56 deletions waltz-ng/client/capabilities/capability-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,17 @@
</waltz-page-header>


<div class="row no-overflow"
ng-if="ctrl.capability.parent"
style="padding: 1em">

<div class="col-md-12">
<span class="text-muted">
<waltz-icon name="level-up"></waltz-icon>
Parent:
</span>
<a ui-sref="main.capabilities.view ({ id: ctrl.capability.parent.id })">
{{ ctrl.capability.parent.name }}
</a>
<span class="text-muted small ">
{{ ctrl.capability.parent.description }}
</span>
</div>

</div>

<waltz-capability-summary capability="ctrl.capability"
applications="ctrl.apps"
server-stats="ctrl.serverStats"
complexity="ctrl.complexity"
flows="ctrl.dataFlows"
asset-costs="ctrl.assetCosts">

</waltz-capability-summary>



<br>

<!-- CHILDREN -->
<div class="row"
ng-if="ctrl.capability.children.length > 0">
<div class="col-md-offset-1 col-md-10">
<table class="table table-condensed small">
<colgroup>
<col width="20%">
<col width="80%">
</colgroup>
<thead>
<tr>
<th colspan="2">
Sub-Capabilities
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="child in ctrl.capability.children | orderBy:'name'">
<td>
<a ui-sref="main.capabilities.view ({ id: child.id })">
{{ child.name }}
</a>
</td>
<td>
<span class="text-muted">
{{ child.description }}
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>


<!-- RATINGS -->
<waltz-section name="Application Capability Ratings">

Expand Down
92 changes: 92 additions & 0 deletions waltz-ng/client/capabilities/directives/capability-scorecard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<div>
<div class="waltz-page-summary">
<!-- BASICS -->
<div class="row">
<div class="col-md-12">
<h3 style="margin-top: 10px; padding-bottom: 4px; border-bottom: 1px solid #eee;">
{{ ctrl.capability.name }}
</h3>
<div style="border-bottom: 2px dotted #eee; padding: 6px"
class="waltz-paragraph">
{{ ctrl.capability.description }}
</div>
</div>
</div>



<div class="row">
<div class="col-sm-4">
<waltz-apps-by-investment-pie applications="ctrl.applications"
size="80">
</waltz-apps-by-investment-pie>
</div>

<div class="col-sm-4">
<waltz-apps-by-lifecycle-phase-pie applications="ctrl.applications"
size="80">
</waltz-apps-by-lifecycle-phase-pie>
</div>

<div class="col-sm-4">
<waltz-data-flows-by-direction-pie applications='ctrl.applications'
flows="ctrl.flows"
size="80">
</waltz-data-flows-by-direction-pie>
</div>
</div>


<div class="row">

<!-- PORTFOLIO COST -->
<div class="col-sm-4">
<waltz-basic-info-tile name="Portfolio Cost"
description="Cumulative value of infra and app dev costs"
waltz-jump-to="costs-section"
icon="money">
<span style="font-size: xx-large;">
{{ ctrl.portfolioCostStr }}
</span>
</waltz-basic-info-tile>
</div>


<!-- COMPLEXITY -->
<div class="col-sm-4">
<waltz-basic-info-tile name="Complexity"
description="Derived from capabilities, connections and servers"
class="clickable"
waltz-jump-to="complexity-section"
icon="rocket">
<div style="font-size: xx-large;">
&Sigma; {{ ctrl.complexitySummary.cumulativeScore | toFixed:1 }}
</div>
<div class="small text-muted">
{{ ctrl.complexitySummary.averageScore | toFixed:2 }} per app
</div>
</waltz-basic-info-tile>

</div>

<!-- SERVERS -->
<div class="col-sm-4">
<waltz-basic-info-tile name="Servers"
description="Number of servers supporting this group"
icon="server">
<div>
<div style="font-size: xx-large;">
# {{ ctrl.serverStats.total }}
</div>
<div class="small text-muted">
{{ ctrl.serverStats.virtualPercentage }}% virtual
</div>
</div>
</waltz-basic-info-tile>
</div>

</div>


</div>
</div>
Loading

0 comments on commit 9b76005

Please sign in to comment.