Skip to content

Commit bac0509

Browse files
Merge pull request #205 from davidwatkins73/master
ratings explorer, boingy graph limits, logo overlays and more
2 parents 0bed102 + 89777c9 commit bac0509

21 files changed

Lines changed: 219 additions & 104 deletions

File tree

waltz-data/src/main/java/com/khartec/waltz/data/source_data_rating/SourceDataRatingDAO.java renamed to waltz-data/src/main/java/com/khartec/waltz/data/source_data_rating/SourceDataRatingDao.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,34 @@
1212
import org.springframework.beans.factory.annotation.Autowired;
1313
import org.springframework.stereotype.Repository;
1414

15+
import java.time.LocalDateTime;
1516
import java.util.Collection;
17+
import java.util.Optional;
1618

1719
import static com.khartec.waltz.schema.tables.SourceDataRating.SOURCE_DATA_RATING;
1820

21+
1922
@Repository
2023
public class SourceDataRatingDao {
2124

2225
private static final RecordMapper<? super Record, SourceDataRating> MAPPER = r -> {
2326
SourceDataRatingRecord record = r.into(SOURCE_DATA_RATING);
27+
28+
Optional<LocalDateTime> lastImportDateTime = Optional
29+
.ofNullable(record.getLastImport())
30+
.map(t -> t.toLocalDateTime());
31+
2432
return ImmutableSourceDataRating.builder()
2533
.sourceName(record.getSourceName())
2634
.entityKind(EntityKind.valueOf(record.getEntityKind()))
2735
.authoritativeness(RagRating.valueOf(record.getAuthoritativeness()))
2836
.accuracy(RagRating.valueOf(record.getAccuracy()))
2937
.completeness(RagRating.valueOf(record.getCompleteness()))
38+
.lastImportDate(lastImportDateTime)
3039
.build();
3140
};
3241

42+
3343
private final DSLContext dsl;
3444

3545

@@ -44,7 +54,6 @@ public Collection<SourceDataRating> findAll() {
4454
return dsl.select(SOURCE_DATA_RATING.fields())
4555
.from(SOURCE_DATA_RATING)
4656
.fetch(MAPPER);
47-
4857
}
4958

5059
}

waltz-model/src/main/java/com/khartec/waltz/model/source_data_rating/SourceDataRating.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import com.khartec.waltz.model.capabilityrating.RagRating;
77
import org.immutables.value.Value;
88

9+
import java.time.LocalDateTime;
10+
import java.util.Optional;
11+
912
@Value.Immutable
1013
@JsonSerialize(as = ImmutableSourceDataRating.class)
1114
@JsonDeserialize(as = ImmutableSourceDataRating.class)
@@ -17,4 +20,6 @@ public abstract class SourceDataRating {
1720
public abstract RagRating authoritativeness();
1821
public abstract RagRating accuracy();
1922
public abstract RagRating completeness();
23+
24+
public abstract Optional<LocalDateTime> lastImportDate();
2025
}

