Skip to content

Commit

Permalink
Merge pull request #207 from davidwatkins73/master
Browse files Browse the repository at this point in the history
Adding involvment kind and improving source data ratings
  • Loading branch information
davidwatkins73 committed Jun 16, 2016
2 parents bac0509 + d54b0ef commit 23d71b0
Show file tree
Hide file tree
Showing 25 changed files with 202 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public enum EntityKind {
AUTHORITATIVE_SOURCE,
CHANGE_INITIATIVE,
PERFORMANCE_METRIC_PACK,
PROCESS
PROCESS,
INVOLVEMENT

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
class="btn btn-xs btn-primary">
Edit
</a>
<button class="btn btn-xs waltz-btn-transparent"
ng-click="ctrl.visibility.overlay = ! ctrl.visibility.overlay">
<waltz-icon name="map-signs"></waltz-icon>
</button>
</waltz-section-actions>

<waltz-source-data-overlay visible="ctrl.visibility.overlay"
ratings="ctrl.sourceDataRatings"
entities="['APP_CAPABILITY']">
</waltz-source-data-overlay>

<div class="row">
<div class="col-sm-12" style="border-left: 1px solid #eee">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ const BINDINGS = {
appCapabilities: '=',
capabilities: '=',
selfId: '@',
sourceDataRatings: '=',
traits: '='
};


function controller() {
}
const directive = {
restrict: 'E',
replace: true,
template: require('./app-capability-section.html'),
controller: () => {},
controllerAs: 'ctrl',
scope: {},
bindToController: BINDINGS
};


export default [
() => ({
restrict: 'E',
replace: true,
template: require('./app-capability-section.html'),
controller,
controllerAs: 'ctrl',
scope: {},
bindToController: BINDINGS
})
]
;
export default () => directive;
33 changes: 29 additions & 4 deletions waltz-ng/client/applications/app-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<waltz-app-capability-section app-capabilities="ctrl.appCapabilities"
traits="ctrl.explicitTraits"
capabilities="ctrl.capabilities"
self-id="{{ctrl.app.id}}">
self-id="{{ctrl.app.id}}"
source-data-ratings="ctrl.sourceDataRatings">
</waltz-app-capability-section>


Expand All @@ -36,8 +37,17 @@
class="btn btn-xs btn-primary">
Edit
</a>
<button class="btn btn-xs waltz-btn-transparent"
ng-click="ctrl.visibility.appCapabilitiesOverlay = ! ctrl.visibility.appCapabilitiesOverlay">
<waltz-icon name="map-signs"></waltz-icon>
</button>
</waltz-section-actions>

<waltz-source-data-overlay visible="ctrl.visibility.appCapabilitiesOverlay"
ratings="ctrl.sourceDataRatings"
entities="['APP_CAPABILITY']">
</waltz-source-data-overlay>

<waltz-rating-group-header measurables="ctrl.ratings.group.measurables"></waltz-rating-group-header>

<waltz-rating-group tweakers="ctrl.ratings.tweakers"
Expand All @@ -54,13 +64,14 @@


<!-- PROCESSES -->
<waltz-process-section processes="ctrl.processes">

<waltz-process-section processes="ctrl.processes"
source-data-ratings="ctrl.sourceDataRatings">
</waltz-process-section>


<!-- INVOLVED PEOPLE -->
<waltz-involved-people-section involvements="ctrl.peopleInvolvements">
<waltz-involved-people-section involvements="ctrl.peopleInvolvements"
source-data-ratings="ctrl.sourceDataRatings">
</waltz-involved-people-section>


Expand All @@ -73,8 +84,18 @@
class="btn btn-xs btn-primary">
Edit
</a>
<button class="btn btn-xs waltz-btn-transparent"
ng-click="ctrl.visibility.logicalFlows = ! ctrl.visibility.logicalFlows">
<waltz-icon name="map-signs"></waltz-icon>
</button>
</waltz-section-actions>

<waltz-source-data-overlay visible="ctrl.visibility.logicalFlows"
ratings="ctrl.sourceDataRatings"
entities="['LOGICAL_DATA_FLOW']">
</waltz-source-data-overlay>


<div class="alert alert-warning" ng-if="ctrl.flows.length == 0">
<strong>
No Data Flows
Expand Down Expand Up @@ -178,6 +199,10 @@ <h4>

<!-- COSTS -->
<waltz-section name="Costs">
<waltz-source-data-section-addon ratings="ctrl.sourceDataRatings"
entities="['ASSET_COST']">
</waltz-source-data-section-addon>

<div ng-if="ctrl.costs.length == 0">
<div class="alert alert-warning">
<strong>
Expand Down
35 changes: 20 additions & 15 deletions waltz-ng/client/applications/app-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
*
*/
import {
loadDataFlows,
loadAuthSources,
loadChangeLog,
loadDatabases,
loadDataFlows,
loadInvolvements,
loadAuthSources,
loadServers,
loadSoftwareCatalog,
loadDatabases
loadSourceDataRatings
} from "./data-load";
import {prepareSlopeGraph} from "../data-flow/directives/slope-graph/slope-graph-utils";
import {mkAppRatingsGroup, calculateHighestRatingCount} from "../ratings/directives/common";
Expand All @@ -37,6 +38,7 @@ function controller($q,
ratingStore,
serverInfoStore,
softwareCatalogStore,
sourceDataRatingStore,
displayNameService ) {

const { id, organisationalUnitId } = appView.app;
Expand Down Expand Up @@ -71,27 +73,29 @@ function controller($q,

const promises = [
loadDataFlows(dataFlowStore, id, vm),
loadChangeLog(changeLogStore, id, vm),
loadInvolvements($q, involvementStore, id, vm),
loadAuthSources(authSourcesStore, orgUnitStore, id, organisationalUnitId, vm),
loadServers(serverInfoStore, id, vm),
loadSoftwareCatalog(softwareCatalogStore, id, vm),
loadDatabases(databaseStore, id, vm)
];

$q.all(promises).then(() => {
$q.all(promises)
.then(() => {
const graphData = prepareSlopeGraph(
id,
vm.flows,
vm.dataTypes,
vm.appAuthSources,
vm.ouAuthSources,
displayNameService,
$state);

const graphData = prepareSlopeGraph(
id,
vm.flows,
vm.dataTypes,
vm.appAuthSources,
vm.ouAuthSources,
displayNameService,
$state);
vm.flow = graphData;
})
.then(() => loadChangeLog(changeLogStore, id, vm))
.then(() => loadSourceDataRatings(sourceDataRatingStore, vm))

vm.flow = graphData;
});


complexityStore
Expand Down Expand Up @@ -121,6 +125,7 @@ controller.$inject = [
'RatingStore',
'ServerInfoStore',
'SoftwareCatalogStore',
'SourceDataRatingStore',
'WaltzDisplayNameService'
];

Expand Down
7 changes: 7 additions & 0 deletions waltz-ng/client/applications/data-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ export function loadChangeLog(changeLogStore, id, vm) {
}


export function loadSourceDataRatings(sourceDataRatingStore, vm) {
sourceDataRatingStore
.findAll()
.then(sdrs => vm.sourceDataRatings = sdrs);
}


export function loadServers(serverInfoStore, appId, vm) {
serverInfoStore
.findByAppId(appId)
Expand Down
4 changes: 2 additions & 2 deletions waltz-ng/client/capabilities/capability-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@


<!-- PROCESSES -->
<waltz-process-section processes="ctrl.processes">

<waltz-process-section processes="ctrl.processes"
source-data-ratings="ctrl.sourceDataRatings">
</waltz-process-section>


Expand Down
1 change: 1 addition & 0 deletions waltz-ng/client/common/services/display_names.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const entityNames = {
CHANGE_INITIATIVE: 'Change Initiative',
DATABASE: 'Database',
END_USER_APPLICATION: 'End User App',
INVOLVEMENT: 'Involvement',
LOGICAL_DATA_FLOW: "Logical Data Flow",
ORG_UNIT: 'Org Unit',
PERSON: 'Person',
Expand Down
1 change: 1 addition & 0 deletions waltz-ng/client/common/services/icon_names.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const entityIconNames = {
CHANGE_INITIATIVE: 'paper-plane-o',
DATABASE: 'database',
END_USER_APPLICATION: 'table',
INVOLVEMENT: 'share-alt-square',
LOGICAL_DATA_FLOW: "random",
ORG_UNIT: 'sitemap',
PERSON: 'user',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div>
<waltz-section name="People" icon="users" small="( {{ctrl.involvements.length}} )">

<waltz-source-data-section-addon ratings="ctrl.sourceDataRatings"
entities="['INVOLVEMENT']">
</waltz-source-data-section-addon>

<div ng-if="ctrl.involvements.length > 0">
<div style="font-size: smaller; height: 300px"
Expand Down
18 changes: 13 additions & 5 deletions waltz-ng/client/involvement/directives/involved-people-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
* You must not remove this notice, or any other, from this software.
*
*/

import _ from "lodash";


const BINDINGS = {
involvements: '='
involvements: '=',
sourceDataRatings: '='
};


const initialData = {
const initialState = {
involvements: []
};

Expand Down Expand Up @@ -55,7 +60,7 @@ const columnDefs = [

function controller($scope, uiGridConstants) {

const vm = Object.assign(this, initialData);
const vm = _.defaults(this, initialState);

vm.gridOptions = {
enableSorting: true,
Expand All @@ -73,12 +78,15 @@ function controller($scope, uiGridConstants) {
controller.$inject = ['$scope', 'uiGridConstants'];


export default () => ({
const directive = {
restrict: 'E',
replace: true,
template: require('./involved-people-section.html'),
scope: {},
bindToController: BINDINGS,
controller,
controllerAs: 'ctrl'
});
};


export default () => directive;
15 changes: 13 additions & 2 deletions waltz-ng/client/org-units/list-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,24 @@
<waltz-section name="Organisational Units">

<!-- EXPORT -->
<div class="waltz-section-actions">
<waltz-section-actions>
<waltz-data-extract-link name="Download All"
extract="org-units">
</waltz-data-extract-link>
</div>

&nbsp;

<button class="btn btn-xs waltz-btn-transparent"
ng-click="ctrl.visibility.sourceDataRatings = ! ctrl.visibility.sourceDataRatings">
<waltz-icon name="map-signs">
</waltz-icon>
</button>
</waltz-section-actions>

<waltz-source-data-overlay visible="ctrl.visibility.sourceDataRatings"
ratings="ctrl.sourceDataRatings"
entities="['ORG_UNIT']">
</waltz-source-data-overlay>
<!-- TREE -->
<div class="row">
<div class="col-sm-8">
Expand Down
6 changes: 6 additions & 0 deletions waltz-ng/client/org-units/list-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,18 @@ function prepareOrgUnitTree(orgUnits, appTallies, endUserAppTallies) {
function controller(orgUnits,
appTallies,
endUserAppTallies,
sourceDataRatingStore,
svgStore,
$state) {

const vm = this;

loadDiagrams(svgStore, vm, $state);

sourceDataRatingStore
.findAll()
.then(sdrs => vm.sourceDataRatings = sdrs);

vm.filteredOrgUnits = [];
vm.trees = prepareOrgUnitTree(orgUnits, appTallies, endUserAppTallies);
vm.orgUnits = orgUnits;
Expand All @@ -116,6 +121,7 @@ controller.$inject = [
'orgUnits',
'appTallies',
'endUserAppTallies',
'SourceDataRatingStore',
'SvgDiagramStore',
'$state'
];
Expand Down
2 changes: 1 addition & 1 deletion waltz-ng/client/org-units/services/org-unit-view-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function service($q,
const bulkPromise = $q.all([
ratingStore.findByAppIds(appIds),
appCapabilityStore.findApplicationCapabilitiesByAppIdSelector(appIdSelector),
capabilityStore.findByAppIds(appIds),
capabilityStore.findAll(),
ratedDataFlowDataService.findByOrgUnitTree(orgUnitId), // use orgIds (ASC + DESC)
authSourceCalculator.findByOrgUnit(orgUnitId), // use orgIds(ASC)
endUserAppStore.findByOrgUnitTree(orgUnitId), // use orgIds(DESC)
Expand Down
3 changes: 2 additions & 1 deletion waltz-ng/client/org-units/unit-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
<!-- PEOPLE -->
<waltz-involved-people-section
id="people-section"
involvements="ctrl.viewData.involvements">
involvements="ctrl.viewData.involvements"
source-data-ratings="ctrl.viewData.sourceDataRatings">
</waltz-involved-people-section>


Expand Down
Loading

0 comments on commit 23d71b0

Please sign in to comment.