Skip to content

Commit 9ddccc7

Browse files
- more labels for flow classifications
- nicer popovers - physical flow/spec data types - physical flow/spec assessments - pulled out filters to own widget - pulled out assessment table to own widget #6895
1 parent 09aafcf commit 9ddccc7

18 files changed

Lines changed: 376 additions & 308 deletions

File tree

waltz-data/src/main/java/org/finos/waltz/data/GenericSelectorFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.finos.waltz.data.logical_flow.LogicalFlowIdSelectorFactory;
3030
import org.finos.waltz.data.measurable.MeasurableIdSelectorFactory;
3131
import org.finos.waltz.data.orgunit.OrganisationalUnitIdSelectorFactory;
32+
import org.finos.waltz.data.physical_flow.PhysicalFlowIdSelectorFactory;
3233
import org.finos.waltz.data.physical_specification.PhysicalSpecificationIdSelectorFactory;
3334
import org.finos.waltz.model.EntityKind;
3435
import org.finos.waltz.model.HierarchyQueryScope;
@@ -53,6 +54,7 @@ public class GenericSelectorFactory {
5354
private final OrganisationalUnitIdSelectorFactory organisationalUnitIdSelectorFactory = new OrganisationalUnitIdSelectorFactory();
5455
private final AttestationIdSelectorFactory attestationIdSelectorFactory = new AttestationIdSelectorFactory();
5556
private final PhysicalSpecificationIdSelectorFactory specificationIdSelectorFactory = new PhysicalSpecificationIdSelectorFactory();
57+
private final PhysicalFlowIdSelectorFactory physicalFlowIdSelectorFactory = new PhysicalFlowIdSelectorFactory();
5658

5759

5860
public GenericSelector apply(IdSelectionOptions selectionOptions) {
@@ -125,6 +127,8 @@ private Select<Record1<Long>> applySelectorForKind(EntityKind kind, IdSelectionO
125127
return organisationalUnitIdSelectorFactory.apply(selectionOptions);
126128
case ATTESTATION:
127129
return attestationIdSelectorFactory.apply(selectionOptions);
130+
case PHYSICAL_FLOW:
131+
return physicalFlowIdSelectorFactory.apply(selectionOptions);
128132
case PHYSICAL_SPECIFICATION:
129133
return specificationIdSelectorFactory.apply(selectionOptions);
130134
//todo: (KS) Add support for Person

waltz-model/src/main/java/org/finos/waltz/model/logical_flow/LogicalFlowView.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,28 @@
3636
@JsonDeserialize(as = ImmutableLogicalFlowView.class)
3737
public abstract class LogicalFlowView {
3838

39-
public abstract Set<LogicalFlow> flows();
39+
public abstract Set<LogicalFlow> logicalFlows();
4040

41-
public abstract Set<AssessmentRating> flowRatings();
41+
public abstract Set<PhysicalFlow> physicalFlows();
4242

43-
public abstract Set<AssessmentDefinition> primaryAssessmentDefinitions();
43+
public abstract Set<PhysicalSpecification> physicalSpecifications();
4444

4545
public abstract Set<RatingSchemeItem> ratingSchemeItems();
4646

47-
public abstract Set<DataTypeDecorator> dataTypeDecorators();
47+
public abstract Set<DataTypeDecorator> logicalFlowDataTypeDecorators();
4848

49-
public abstract Set<PhysicalFlow> physicalFlows();
49+
public abstract Set<DataTypeDecorator> physicalSpecificationDataTypeDecorators();
5050

51-
public abstract Set<PhysicalSpecification> physicalSpecifications();
51+
public abstract Set<AssessmentDefinition> logicalFlowAssessmentDefinitions();
52+
53+
public abstract Set<AssessmentDefinition> physicalFlowAssessmentDefinitions();
54+
55+
public abstract Set<AssessmentDefinition> physicalSpecificationAssessmentDefinitions();
56+
57+
public abstract Set<AssessmentRating> logicalFlowRatings();
58+
59+
public abstract Set<AssessmentRating> physicalFlowRatings();
60+
61+
public abstract Set<AssessmentRating> physicalSpecificationRatings();
5262

5363
}

waltz-ng/client/assessments/components/rating-editor/RatingListView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
2929
$: canAdd = hasAddPermission && (singleValueCanAdd || multiValueCanAdd);
3030
31-
$: sortedRatingList =_.sortBy($selectedAssessment?.ratings, d => _.toLower(d.ratingItem.ratingGroup + d.ratingItem.name));
31+
$: sortedRatingList =_.sortBy($selectedAssessment?.ratings, d => _.toLower(d.ratingItem?.ratingGroup + d.ratingItem?.name));
3232
3333
</script>
3434
Lines changed: 49 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script>
2-
32
import {dataTypeStore} from "../../../../svelte-stores/data-type-store";
43
import {logicalFlowStore} from "../../../../svelte-stores/logical-flow-store";
54
import {mkSelectionOptions} from "../../../../common/selector-utils";
@@ -8,171 +7,102 @@
87
import LogicalFlowTable from "./LogicalFlowTable.svelte";
98
import {filters, resetFlowDetailsStore, selectedLogicalFlow, selectedPhysicalFlow} from "./flow-details-store";
109
import PhysicalFlowTable from "./PhysicalFlowTable.svelte";
11-
import {
12-
Directions,
13-
mkFlowDetails,
14-
mkLogicalFromFlowDetails} from "./flow-detail-utils";
15-
import {
16-
FilterKinds,
17-
mkAssessmentFilters} from "./filters/filter-utils";
10+
import {mkFlowDetails} from "./flow-detail-utils";
11+
import {mkAssessmentFilters} from "./filters/filter-utils";
1812
import SelectedFlowDetailPanel from "./SelectedFlowDetailPanel.svelte";
19-
import AssessmentFilters from "./filters/AssessmentFilters.svelte";
20-
import DataTypeFilters from "./filters/DataTypeFilters.svelte";
21-
import InboundOutboundFilters from "./filters/InboundOutboundFilters.svelte";
2213
import {onMount} from "svelte";
23-
import PhysicalFlowAttributeFilters from "./filters/PhysicalFlowAttributeFilters.svelte";
24-
import Icon from "../../../../common/svelte/Icon.svelte";
2514
import DataExtractLink from "../../../../common/svelte/DataExtractLink.svelte";
26-
import FlowClassificationFilters from "./filters/FlowClassificationFilters.svelte";
2715
import {flowClassificationStore} from "../../../../svelte-stores/flow-classification-store";
16+
import FlowDetailFilters from "./filters/FlowDetailFilters.svelte";
2817
2918
export let parentEntityRef;
3019
20+
function filterFlows(allFlows, filters) {
21+
console.log("ff", {allFlows, filters})
22+
return _
23+
.chain(allFlows)
24+
.map(d => Object.assign(d, {visible: _.every(filters, f => f.test(d))}))
25+
.value();
26+
}
27+
3128
let selectionOptions;
32-
let flowViewCall;
29+
30+
let flowViewCall = null;
31+
let flowClassificationCall = null;
32+
let dataTypesCall = null;
33+
3334
let flowView;
3435
let mappedDataTypes = [];
3536
let assessmentFilters = [];
3637
let dataTypes = [];
3738
let allFlows = [];
3839
let physicalFlows = [];
3940
let logicalFlows = [];
40-
let flowClassificationCall = flowClassificationStore.findAll();
4141
42-
$: flowClassifications = $flowClassificationCall?.data;
42+
onMount(() => {
43+
resetFlowDetailsStore();
44+
flowClassificationCall = flowClassificationStore.findAll();
45+
dataTypesCall = dataTypeStore.findAll();
46+
});
4347
44-
$: {
45-
if (parentEntityRef) {
46-
selectionOptions = mkSelectionOptions(parentEntityRef);
47-
flowViewCall = logicalFlowStore.getViewForSelector(selectionOptions);
48-
}
49-
}
50-
51-
onMount(() => resetFlowDetailsStore());
52-
53-
let dataTypesCall = dataTypeStore.findAll();
5448
$: allDataTypes = $dataTypesCall?.data;
55-
49+
$: flowClassifications = $flowClassificationCall?.data;
5650
$: flowView = $flowViewCall?.data;
5751
52+
$: filteredFlows = filterFlows(allFlows, $filters);
53+
$: physicalFlows = _.filter(filteredFlows, d => !_.isEmpty(d.physicalFlow));
54+
$: allAssessmentDefinitions = _.concat(
55+
flowView?.logicalFlowAssessmentDefinitions || [],
56+
flowView?.physicalFlowAssessmentDefinitions || [],
57+
flowView?.physicalSpecificationAssessmentDefinitions || []);
58+
59+
$: logicalFlows = _
60+
.chain(filteredFlows)
61+
.uniqBy(d => d.logicalFlow.id)
62+
.value();
63+
5864
$: {
5965
if (flowView && allDataTypes) {
60-
6166
mappedDataTypes = _
6267
.chain(flowView.dataTypeDecorators, d => d.decoratorEntity)
6368
.uniq()
6469
.orderBy(d => d.name)
6570
.value();
6671
6772
const mappedDataTypeIds = _.map(mappedDataTypes, d => d.dataTypeId);
68-
6973
dataTypes = reduceToSelectedNodesOnly(allDataTypes, mappedDataTypeIds);
70-
7174
assessmentFilters = mkAssessmentFilters(flowView);
72-
7375
allFlows = mkFlowDetails(flowView, parentEntityRef);
7476
}
7577
}
7678
77-
function filterFlows(allFlows, filters) {
78-
return _
79-
.chain(allFlows)
80-
.map(d => Object.assign(d, {visible: _.every(filters, f => f.test(d))}))
81-
.value();
79+
$: {
80+
if (parentEntityRef) {
81+
selectionOptions = mkSelectionOptions(parentEntityRef);
82+
flowViewCall = logicalFlowStore.getViewForSelector(selectionOptions);
83+
}
8284
}
8385
84-
$: filteredFlows = filterFlows(allFlows, $filters);
85-
86-
$: physicalFlows = _.filter(filteredFlows, d => !_.isEmpty(d.physicalFlow));
87-
88-
$: logicalFlows = _
89-
.chain(filteredFlows)
90-
.map(d => mkLogicalFromFlowDetails(d))
91-
.uniqBy(d => d.logicalFlow.id)
92-
.value();
93-
94-
$: logicalFlowPrimaryAssessments = _.get(flowView, "primaryAssessmentDefinitions", []);
95-
86+
$: console.log({filterFlows, physicalFlows, logicalFlows})
9687
</script>
9788
9889
99-
10090
<div class="flow-detail-panel">
10191
<div class="flow-detail-table">
102-
<details>
103-
104-
<summary>
105-
Filters
106-
{#if !_.isEmpty($filters)}
107-
<button class="btn btn-skinny"
108-
on:click={() => $filters = []}>
109-
Clear All
110-
</button>
111-
{/if}
112-
</summary>
113-
114-
<details class="filter-set" style="margin-top: 1em">
115-
<summary>
116-
<Icon name="random"/> Flow Direction & Classification
117-
{#if _.some($filters, d => d.kind === FilterKinds.DIRECTION) && _.find($filters, d => d.kind === FilterKinds.DIRECTION).direction !== Directions.ALL}
118-
<span style="color: darkorange"
119-
title="Flows have been filtered by direction">
120-
<Icon name="exclamation-circle"/>
121-
</span>
122-
{/if}
123-
</summary>
124-
<InboundOutboundFilters/>
125-
<FlowClassificationFilters/>
126-
</details>
127-
128-
<details class="filter-set">
129-
<summary>
130-
<Icon name="qrcode"/> Data Types
131-
{#if _.some($filters, d => d.kind === FilterKinds.DATA_TYPE)}
132-
<span style="color: darkorange"
133-
title="Data type filters have been applied">
134-
<Icon name="exclamation-circle"/>
135-
</span>
136-
{/if}
137-
</summary>
138-
<DataTypeFilters {dataTypes}/>
139-
</details>
140-
141-
<details class="filter-set">
142-
<summary>
143-
<Icon name="puzzle-piece"/> Assessments
144-
{#if _.some($filters, d => d.kind === FilterKinds.ASSESSMENT)}
145-
<span style="color: darkorange"
146-
title="Assessment filters have been applied">
147-
<Icon name="exclamation-circle"/>
148-
</span>
149-
{/if}
150-
</summary>
151-
<AssessmentFilters {assessmentFilters}/>
152-
</details>
153-
154-
<details class="filter-set">
155-
<summary>
156-
<Icon name="asterisk"/> Physical Flow
157-
{#if _.some($filters, d => d.kind === FilterKinds.PHYSICAL_FLOW_ATTRIBUTE)}
158-
<span style="color: darkorange"
159-
title="Physical flow attribute filters have been applied">
160-
<Icon name="exclamation-circle"/>
161-
</span>
162-
{/if}
163-
</summary>
164-
<PhysicalFlowAttributeFilters flows={physicalFlows}/>
165-
</details>
166-
</details>
92+
<FlowDetailFilters {dataTypes}
93+
{assessmentFilters}
94+
{physicalFlows}/>
16795
16896
<LogicalFlowTable {logicalFlows}
16997
{flowClassifications}
170-
assessments={logicalFlowPrimaryAssessments}/>
98+
assessmentDefinitions={allAssessmentDefinitions}/>
17199
<br>
172100
<PhysicalFlowTable {physicalFlows}
173-
{flowClassifications}/>
101+
{flowClassifications}
102+
assessmentDefinitions={allAssessmentDefinitions}/>
174103
175-
<div style="padding-top: 1em" class="pull-right">
104+
<div style="padding-top: 1em"
105+
class="pull-right">
176106
<span>
177107
<DataExtractLink name="Export Logical Flow Details"
178108
filename="Logical Flows"
@@ -193,13 +123,12 @@
193123
{#if $selectedLogicalFlow || $selectedPhysicalFlow}
194124
<div class="flow-detail-context-panel">
195125
<SelectedFlowDetailPanel flowClassifications={flowClassifications}
196-
assessmentDefinitions={logicalFlowPrimaryAssessments}/>
126+
assessmentDefinitions={allAssessmentDefinitions}/>
197127
</div>
198128
{/if}
199129
</div>
200130
201131
<style>
202-
203132
.flow-detail-context-panel {
204133
width: 30%;
205134
padding-left: 1em;
@@ -215,9 +144,4 @@
215144
width: 70%;
216145
flex: 1 1 50%
217146
}
218-
219-
.filter-set {
220-
background-color: #fafafa;
221-
}
222-
223147
</style>

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script>
2-
32
import SearchInput from "../../../../common/svelte/SearchInput.svelte";
43
import {termSearch} from "../../../../common";
54
import RatingIndicatorCell from "../../../../ratings/components/rating-indicator-cell/RatingIndicatorCell.svelte";
@@ -12,10 +11,11 @@
1211
1312
export let logicalFlows = [];
1413
export let flowClassifications = [];
15-
export let assessments;
14+
export let assessmentDefinitions = [];
1615
1716
let qry;
1817
let selectionLatchOpen = true;
18+
let defs = [];
1919
2020
function isSameFlow(a, b) {
2121
const aId = _.get(a, ["logicalFlow", "id"]);
@@ -87,6 +87,9 @@
8787
"logicalFlow.target.externalId"
8888
]);
8989
90+
$: defs = _.filter(
91+
assessmentDefinitions,
92+
d => d.entityKind === 'LOGICAL_DATA_FLOW');
9093
</script>
9194

9295
<h4>
@@ -116,7 +119,7 @@
116119
<th nowrap="nowrap" style="width: 20em">Target</th>
117120
<th nowrap="nowrap" style="width: 20em">Target Ext ID</th>
118121
<th nowrap="nowrap" style="width: 20em; max-width: 20em">Data Types</th>
119-
{#each assessments as defn}
122+
{#each defs as defn}
120123
<th nowrap="nowrap" style="width: 20em">{defn.name}</th>
121124
{/each}
122125
</tr>
@@ -147,8 +150,8 @@
147150
</svelte:fragment>
148151
</Tooltip>
149152
</td>
150-
{#each assessments as defn}
151-
{@const assessmentRatingsForFlow = _.get(flow.ratingsByDefId, defn.id, [])}
153+
{#each defs as defn}
154+
{@const assessmentRatingsForFlow = _.get(flow.logicalFlowRatingsByDefId, defn.id, [])}
152155
<td>
153156
<div class="rating-col">
154157
{#each assessmentRatingsForFlow as rating}
@@ -160,7 +163,7 @@
160163
</tr>
161164
{:else}
162165
<tr>
163-
<td colspan={5 + _.size(assessments)}>
166+
<td colspan={5 + _.size(defs)}>
164167
<NoData type="info">There are no logical flows to show, these may have been filtered.</NoData>
165168
</td>
166169
</tr>
@@ -171,9 +174,8 @@
171174

172175

173176
<style>
174-
175177
.selected {
176-
background: #eefaee;
178+
background: #eefaee !important;
177179
}
178180
179181
table {
@@ -199,6 +201,4 @@
199201
display: flex;
200202
gap: 1em;
201203
}
202-
203-
204204
</style>

0 commit comments

Comments
 (0)