Skip to content

Commit 09aafcf

Browse files
- more labels for flow classifications
- nicer popovers #6895
1 parent 2be5c8f commit 09aafcf

22 files changed

Lines changed: 190 additions & 132 deletions

waltz-ng/client/common/svelte/Toggle.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@
4141
</span>
4242
{/if}
4343
{/if}
44+
45+
<style>
46+
button {
47+
font-size: inherit;
48+
}
49+
</style>

waltz-ng/client/common/svelte/Tooltip.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
export let content;
1212
export let props;
13+
export let trigger = "mouseenter click";
1314
export let placement = "top";
1415
export let delay = [300, 100];
1516
@@ -22,7 +23,7 @@
2223
arrow: true,
2324
interactive: true,
2425
appendTo: document.body,
25-
trigger: 'mouseenter click',
26+
trigger,
2627
theme: "light-border",
2728
placement,
2829
delay,
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<script context="module">
2+
import {writable} from "svelte/store";
3+
let hideRatings = writable(true);
4+
</script>
5+
6+
<script>
7+
import _ from "lodash";
8+
import EntityLabel from "../../../../common/svelte/EntityLabel.svelte";
9+
import Toggle from "../../../../common/svelte/Toggle.svelte";
10+
11+
export let decorators = [];
12+
export let flowClassifications = []
13+
14+
15+
$: flowClassificationsByCode = _.keyBy(flowClassifications, d => d.code);
16+
17+
$: hasRatings = !_.isEmpty(flowClassifications)
18+
$: showRatings = !$hideRatings && hasRatings;
19+
20+
</script>
21+
22+
<table class="">
23+
<tbody class="small">
24+
{#each _.orderBy(decorators, d => d.decoratorEntity.name) as type}
25+
<tr>
26+
<td>
27+
<div class="rating-icon"
28+
style={`background-color: ${flowClassificationsByCode[type.rating]?.color}`}>
29+
</div>
30+
<EntityLabel ref={type.decoratorEntity}
31+
showIcon={false}>
32+
</EntityLabel>
33+
</td>
34+
{#if showRatings}
35+
<td>
36+
{_.get(flowClassificationsByCode, [type.rating, "name"], "-")}
37+
</td>
38+
{/if}
39+
</tr>
40+
{/each}
41+
</tbody>
42+
</table>
43+
44+
{#if hasRatings}
45+
<div class="smaller">
46+
<Toggle state={showRatings}
47+
labelOn="Hide Ratings"
48+
onToggle={() => $hideRatings = !$hideRatings}
49+
labelOff="Show Ratings"/>
50+
</div>
51+
{/if}
52+
53+
54+
55+
<style>
56+
57+
.rating-icon {
58+
display: inline-block;
59+
height: 1em;
60+
width: 1em;
61+
border:1px solid #ccc;
62+
border-radius: 2px;
63+
}
64+
65+
table {
66+
width: 100%;
67+
}
68+
69+
table td {
70+
padding-bottom: 0.2em;
71+
padding-right: 0.6em;
72+
border-bottom: 1px solid #eee;
73+
vertical-align: top;
74+
}
75+
</style>

waltz-ng/client/data-flow/components/svelte/flow-detail-tab/DataTypeTooltipContent.svelte

Lines changed: 0 additions & 40 deletions
This file was deleted.

waltz-ng/client/data-flow/components/svelte/flow-detail-tab/FlowDetailPanel.svelte

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import PhysicalFlowAttributeFilters from "./filters/PhysicalFlowAttributeFilters.svelte";
2424
import Icon from "../../../../common/svelte/Icon.svelte";
2525
import DataExtractLink from "../../../../common/svelte/DataExtractLink.svelte";
26+
import FlowClassificationFilters from "./filters/FlowClassificationFilters.svelte";
27+
import {flowClassificationStore} from "../../../../svelte-stores/flow-classification-store";
2628
2729
export let parentEntityRef;
2830
@@ -35,6 +37,9 @@
3537
let allFlows = [];
3638
let physicalFlows = [];
3739
let logicalFlows = [];
40+
let flowClassificationCall = flowClassificationStore.findAll();
41+
42+
$: flowClassifications = $flowClassificationCall?.data;
3843
3944
$: {
4045
if (parentEntityRef) {
@@ -108,7 +113,7 @@
108113

109114
<details class="filter-set" style="margin-top: 1em">
110115
<summary>
111-
<Icon name="random"/> Flow Direction
116+
<Icon name="random"/> Flow Direction & Classification
112117
{#if _.some($filters, d => d.kind === FilterKinds.DIRECTION) && _.find($filters, d => d.kind === FilterKinds.DIRECTION).direction !== Directions.ALL}
113118
<span style="color: darkorange"
114119
title="Flows have been filtered by direction">
@@ -117,6 +122,7 @@
117122
{/if}
118123
</summary>
119124
<InboundOutboundFilters/>
125+
<FlowClassificationFilters/>
120126
</details>
121127

122128
<details class="filter-set">
@@ -160,9 +166,11 @@
160166
</details>
161167

162168
<LogicalFlowTable {logicalFlows}
169+
{flowClassifications}
163170
assessments={logicalFlowPrimaryAssessments}/>
164171
<br>
165-
<PhysicalFlowTable {physicalFlows}/>
172+
<PhysicalFlowTable {physicalFlows}
173+
{flowClassifications}/>
166174

167175
<div style="padding-top: 1em" class="pull-right">
168176
<span>
@@ -184,7 +192,8 @@
184192
</div>
185193
{#if $selectedLogicalFlow || $selectedPhysicalFlow}
186194
<div class="flow-detail-context-panel">
187-
<SelectedFlowDetailPanel assessmentDefinitions={logicalFlowPrimaryAssessments}/>
195+
<SelectedFlowDetailPanel flowClassifications={flowClassifications}
196+
assessmentDefinitions={logicalFlowPrimaryAssessments}/>
188197
</div>
189198
{/if}
190199
</div>

waltz-ng/client/data-flow/components/svelte/flow-detail-tab/LogicalFlowTable.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
import {filters, selectedLogicalFlow, selectedPhysicalFlow, updateFilters} from "./flow-details-store";
88
import {truncate} from "../../../../common/string-utils";
99
import Tooltip from "../../../../common/svelte/Tooltip.svelte";
10-
import DataTypeTooltipContent from "./DataTypeTooltipContent.svelte";
10+
import DataTypeTooltipContent from "./DataTypeMiniTable.svelte";
1111
import NoData from "../../../../common/svelte/NoData.svelte";
1212
1313
export let logicalFlows = [];
14+
export let flowClassifications = [];
1415
export let assessments;
1516
1617
let qry;
@@ -67,7 +68,8 @@
6768
6869
function mkDataTypeTooltipProps(row) {
6970
return {
70-
decorators: row.dataTypesForLogicalFlow
71+
decorators: row.dataTypesForLogicalFlow,
72+
flowClassifications
7173
};
7274
}
7375
@@ -102,9 +104,10 @@
102104
<div>
103105
<SearchInput bind:value={qry}/>
104106
</div>
107+
105108
<div class="table-container"
106109
class:waltz-scroll-region-350={_.size(logicalFlows) > 10}>
107-
<table class="table table-condensed small"
110+
<table class="table table-condensed small table-hover"
108111
style="margin-top: 1em">
109112
<thead>
110113
<tr>
@@ -137,6 +140,7 @@
137140
</td>
138141
<td>
139142
<Tooltip content={DataTypeTooltipContent}
143+
trigger={"mouseenter"}
140144
props={mkDataTypeTooltipProps(flow)}>
141145
<svelte:fragment slot="target">
142146
<span>{truncate(mkDataTypeString(flow.dataTypesForLogicalFlow), 30)}</span>

waltz-ng/client/data-flow/components/svelte/flow-detail-tab/PhysicalFlowTable.svelte

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
import {selectedPhysicalFlow, selectedLogicalFlow} from "./flow-details-store";
1414
import {mkLogicalFromFlowDetails} from "./flow-detail-utils";
1515
import NoData from "../../../../common/svelte/NoData.svelte";
16-
import DataTypeTooltipContent from "./DataTypeTooltipContent.svelte";
16+
import DataTypeTooltipContent from "./DataTypeMiniTable.svelte";
1717
import {truncate} from "../../../../common/string-utils";
1818
import Tooltip from "../../../../common/svelte/Tooltip.svelte";
1919
20-
export let physicalFlows;
20+
export let physicalFlows = [];
21+
export let flowClassifications = [];
2122
2223
function selectPhysicalFlow(flow) {
2324
if ($selectedPhysicalFlow === flow) {
@@ -29,9 +30,27 @@
2930
}
3031
3132
function mkDataTypeTooltipProps(row) {
33+
row.dataTypesForSpecification;
34+
35+
const ratingByDataTypeId = _.reduce(
36+
row.dataTypesForLogicalFlow,
37+
(acc, d) => {
38+
acc[d.decoratorEntity.id] = d.rating;
39+
return acc;
40+
},
41+
{});
42+
43+
const decorators = _.map(
44+
row.dataTypesForSpecification,
45+
d => Object.assign(
46+
{},
47+
d,
48+
{ rating: ratingByDataTypeId[d.decoratorEntity?.id] }));
49+
3250
return {
33-
decorators: row.dataTypesForSpecification
34-
}
51+
decorators,
52+
flowClassifications
53+
};
3554
}
3655
3756
function mkDataTypeString(dataTypes) {
@@ -43,7 +62,6 @@
4362
.value();
4463
}
4564
46-
4765
let qry;
4866
let visibleFlows;
4967
let enumsCall = enumValueStore.load();
@@ -64,8 +82,6 @@
6482
"logicalFlow.target.name",
6583
"logicalFlow.target.externalId"
6684
]);
67-
68-
6985
</script>
7086
7187
@@ -86,7 +102,7 @@
86102
</div>
87103
<div class="table-container"
88104
class:waltz-scroll-region-350={_.size(physicalFlows) > 10}>
89-
<table class="table table-condensed small"
105+
<table class="table table-condensed small table-hover"
90106
style="margin-top: 1em">
91107
<thead>
92108
<tr>
@@ -127,6 +143,7 @@
127143
</td>
128144
<td>
129145
<Tooltip content={DataTypeTooltipContent}
146+
trigger={"mouseenter"}
130147
props={mkDataTypeTooltipProps(flow)}>
131148
<svelte:fragment slot="target">
132149
<span>{truncate(mkDataTypeString(flow.dataTypesForSpecification), 30)}</span>

waltz-ng/client/data-flow/components/svelte/flow-detail-tab/SelectedFlowDetailPanel.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<script>
2-
import {selectedLogicalFlow, selectedPhysicalFlow} from "./flow-details-store";
2+
import {filters, selectedLogicalFlow, selectedPhysicalFlow} from "./flow-details-store";
33
import Icon from "../../../../common/svelte/Icon.svelte";
44
import SelectedLogicalFlowDetail from "./SelectedLogicalFlowDetail.svelte";
55
import SelectedPhysicalFlowDetail from "./SelectedPhysicalFlowDetail.svelte";
6+
import _ from "lodash";
67
78
export let assessmentDefinitions = [];
9+
export let flowClassifications = [];
810
911
function clearSelected() {
1012
$selectedPhysicalFlow = null;
1113
$selectedLogicalFlow = null;
14+
$filters = _.reject($filters, d => d.id === "SELECTED_LOGICAL")
1215
}
1316
1417
</script>
@@ -32,7 +35,8 @@
3235
<div class="col-md-12">
3336

3437
{#if $selectedLogicalFlow}
35-
<SelectedLogicalFlowDetail {assessmentDefinitions}/>
38+
<SelectedLogicalFlowDetail {flowClassifications}
39+
{assessmentDefinitions}/>
3640
{/if}
3741

3842
{#if $selectedPhysicalFlow}

0 commit comments

Comments
 (0)