-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from davidwatkins73/master
Adding pies to people/groups/capabilities pages
- Loading branch information
Showing
23 changed files
with
569 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
waltz-ng/client/applications/directives/apps-by-investment-pie.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
81
waltz-ng/client/applications/directives/apps-by-investment-pie.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; | ||
}; |
9 changes: 9 additions & 0 deletions
9
waltz-ng/client/applications/directives/apps-by-lifecycle-phase-pie.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
74 changes: 74 additions & 0 deletions
74
waltz-ng/client/applications/directives/apps-by-lifecycle-phase-pie.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
waltz-ng/client/capabilities/directives/capability-scorecard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;"> | ||
Σ {{ 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> |
Oops, something went wrong.