waltz-ng/client/applications/directives/app-table.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,30 @@ function controller(uiGridConstants, $scope, $animate) {
4545
{
4646
field: 'name',
4747
cellTemplate: '<div class="ui-grid-cell-contents"> <a ui-sref="main.app.view ({ id: row.entity[\'id\'] })">{{ COL_FIELD }}</a></div>'
48-
},
49-
{
48+
}, {
5049
field: 'kind',
51-
cellTemplate: '<div class="ui-grid-cell-contents"> {{ COL_FIELD | toDisplayName:"applicationKind" }}</div>',
50+
cellTemplate: '<div class="ui-grid-cell-contents"><span ng-bind="COL_FIELD | toDisplayName:\'applicationKind\'"></span></div>',
5251
filter: {
5352
type: uiGridConstants.filter.SELECT,
5453
selectOptions: _.map(applicationKindDisplayNames, (label, value) => ({ label, value }))
5554
}
56-
},
57-
{
55+
}, {
56+
field: 'assetCode'
57+
}, {
5858
field: 'overallRating',
59-
cellTemplate: '<div class="ui-grid-cell-contents"> {{ COL_FIELD | toDisplayName:"investmentRating" }}</div>',
59+
cellTemplate: '<div class="ui-grid-cell-contents"><span ng-bind="COL_FIELD | toDisplayName:\'investmentRating\'"></span></div>',
6060
filter: {
6161
type: uiGridConstants.filter.SELECT,
6262
selectOptions: _.map(investmentRatingNames, (label, value) => ({ label, value }))
6363
}
64-
},
65-
{
64+
}, {
6665
field: 'lifecyclePhase',
67-
cellTemplate: '<div class="ui-grid-cell-contents"> {{ COL_FIELD | toDisplayName:"lifecyclePhase" }}</div>',
66+
cellTemplate: '<div class="ui-grid-cell-contents"><span ng-bind="COL_FIELD | toDisplayName:\'lifecyclePhase\'"></span></span></div>',
6867
filter: {
6968
type: uiGridConstants.filter.SELECT,
7069
selectOptions: _.map(lifecyclePhaseDisplayNames, (label, value) => ({ label, value }))
7170
}
72-
},
73-
{
71+
}, {
7472
field: 'description',
7573
cellTooltip: (row) => row.entity.description
7674
}

waltz-ng/client/data-flow/directives/boingy-graph/boingy-graph.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ function handleNodeClick(node) {
2525

2626

2727
const force = d3.layout.force()
28-
.gravity(0.05)
29-
.friction(0.6)
3028
.distance(100)
31-
.charge(-100);
29+
.linkDistance(60)
30+
.charge(-120);
3231

3332

3433
function setup(holder) {

waltz-ng/client/data-flow/directives/data-flows-tabgroup.html

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,39 @@ <h4>Data Categories</h4>
5050
name="Loading Flow Data">
5151
</waltz-loading-notification>
5252

53-
<div ng-if="ctrl.boingyEverShown && ctrl.flowData.flows.length > 0">
53+
<div ng-if="ctrl.filteredFlowData.entities.length == 0 && ctrl.flowData.flows.length > 0">
54+
<div class="alert alert-warning">
55+
<strong>No data to show</strong> given the current filter options. Use the
56+
configure button above to adjust these options.
57+
</div>
58+
</div>
59+
60+
61+
<div ng-if="ctrl.filteredFlowData.entities.length >= 200 && !ctrl.visibility.ignoreLimits">
62+
<div class="alert alert-warning">
63+
This graph will have <strong>too many nodes</strong> to render smoothly.
64+
Use the configure button too limit the amount of data to show. Alternatively
65+
the data is available via the 'Table' tab.
66+
67+
<br>
68+
69+
If you still want to see the graph click
70+
<a href ng-click="ctrl.visibility.ignoreLimits = true">here</a>
71+
- however be aware that your machine may struggle.
72+
</div>
73+
</div>
74+
5475

55-
<waltz-data-flow-diagram data="ctrl.filteredFlowData"
56-
tweakers="ctrl.graphTweakers">
57-
</waltz-data-flow-diagram>
76+
<div ng-if="ctrl.boingyEverShown && ctrl.filteredFlowData.flows.length > 0">
77+
<div ng-if="ctrl.filteredFlowData.entities.length < 200 || ctrl.visibility.ignoreLimits">
78+
<waltz-data-flow-diagram data="ctrl.filteredFlowData"
79+
tweakers="ctrl.graphTweakers">
80+
</waltz-data-flow-diagram>
5881

59-
<div class="small text-muted">
60-
Dragging nodes will pin them. Double click to unpin. If an application is gray
61-
it is not a member of this group.
82+
<div class="small text-muted">
83+
Dragging nodes will pin them. Double click to unpin. If an application is gray
84+
it is not a member of this group.
85+
</div>
6286
</div>
6387
</div>
6488

waltz-ng/client/navbar/index.js

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,5 @@
1111
*
1212
*/
1313

14-
import tmpl from "./navbar.html";
15-
import _ from "lodash";
1614

17-
function controller(applicationStore, personStore, capabilityStore, orgUnitStore, timeout) {
18-
const searchResults = {
19-
show: false
20-
};
21-
22-
function doSearch(query) {
23-
if (_.isEmpty(query)) {
24-
searchResults.show = false;
25-
} else {
26-
searchResults.show = true;
27-
applicationStore
28-
.search(query)
29-
.then(r => searchResults.apps = r);
30-
personStore
31-
.search(query)
32-
.then(r => searchResults.people = r);
33-
capabilityStore
34-
.search(query)
35-
.then(r => searchResults.capabilities = r);
36-
orgUnitStore
37-
.search(query)
38-
.then(r => searchResults.orgUnits = r);
39-
}
40-
}
41-
42-
function dismissResults() {
43-
timeout(() => { searchResults.show = false; }, 400);
44-
}
45-
46-
const vm = this;
47-
vm.doSearch = () => doSearch(vm.query);
48-
vm.showSearch = () => searchResults.show;
49-
vm.dismissResults = dismissResults;
50-
vm.searchResults = searchResults;
51-
}
52-
53-
controller.$inject = ['ApplicationStore', 'PersonStore', 'CapabilityStore', 'OrgUnitStore', '$timeout'];
54-
55-
export default (module) => module.directive('waltzNavbar', () => {
56-
return {
57-
restrict: 'E',
58-
template: tmpl,
59-
controller,
60-
controllerAs: 'ctrl'
61-
};
62-
});
15+
export default (module) => module.directive('waltzNavbar', require('./navbar'));

waltz-ng/client/navbar/navbar.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
style="position: relative; top: -6px;"
99
src="../../images/branding/waltz_badge+text_horizontal_positive_bw_300px.png">
1010
</a>
11+
<span ng-bind='ctrl.logoOverlayText'
12+
style='position: relative; left: -35px; top:30px; color: {{ ctrl.logoOverlayColor }}; font-weight: bold; font-style: italic'>
13+
14+
</span>
15+
16+
<span ng-bind="ctrl.logoOverlay" ></span>
1117
</div>
1218

1319
<ul class="nav navbar-nav nav-bar-left">

waltz-ng/client/navbar/navbar.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import _ from "lodash";
2+
3+
4+
function controller($timeout,
5+
applicationStore,
6+
capabilityStore,
7+
personStore,
8+
orgUnitStore,
9+
settingsStore) {
10+
const searchResults = {
11+
show: false
12+
};
13+
14+
settingsStore
15+
.findAll()
16+
.then(settings => {
17+
vm.logoOverlayText = settingsStore.findOrDefault(settings, "ui.logo.overlay.text", "");
18+
vm.logoOverlayColor = settingsStore.findOrDefault(settings, "ui.logo.overlay.color", "");
19+
});
20+
21+
function doSearch(query) {
22+
if (_.isEmpty(query)) {
23+
searchResults.show = false;
24+
} else {
25+
searchResults.show = true;
26+
applicationStore
27+
.search(query)
28+
.then(r => searchResults.apps = r);
29+
personStore
30+
.search(query)
31+
.then(r => searchResults.people = r);
32+
capabilityStore
33+
.search(query)
34+
.then(r => searchResults.capabilities = r);
35+
orgUnitStore
36+
.search(query)
37+
.then(r => searchResults.orgUnits = r);
38+
}
39+
}
40+
41+
function dismissResults() {
42+
$timeout(() => { searchResults.show = false; }, 400);
43+
}
44+
45+
const vm = this;
46+
vm.doSearch = () => doSearch(vm.query);
47+
vm.showSearch = () => searchResults.show;
48+
vm.dismissResults = dismissResults;
49+
vm.searchResults = searchResults;
50+
51+
vm.logoOverlayText = "beta";
52+
vm.logoOverlayColor = '#a90000';
53+
}
54+
55+
controller.$inject = [
56+
'$timeout',
57+
'ApplicationStore',
58+
'CapabilityStore',
59+
'PersonStore',
60+
'OrgUnitStore',
61+
'SettingsStore'
62+
];
63+
64+
export default () => {
65+
return {
66+
restrict: 'E',
67+
template: require("./navbar.html"),
68+
controller,
69+
controllerAs: 'ctrl'
70+
};
71+
};

waltz-ng/client/playpen/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@ export default (module) => {
2626
}
2727
]);
2828

29-
module.directive('waltzRagLine', require('./rag-line'));
30-
module.directive('waltzRatingExplorerSection', require('./rating-explorer-section'));
31-
module.directive('waltzSimpleStackChart', require('./simple-stack-chart'));
3229

3330
};

waltz-ng/client/playpen/playpen.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
</waltz-page-header>
1111

1212

13-
<waltz-rating-explorer-section applications="ctrl.applications"
14-
app-capabilities="ctrl.appCapabilities"
15-
capabilities="ctrl.allCapabilities"
16-
ratings="ctrl.ratings">
17-
</waltz-rating-explorer-section>
13+
<!-- FLOWS -->
14+
<waltz-data-flows-tabgroup-section ratings="ctrl.sourceDataRatings"
15+
flow-data="ctrl.dataFlows"
16+
on-load-detail="ctrl.loadFlowDetail"
17+
applications="ctrl.applications">
18+
</waltz-data-flows-tabgroup-section>
19+
1820
</div>

0 commit comments

Comments
 (0)